diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..51f1a321 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +patreon: riverfor +custom: ["https://paypal.me/qpyriver"] diff --git a/.gitignore b/.gitignore index f3579da9..1c454d72 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,29 @@ *.iml .gradle build +__MACOSX .idea -gradle +keystore .DS_Store -*.pyc +local.properties +*.apk +qbaselib.iml +.* +!/.gitignore +gradle-wrapper.properties +Android.mk +qpython/src/main/jni/python/libpython2.7.b +qpysdk/src/main/obj +values-fr +values-tr +build.gradle.new +captures +old.git +qpython/qpython.key +qpython/cn/release/output.json +qpython/od/release/* +qpython/cn +qpython/google +qpython/os +qpython/ol +qpython/op diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..441d4c0b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "qbaselib"] + path = qbaselib + url = git@github.com:qpython-android/qbaselib.git +[submodule "qftplib"] + path = qftplib + url = git@github.com:qpython-android/qftplib.git +[submodule "qpysdk/src/main/jni"] + path = qpysdk/src/main/jni + url = git@github.com:qpython-android/pygamesdl2-jni.git +[submodule "qpysl4a"] + path = qpysl4a + url = git@github.com:qpython-android/qpysl4a.git diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 33396733..00000000 --- a/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright [2017] [YAN HECUN ] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/README.md b/README.md index 29bef179..9912213e 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,79 @@ -# QPython Project -

+# About -Welcome to read the QPython guide! -QPython is a script engine that runs Python on android devices. It lets your android device run Python scripts and projects. It contains the Python interpreter, console, editor, and the SL4A Library for Android. It’s Python on Android! +

+Welcome to the QPython project! -QPython has several millions users in the world already, it's a great project for programming users, welcome to join us for contributing to this project NOW. +QPython is the Python engine for android. It contains some amazing features such as Python interpreter, runtime environment, editor and QPYI and integrated SL4A. It makes it easy for you to use Python on Android. And it's FREE. +Compared with other Python apps, QPython mainly solves how to use Python to drive your Android device work. Good SL4A support is our main goal, such as android's camera, sensor, sms media APIs etc. -What's NEW ------------------------- -QPython project include the QPython https://play.google.com/store/apps/details?id=org.qpython.qpy and QPython3 https://play.google.com/store/apps/details?id=org.qpython.qpy3 applications. +QPython already has millions of users worldwide and it is also an open source project. -QPython application is using the **Python 2.7.2** , and QPython application is using the **Python 3.2.2** . +For different usage scenarios, QPython has two branches, namely QPython Ox and 3x. +QPython Ox is mainly aimed at programming learners, and it provides more friendly features for beginners. +QPython 3x is mainly for experienced Python users, and it provides some advanced technical features. -QPython's newest version is 1.3.0 (Released on 2017/3/20) , QPython3's newest version is 1.0.2 (Released on 2017/3/29), New versions include many amazing features, please upgrade to the newest version as soon from google play, amazon appstore etc. +## Quick start +This repository is the QPython Ox project repository, you can follow the below steps to run it. -Thanks these guys who are contributing ----------------------------------------- -They are pushing on the QPython project moving forward. +- Macos + Android studio, (Ubuntu may work too) +- git clone git@github.com:qpython-android/qpython.git +- git submodule init +- git submodule sync +- git submodule update +- build it... -River, Mae, Zoom.Quiet, MathiasLuo, liyuanrui, Kyle kersey ... +Get more information from [wiki](https://github.com/qpython-android/qpython/wiki) for developing QPython +## Related -Do you want to join the great QPython team ? You could Ask qustions on twitter https://twitter.com/qpython or email us mailto:support@qpython.org. -And you could fork us on github https://github.com/qpython-android/qpython and send pull request. +- [QPython 3x features](https://github.com/qpython-android/qpython.org/blob/master/qpython-docs/source/en/qpython_3x_featues.rst), [QPython Ox features](https://github.com/qpython-android/qpython.org/blob/master/qpython-docs/source/en/qpython_ox_featues.rst) +- [QPySL4A APIs](https://github.com/qpython-android/qpysl4a/blob/master/doc/en/APIs.rst) and [test scripts](https://github.com/qpython-android/qpysl4a/issues/1) +- QPYPI Packages +## How to ask QPython related questions +In order to benefit those guys who have the same issue with QPython, we suggest that you should ask the issue which is related with QPython within public techical communities. -QPython Communities ----------------------- -**There are many active QPython communities where you could meet the QPython users like you** -* Join Facebook community https://www.facebook.com/groups/qpython -* Join Google group https://groups.google.com/forum/#!forum/qpython -* Join Gitter chat https://gitter.com/qpython-android/qpython -* Join G+ community https://plus.google.com/communities/111759148772865961493 -* QPython on Stackoverflow http://stackoverflow.com/questions/tagged/qpython +### English QPythonista Community -**And you could talk to us through social network** +- [Ask in stackoverflow](https://stackoverflow.com/questions/tagged/qpython) +- [Discuss QPython Programming in QPython Group](https://www.facebook.com/groups/qpython/) -* Like us on facebook https://www.facebook.com/QPython -* Follow us on twitter https://twitter.com/qpython +### Chinese QPythonista Community -* Report issue https://github.com/qpython-android/qpython/issues -* Email us mailto:support@qpython.org +- [在segmentfault提问 - Chinese](https://segmentfault.com/t/qpython) +- [在贴吧讨论 - Chinese](https://tieba.baidu.com/f?ie=utf-8&kw=qpython) +### Report issues -Support -------------- -We are happy to hear feedback from you, but sometimes some bugs or features demand may not be implemented soon for we lack resources. +Please tell us your phone's informatioin, android os information, QPython branch, and your code, where did you install it and the detailed stituation you have encountered. -So if you have any issue need the core developer team to solve with higher priority, you could try the https://www.bountysource.com . +- [Report an app's issue](https://github.com/qpython-android/qpython/issues) +- [Report an non-app's issue](https://github.com/qpython-android/qpython.org/issues) +- [Request to support a package](https://github.com/qpython-android/qpypi/issues) -**It's the official QPython Users & Contributors' Guide, please follow http://www.qpython.org for more information.** +## Donation + +- harford (Wechat) +- 晨晖 (Wechat) + +THANK YOU VERY MUCH FOR DONATION! + + +## How to contribute +WE NEED YOUR HELP AND CONTRIBUTE, WE WILL BE VERY GRATEFUL IF YOU CAN TELL US YOUR IDEA OR SUGGESTION. + +IF YOU WANT TO PARTICIPATE THIS PROJECT, PLEASE SEND YOUR EMAIL TO US, WE WILL INVITE YOU INTO QPYTHON SLACK GROUP WHERE WE WILL DISCUSS HOW TO PUSH ON QPYTHON. + +- Email: support@qpython.org +- Twitter: @qpython +- Facebook: https://www.facebook.com/qpython + +Or you can join [qpython slack](https://join.slack.com/t/qpython/shared_invite/enQtOTI1MDY1NzM4NjU2LTljZDI3MjI0ZmZmNzIwNzAwMTU2ZDIyNGRjMTJiOTQ4MzgzY2Y3NDU5YzJjNTQ5MmM4Nzk2MGI4YWZmY2VhOTU) + +THANK YOU. diff --git a/build.gradle b/build.gradle index d769076f..d576ffd4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,31 +1,52 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. +def supportVersion = "28.0.0" // equals to line60 +def retrofitVersion = "2.1.0" +def rxVersion = "1.2.1" -//task wrapper(type: Wrapper) { -// ersion = '2.2.1' -// gradleV -// distributionUrl = 'https://services.gradle.org/distributions/gradle-2.2.1-all.zip' -//} +def okhttpVersion = '3.10.0' + +def butterknifeVersion = '9.0.0' //eqals to line 26 buildscript { repositories { jcenter() + google() mavenCentral() + + maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://maven.google.com" } } + dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' - classpath 'me.tatarka:gradle-retrolambda:3.2.5' - classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0' - classpath "io.realm:realm-gradle-plugin:1.1.1" - classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1' - classpath "io.realm:realm-gradle-plugin:3.0.0" + classpath 'com.android.tools.build:gradle:3.5.3' + + // A gradle plugin for getting java lambda support in java 6, 7 and android + // https://github.com/evant/gradle-retrolambda + classpath 'me.tatarka:gradle-retrolambda:3.7.0' + + // Gradle plugin which downloads and manages your Android SDK. + //classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0' + + // Field and method binding for Android views which uses annotation processing to generate boilerplate code for you. + // https://github.com/JakeWharton/butterknife + classpath "com.jakewharton:butterknife-gradle-plugin:9.0.0-rc2" + + // Realm is a mobile database: a replacement for SQLite & ORMs + // https://github.com/realm/realm-java + classpath "io.realm:realm-gradle-plugin:3.5.0" + + classpath 'com.google.gms:google-services:4.0.2' } } allprojects { repositories { jcenter() + google() + + mavenCentral() maven { url "https://jitpack.io" } maven { url 'https://dl.bintray.com/azeesoft/maven' } + //maven { url "http://mvn.leancloud.cn/nexus/content/repositories/public" } } } @@ -33,12 +54,65 @@ task clean(type: Delete) { delete rootProject.buildDir } - subprojects { def androidHome - if ((androidHome = System.env.'ANDROID_HOME') && (androidHome = androidHome as File).exists() - && androidHome.canWrite()) - apply plugin: 'android-sdk-manager' + && androidHome.canWrite()) { + //apply plugin: 'android-sdk-manager' + } + + project.configurations.all { + resolutionStrategy.eachDependency { details -> + if (details.requested.group == 'com.android.support' + && !details.requested.name.contains('multidex')) { + details.useVersion "${supportVersion}" + } + } + + } } + +ext { + libOkHttp3 = "com.squareup.okhttp3:okhttp:${okhttpVersion}" + + libRxJava = "io.reactivex:rxandroid:${rxVersion}" + libRxAndroid = "io.reactivex:rxjava:${rxVersion}" + libFileDownloaderLib = 'com.liulishuo.filedownloader:library:0.3.5' + + libSupportV4 = "com.android.support:support-v4:${supportVersion}" + libSupportV4Design = 'com.android.support:design:${supportVersion}' + + libSupportV7 = "com.android.support:appcompat-v7:${supportVersion}" + libSupportCardView = "com.android.support:cardview-v7:${supportVersion}" + + libSupportPreference = "com.android.support:preference-v14:${supportVersion}" + libSupportAnnotation = "com.android.support:support-annotations:${supportVersion}" + libSupportDesign = "com.android.support:design:${supportVersion}" + libOkHttp3Log = "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}" + + minSdkVersion = 14 + targetSdkVersion = 28 + compileSdkVersion = 28 + buildToolsVersion = '28.0.3' + + // firebase related https://firebase.google.com/docs/android/setup + firebaseCore = "com.google.firebase:firebase-core:16.0.6" + firebaseMsg = "com.google.firebase:firebase-messaging:17.3.4" + firebaseAuth = "com.google.firebase:firebase-auth:16.1.0" + firebaseDatabase = "com.google.firebase:firebase-database:16.0.5" + + // https://developers.google.com/android/guides/setup + googlePlayServiceAuth = "com.google.android.gms:play-services-auth:16.0.1" + + leakcanaryDebug = 'com.squareup.leakcanary:leakcanary-android:1.5.4' + leakcanaryRelease = 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' + libGoogleGuava = 'com.google.guava:guava:18.0' + + retrofit = "com.squareup.retrofit2:retrofit:${retrofitVersion}" + retrofitCoverterGson = "com.squareup.retrofit2:converter-gson:${retrofitVersion}" + retrofitAdapterRxjava = "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}" + + libButterknife = "com.jakewharton:butterknife:${butterknifeVersion}" + libButterknifeCompiler ="com.jakewharton:butterknife-compiler:${butterknifeVersion}" +} \ No newline at end of file diff --git a/debug.keystore b/debug.keystore new file mode 100644 index 00000000..70dc936c Binary files /dev/null and b/debug.keystore differ diff --git a/docs/.buildinfo b/docs/.buildinfo deleted file mode 100644 index 6a83f7d7..00000000 --- a/docs/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 0991b60e109f8efd00cf6abd94a92cc2 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 4632497e..00000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -www.qpython.org diff --git a/docs/QPython_3x_featues.md b/docs/QPython_3x_featues.md new file mode 100644 index 00000000..491234b5 --- /dev/null +++ b/docs/QPython_3x_featues.md @@ -0,0 +1,36 @@ +# QPython 3x featues + +Because google play and some appstores have strict requirements on the permissions of the app, we use different strategies in different appstores, which is why the branch name will be different. For example, L means Limited, and S means it contains Sensitive permissions. + +## Python +- Python3.6.6 +- QRCode Reader +- Editor +- QPYPI +- Ftp + +## Android Permissions + +### Both QPython 3S and 3L + +- android.permission.INTERNET +- android.permission.ACCESS_SUPERUSER +- android.permission.WAKE_LOCK +- android.permission.ACCESS_NETWORK_STATE +- android.permission.ACCESS_WIFI_STATE +- android.permission.RECEIVE_BOOT_COMPLETED +- android.permission.CAMERA +- android.permission.FLASHLIGHT +- android.permission.VIBRATE +- android.permission.RECEIVE_USER_PRESENT +- com.android.vending.BILLING +- com.android.browser.permission.READ_HISTORY_BOOKMARKS +- com.android.browser.permission.WRITE_HISTORY_BOOKMARKS +- com.android.launcher.permission.INSTALL_SHORTCUT +- com.android.launcher.permission.UNINSTALL_SHORTCUT +- android.permission.READ_EXTERNAL_STORAGE +- android.permission.WRITE_EXTERNAL_STORAGE +- android.permission.ACCESS_COARSE_LOCATION +- android.permission.ACCESS_FINE_LOCATION + +### QPython 3S diff --git a/docs/QPython_Ox_featues.md b/docs/QPython_Ox_featues.md new file mode 100644 index 00000000..fdfb8c09 --- /dev/null +++ b/docs/QPython_Ox_featues.md @@ -0,0 +1,40 @@ +# QPython Ox featues + +Because google play and some appstores have strict requirements on the permissions of the app, we use different strategies in different appstores, which is why the branch name will be different. For example, L means Limited, and S means it contains Sensitive permissions. + +## Python +- Python3 + Python2 basis +- QRCode Reader +- Editor +- QPYPI +- Ftp +- Course + +## Permissions +### Both QPython OL and OS +- android.permission.INTERNET +- android.permission.ACCESS_SUPERUSER +- android.permission.WAKE_LOCK +- android.permission.ACCESS_NETWORK_STATE +- android.permission.ACCESS_WIFI_STATE +- android.permission.RECEIVE_BOOT_COMPLETED +- android.permission.CAMERA +- android.permission.FLASHLIGHT +- android.permission.VIBRATE +- android.permission.RECEIVE_USER_PRESENT +- com.android.vending.BILLING +- com.android.browser.permission.READ_HISTORY_BOOKMARKS +- com.android.browser.permission.WRITE_HISTORY_BOOKMARKS +- com.android.launcher.permission.INSTALL_SHORTCUT +- com.android.launcher.permission.UNINSTALL_SHORTCUT +- android.permission.READ_EXTERNAL_STORAGE +- android.permission.WRITE_EXTERNAL_STORAGE +- android.permission.ACCESS_COARSE_LOCATION +- android.permission.ACCESS_FINE_LOCATION + +### QPython OS +- android.permission.FOREGROUND_SERVICE +- android.permission.BLUETOOTH +- android.permission.BLUETOOTH_ADMIN +- android.permission.NFC +- android.permission.RECORD_AUDIO diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..42a966ab --- /dev/null +++ b/docs/README.md @@ -0,0 +1,2 @@ +# About +QPython documentation diff --git a/docs/_sources/document.txt b/docs/_sources/document.txt deleted file mode 100644 index 7ef4e7ee..00000000 --- a/docs/_sources/document.txt +++ /dev/null @@ -1,111 +0,0 @@ -.. QPython documentation master file, created by - sphinx-quickstart on Fri Apr 7 15:07:35 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. image:: _static/bestpython.png - - -Welcome to read the QPython guide! -============================================= - -QPython is a script engine that runs Python on android devices. It lets your android device run Python scripts and projects. It contains the Python interpreter, console, editor, and the SL4A Library for Android. It’s Python on Android! - - -QPython has several millions users in the world already, it's a great project for programming users, welcome to join us for contributing to this project NOW. - - -What's NEW ------------------------- -QPython project include the `QPython `_ and `QPython3 `_ applications. - -QPython application is using the **Python 2.7.2** , and QPython application is using the **Python 3.2.2** . - - -QPython's newest version is 1.3.2 (Released on 2017/5/12) , QPython3's newest version is 1.0.2 (Released on 2017/3/29), New versions include many amazing features, please upgrade to the newest version as soon from google play, amazon appstore etc. - - -Thanks these guys who are contributing ----------------------------------------- -They are pushing on the QPython project moving forward. - -.. image:: https://avatars0.githubusercontent.com/u/3059527?v=3&s=60 - :target: https://github.com/riverfor - :alt: River is the project's organizer and the current online QPython's author. - -.. image:: https://avatars0.githubusercontent.com/u/10812534?v=3&s=60 - :target: https://github.com/pollyfat - :alt: Mae is a beautiful and talented girl developer who is good at python & android programming. - -.. image:: https://avatars0.githubusercontent.com/u/22494?v=3&s=60 - :target: https://github.com/ZoomQuiet - :alt: Zoom.Quiet is a knowledgeable guy who is famous in many opensource communities. - -.. image:: https://avatars3.githubusercontent.com/u/10219741?v=3&s=60 - :target: https://github.com/mathiasluo - :alt: MathiasLuo is a android geek developer - -.. image:: https://avatars2.githubusercontent.com/u/25975283?v=3&s=60 - :target: https://github.com/liyuanrui - :alt: liyuanrui is a Chinese geek - -.. image:: https://avatars3.githubusercontent.com/u/5159173?v=3&s=60 - :target: https://github.com/kylelk - :alt: Kyle kersey is a US geek - - -Do you want to join the great QPython team ? You could `Ask qustions on twitter `_ or `email us `_. -And you could `fork us on github `_ and send pull request. - - -QPython Communities ----------------------- -**There are many active QPython communities where you could meet the QPython users like you** - -* `Join Facebook community `_ -* `Join Google group `_ -* `Join Gitter chat `_ -* `Join G+ community(For QPython testers) `_ -* `QPython on Stackoverflow `_ - -**And you could talk to us through social network** - -* `Like us on facebook `_ -* `Follow us on twitter `_ - -* `Report issue `_ -* `Email us `_ - - -**It's the official QPython Users & Contributors' Guide, please follow these steps for using and contributing.** - -Support -------------- -We are happy to hear feedback from you, but sometimes some bugs or features demand may not be implemented soon for we lack resources. - -So if you have any issue need the core developer team to solve with higher priority, you could try the `bountysource service `_. - - - -Now, let's GO ---------------- -.. toctree:: - :maxdepth: 2 - - en/guide - -Others ---------------- -.. toctree:: - :maxdepth: 2 - - en/faq - - -For Chinese users -------------------- -.. toctree:: - :maxdepth: 2 - - zhindex - diff --git a/docs/_sources/en/faq.txt b/docs/_sources/en/faq.txt deleted file mode 100644 index a891d3dd..00000000 --- a/docs/_sources/en/faq.txt +++ /dev/null @@ -1,26 +0,0 @@ -FAQ -==== - - -**How to run qpython script from other terminals ?** - -- You could "share to" qpython from 3rd apps. - -- You need to root the android device first, then soure the env vars (Just like the qpython wiki link you mentioned) and execute the /data/data/org.qpython.qpy/bin/python or /data/data/org.qpython.qpy/bin/python-android5 (for android 5 above) - - -`Case sample `_ - - - -**Support pygame ?** - -Even you could import pygame in QPython, but QPython doesn't support pygame now. - -We will consider to support it later, please follow us on facebook to get it's progress. - - -`Case sample `_ - - - diff --git a/docs/_sources/en/guide.txt b/docs/_sources/en/guide.txt deleted file mode 100644 index e13917ea..00000000 --- a/docs/_sources/en/guide.txt +++ /dev/null @@ -1,47 +0,0 @@ -Getting started -========================== -How to start quickly ? Just follow the following steps: - -.. toctree:: - :maxdepth: 2 - - guide_howtostart - guide_helloworld - - -Programming Guide -======================== - -If you you want to know more about how to program through qpython, just follow these steps: - - -.. toctree:: - :maxdepth: 2 - - guide_program - guide_ide - guide_libraries - guide_extend - - -**QPython project is not only a powerful Python engine for android, but is a active technology community also.** - -Developers' Guide -======================= -QPython developers' goal is pushing out a great Python for android. - -.. toctree:: - :maxdepth: 2 - - guide_developers - - -Contributors' Guide -======================== - -Welcome to join QPython contributors team, you are not just a user, but a creator of QPython. - -.. toctree:: - :maxdepth: 2 - - guide_contributors diff --git a/docs/_sources/en/guide_androidhelpers.txt b/docs/_sources/en/guide_androidhelpers.txt deleted file mode 100644 index 1dd97265..00000000 --- a/docs/_sources/en/guide_androidhelpers.txt +++ /dev/null @@ -1,2035 +0,0 @@ -The Scripting Layer for Android (abridged as SL4A, and previously named Android Scripting Environment or ASE) is a library that allows the creation and running of scripts written in various scripting languages directly on Android devices. QPython start to extend the SL4A project and integrate it. - - -.. image:: ../_static/sl4a.jpg - -There are many SL4A APIs, if you found any issue, please `report an issue `_. - -AndroidFacade -=============== - -Clipboard APIs ----------------- -.. py:function:: setClipboard(text) - - Put text in the clipboard - - :param str text: text - -.. py:function:: getClipboard(text) - - Read text from the clipboard - - :return: The text in the clipboard - - -:: - - sample code to show setClipboard/getClipboard - - -Intent & startActivity APIs ----------------------------------- -.. py:function:: makeIntent(action, uri, type, extras, categories, packagename, classname, flags) - - Starts an activity and returns the result - - :param str action: action - :param str uri(Optional): uri - :param str type(Optional): MIME type/subtype of the URI - :param object extras(Optional): a Map of extras to add to the Intent - :param list categories(Optional): a List of categories to add to the Intent - :param str packagename(Optional): name of package. If used, requires classname to be useful - :param str classname(Optional): name of class. If used, requires packagename to be useful - :param int flags(Optional): Intent flags - - :return: An object representing an Intent - - -:: - - sample code to show makeIntent - - -.. py:function:: getIntent() - - Returns the intent that launched the script - -:: - - sample code to show getIntent - - -.. py:function:: startActivityForResult(action, uri, type, extras, packagename, classname) - - Starts an activity and returns the result - - :param str action: action - :param str uri(Optional): uri - :param str type(Optional): MIME type/subtype of the URI - :param object extras(Optional): a Map of extras to add to the Intent - :param str packagename(Optional): name of package. If used, requires classname to be useful - :param str classname(Optional): name of class. If used, requires packagename to be useful - - :return: A Map representation of the result Intent - - -:: - - sample code to show startActivityForResult - - -.. py:function:: startActivityForResultIntent(intent) - - Starts an activity and returns the result - - :param Intent intent: Intent in the format as returned from makeIntent - - :return: A Map representation of the result Intent - - -:: - - sample code to show startActivityForResultIntent - -.. py:function:: startActivityIntent(intent, wait) - - Starts an activity - - :param Intent intent: Intent in the format as returned from makeIntent - :param bool wait(Optional): block until the user exits the started activity - -:: - - sample code to show startActivityIntent - - -.. py:function:: startActivity(action, uri, type, extras, wait, packagename, classname) - - Starts an activity - - :param str action: action - :param str uri(Optional): uri - :param str type(Optional): MIME type/subtype of the URI - :param object extras(Optional): a Map of extras to add to the Intent - :param bool wait(Optional): block until the user exits the started activity - :param str packagename(Optional): name of package. If used, requires classname to be useful - :param str classname(Optional): name of class. If used, requires packagename to be useful - -:: - - sample code to show startActivityForResultIntent - - -SendBroadcast APIs -------------------- -.. py:function:: sendBroadcast(action, uri, type, extras, packagename, classname) - - Send a broadcast - - :param str action: action - :param str uri(Optional): uri - :param str type(Optional): MIME type/subtype of the URI - :param object extras(Optional): a Map of extras to add to the Intent - :param str packagename(Optional): name of package. If used, requires classname to be useful - :param str classname(Optional): name of class. If used, requires packagename to be useful - - -:: - - sample code to show sendBroadcast - -.. py:function:: sendBroadcastIntent(intent) - - Send a broadcast - - :param Intent intent: Intent in the format as returned from makeIntent - -:: - - sample code to show sendBroadcastIntent - - -Vibrate ----------- -.. py:function:: vibrate(intent) - - Vibrates the phone or a specified duration in milliseconds - - :param int duration: duration in milliseconds - -:: - - sample code to show vibrate - - -NetworkStatus ---------------- -.. py:function:: getNetworkStatus() - - Returns the status of network connection - -:: - - sample code to show getNetworkStatus - -PackageVersion APIs ------------------------------- -.. py:function:: requiredVersion(requiredVersion) - - Checks if version of QPython SL4A is greater than or equal to the specified version - - :param int requiredVersion: requiredVersion - - :return: true or false - - -.. py:function:: getPackageVersionCode(packageName) - - Returns package version code - - :param str packageName: packageName - - :return: Package version code - -.. py:function:: getPackageVersion(packageName) - - Returns package version name - - :param str packageName: packageName - - :return: Package version name - - -:: - - sample code to show getPackageVersionCode & getPackageVersion - - -System APIs --------------------------------- -.. py:function:: getConstants(classname) - - Get list of constants (static final fields) for a class - - :param str classname: classname - - :return: list - -:: - - sample code to show getConstants - -.. py:function:: environment() - - A map of various useful environment details - - :return: environment map object includes id, display, offset, TZ, SDK, download, appcache, availblocks, blocksize, blockcount, sdcard - -:: - - sample code to show environment - -.. py:function:: log(message) - - Writes message to logcat - - :param str message: message - -:: - - sample code to show log - - -SendEmail ----------- -.. py:function:: sendEmail(to, subject, body, attachmentUri) - - Launches an activity that sends an e-mail message to a given recipient - - :param str to: A comma separated list of recipients - :param str subject: subject - :param str body: mail body - :param str attachmentUri(Optional): message - -:: - - sample code to show sendEmail - - -Toast, getInput, getPassword, notify APIs ------------------------------------------------- -.. py:function:: makeToast(message) - - Displays a short-duration Toast notification - - :param str message: message - -:: - - sample code to show makeToast - -.. py:function:: getInput(title, message) - - Queries the user for a text input - - :param str title: title of the input box - :param str message: message to display above the input box - -:: - - sample code to show getInput - -.. py:function:: getPassword(title, message) - - Queries the user for a password - - :param str title: title of the input box - :param str message: message to display above the input box - -:: - - sample code to show getPassword - -.. py:function:: notify(title, message, url) - - Displays a notification that will be canceled when the user clicks on it - - :param str title: title - :param str message: message - :param str url(optional): url - -:: - import androidhelper - droid = androidhelper.Android() - droid.notify('Hello','QPython','http://qpython.org') # you could set the 3rd parameter None also - - - -ApplicationManagerFacade -========================= - -Manager APIs -------------- - -.. py:function:: getLaunchableApplications() - - Returns a list of all launchable application class names - - :return: map object - -:: - - sample code to show getLaunchableApplications - - -.. py:function:: launch(classname) - - Start activity with the given class name - - :param str classname: classname - -:: - - sample code to show launch - -.. py:function:: getRunningPackages() - - Returns a list of packages running activities or services - - :return: List of packages running activities - -:: - - sample code to show getRunningPackages - -.. py:function:: forceStopPackage(packageName) - - Force stops a package - - :param str packageName: packageName - -:: - - sample code to show forceStopPackage - - -CameraFacade -========================= - -.. py:function:: cameraCapturePicture(targetPath) - - Take a picture and save it to the specified path - - :return: A map of Booleans autoFocus and takePicture where True indicates success - -.. py:function:: cameraInteractiveCapturePicture(targetPath) - - Starts the image capture application to take a picture and saves it to the specified path - -CommonIntentsFacade -========================= - -Barcode ----------- -.. py:function:: scanBarcode() - - Starts the barcode scanner - - :return: A Map representation of the result Intent - -View APIs ----------- -.. py:function:: pick(uri) - - Display content to be picked by URI (e.g. contacts) - - :return: A map of result values - -.. py:function:: view(uri, type, extras) - - Start activity with view action by URI (i.e. browser, contacts, etc.) - -.. py:function:: viewMap(query) - - Opens a map search for query (e.g. pizza, 123 My Street) - -.. py:function:: viewContacts() - - Opens the list of contacts - -.. py:function:: viewHtml(path) - - Opens the browser to display a local HTML file - -.. py:function:: search(query) - - Starts a search for the given query - -ContactsFacade -========================= - -.. py:function:: pickContact() - - Displays a list of contacts to pick from - - :return: A map of result values - -.. py:function:: pickPhone() - - Displays a list of phone numbers to pick from - - :return: The selected phone number - -.. py:function:: contactsGetAttributes() - - Returns a List of all possible attributes for contacts - - :return: a List of contacts as Maps - -.. py:function:: contactsGetIds() - - Returns a List of all contact IDs - -.. py:function:: contactsGet(attributes) - - Returns a List of all contacts - -.. py:function:: contactsGetById(id) - - Returns contacts by ID - -.. py:function:: contactsGetCount() - - Returns the number of contacts - -.. py:function:: queryContent(uri, attributes, selection, selectionArgs, order) - - Content Resolver Query - - :return: result of query as Maps - -.. py:function:: queryAttributes(uri) - - Content Resolver Query Attributes - - :return: a list of available columns for a given content uri - -EventFacade -========================= - -.. py:function:: eventClearBuffer() - - Clears all events from the event buffer - -.. py:function:: eventRegisterForBroadcast(category, enqueue) - - Registers a listener for a new broadcast signal - -.. py:function:: eventUnregisterForBroadcast(category) - - Stop listening for a broadcast signal - -.. py:function:: eventGetBrodcastCategories() - - Lists all the broadcast signals we are listening for - -.. py:function:: eventPoll(number_of_events) - - Returns and removes the oldest n events (i.e. location or sensor update, etc.) from the event buffer - - :return: A List of Maps of event properties - -.. py:function:: eventWaitFor(eventName, timeout) - - Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer - - :return: Map of event properties - -.. py:function:: eventWait(timeout) - - Blocks until an event occurs. The returned event is removed from the buffer - - :return: Map of event properties - -.. py:function:: eventPost(name, data, enqueue) - - Post an event to the event queue - -.. py:function:: rpcPostEvent(name, data) - - Post an event to the event queue - -.. py:function:: receiveEvent() - - Returns and removes the oldest event (i.e. location or sensor update, etc.) from the event buffer - - :return: Map of event properties - -.. py:function:: waitForEvent(eventName, timeout) - - Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer - - :return: Map of event properties - -.. py:function:: startEventDispatcher(port) - - Opens up a socket where you can read for events posted - -.. py:function:: stopEventDispatcher() - - Stops the event server, you can't read in the port anymore - -LocationFacade -========================= - -Providers APIs ------------------ - -.. py:function:: locationProviders() - - Returns availables providers on the phone - -.. py:function:: locationProviderEnabled(provider) - - Ask if provider is enabled - -Location APIs ------------------ -.. py:function:: startLocating(minDistance, minUpdateDistance) - - Starts collecting location data - -.. py:function:: readLocation() - - Returns the current location as indicated by all available providers - - :return: A map of location information by provider - -.. py:function:: stopLocating() - - Stops collecting location data - -.. py:function:: getLastKnownLocation() - - Returns the last known location of the device - - :return: A map of location information by provider - -*sample code* -:: - - Droid = androidhelper.Android() - location = Droid.getLastKnownLocation().result - location = location.get('network', location.get('gps')) - - -GEO ------------ -.. py:function:: geocode(latitude, longitude, maxResults) - - Returns a list of addresses for the given latitude and longitude - - :return: A list of addresses - -PhoneFacade -========================= - -PhoneStat APIs ----------------- - -.. py:function:: startTrackingPhoneState() - - Starts tracking phone state - -.. py:function:: readPhoneState() - - Returns the current phone state and incoming number - - :return: A Map of "state" and "incomingNumber" - -.. py:function:: stopTrackingPhoneState() - - Stops tracking phone state - - -Call & Dia APIs ----------------- - -.. py:function:: phoneCall(uri) - - Calls a contact/phone number by URI - -.. py:function:: phoneCallNumber(number) - - Calls a phone number - -.. py:function:: phoneDial(uri) - - Dials a contact/phone number by URI - -.. py:function:: phoneDialNumber(number) - - Dials a phone number - - - -Get information APIs ------------------------- -.. py:function:: getCellLocation() - - Returns the current cell location - -.. py:function:: getNetworkOperator() - - Returns the numeric name (MCC+MNC) of current registered operator - -.. py:function:: getNetworkOperatorName() - - Returns the alphabetic name of current registered operator - -.. py:function:: getNetworkType() - - Returns a the radio technology (network type) currently in use on the device - -.. py:function:: getPhoneType() - - Returns the device phone type - -.. py:function:: getSimCountryIso() - - Returns the ISO country code equivalent for the SIM provider's country code - -.. py:function:: getSimOperator() - - Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 5 or 6 decimal digits - -.. py:function:: getSimOperatorName() - - Returns the Service Provider Name (SPN) - -.. py:function:: getSimSerialNumber() - - Returns the serial number of the SIM, if applicable. Return null if it is unavailable - -.. py:function:: getSimState() - - Returns the state of the device SIM card - -.. py:function:: getSubscriberId() - - Returns the unique subscriber ID, for example, the IMSI for a GSM phone. Return null if it is unavailable - -.. py:function:: getVoiceMailAlphaTag() - - Retrieves the alphabetic identifier associated with the voice mail number - -.. py:function:: getVoiceMailNumber() - - Returns the voice mail number. Return null if it is unavailable - -.. py:function:: checkNetworkRoaming() - - Returns true if the device is considered roaming on the current network, for GSM purposes - -.. py:function:: getDeviceId() - - Returns the unique device ID, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available - -.. py:function:: getDeviceSoftwareVersion() - - Returns the software version number for the device, for example, the IMEI/SV for GSM phones. Return null if the software version is not available - -.. py:function:: getLine1Number() - - Returns the phone number string for line 1, for example, the MSISDN for a GSM phone. Return null if it is unavailable - -.. py:function:: getNeighboringCellInfo() - - Returns the neighboring cell information of the device - -MediaRecorderFacade -========================= - - -Audio --------- - -.. py:function:: recorderStartMicrophone(targetPath) - - Records audio from the microphone and saves it to the given location - -Video APIs ------------ - -.. py:function:: recorderStartVideo(targetPath, duration, videoSize) - - Records video from the camera and saves it to the given location. - Duration specifies the maximum duration of the recording session. - If duration is 0 this method will return and the recording will only be stopped - when recorderStop is called or when a scripts exits. - Otherwise it will block for the time period equal to the duration argument. - videoSize: 0=160x120, 1=320x240, 2=352x288, 3=640x480, 4=800x480. - - -.. py:function:: recorderCaptureVideo(targetPath, duration, recordAudio) - - Records video (and optionally audio) from the camera and saves it to the given location. - Duration specifies the maximum duration of the recording session. - If duration is not provided this method will return immediately and the recording will only be stopped - when recorderStop is called or when a scripts exits. - Otherwise it will block for the time period equal to the duration argument. - -.. py:function:: startInteractiveVideoRecording(path) - - Starts the video capture application to record a video and saves it to the specified path - - -Stop --------- -.. py:function:: recorderStop() - - Stops a previously started recording - - -SensorManagerFacade -========================= - -Start & Stop -------------- -.. py:function:: startSensingTimed(sensorNumber, delayTime) - - Starts recording sensor data to be available for polling - -.. py:function:: startSensingThreshold(ensorNumber, threshold, axis) - - Records to the Event Queue sensor data exceeding a chosen threshold - -.. py:function:: startSensing(sampleSize) - - Starts recording sensor data to be available for polling - -.. py:function:: stopSensing() - - Stops collecting sensor data - -Read data APIs ---------------- -.. py:function:: readSensors() - - Returns the most recently recorded sensor data - -.. py:function:: sensorsGetAccuracy() - - Returns the most recently received accuracy value - -.. py:function:: sensorsGetLight() - - Returns the most recently received light value - -.. py:function:: sensorsReadAccelerometer() - - Returns the most recently received accelerometer values - - :return: a List of Floats [(acceleration on the) X axis, Y axis, Z axis] - -.. py:function:: sensorsReadMagnetometer() - - Returns the most recently received magnetic field values - - :return: a List of Floats [(magnetic field value for) X axis, Y axis, Z axis] - -.. py:function:: sensorsReadOrientation() - - Returns the most recently received orientation values - - :return: a List of Doubles [azimuth, pitch, roll] - -*sample code* -:: - - Droid = androidhelper.Android() - Droid.startSensingTimed(1, 250) - sensor = Droid.sensorsReadOrientation().result - Droid.stopSensing() - - -SettingsFacade -========================= - -Screen ----------- - -.. py:function:: setScreenTimeout(value) - - Sets the screen timeout to this number of seconds - - :return: The original screen timeout - -.. py:function:: getScreenTimeout() - - Gets the screen timeout - - :return: the current screen timeout in seconds - -AirplanerMode ---------------------- - -.. py:function:: checkAirplaneMode() - - Checks the airplane mode setting - - :return: True if airplane mode is enabled - -.. py:function:: toggleAirplaneMode(enabled) - - Toggles airplane mode on and off - - :return: True if airplane mode is enabled - -Ringer Silent Mode ---------------------- - -.. py:function:: checkRingerSilentMode() - - Checks the ringer silent mode setting - - :return: True if ringer silent mode is enabled - -.. py:function:: toggleRingerSilentMode(enabled) - - Toggles ringer silent mode on and off - - :return: True if ringer silent mode is enabled - -Vibrate Mode ---------------------- - -.. py:function:: toggleVibrateMode(enabled) - - Toggles vibrate mode on and off. If ringer=true then set Ringer setting, else set Notification setting - - :return: True if vibrate mode is enabled - -.. py:function:: getVibrateMode(ringer) - - Checks Vibration setting. If ringer=true then query Ringer setting, else query Notification setting - - :return: True if vibrate mode is enabled - -Ringer & Media Volume ---------------------- - -.. py:function:: getMaxRingerVolume() - - Returns the maximum ringer volume - -.. py:function:: getRingerVolume() - - Returns the current ringer volume - -.. py:function:: setRingerVolume(volume) - - Sets the ringer volume - -.. py:function:: getMaxMediaVolume() - - Returns the maximum media volume - -.. py:function:: getMediaVolume() - - Returns the current media volume - -.. py:function:: setMediaVolume(volume) - - Sets the media volume - -Screen Brightness ---------------------- - -.. py:function:: getScreenBrightness() - - Returns the screen backlight brightness - - :return: the current screen brightness between 0 and 255 - -.. py:function:: setScreenBrightness(value) - - Sets the the screen backlight brightness - - :return: the original screen brightness - -.. py:function:: checkScreenOn() - - Checks if the screen is on or off (requires API level 7) - - :return: True if the screen is currently on - - -SmsFacade -========================= - -.. py:function:: smsSend(destinationAddress, text) - - Sends an SMS - - :param str destinationAddress: typically a phone number - :param str text: - -.. py:function:: smsGetMessageCount(unreadOnly, folder) - - Returns the number of messages - - :param bool unreadOnly: typically a phone number - :param str folder(optional): default "inbox" - -.. py:function:: smsGetMessageIds(unreadOnly, folder) - - Returns a List of all message IDs - - :param bool unreadOnly: typically a phone number - :param str folder(optional): default "inbox" - -.. py:function:: smsGetMessages(unreadOnly, folder, attributes) - - Returns a List of all messages - - :param bool unreadOnly: typically a phone number - :param str folder: default "inbox" - :param list attributes(optional): attributes - - :return: a List of messages as Maps - -.. py:function:: smsGetMessageById(id, attributes) - - Returns message attributes - - :param int id: message ID - :param list attributes(optional): attributes - - :return: a List of messages as Maps - -.. py:function:: smsGetAttributes() - - Returns a List of all possible message attributes - -.. py:function:: smsDeleteMessage(id) - - Deletes a message - - :param int id: message ID - - :return: True if the message was deleted - -.. py:function:: smsMarkMessageRead(ids, read) - - Marks messages as read - - :param list ids: List of message IDs to mark as read - :param bool read: true or false - - :return: number of messages marked read - -SpeechRecognitionFacade -========================= - -.. py:function:: recognizeSpeech(prompt, language, languageModel) - - Recognizes user's speech and returns the most likely result - - :param str prompt(optional): text prompt to show to the user when asking them to speak - :param str language(optional): language override to inform the recognizer that it should expect speech in a language different than the one set in the java.util.Locale.getDefault() - :param str languageModel(optional): informs the recognizer which speech model to prefer (see android.speech.RecognizeIntent) - - :return: An empty string in case the speech cannot be recongnized - - -ToneGeneratorFacade -========================= - -.. py:function:: generateDtmfTones(phoneNumber, toneDuration) - - Generate DTMF tones for the given phone number - - :param str phoneNumber: phone number - :param int toneDuration(optional): default 100, duration of each tone in milliseconds - - -WakeLockFacade -========================= - -.. py:function:: wakeLockAcquireFull() - - Acquires a full wake lock (CPU on, screen bright, keyboard bright) - -.. py:function:: wakeLockAcquirePartial() - - Acquires a partial wake lock (CPU on) - -.. py:function:: wakeLockAcquireBright() - - Acquires a bright wake lock (CPU on, screen bright) - -.. py:function:: wakeLockAcquireDim() - - Acquires a dim wake lock (CPU on, screen dim) - -.. py:function:: wakeLockRelease() - - Releases the wake lock - -WifiFacade -========================= - -.. py:function:: wifiGetScanResults() - - Returns the list of access points found during the most recent Wifi scan - -.. py:function:: wifiLockAcquireFull() - - Acquires a full Wifi lock - -.. py:function:: wifiLockAcquireScanOnly() - - Acquires a scan only Wifi lock - -.. py:function:: wifiLockRelease() - - Releases a previously acquired Wifi lock - -.. py:function:: wifiStartScan() - - Starts a scan for Wifi access points - - :return: True if the scan was initiated successfully - -.. py:function:: checkWifiState() - - Checks Wifi state - - :return: True if Wifi is enabled - -.. py:function:: toggleWifiState(enabled) - - Toggle Wifi on and off - - :param bool enabled(optional): enabled - - :return: True if Wifi is enabled - -.. py:function:: wifiDisconnect() - - Disconnects from the currently active access point - - :return: True if the operation succeeded - -.. py:function:: wifiGetConnectionInfo() - - Returns information about the currently active access point - -.. py:function:: wifiReassociate() - - Returns information about the currently active access point - - :return: True if the operation succeeded - -.. py:function:: wifiReconnect() - - Reconnects to the currently active access point - - :return: True if the operation succeeded - - -BatteryManagerFacade -========================= - -.. py:function:: readBatteryData() - - Returns the most recently recorded battery data - -.. py:function:: batteryStartMonitoring() - - Starts tracking battery state - -.. py:function:: batteryStopMonitoring() - - Stops tracking battery state - -.. py:function:: batteryGetStatus() - - Returns the most recently received battery status data: - 1 - unknown; - 2 - charging; - 3 - discharging; - 4 - not charging; - 5 - full - -.. py:function:: batteryGetHealth() - - Returns the most recently received battery health data: - 1 - unknown; - 2 - good; - 3 - overheat; - 4 - dead; - 5 - over voltage; - 6 - unspecified failure - -.. py:function:: batteryGetPlugType() - - Returns the most recently received plug type data: - -1 - unknown - 0 - unplugged - 1 - power source is an AC charger - 2 - power source is a USB port - - -.. py:function:: batteryCheckPresent() - - Returns the most recently received battery presence data - -.. py:function:: batteryGetLevel() - - Returns the most recently received battery level (percentage) - -.. py:function:: batteryGetVoltage() - - Returns the most recently received battery voltage - -.. py:function:: batteryGetTemperature() - - Returns the most recently received battery temperature - -.. py:function:: batteryGetTechnology() - - Returns the most recently received battery technology data - - -ActivityResultFacade -========================= - -.. py:function:: setResultBoolean(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - - -.. py:function:: setResultByte(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultShort(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultChar(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - - -.. py:function:: setResultInteger(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultLong(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultFloat(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultDouble(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultString(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultBooleanArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultByteArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultShortArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultCharArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultIntegerArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultLongArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultFloatArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultDoubleArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultStringArray(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - -.. py:function:: setResultSerializable(resultCode, resultValue) - - Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), - the resulting intent will contain SCRIPT_RESULT extra with the given value - - :param int resultCode: - :param byte resultValue: - - -MediaPlayerFacade -========================= - -Control ------------------ -.. py:function:: mediaPlay(url, tag, play) - - Open a media file - - :param str url: url of media resource - :param str tag(optional): string identifying resource (default=default) - :param bool play(optional): start playing immediately - - :return: true if play successful - -.. py:function:: mediaPlayPause(tag) - - pause playing media file - - :param str tag: string identifying resource (default=default) - - :return: true if successful - -.. py:function:: mediaPlayStart(tag) - - start playing media file - - :param str tag: string identifying resource (default=default) - - :return: true if successful - -.. py:function:: mediaPlayClose(tag) - - Close media file - - :param str tag: string identifying resource (default=default) - - :return: true if successful - -.. py:function:: mediaIsPlaying(tag) - - Checks if media file is playing - - :param str tag: string identifying resource (default=default) - - :return: true if successful - - -.. py:function:: mediaPlaySetLooping(enabled, tag) - - Set Looping - - :param bool enabled: default true - :param str tag: string identifying resource (default=default) - - :return: True if successful - -.. py:function:: mediaPlaySeek(msec, tag) - - Seek To Position - - :param int msec: default true - :param str tag: string identifying resource (default=default) - - :return: New Position (in ms) - -Get Information ------------------ -.. py:function:: mediaPlayInfo(tag) - - Information on current media - - :param str tag: string identifying resource (default=default) - - :return: Media Information - -.. py:function:: mediaPlayList() - - Lists currently loaded media - - :return: List of Media Tags - - -PreferencesFacade -========================= - -.. py:function:: prefGetValue(key, filename) - - Read a value from shared preferences - - :param str key: key - :param str filename(optional): Desired preferences file. If not defined, uses the default Shared Preferences. - - -.. py:function:: prefPutValue(key, value, filename) - - Write a value to shared preferences - - :param str key: key - :param str value: value - :param str filename(optional): Desired preferences file. If not defined, uses the default Shared Preferences. - -.. py:function:: prefGetAll(filename) - - Get list of Shared Preference Values - - :param str filename(optional): Desired preferences file. If not defined, uses the default Shared Preferences. - - -QPyInterfaceFacade -========================= - -.. py:function:: executeQPy(script) - - Execute a qpython script by absolute path - - :param str script: The absolute path of the qpython script - - :return: bool - - -TextToSpeechFacade -========================= - -.. py:function:: ttsSpeak(message) - - Speaks the provided message via TTS - - :param str message: message - -.. py:function:: ttsIsSpeaking() - - Returns True if speech is currently in progress - -EyesFreeFacade -========================= - -.. py:function:: ttsSpeak(message) - - Speaks the provided message via TTS - - :param str message: message - - -BluetoothFacade -========================= - -.. py:function:: bluetoothActiveConnections() - - Returns active Bluetooth connections - - -.. py:function:: bluetoothWriteBinary(base64, connID) - - Send bytes over the currently open Bluetooth connection - - :param str base64: A base64 encoded String of the bytes to be sent - :param str connID(optional): Connection id - -.. py:function:: bluetoothReadBinary(bufferSize, connID) - - Read up to bufferSize bytes and return a chunked, base64 encoded string - - :param int bufferSize: default 4096 - :param str connID(optional): Connection id - -.. py:function:: bluetoothConnect(uuid, address) - - Connect to a device over Bluetooth. Blocks until the connection is established or fails - - :param str uuid: The UUID passed here must match the UUID used by the server device - :param str address(optional): The user will be presented with a list of discovered devices to choose from if an address is not provided - - :return: True if the connection was established successfully - -.. py:function:: bluetoothAccept(uuid, timeout) - - Listens for and accepts a Bluetooth connection. Blocks until the connection is established or fails - - :param str uuid: The UUID passed here must match the UUID used by the server device - :param int timeout: How long to wait for a new connection, 0 is wait for ever (default=0) - -.. py:function:: bluetoothMakeDiscoverable(duration) - - Requests that the device be discoverable for Bluetooth connections - - :param int duration: period of time, in seconds, during which the device should be discoverable (default=300) - -.. py:function:: bluetoothWrite(ascii, connID) - - Sends ASCII characters over the currently open Bluetooth connection - - :param str ascii: text - :param str connID: Connection id - -.. py:function:: bluetoothReadReady(connID) - - Sends ASCII characters over the currently open Bluetooth connection - - :param str ascii: text - :param str connID: Connection id - -.. py:function:: bluetoothRead(bufferSize, connID) - - Read up to bufferSize ASCII characters - - :param int bufferSize: default=4096 - :param str connID(optional): Connection id - -.. py:function:: bluetoothReadLine(connID) - - Read the next line - - :param str connID(optional): Connection id - -.. py:function:: bluetoothGetRemoteDeviceName(address) - - Queries a remote device for it's name or null if it can't be resolved - - :param str address: Bluetooth Address For Target Device - -.. py:function:: bluetoothGetLocalName() - - Gets the Bluetooth Visible device name - -.. py:function:: bluetoothSetLocalName(name) - - Sets the Bluetooth Visible device name, returns True on success - - :param str name: New local name - -.. py:function:: bluetoothGetScanMode() - - Gets the scan mode for the local dongle. - Return values: - -1 when Bluetooth is disabled. - 0 if non discoverable and non connectable. - 1 connectable non discoverable. - 3 connectable and discoverable. - -.. py:function:: bluetoothGetConnectedDeviceName(connID) - - Returns the name of the connected device - - :param str connID: Connection id - -.. py:function:: checkBluetoothState() - - Checks Bluetooth state - - :return: True if Bluetooth is enabled - -.. py:function:: toggleBluetoothState(enabled, prompt) - - Toggle Bluetooth on and off - - :param bool enabled: - :param str prompt: Prompt the user to confirm changing the Bluetooth state, default=true - - :return: True if Bluetooth is enabled - -.. py:function:: bluetoothStop(connID) - - Stops Bluetooth connection - - :param str connID: Connection id - -.. py:function:: bluetoothGetLocalAddress() - - Returns the hardware address of the local Bluetooth adapter - -.. py:function:: bluetoothDiscoveryStart() - - Start the remote device discovery process - - :return: true on success, false on error - -.. py:function:: bluetoothDiscoveryCancel() - - Cancel the current device discovery process - - :return: true on success, false on error - -.. py:function:: bluetoothIsDiscovering() - - Return true if the local Bluetooth adapter is currently in the device discovery process - - -SignalStrengthFacade -========================= -.. py:function:: startTrackingSignalStrengths() - - Starts tracking signal strengths - -.. py:function:: readSignalStrengths() - - Returns the current signal strengths - - :return: A map of gsm_signal_strength - -.. py:function:: stopTrackingSignalStrengths() - - Stops tracking signal strength - - -WebCamFacade -========================= - -.. py:function:: webcamStart(resolutionLevel, jpegQuality, port) - - Starts an MJPEG stream and returns a Tuple of address and port for the stream - - :param int resolutionLevel: increasing this number provides higher resolution (default=0) - :param int jpegQuality: a number from 0-10 (default=20) - :param int port: If port is specified, the webcam service will bind to port, otherwise it will pick any available port (default=0) - -.. py:function:: webcamAdjustQuality(resolutionLevel, jpegQuality) - - Adjusts the quality of the webcam stream while it is running - - :param int resolutionLevel: increasing this number provides higher resolution (default=0) - :param int jpegQuality: a number from 0-10 (default=20) - -.. py:function:: cameraStartPreview(resolutionLevel, jpegQuality, filepath) - - Start Preview Mode. Throws 'preview' events - - :param int resolutionLevel: increasing this number provides higher resolution (default=0) - :param int jpegQuality: a number from 0-10 (default=20) - :param str filepath: Path to store jpeg files - - :return: True if successful - -.. py:function:: cameraStopPreview() - - Stop the preview mode - - -UiFacade -========================= - -Dialog --------- -.. py:function:: dialogCreateInput(title, message, defaultText, inputType) - - Create a text input dialog - - :param str title: title of the input box - :param str message: message to display above the input box - :param str defaultText(optional): text to insert into the input box - :param str inputType(optional): type of input data, ie number or text - -.. py:function:: dialogCreatePassword(title, message) - - Create a password input dialog - - :param str title: title of the input box - :param str message: message to display above the input box - -.. py:function:: dialogGetInput(title, message, defaultText) - - Create a password input dialog - - :param str title: title of the input box - :param str message: message to display above the input box - :param str defaultText(optional): text to insert into the input box - -.. py:function:: dialogGetPassword(title, message) - - Queries the user for a password - - :param str title: title of the password box - :param str message: message to display above the input box - -.. py:function:: dialogCreateSeekBar(start, maximum, title) - - Create seek bar dialog - - :param int start: default=50 - :param int maximum: default=100 - :param int title: title - -.. py:function:: dialogCreateTimePicker(hour, minute, is24hour) - - Create time picker dialog - - :param int hour: default=0 - :param int miute: default=0 - :param bool is24hour: default=false - -.. py:function:: dialogCreateDatePicker(year, month, day) - - Create date picker dialog - - :param int year: default=1970 - :param int month: default=1 - :param int day: default=1 - - -NFC -------------- -**Data structs** -*QPython NFC json result* -:: - - { - "role": , # could be self/master/slave - "stat": , # could be ok / fail / cancl - "message": - } - -**APIs** - -.. py:function:: dialogCreateNFCBeamMaster(title, message, inputType) - - Create a dialog where you could create a qpython beam master - - :param str title: title of the input box - :param str message: message to display above the input box - :param str inputType(optional): type of input data, ie number or text - -.. py:function:: NFCBeamMessage(content, title, message) - - Create a dialog where you could create a qpython beam master - - :param str content: message you want to sent - :param str title: title of the input box - :param str message: message to display above the input box - :param str inputType(optional): type of input data, ie number or text - -.. py:function:: dialogCreateNFCBeamSlave(title, message) - - Create a qpython beam slave - - :param str title: title of the input box - :param str message: message to display above the input box - -Progress --------------- -.. py:function:: dialogCreateSpinnerProgress(message, maximumProgress) - - Create a spinner progress dialog - - :param str message(optional): message - :param int maximunProgress(optional): dfault=100 - -.. py:function:: dialogSetCurrentProgress(current) - - Set progress dialog current value - - :param int current: current - -.. py:function:: dialogSetMaxProgress(max) - - Set progress dialog maximum value - - :param int max: max - - -.. py:function:: dialogCreateHorizontalProgress(title, message, maximumProgress) - - Create a horizontal progress dialog - - :param str title(optional): title - :param str message(optional): message - :param int maximunProgress(optional): dfault=100 - - -Alert ----------- -.. py:function:: dialogCreateAlert(title, message) - - Create alert dialog - - :param str title(optional): title - :param str message(optional): message - :param int maximunProgress(optional): dfault=100 - - -Dialog Control ---------------- -.. py:function:: dialogSetPositiveButtonText(text) - - Set alert dialog positive button text - - :param str text: text - -.. py:function:: dialogSetNegativeButtonText(text) - - Set alert dialog negative button text - - :param str text: text - -.. py:function:: dialogSetNeutralButtonText(text) - - Set alert dialog button text - - :param str text: text - -.. py:function:: dialogSetItems(items) - - Set alert dialog list items - - :param list items: items - -.. py:function:: dialogSetSingleChoiceItems(items, selected) - - Set alert dialog list items - - :param list items: items - :param int selected: selected item index (default=0) - -.. py:function:: dialogSetMultiChoiceItems(items, selected) - - Set dialog multiple choice items and selection - - :param list items: items - :param int selected: selected item index (default=0) - -.. py:function:: addContextMenuItem(label, event, eventData) - - Adds a new item to context menu - - :param str label: label for this menu item - :param str event: event that will be generated on menu item click - :param object eventData: event object - -.. py:function:: addOptionsMenuItem(label, event, eventData, iconName) - - Adds a new item to context menu - - :param str label: label for this menu item - :param str event: event that will be generated on menu item click - :param object eventData: event object - :param str iconName: Android system menu icon, see http://developer.android.com/reference/android/R.drawable.html - -.. py:function:: dialogGetResponse() - - Returns dialog response - -.. py:function:: dialogGetSelectedItems() - - This method provides list of items user selected - -.. py:function:: dialogDismiss() - - Dismiss dialog - -.. py:function:: dialogShow() - - Show dialog - - -Layout ---------- -.. py:function:: fullShow(layout) - - Show Full Screen - - :param string layout: String containing View layout - -.. py:function:: fullDismiss() - - Dismiss Full Screen - -.. py:function:: fullQuery() - - Get Fullscreen Properties - -.. py:function:: fullQueryDetail(id) - - Get fullscreen properties for a specific widget - - :param str id: id of layout widget - -.. py:function:: fullSetProperty(id) - - Set fullscreen widget property - - :param str id: id of layout widget - :param str property: name of property to set - :param str value: value to set property to - -.. py:function:: fullSetList(id, list) - - Attach a list to a fullscreen widget - - :param str id: id of layout widget - :param list list: List to set - -.. py:function:: fullKeyOverride(keycodes, enable) - - Override default key actions - - :param str keycodes: id of layout widget - :param bool enable: List to set (default=true) - - - -WebView ------------ -.. py:function:: webViewShow() - - Display a WebView with the given URL - - :param str url: url - :param bool wait(optional): block until the user exits the WebView - -USB Host Serial Facade -====================== - -*QPython 1.3.1+ and QPython3 1.0.3+ contains this feature* - -SL4A Facade for USB Serial devices by Android USB Host API. - - -It control the USB-Serial like devices -from Andoroid which has USB Host Controller . - -The sample -`demonstration is also available at youtube video `_ - - -Requirements -------------- -* Android device which has USB Host controller (and enabled in that firmware). -* Android 4.0 (API14) or later. -* USB Serial devices (see [Status](#Status)). -* USB Serial devices were not handled by Android kernel. - - > I heard some android phone handle USB Serial devices - > make /dev/ttyUSB0 in kernel level. - > In this case, Android does not be able to handle the device - > from OS level. - - please check Android Applications be able to grab the target USB Devices, - such as `USB Device Info `_. - -Status ---------------- -* probably work with USB CDC, like FTDI, Arduino or else. - -* 2012/09/10: work with 78K0F0730 device (new RL78) with Tragi BIOS board. - - `M78K0F0730 `_ - -* 2012/09/24: work with some pl2303 devcies. - -Author -------- -This facade developped by `Kuri65536 `_ -you can see the commit log in it. - - -APIs --------- -.. py:function:: usbserialGetDeviceList() - - Returns USB devices reported by USB Host API. - - :return: Returns "Map of id and string information Map - - -.. py:function:: usbserialDisconnect(connID) - - Disconnect all USB-device - - :param str connID: connection ID - -.. py:function:: usbserialActiveConnections() - - Returns active USB-device connections. - - :return: Returns "Active USB-device connections by Map UUID vs device-name." - - -.. py:function:: usbserialWriteBinary(base64, connID) - - Send bytes over the currently open USB Serial connection. - - :param str base64: - :param str connId: - -.. py:function:: usbserialReadBinary(bufferSize, connID) - - Read up to bufferSize bytes and return a chunked, base64 encoded string - - :param int bufferSize: - :param str connId: - -.. py:function:: usbserialConnect(hash, options) - - Connect to a device with USB-Host. request the connection and exit - - :param str hash: - :param str options: - - :return: Returns messages the request status - -.. py:function:: usbserialHostEnable() - - Requests that the host be enable for USB Serial connections. - - :return: True if the USB Device is accesible - -.. py:function:: usbserialWrite(String ascii, String connID) - - Sends ASCII characters over the currently open USB Serial connection - - :param str ascii: - :param str connID: - -.. py:function:: usbserialReadReady(connID) - - :param str connID: - - :return: True if the next read is guaranteed not to block - - -.. py:function:: usbserialRead(connID, bufferSize) - - Read up to bufferSize ASCII characters. - - :param str connID: - :param int bufferSize: - -.. py:function:: usbserialGetDeviceName(connID) - - Queries a remote device for it's name or null if it can't be resolved - - :param str connID: diff --git a/docs/_sources/en/guide_contributors.txt b/docs/_sources/en/guide_contributors.txt deleted file mode 100644 index 4de51a61..00000000 --- a/docs/_sources/en/guide_contributors.txt +++ /dev/null @@ -1,40 +0,0 @@ -Welcome contribute -=============================== -Thanks for supporting this project, QPython is a greate project, and we hope you join us to help with make it more greater. - -Please send email to us(support at qpython.org) to introduce youself briefly, and which part do you want to contribute. - -Then we will consider to invite you to join the qpython-collaborator group. - -How to help with test -======================== - -.. toctree:: - :maxdepth: 2 - - guide_contributors_test - -How to contribute documentation -================================ - -How to translate -================================ - - -How to launch a local QPython users community -================================================================ - -How to organise a local qpython user sharing event ----------------------------------------- - -How to became the developer member -==================================== - -How to develop qpython built-in programs ----------------------------------------- - -How to sponsor QPython project -==================================== - - -More detail coming soon... diff --git a/docs/_sources/en/guide_contributors_test.txt b/docs/_sources/en/guide_contributors_test.txt deleted file mode 100644 index 84c8d78c..00000000 --- a/docs/_sources/en/guide_contributors_test.txt +++ /dev/null @@ -1,33 +0,0 @@ -QPython is keeping develop! -If you are interested about what we are doing and want to make some contribution, follow this guide to make this project better! - - -Join the tester community --------------------------- -We create a G+ community where you could report bugs or offer suggestions -> `QPython tester G+ community(For QPython testers) `_ - -Join us now! - -.. image:: ../_static/1.png - :scale: 50 % - - -Become a tester ----------------- -After join the tester community, you could become a tester! -Click this and become a tester -> `I'm ready for test `_ - -.. image:: ../_static/2.png - -Report or suggest -------------------- -If you find out any bugs or have any cool idea about QPython, please let us know about it. -You could write down your suggestion or bug report on the community. - -.. image:: ../_static/3.png - - - -Feedback ---------- -Send your feedback to QPython using the contact information: support@qptyhon.org \ No newline at end of file diff --git a/docs/_sources/en/guide_developers.txt b/docs/_sources/en/guide_developers.txt deleted file mode 100644 index 22a7d2b3..00000000 --- a/docs/_sources/en/guide_developers.txt +++ /dev/null @@ -1,75 +0,0 @@ -Android -============================== -Android part offers the common Python user interaction functions, like console, editor, file browsing, QRCode reader etc. - - -Console ---------- - - -Editor ------------ - - -File browsing ------------- - - -QRCode reader ------------------------- - - -QSL4A -============================== -QSL4A is the folk of SL4A for QPython, which allows users being able to program with Python script for android. - - -QPython Core -============================== -Besides Python core, QPython core offer three types programming mode also. - -Python 2.x ------------ - -Python 3.x ------------ - -Console program ---------------- - -Kivy program ------------- - -WebApp program --------------- - - - -Pip and libraries -============================== -Pip and libraries offer great expansion ability for QPython. - -Pip ---------- - -Libraries ----------- - - -Quick tools -============================== -Quick tools offers better guide for using QPython well for different users. - -QPython API ------------- - -FTP --------- - - -QPY.IO (Enterprise service) -============================== -It's a enterprise service which aim at offering quick android development delivery with QPython. - -It's QPython's maintainers' main paid service, but not a opensource project. - diff --git a/docs/_sources/en/guide_extend.txt b/docs/_sources/en/guide_extend.txt deleted file mode 100644 index bda077ed..00000000 --- a/docs/_sources/en/guide_extend.txt +++ /dev/null @@ -1,131 +0,0 @@ -QPython Open API -===================================================== -QPython has an open activity which allow you run qpython from outside. - -The MPyAPI's definition seems like the following: - -:: - - - - - - - - - - - - - - - - - - - - - - - - - - - -**So, with it's help, you could:** - -Share some content to QPython's scripts ---------------------------------------------- -You could choose some content in some app, and share to qpython's script, then you could handle the content with the **sys.argv[2]** - -`Watch the demo video on YouTube `_ - - -Run QPython's script from your own application ------------------------------------------------------- - -You can call QPython to run some script or python code in your application by call this activity, like the following sample: - -:: - - // code sample shows how to call qpython API - String extPlgPlusName = "org.qpython.qpy"; // QPython package name - Intent intent = new Intent(); - intent.setClassName(extPlgPlusName, "org.qpython.qpylib.MPyApi"); - intent.setAction(extPlgPlusName + ".action.MPyApi"); - - Bundle mBundle = new Bundle(); - mBundle.putString("app", "myappid"); - mBundle.putString("act", "onPyApi"); - mBundle.putString("flag", "onQPyExec"); // any String flag you may use in your context - mBundle.putString("param", ""); // param String param you may use in your context - - /* - * The Python code we will run - */ - String code = "import androidhelper\n" + - "droid = androidhelper.Android()\n" + - "line = droid.dialogGetInput()\n" + - "s = 'Hello %s' % line.result\n" + - "droid.makeToast(s)\n" - - mBundle.putString("pycode", code); - intent.putExtras(mBundle); - startActivityForResult(intent, SCRIPT_EXEC_PY); - ... - - - - // And you can handle the qpython callabck result in onActivityResult - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == SCRIPT_EXEC_PY) { - if (data!=null) { - Bundle bundle = data.getExtras(); - String flag = bundle.getString("flag"); - String param = bundle.getString("param"); - String result = bundle.getString("result"); // Result your Pycode generate - Toast.makeText(this, "onQPyExec: return ("+result+")", Toast.LENGTH_SHORT).show(); - } else { - Toast.makeText(this, "onQPyExec: data is null", Toast.LENGTH_SHORT).show(); - - } - } - } - - -`Checkout the full project from github `_ - -And there is `a production application - QPython Plugin for Tasker `_ - -QPython Online Service -===================================================== - -Now the QPython online service only open for QPython, not QPython3. - - -QPypi ---------------------------------------------------------- -Can I install some packages which required pre-compiled ? -Sure, you could install some pre-compiled packages from QPypi, you could find it through "Libraries" on dashboard. - - -.. image:: ../_static/guide_extend_pic2.png - -If you couldn't found the package here, you could send email to river@qpython.org . - -QPY.IO ---------------------------------------------------- -Can I build an independent APK from QPython script? - -Sure you can. now the service is **in BETA**, it's a challenging thing. We will publish it as a online service, for we want to let the development process is simple, you don't need to own the development environment set up when you want to build a application. - - -.. image:: ../_static/guide_extend_pic1.png - -If you want to try it out or have some business proposal, please contact with us by sending email to river@qpython.org . diff --git a/docs/_sources/en/guide_helloworld.txt b/docs/_sources/en/guide_helloworld.txt deleted file mode 100644 index d07001f6..00000000 --- a/docs/_sources/en/guide_helloworld.txt +++ /dev/null @@ -1,121 +0,0 @@ -Writing "Hello World" -======================== - - -Hello world ----------------- -.. image:: ../_static/guide_helloworld_pic1.png - :alt: hello world - -Well, after you became a bit more familiar with QPython, let's create our first program in QPython. Obviously, it will be `helloworld.py`. ;) - -Start QPython, open editor and enter the following code: - -:: - - import androidhelper - droid = androidhelper.Android() - droid.makeToast('Hello, Username!') - -No wonder, it's just similar to any other hello-world program. When executed, it just shows pop-up message on the screen (see screenshot on the top). Anyway, it's a good example of QPython program. - -SL4A library ------------- - -It begins with *import androidhelper* — the most useful module in QPython, which encapsulates almost all interface with Android, available in Python. Any script developed in QPython starts with this statement (at least if it claims to communicate with user). Read more about Python library `here `_ and import statement `here `_ - -By the way, if you're going to make your script compatible with SL4A, you should replace the first line with the following code (and use `android` instead `androidhelper` further in the program): - -:: - - try: - import androidhelper as android - except ImportError: - import android - -Ok, next we're creating an object `droid` (actually a class), it is necessary to call RPC functions in order to communicate with Android. - -And the last line of our code calls such function, `droid.makeToast()`, which shows a small pop-up message (a "toast") on the screen. - -Well, let's add some more functionality. Let it ask the user name and greet them. - -More samples ---------------- -We can display a simple dialog box with the title, prompt, edit field and buttons **Ok** and **Cancel** using `dialogGetInput` call. Replace the last line of your code and save it as `hello1.py`: - -:: - - import androidhelper - droid = androidhelper.Android() - respond = droid.dialogGetInput("Hello", "What is your name?") - -Well, I think it should return any respond, any user reaction. That's why I wrote `respond = ...`. But what the call actually returns? Let's check. Just add `print` statement after the last line: - -:: - - import androidhelper - droid = androidhelper.Android() - respond = droid.dialogGetInput("Hello", "What is your name?") - print respond - -Then save and run it... - -Oops! Nothing printed? Don't worry. Just pull notification bar and you will see "QPython Program Output: hello1.py" — tap it! - - -As you can see, `droid.dialogGetInput()` returns a JSON object with three fields. We need only one — `result` which contains an actual input from user. - -Let's add script's reaction: - -:: - - import androidhelper - droid = androidhelper.Android() - respond = droid.dialogGetInput("Hello", "What is your name?") - print respond - message = 'Hello, %s!' % respond.result - droid.makeToast(message) - -Last two lines (1) format the message and (2) show the message to the user in the toast. See `Python docs `_ if you still don't know what `%` means. - -Wow! It works! ;) - -Now I'm going to add a bit of logic there. Think: what happen if the user clicks **Cancel** button, or clicks **Ok** leaving the input field blank? - -You can play with the program checking what contains `respond` variable in every case. - -First of all, I want to put text entered by user to a separate variable: `name = respond.result`. Then I'm going to check it, and if it contains any real text, it will be considered as a name and will be used in greeting. Otherwise another message will be shown. Replace fifth line `message = 'Hello, %s!' % respond.result` with the following code: - -:: - - name = respond.result - if name: - message = 'Hello, %s!' % name - else: - message = "Hey! And you're not very polite, %Username%!" - -Use **<** and **>** buttons on the toolbar to indent/unindent lines in if-statement (or just use space/backspace keys). You can read more about indentation in Python `here `_; if-statement described `here `_. - -First of all, we put user input to the variable `name`. Then we check does `name` contain anything? In case the user left the line blank and clicked **Ok**, the return value is empty string `''`. In case of **Cancel** button pressed, the return value is `None`. Both are treated as false in if-statement. So, only if `name` contans anything meaninful, then-statement is executed and greeting "Hello, ...!" shown. In case of empty input the user will see "Hey! And you're not very polite, %Username%!" message. - -Ok, here is the whole program: - -:: - - import androidhelper - droid = androidhelper.Android() - respond = droid.dialogGetInput("Hello", "What is your name?") - print respond - name = respond.result - if name: - message = 'Hello, %s!' % name - else: - message = "Hey! And you're not very polite, %Username%!" - droid.makeToast(message) - - -`Thanks dmych offer the first draft in his blog `_ - - - - diff --git a/docs/_sources/en/guide_howtostart.txt b/docs/_sources/en/guide_howtostart.txt deleted file mode 100644 index 8575d63e..00000000 --- a/docs/_sources/en/guide_howtostart.txt +++ /dev/null @@ -1,133 +0,0 @@ - - -QPython: How To Start -======================== -Now, I will introduce the QPython's features through it's interfaces. - -1. Dashboard ------------------- - -.. image:: ../_static/guide_howtostart_pic1.png - :alt: QPython start - - -After you installed QPython, start it in the usual way by tapping its icon in the menu. Screenshot on the top of this post shows what you should see when QPython just started. - -**Start button** - -By tapping the big button with Python logo in the center of the screen you can - -**Launch your local script or project** - -*Get script from QR code* (funny brand new way to share and distribute your code, you can create QRCode through `QPython's QRCode generator `_ - -Now you can install many 3rd libaries ( pure python libraries mainly ) through pip_console.py script. - -If you want QPython to run some script of project when you click the start button, you can make it by setting default program in setting activity. - - -**Developer kit dashboard** - -If you swipe to the left instead of tapping, you will see another (second) main screen of QPython *(Pic. 2)*. As for me, it is much more useful and comfortable for developer. - -.. image:: ../_static/guide_howtostart_pic2.png - :alt: QPython develop dashboard - - -Tools available here: - -* **Console** — yes, it's regular Python console, feel free to comunicate with interpreter directly -* **Editor** — QPython has a nice text editor integrated with the rest, you can write code and run it without leaving the application -* **My QPython** — here you can find your scripts and projects -* **System** — maintain libraries and components: install and uninstall them -* **Package Index** opens the page `QPyPI `_ in browser allowing to install packages listed there -* **Community** leads to `QPython.org `_ page. Feel free to join or ask&answer questions in the QPython community. - -By long clicking on the console or editor, you have chance to create the shortcut on desktop which allow you enter console or editor directly. - -Next, let's see the console and the editor. - -2. Console and editor -------------------------- - -.. image:: ../_static/guide_howtostart_pic3.png - :alt: QPython console - - -As I said before, there is an ordinary Python console. Many people usually use it to explore objects' properties, consult about syntax and test their ideas. You can type your commands directly and Python interpreter will execute them. You can open additional consoles by tapping the plus button (1) and usedrop-down list on the upper left corner to switch between consoles (2). To close the console just tap the close button (3). - -.. image:: ../_static/guide_howtostart_pic4.png - :alt: QPython notification - - -Please note, there will be notification in the notification bar unless you explicitly close the console and you always can reach the open console by tapping the notification. - - - -.. image:: ../_static/guide_howtostart_pic5.png - :alt: QPython editor - - -The editor allows you obviously (hello Cap!) enter and modify text. Here you can develop your scripts, save them and execute. The editor supports Python syntax highlighting and shows line numbers (there is no ability to go to the line by number though). *(above picture)* - -When typing, you can easily control indentation level (which is critical for Python code) using two buttons on the toolbar (1). Next buttons on the toolbar are **Save** and **Save As** (2), then goes **Run** (3), **Undo**, **Search**, **Recent Files** and **Settings** buttons. Also there are two buttons on the top: **Open** and **New** (5). - -When saving, don't forget to add `.py` estension to the file name since the editor don't do it for you. - -3. Programs --------------------- -You can find the scripts or projects in My QPython. My QPython contains the scripts and Projects. - -By long clicking on script or project, you have chance to create the shortcut for the script or project. Once you have created the shortcuts on desktop, you can directly run the script or project from desktop. - - -**Scripts** -Scripts : A single script. The scripts are in the /sdcard/com.hipipal.qpyplus/scripts directory. -If you want your script could be found in My QPython, please upload it to this directory. - -When you click the script, you can choose the following actions: - -- Run : Run the script -- Open : Edit the script with built-in editor -- Rename : Rename the script -- Delete : Delete the script - -**Projects** -Projects : A directory which should contain the main.py as the project's default launch script, and you can put other dependency 3rd libraries or resources in the same directory, if you want your project could be found in My QPython, please upload them into this directory. - -When you click on the project, you can choose the following actions: - -- Run : run the project -- Open : use it to explore project's resources -- Rename : Rename the project -- Delete : Delete the project - -4. Libraries --------------- - -By installing 3rd libraries, you can extend your qpython's programming ability quickly. There are some ways to install libraries. - -**QPypi** - -You can install some pre-built libraries from QPypi, like numpy etc. - -**Pip console** - -You can install most pure python libraries through pip console. - - -Besides the two ways above, you could copy libraries into the /sdcard/qpython/lib/python2.7/site-packages in your device. - - -*Notice:* -Some libraries mixed with c/c++ files could not be install through pip console for the android lacks the compiler environment, you could ask help from qpython developer team. - - -5. Community --------------- -It will redirect to the QPython.org, including somthe source of this documentation, and there are some qpython user communities' link, many questions of qpython usage or programming could be asked in the community. - - - - -`Thanks dmych offer the first draft in his blog `_ diff --git a/docs/_sources/en/guide_ide.txt b/docs/_sources/en/guide_ide.txt deleted file mode 100644 index 45865c81..00000000 --- a/docs/_sources/en/guide_ide.txt +++ /dev/null @@ -1,49 +0,0 @@ -Use the best way for developing -=================================================== - - -Develop from QEditor ----------------------------------------- -QEditor is the QPython's built-in editor, which supports Python / HTML syntax highlight. - - -**QEditor's main features** - -* Edit / View plain text file, like Python, Lua, HTML, Javascript and so on - -* Edit and run Python script & Python syntax highlight - -* Edit and run Shell script - -* Preview HTML with built-in HTML browser - -* Search by keyword, code snippets, code share - -You could run the QPython script directly when you develop from QEditor, so when you are moving it's the most convient way for QPython develop. - - -Develop from browser --------------------------------------- -QPython has a built-in script which is **qedit4web.py**, you could see it when you click the start button and choose "Run local script". -After run it, you could see the result. - -.. image:: ../_static/guide_ide_qedit4web.png - :alt: QPython qedit4web - -Then, you could access the url from your PC/Laptop's browser for developing, just like the below pics. - -.. image:: ../_static/guide_ide_qedit4web_choose.png - :alt: QPython qedit4web choose project or file - -*After choose some project or script, you could start to develop* - -.. image:: ../_static/guide_ide_qedit4web_develop.png - :alt: QPython qedit4web - - -With it's help, you could write from browser and run from your android phone. It is very convenient. - - -Develop from your computer --------------------------- -Besides the above ways, you could develop the script with your way, then upload to your phone and run with QPython also. diff --git a/docs/_sources/en/guide_libraries.txt b/docs/_sources/en/guide_libraries.txt deleted file mode 100644 index e4bb3ef2..00000000 --- a/docs/_sources/en/guide_libraries.txt +++ /dev/null @@ -1,292 +0,0 @@ -QPython built-in Libraries -========================== -QPython is using the Python 2.7.2 and it support most Python stardard libraries. And you could see their documentation through Python documentation. - -QPython dynload libraries --------------------------------------------------------------- -Just like Python, QPython contains python built-in .so libraries. - -Usually, you don't need to import them manually, they were used in stardard libraries, and could be imported automatically. - -* _codecs_cn.so -* _codecs_hk.so -* _codecs_iso2022.so -* _codecs_jp.so -* _codecs_kr.so -* _codecs_tw.so -* _csv.so -* _ctypes.so -* _ctypes_test.so -* _hashlib.so -* _heapq.so -* _hotshot.so -* _io.so -* _json.so -* _lsprof.so -* _multibytecodec.so -* _sqlite3.so -* _ssl.so -* _testcapi.so -* audioop.so -* future_builtins.so -* grp.so -* mmap.so -* resource.so -* syslog.so -* termios.so -* unicodedata.so - -QPython stardard libraries ---------------------------- -The following libraries are the stardard QPython libraries which are the same as Python: - -- `BaseHTTPServer.py `_ -- `binhex.py `_ -- `fnmatch.py `_ -- mhlib.py -- quopri.py -- sysconfig.py -- Bastion.py -- bisect.py -- formatter.py -- mimetools.py -- random.py -- tabnanny.py -- CGIHTTPServer.py -- bsddb -- fpformat.py -- mimetypes.py -- re.py -- tarfile.py -- ConfigParser.py -- cProfile.py -- fractions.py -- mimify.py -- repr.py -- telnetlib.py -- Cookie.py -- calendar.py -- ftplib.py -- modulefinder.py -- rexec.py -- tempfile.py -- DocXMLRPCServer.py -- cgi.py -- functools.py -- multifile.py -- rfc822.py -- textwrap.py -- HTMLParser.py -- cgitb.py -- genericpath.py -- mutex.py -- rlcompleter.py -- this.py -- chunk.py -- getopt.py -- netrc.py -- robotparser.py -- threading.py -- MimeWriter.py -- cmd.py -- getpass.py -- new.py -- runpy.py -- timeit.py -- Queue.py -- code.py -- gettext.py -- nntplib.py -- sched.py -- toaiff.py -- SimpleHTTPServer.py -- codecs.py -- glob.py -- ntpath.py -- sets.py -- token.py -- SimpleXMLRPCServer.py -- codeop.py -- gzip.py -- nturl2path.py -- sgmllib.py -- tokenize.py -- SocketServer.py -- collections.py -- hashlib.py -- numbers.py -- sha.py -- trace.py -- StringIO.py -- colorsys.py -- heapq.py -- opcode.py -- shelve.py -- traceback.py -- UserDict.py -- commands.py -- hmac.py -- optparse.py -- shlex.py -- tty.py -- UserList.py -- compileall.py -- hotshot -- os.py -- shutil.py -- types.py -- UserString.py -- compiler -- htmlentitydefs.py -- os2emxpath.py -- site.py -- unittest -- _LWPCookieJar.py -- config -- htmllib.py -- smtpd.py -- urllib.py -- _MozillaCookieJar.py -- contextlib.py -- httplib.py -- pdb.py -- smtplib.py -- urllib2.py -- __future__.py -- cookielib.py -- ihooks.py -- pickle.py -- sndhdr.py -- urlparse.py -- __phello__.foo.py -- copy.py -- imaplib.py -- pickletools.py -- socket.py -- user.py -- _abcoll.py -- copy_reg.py -- imghdr.py -- pipes.py -- sqlite3 -- uu.py -- _pyio.py -- csv.py -- importlib -- pkgutil.py -- sre.py -- uuid.py -- _strptime.py -- ctypes -- imputil.py -- plat-linux4 -- sre_compile.py -- warnings.py -- _threading_local.py -- dbhash.py -- inspect.py -- platform.py -- sre_constants.py -- wave.py -- _weakrefset.py -- decimal.py -- io.py -- plistlib.py -- sre_parse.py -- weakref.py -- abc.py -- difflib.py -- json -- popen2.py -- ssl.py -- webbrowser.py -- aifc.py -- dircache.py -- keyword.py -- poplib.py -- stat.py -- whichdb.py -- antigravity.py -- dis.py -- lib-tk -- posixfile.py -- statvfs.py -- wsgiref -- anydbm.py -- distutils -- linecache.py -- posixpath.py -- string.py -- argparse.py -- doctest.py -- locale.py -- pprint.py -- stringold.py -- xdrlib.py -- ast.py -- dumbdbm.py -- logging -- profile.py -- stringprep.py -- xml -- asynchat.py -- dummy_thread.py -- macpath.py -- pstats.py -- struct.py -- xmllib.py -- asyncore.py -- dummy_threading.py -- macurl2path.py -- pty.py -- subprocess.py -- xmlrpclib.py -- atexit.py -- email -- mailbox.py -- py_compile.py -- sunau.py -- zipfile.py -- audiodev.py -- encodings -- mailcap.py -- pyclbr.py -- sunaudio.py -- base64.py -- filecmp.py -- markupbase.py -- pydoc.py -- symbol.py -- bdb.py -- fileinput.py -- md5.py -- pydoc_data -- symtable.py - - - -Python 3rd Libraries -========================== - -- `BeautifulSoup.py(3) `_ -- pkg_resources.py -- androidhelper -- plyer -- `bottle.py `_ -- qpy.py -- qpythoninit.py -- setuptools -- `pip `_ - - -Androidhelper APIs -======================== -To simplify QPython SL4A development in IDEs with a -"hepler" class derived from the default Android class containing -SL4A facade functions & API documentation - - -.. toctree:: - :maxdepth: 2 - - guide_androidhelpers diff --git a/docs/_sources/en/guide_program.txt b/docs/_sources/en/guide_program.txt deleted file mode 100644 index 07962d77..00000000 --- a/docs/_sources/en/guide_program.txt +++ /dev/null @@ -1,191 +0,0 @@ -QPython's main features -==================================== - -**With QPython, you could build android applications with android application and script language now.** - - -Why should I choose QPython ------------------------- -The smartphone is becomming people's essential information & technical assitant, so an flexiable script engine could help people complete most jobs efficiently without complex development. - -QPython offer **an amazing developing experience**, with it's help, you could implement the program easily without complex installing IDE, compiling, package progress etc. - -QPython's main features -------------------------- -You can do most jobs through QPython just like the way that Python does on PC/Laptop. - - -**Libraries** - -- QPython supports most stardard Python libraries. - -- QPython supports many 3rd Python libraries which implemented with pure Python code. - -- QPython supports some Python libraries mixed with C/C++ code which pre-compiled by QPython develop team. - -- QPython allows you put on the libraries by yourself. - -Besides these, QPython offers some extra features which Python doesn't offer, Like: - -- Android APIs Access(Like SMS, GPS, NFC, BLUETOOTH etc) - -*Why QPython require so many permissions?* - -QPython need these permissions to access Android's API. - - -**Runtime modes** - -QPython supports several runtime modes for android. - -**Console mode** - -It's the default runtime mode in QPython, it's very common in PC/laptop. - - -**Kivy mode** - -QPython supports `Kivy `_ as the GUI programming solution. - - -Kivy is an open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. - -Your device should support opengl2.0 for supporting kivy mode. - -By insert into the following header in your script, you can let your script run with kivy mode. - -:: - - #qpy:kivy - - -*An kivy program in QPython sample* - -:: - - #qpy:kivy - from kivy.app import App - from kivy.uix.button import Button - - class TestApp(App): - def build(self): - return Button(text='Hello World') - - TestApp().run() - - -If your library require the opengl driver, you shoule declare the kivy mode header in your script, like the jnius. - -*NOTE: QPython3 didn't support kivy mode yet, we have plan to support it in the future* - -**WebApp mode** - -We recommend you implement WebApp with QPython for it offer the easy to accomplish UI and Take advantage of Python's fast programming strong point. - -WebApp will start a webview in front, and run a python web service background. -You could use *bottle*(QPython built-in library) to implement the web service, or you could install *django* / *flask* framework also. - - -By insert into the following header in your script, you can let your script run with webapp mode. - -:: - - #qpy:webapp: - #qpy: - #qpy:// - -For example - -:: - - #qpy:webapp:Hello QPython - #qpy://localhost:8080/hello - - -The previous should start a webview which should load the *http://localhost:8080/hello* as the default page, and the webview will keep the titlebar which title is "Hello QPython", if you add the *#qpy:fullscreen* it will hide the titlebar. - - -:: - - #qpy:webapp:Hello Qpython - #qpy://127.0.0.1:8080/ - """ - This is a sample for qpython webapp - """ - - from bottle import Bottle, ServerAdapter - from bottle import run, debug, route, error, static_file, template - - - ######### QPYTHON WEB SERVER ############### - - class MyWSGIRefServer(ServerAdapter): - server = None - - def run(self, handler): - from wsgiref.simple_server import make_server, WSGIRequestHandler - if self.quiet: - class QuietHandler(WSGIRequestHandler): - def log_request(*args, **kw): pass - self.options['handler_class'] = QuietHandler - self.server = make_server(self.host, self.port, handler, **self.options) - self.server.serve_forever() - - def stop(self): - #sys.stderr.close() - import threading - threading.Thread(target=self.server.shutdown).start() - #self.server.shutdown() - self.server.server_close() #<--- alternative but causes bad fd exception - print "# qpyhttpd stop" - - - ######### BUILT-IN ROUTERS ############### - @route('/__exit', method=['GET','HEAD']) - def __exit(): - global server - server.stop() - - @route('/assets/') - def server_static(filepath): - return static_file(filepath, root='/sdcard') - - - ######### WEBAPP ROUTERS ############### - @route('/') - def home(): - return template('

Hello {{name}} !

'+ \ - 'View source',name='QPython') - - - ######### WEBAPP ROUTERS ############### - app = Bottle() - app.route('/', method='GET')(home) - app.route('/__exit', method=['GET','HEAD'])(__exit) - app.route('/assets/', method='GET')(server_static) - - try: - server = MyWSGIRefServer(host="127.0.0.1", port="8080") - app.run(server=server,reloader=False) - except Exception,ex: - print "Exception: %s" % repr(ex) - - -If you want the webapp could be close when you exit the webview, you have to define the *@route('/__exit', method=['GET','HEAD'])* method , for the qpython will request the *http://localhost:8080/__exit* when you exit the webview. So you can release other resource in this function. - -.. image:: ../_static/guide_program_pic1.png - :alt: QPython WebApp Sample - -*Running screenshot* - - -In the other part of the code, you could implement a webserver whish serve on localhost:8080 and make the URL /hello implement as your webapp's homepage. - - -**Q mode** - -If you don't want the QPython display some UI, pelase try to use the QScript mode, it could run a script background, just insert the following header into your script: - -:: - - #qpy:qpyapp diff --git a/docs/_sources/zh/contributorshowto.txt b/docs/_sources/zh/contributorshowto.txt deleted file mode 100644 index da17ec1e..00000000 --- a/docs/_sources/zh/contributorshowto.txt +++ /dev/null @@ -1,36 +0,0 @@ - -QPython文档体系说明 ---------------------- - -QPython 文档体系分为 英文/中文 两部分,我们努力保持两种语言对应内容的准确和同步,其中内容其中又分为 - -* 快速开始 (使用上的帮助) - -* 编程指南 (主要是用QPython来进行编程和开发的指南) - -* QPython黑客指南 (深入折腾的指导) - -* 贡献者指南 (QPython贡献者指南,分为在QPython team内的,和以外的) - - -如何提交文档 -------------------------------- -文档非常重要,我们用sphinx来组织文档,并且文档会通过github page功能直接推到qpython.org网站中 -在想要贡献QPython文档之前仔细阅读我们的指南 - -* git clone http://github.com/qpython-android/qpython - -* 进入到 项目的qpython-docs目录中 - -* 按照sphinx规则编辑source中的文件即可 - -* 最后cd到qpython-docs中并运行build.sh - -* 打开浏览器打开本地文件检查, - -* 如果检查无问题则可以提交,然后浏览qpython.org即可看到最新的更新 - - -如何提交翻译 -------------------------------- -QPython是一个支持多语言的应用,你可以通过以下方式来提交对应国家的翻译 diff --git a/docs/_sources/zh/howtostart.txt b/docs/_sources/zh/howtostart.txt deleted file mode 100644 index 8a1ed07f..00000000 --- a/docs/_sources/zh/howtostart.txt +++ /dev/null @@ -1,28 +0,0 @@ -快速开始 -========= - -* `QPython - 使用说明 `_ -* `QPython - 快速开始 `_ -* `“你好,世界!” `_ - -编程指南 -============ - -* `QPython - 开发 WEB APP `_ -* `QPython - Bottle 快速了解 `_ - -QPython黑客指南 -================= - -* `QPython - 编程向导 `_ -* `QPython 黑客 `_ - -贡献者指南 -================= -欢迎加入 QPython 团队 - -.. toctree:: - :maxdepth: 2 - - contributorshowto - diff --git a/docs/_sources/zh/quickstart.txt b/docs/_sources/zh/quickstart.txt deleted file mode 100644 index eb41fb3b..00000000 --- a/docs/_sources/zh/quickstart.txt +++ /dev/null @@ -1,3 +0,0 @@ -ٿʼ -======== - diff --git a/docs/_sources/zhindex.txt b/docs/_sources/zhindex.txt deleted file mode 100644 index 6006633f..00000000 --- a/docs/_sources/zhindex.txt +++ /dev/null @@ -1,33 +0,0 @@ -中文用户向导 -============================================= - -欢迎 ! ------------------------------- -QPython/QPython3 的最新版本1.3.2(QPython), 1.0.2(QPython3) 已经发布,它包含了许多惊艳的特性,请从应用市场安装 - - -QPython 起步 ------------------------- -.. toctree:: - :maxdepth: 2 - - zh/howtostart - - -更多链接 ------------------------------- -* `常见问题 `_ -* `在百度贴吧里讨论 `_ -* `在微博问我们问题 `_ -* `给我们发邮件 `_ -* `报告问题 `_ - -QPython 用户开发组 ------------------------------- -* 请加入 `QPython 用户开发者组 `_ 来和全世界的 QPython 用户一块来玩转QPython。 -* 加入QPython QQ组(Q群:540717901)来和中国活跃的QPython 用户一起玩转 QPython - -如何贡献 ---------- -想成为 QPython 的贡献者么?请 `给我们发邮件 `_ - diff --git a/docs/document.html b/docs/document.html deleted file mode 100644 index 2eb7d19f..00000000 --- a/docs/document.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - -Welcome to read the QPython guide! — QPython 0.9 documentation - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
-
    -
  • Guide »
  • -
  • Welcome to read the QPython guide!
  • -
-
-
-
-images/bestpython.png -
-

Welcome to read the QPython guide!

-

QPython is a script engine that runs Python on android devices. It lets your android device run Python scripts and projects. It contains the Python interpreter, console, editor, and the SL4A Library for Android. It’s Python on Android!

-

QPython has several millions users in the world already, it’s a great project for programming users, welcome to join us for contributing to this project NOW.

-
-

What’s NEW

-

QPython project include the QPython and QPython3 applications.

-

QPython application is using the Python 2.7.2 , and QPython application is using the Python 3.2.2 .

-

QPython’s newest version is 1.3.2 (Released on 2017/5/12) , QPython3’s newest version is 1.0.2 (Released on 2017/3/29), New versions include many amazing features, please upgrade to the newest version as soon from google play, amazon appstore etc.

-
-
-

Thanks these guys who are contributing

-

They are pushing on the QPython project moving forward.

-River is the project's organizer and the current online QPython's author. -Mae is a beautiful and talented girl developer who is good at python & android programming. -Zoom.Quiet is a knowledgeable guy who is famous in many opensource communities. -MathiasLuo is a android geek developer -liyuanrui is a Chinese geek -Kyle kersey is a US geek -

Do you want to join the great QPython team ? You could Ask qustions on twitter or email us. -And you could fork us on github and send pull request.

-
-
-

QPython Communities

-

There are many active QPython communities where you could meet the QPython users like you

- -

And you could talk to us through social network

- -

It’s the official QPython Users & Contributors’ Guide, please follow these steps for using and contributing.

-
-
-

Support

-

We are happy to hear feedback from you, but sometimes some bugs or features demand may not be implemented soon for we lack resources.

-

So if you have any issue need the core developer team to solve with higher priority, you could try the bountysource service.

-
- -
-

Others

-
- -
-
- -
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/faq.html b/docs/en/faq.html deleted file mode 100644 index b065103b..00000000 --- a/docs/en/faq.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - -FAQ — QPython 0.9 documentation - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

FAQ

-

How to run qpython script from other terminals ?

-
    -
  • You could “share to” qpython from 3rd apps.
  • -
  • You need to root the android device first, then soure the env vars (Just like the qpython wiki link you mentioned) and execute the /data/data/org.qpython.qpy/bin/python or /data/data/org.qpython.qpy/bin/python-android5 (for android 5 above)
  • -
-

Case sample

-

Support pygame ?

-

Even you could import pygame in QPython, but QPython doesn’t support pygame now.

-

We will consider to support it later, please follow us on facebook to get it’s progress.

-

Case sample

-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide.html b/docs/en/guide.html deleted file mode 100644 index a7e20c35..00000000 --- a/docs/en/guide.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - -Getting started — QPython 0.9 documentation - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
-
    -
  • Guide »
  • -
  • Getting started
  • -
-
-
-
-
-

Getting started

-

How to start quickly ? Just follow the following steps:

- -
- -
-

Developers’ Guide

-

QPython developers’ goal is pushing out a great Python for android.

- -
- -
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_androidhelpers.html b/docs/en/guide_androidhelpers.html deleted file mode 100644 index 38a7df7d..00000000 --- a/docs/en/guide_androidhelpers.html +++ /dev/null @@ -1,3668 +0,0 @@ - - - - - -AndroidFacade — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-

The Scripting Layer for Android (abridged as SL4A, and previously named Android Scripting Environment or ASE) is a library that allows the creation and running of scripts written in various scripting languages directly on Android devices. QPython start to extend the SL4A project and integrate it.

-../images/sl4a.jpg -

There are many SL4A APIs, if you found any issue, please report an issue.

-
-

AndroidFacade

-
-

Clipboard APIs

-
-
-setClipboard(text)
-

Put text in the clipboard

- --- - - - -
Parameters:text (str) – text
-
-
-
-getClipboard(text)
-

Read text from the clipboard

- --- - - - -
Returns:The text in the clipboard
-
-
sample code to show setClipboard/getClipboard
-
-
-
-
-

Intent & startActivity APIs

-
-
-makeIntent(action, uri, type, extras, categories, packagename, classname, flags)
-

Starts an activity and returns the result

- --- - - - - - -
Parameters:
    -
  • action (str) – action
  • -
  • uri(Optional) (str) – uri
  • -
  • type(Optional) (str) – MIME type/subtype of the URI
  • -
  • extras(Optional) (object) – a Map of extras to add to the Intent
  • -
  • categories(Optional) (list) – a List of categories to add to the Intent
  • -
  • packagename(Optional) (str) – name of package. If used, requires classname to be useful
  • -
  • classname(Optional) (str) – name of class. If used, requires packagename to be useful
  • -
  • flags(Optional) (int) – Intent flags
  • -
-
Returns:

An object representing an Intent

-
-
-
sample code to show makeIntent
-
-
-
-
-getIntent()
-

Returns the intent that launched the script

-
-
sample code to show getIntent
-
-
-
-
-startActivityForResult(action, uri, type, extras, packagename, classname)
-

Starts an activity and returns the result

- --- - - - - - -
Parameters:
    -
  • action (str) – action
  • -
  • uri(Optional) (str) – uri
  • -
  • type(Optional) (str) – MIME type/subtype of the URI
  • -
  • extras(Optional) (object) – a Map of extras to add to the Intent
  • -
  • packagename(Optional) (str) – name of package. If used, requires classname to be useful
  • -
  • classname(Optional) (str) – name of class. If used, requires packagename to be useful
  • -
-
Returns:

A Map representation of the result Intent

-
-
-
sample code to show startActivityForResult
-
-
-
-
-startActivityForResultIntent(intent)
-

Starts an activity and returns the result

- --- - - - - - -
Parameters:intent (Intent) – Intent in the format as returned from makeIntent
Returns:A Map representation of the result Intent
-
-
sample code to show startActivityForResultIntent
-
-
-
-
-startActivityIntent(intent, wait)
-

Starts an activity

- --- - - - -
Parameters:
    -
  • intent (Intent) – Intent in the format as returned from makeIntent
  • -
  • wait(Optional) (bool) – block until the user exits the started activity
  • -
-
-
-
sample code to show startActivityIntent
-
-
-
-
-startActivity(action, uri, type, extras, wait, packagename, classname)
-

Starts an activity

- --- - - - -
Parameters:
    -
  • action (str) – action
  • -
  • uri(Optional) (str) – uri
  • -
  • type(Optional) (str) – MIME type/subtype of the URI
  • -
  • extras(Optional) (object) – a Map of extras to add to the Intent
  • -
  • wait(Optional) (bool) – block until the user exits the started activity
  • -
  • packagename(Optional) (str) – name of package. If used, requires classname to be useful
  • -
  • classname(Optional) (str) – name of class. If used, requires packagename to be useful
  • -
-
-
-
sample code to show startActivityForResultIntent
-
-
-
-
-

SendBroadcast APIs

-
-
-sendBroadcast(action, uri, type, extras, packagename, classname)
-

Send a broadcast

- --- - - - -
Parameters:
    -
  • action (str) – action
  • -
  • uri(Optional) (str) – uri
  • -
  • type(Optional) (str) – MIME type/subtype of the URI
  • -
  • extras(Optional) (object) – a Map of extras to add to the Intent
  • -
  • packagename(Optional) (str) – name of package. If used, requires classname to be useful
  • -
  • classname(Optional) (str) – name of class. If used, requires packagename to be useful
  • -
-
-
-
sample code to show sendBroadcast
-
-
-
-
-sendBroadcastIntent(intent)
-

Send a broadcast

- --- - - - -
Parameters:intent (Intent) – Intent in the format as returned from makeIntent
-
-
sample code to show sendBroadcastIntent
-
-
-
-
-

Vibrate

-
-
-vibrate(intent)
-

Vibrates the phone or a specified duration in milliseconds

- --- - - - -
Parameters:duration (int) – duration in milliseconds
-
-
sample code to show vibrate
-
-
-
-
-

NetworkStatus

-
-
-getNetworkStatus()
-

Returns the status of network connection

-
-
sample code to show getNetworkStatus
-
-
-
-
-

PackageVersion APIs

-
-
-requiredVersion(requiredVersion)
-

Checks if version of QPython SL4A is greater than or equal to the specified version

- --- - - - - - -
Parameters:requiredVersion (int) – requiredVersion
Returns:true or false
-
-
-
-getPackageVersionCode(packageName)
-

Returns package version code

- --- - - - - - -
Parameters:packageName (str) – packageName
Returns:Package version code
-
-
-
-getPackageVersion(packageName)
-

Returns package version name

- --- - - - - - -
Parameters:packageName (str) – packageName
Returns:Package version name
-
-
sample code to show getPackageVersionCode & getPackageVersion
-
-
-
-
-

System APIs

-
-
-getConstants(classname)
-

Get list of constants (static final fields) for a class

- --- - - - - - -
Parameters:classname (str) – classname
Returns:list
-
-
sample code to show getConstants
-
-
-
-
-environment()
-

A map of various useful environment details

- --- - - - -
Returns:environment map object includes id, display, offset, TZ, SDK, download, appcache, availblocks, blocksize, blockcount, sdcard
-
-
sample code to show environment
-
-
-
-
-log(message)
-

Writes message to logcat

- --- - - - -
Parameters:message (str) – message
-
-
sample code to show log
-
-
-
-
-

SendEmail

-
-
-sendEmail(to, subject, body, attachmentUri)
-

Launches an activity that sends an e-mail message to a given recipient

- --- - - - -
Parameters:
    -
  • to (str) – A comma separated list of recipients
  • -
  • subject (str) – subject
  • -
  • body (str) – mail body
  • -
  • attachmentUri(Optional) (str) – message
  • -
-
-
-
sample code to show sendEmail
-
-
-
-
-

Toast, getInput, getPassword, notify APIs

-
-
-makeToast(message)
-

Displays a short-duration Toast notification

- --- - - - -
Parameters:message (str) – message
-
-
sample code to show makeToast
-
-
-
-
-getInput(title, message)
-

Queries the user for a text input

- --- - - - -
Parameters:
    -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
-
-
-
sample code to show getInput
-
-
-
-
-getPassword(title, message)
-

Queries the user for a password

- --- - - - -
Parameters:
    -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
-
-
-
sample code to show getPassword
-
-
-
-
-notify(title, message, url)
-

Displays a notification that will be canceled when the user clicks on it

- --- - - - -
Parameters:
    -
  • title (str) – title
  • -
  • message (str) – message
  • -
  • url(optional) (str) – url
  • -
-
-
-
-
::
-
import androidhelper -droid = androidhelper.Android() -droid.notify(‘Hello’,’QPython’,’http://qpython.org‘) # you could set the 3rd parameter None also
-
-
-
-
-

ApplicationManagerFacade

-
-

Manager APIs

-
-
-getLaunchableApplications()
-

Returns a list of all launchable application class names

- --- - - - -
Returns:map object
-
-
sample code to show getLaunchableApplications
-
-
-
-
-launch(classname)
-

Start activity with the given class name

- --- - - - -
Parameters:classname (str) – classname
-
-
sample code to show launch
-
-
-
-
-getRunningPackages()
-

Returns a list of packages running activities or services

- --- - - - -
Returns:List of packages running activities
-
-
sample code to show getRunningPackages
-
-
-
-
-forceStopPackage(packageName)
-

Force stops a package

- --- - - - -
Parameters:packageName (str) – packageName
-
-
sample code to show forceStopPackage
-
-
-
-
-
-

CameraFacade

-
-
-cameraCapturePicture(targetPath)
-

Take a picture and save it to the specified path

- --- - - - -
Returns:A map of Booleans autoFocus and takePicture where True indicates success
-
-
-
-cameraInteractiveCapturePicture(targetPath)
-

Starts the image capture application to take a picture and saves it to the specified path

-
-
-
-

CommonIntentsFacade

-
-

Barcode

-
-
-scanBarcode()
-

Starts the barcode scanner

- --- - - - -
Returns:A Map representation of the result Intent
-
-
-
-

View APIs

-
-
-pick(uri)
-

Display content to be picked by URI (e.g. contacts)

- --- - - - -
Returns:A map of result values
-
-
-
-view(uri, type, extras)
-

Start activity with view action by URI (i.e. browser, contacts, etc.)

-
-
-
-viewMap(query)
-

Opens a map search for query (e.g. pizza, 123 My Street)

-
-
-
-viewContacts()
-

Opens the list of contacts

-
-
-
-viewHtml(path)
-

Opens the browser to display a local HTML file

-
-
- -

Starts a search for the given query

-
-
-
-
-

ContactsFacade

-
-
-pickContact()
-

Displays a list of contacts to pick from

- --- - - - -
Returns:A map of result values
-
-
-
-pickPhone()
-

Displays a list of phone numbers to pick from

- --- - - - -
Returns:The selected phone number
-
-
-
-contactsGetAttributes()
-

Returns a List of all possible attributes for contacts

- --- - - - -
Returns:a List of contacts as Maps
-
-
-
-contactsGetIds()
-

Returns a List of all contact IDs

-
-
-
-contactsGet(attributes)
-

Returns a List of all contacts

-
-
-
-contactsGetById(id)
-

Returns contacts by ID

-
-
-
-contactsGetCount()
-

Returns the number of contacts

-
-
-
-queryContent(uri, attributes, selection, selectionArgs, order)
-

Content Resolver Query

- --- - - - -
Returns:result of query as Maps
-
-
-
-queryAttributes(uri)
-

Content Resolver Query Attributes

- --- - - - -
Returns:a list of available columns for a given content uri
-
-
-
-

EventFacade

-
-
-eventClearBuffer()
-

Clears all events from the event buffer

-
-
-
-eventRegisterForBroadcast(category, enqueue)
-

Registers a listener for a new broadcast signal

-
-
-
-eventUnregisterForBroadcast(category)
-

Stop listening for a broadcast signal

-
-
-
-eventGetBrodcastCategories()
-

Lists all the broadcast signals we are listening for

-
-
-
-eventPoll(number_of_events)
-

Returns and removes the oldest n events (i.e. location or sensor update, etc.) from the event buffer

- --- - - - -
Returns:A List of Maps of event properties
-
-
-
-eventWaitFor(eventName, timeout)
-

Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer

- --- - - - -
Returns:Map of event properties
-
-
-
-eventWait(timeout)
-

Blocks until an event occurs. The returned event is removed from the buffer

- --- - - - -
Returns:Map of event properties
-
-
-
-eventPost(name, data, enqueue)
-

Post an event to the event queue

-
-
-
-rpcPostEvent(name, data)
-

Post an event to the event queue

-
-
-
-receiveEvent()
-

Returns and removes the oldest event (i.e. location or sensor update, etc.) from the event buffer

- --- - - - -
Returns:Map of event properties
-
-
-
-waitForEvent(eventName, timeout)
-

Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer

- --- - - - -
Returns:Map of event properties
-
-
-
-startEventDispatcher(port)
-

Opens up a socket where you can read for events posted

-
-
-
-stopEventDispatcher()
-

Stops the event server, you can’t read in the port anymore

-
-
-
-

LocationFacade

-
-

Providers APIs

-
-
-locationProviders()
-

Returns availables providers on the phone

-
-
-
-locationProviderEnabled(provider)
-

Ask if provider is enabled

-
-
-
-

Location APIs

-
-
-startLocating(minDistance, minUpdateDistance)
-

Starts collecting location data

-
-
-
-readLocation()
-

Returns the current location as indicated by all available providers

- --- - - - -
Returns:A map of location information by provider
-
-
-
-stopLocating()
-

Stops collecting location data

-
-
-
-getLastKnownLocation()
-

Returns the last known location of the device

- --- - - - -
Returns:A map of location information by provider
-
-

sample code

-
Droid = androidhelper.Android()
-location = Droid.getLastKnownLocation().result
-location = location.get('network', location.get('gps'))
-
-
-
-
-

GEO

-
-
-geocode(latitude, longitude, maxResults)
-

Returns a list of addresses for the given latitude and longitude

- --- - - - -
Returns:A list of addresses
-
-
-
-
-

PhoneFacade

-
-

PhoneStat APIs

-
-
-startTrackingPhoneState()
-

Starts tracking phone state

-
-
-
-readPhoneState()
-

Returns the current phone state and incoming number

- --- - - - -
Returns:A Map of “state” and “incomingNumber”
-
-
-
-stopTrackingPhoneState()
-

Stops tracking phone state

-
-
-
-

Call & Dia APIs

-
-
-phoneCall(uri)
-

Calls a contact/phone number by URI

-
-
-
-phoneCallNumber(number)
-

Calls a phone number

-
-
-
-phoneDial(uri)
-

Dials a contact/phone number by URI

-
-
-
-phoneDialNumber(number)
-

Dials a phone number

-
-
-
-

Get information APIs

-
-
-getCellLocation()
-

Returns the current cell location

-
-
-
-getNetworkOperator()
-

Returns the numeric name (MCC+MNC) of current registered operator

-
-
-
-getNetworkOperatorName()
-

Returns the alphabetic name of current registered operator

-
-
-
-getNetworkType()
-

Returns a the radio technology (network type) currently in use on the device

-
-
-
-getPhoneType()
-

Returns the device phone type

-
-
-
-getSimCountryIso()
-

Returns the ISO country code equivalent for the SIM provider’s country code

-
-
-
-getSimOperator()
-

Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 5 or 6 decimal digits

-
-
-
-getSimOperatorName()
-

Returns the Service Provider Name (SPN)

-
-
-
-getSimSerialNumber()
-

Returns the serial number of the SIM, if applicable. Return null if it is unavailable

-
-
-
-getSimState()
-

Returns the state of the device SIM card

-
-
-
-getSubscriberId()
-

Returns the unique subscriber ID, for example, the IMSI for a GSM phone. Return null if it is unavailable

-
-
-
-getVoiceMailAlphaTag()
-

Retrieves the alphabetic identifier associated with the voice mail number

-
-
-
-getVoiceMailNumber()
-

Returns the voice mail number. Return null if it is unavailable

-
-
-
-checkNetworkRoaming()
-

Returns true if the device is considered roaming on the current network, for GSM purposes

-
-
-
-getDeviceId()
-

Returns the unique device ID, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available

-
-
-
-getDeviceSoftwareVersion()
-

Returns the software version number for the device, for example, the IMEI/SV for GSM phones. Return null if the software version is not available

-
-
-
-getLine1Number()
-

Returns the phone number string for line 1, for example, the MSISDN for a GSM phone. Return null if it is unavailable

-
-
-
-getNeighboringCellInfo()
-

Returns the neighboring cell information of the device

-
-
-
-
-

MediaRecorderFacade

-
-

Audio

-
-
-recorderStartMicrophone(targetPath)
-

Records audio from the microphone and saves it to the given location

-
-
-
-

Video APIs

-
-
-recorderStartVideo(targetPath, duration, videoSize)
-

Records video from the camera and saves it to the given location. -Duration specifies the maximum duration of the recording session. -If duration is 0 this method will return and the recording will only be stopped -when recorderStop is called or when a scripts exits. -Otherwise it will block for the time period equal to the duration argument. -videoSize: 0=160x120, 1=320x240, 2=352x288, 3=640x480, 4=800x480.

-
-
-
-recorderCaptureVideo(targetPath, duration, recordAudio)
-

Records video (and optionally audio) from the camera and saves it to the given location. -Duration specifies the maximum duration of the recording session. -If duration is not provided this method will return immediately and the recording will only be stopped -when recorderStop is called or when a scripts exits. -Otherwise it will block for the time period equal to the duration argument.

-
-
-
-startInteractiveVideoRecording(path)
-

Starts the video capture application to record a video and saves it to the specified path

-
-
-
-

Stop

-
-
-recorderStop()
-

Stops a previously started recording

-
-
-
-
-

SensorManagerFacade

-
-

Start & Stop

-
-
-startSensingTimed(sensorNumber, delayTime)
-

Starts recording sensor data to be available for polling

-
-
-
-startSensingThreshold(ensorNumber, threshold, axis)
-

Records to the Event Queue sensor data exceeding a chosen threshold

-
-
-
-startSensing(sampleSize)
-

Starts recording sensor data to be available for polling

-
-
-
-stopSensing()
-

Stops collecting sensor data

-
-
-
-

Read data APIs

-
-
-readSensors()
-

Returns the most recently recorded sensor data

-
-
-
-sensorsGetAccuracy()
-

Returns the most recently received accuracy value

-
-
-
-sensorsGetLight()
-

Returns the most recently received light value

-
-
-
-sensorsReadAccelerometer()
-

Returns the most recently received accelerometer values

- --- - - - -
Returns:a List of Floats [(acceleration on the) X axis, Y axis, Z axis]
-
-
-
-sensorsReadMagnetometer()
-

Returns the most recently received magnetic field values

- --- - - - -
Returns:a List of Floats [(magnetic field value for) X axis, Y axis, Z axis]
-
-
-
-sensorsReadOrientation()
-

Returns the most recently received orientation values

- --- - - - -
Returns:a List of Doubles [azimuth, pitch, roll]
-
-

sample code

-
Droid = androidhelper.Android()
-Droid.startSensingTimed(1, 250)
-sensor = Droid.sensorsReadOrientation().result
-Droid.stopSensing()
-
-
-
-
-
-

SettingsFacade

-
-

Screen

-
-
-setScreenTimeout(value)
-

Sets the screen timeout to this number of seconds

- --- - - - -
Returns:The original screen timeout
-
-
-
-getScreenTimeout()
-

Gets the screen timeout

- --- - - - -
Returns:the current screen timeout in seconds
-
-
-
-

AirplanerMode

-
-
-checkAirplaneMode()
-

Checks the airplane mode setting

- --- - - - -
Returns:True if airplane mode is enabled
-
-
-
-toggleAirplaneMode(enabled)
-

Toggles airplane mode on and off

- --- - - - -
Returns:True if airplane mode is enabled
-
-
-
-

Ringer Silent Mode

-
-
-checkRingerSilentMode()
-

Checks the ringer silent mode setting

- --- - - - -
Returns:True if ringer silent mode is enabled
-
-
-
-toggleRingerSilentMode(enabled)
-

Toggles ringer silent mode on and off

- --- - - - -
Returns:True if ringer silent mode is enabled
-
-
-
-

Vibrate Mode

-
-
-toggleVibrateMode(enabled)
-

Toggles vibrate mode on and off. If ringer=true then set Ringer setting, else set Notification setting

- --- - - - -
Returns:True if vibrate mode is enabled
-
-
-
-getVibrateMode(ringer)
-

Checks Vibration setting. If ringer=true then query Ringer setting, else query Notification setting

- --- - - - -
Returns:True if vibrate mode is enabled
-
-
-
-

Ringer & Media Volume

-
-
-getMaxRingerVolume()
-

Returns the maximum ringer volume

-
-
-
-getRingerVolume()
-

Returns the current ringer volume

-
-
-
-setRingerVolume(volume)
-

Sets the ringer volume

-
-
-
-getMaxMediaVolume()
-

Returns the maximum media volume

-
-
-
-getMediaVolume()
-

Returns the current media volume

-
-
-
-setMediaVolume(volume)
-

Sets the media volume

-
-
-
-

Screen Brightness

-
-
-getScreenBrightness()
-

Returns the screen backlight brightness

- --- - - - -
Returns:the current screen brightness between 0 and 255
-
-
-
-setScreenBrightness(value)
-

Sets the the screen backlight brightness

- --- - - - -
Returns:the original screen brightness
-
-
-
-checkScreenOn()
-

Checks if the screen is on or off (requires API level 7)

- --- - - - -
Returns:True if the screen is currently on
-
-
-
-
-

SmsFacade

-
-
-smsSend(destinationAddress, text)
-

Sends an SMS

- --- - - - -
Parameters:
    -
  • destinationAddress (str) – typically a phone number
  • -
  • text (str) –
  • -
-
-
-
-
-smsGetMessageCount(unreadOnly, folder)
-

Returns the number of messages

- --- - - - -
Parameters:
    -
  • unreadOnly (bool) – typically a phone number
  • -
  • folder(optional) (str) – default “inbox”
  • -
-
-
-
-
-smsGetMessageIds(unreadOnly, folder)
-

Returns a List of all message IDs

- --- - - - -
Parameters:
    -
  • unreadOnly (bool) – typically a phone number
  • -
  • folder(optional) (str) – default “inbox”
  • -
-
-
-
-
-smsGetMessages(unreadOnly, folder, attributes)
-

Returns a List of all messages

- --- - - - - - -
Parameters:
    -
  • unreadOnly (bool) – typically a phone number
  • -
  • folder (str) – default “inbox”
  • -
  • attributes(optional) (list) – attributes
  • -
-
Returns:

a List of messages as Maps

-
-
-
-
-smsGetMessageById(id, attributes)
-

Returns message attributes

- --- - - - - - -
Parameters:
    -
  • id (int) – message ID
  • -
  • attributes(optional) (list) – attributes
  • -
-
Returns:

a List of messages as Maps

-
-
-
-
-smsGetAttributes()
-

Returns a List of all possible message attributes

-
-
-
-smsDeleteMessage(id)
-

Deletes a message

- --- - - - - - -
Parameters:id (int) – message ID
Returns:True if the message was deleted
-
-
-
-smsMarkMessageRead(ids, read)
-

Marks messages as read

- --- - - - - - -
Parameters:
    -
  • ids (list) – List of message IDs to mark as read
  • -
  • read (bool) – true or false
  • -
-
Returns:

number of messages marked read

-
-
-
-
-

SpeechRecognitionFacade

-
-
-recognizeSpeech(prompt, language, languageModel)
-

Recognizes user’s speech and returns the most likely result

- --- - - - - - -
Parameters:
    -
  • prompt(optional) (str) – text prompt to show to the user when asking them to speak
  • -
  • language(optional) (str) – language override to inform the recognizer that it should expect speech in a language different than the one set in the java.util.Locale.getDefault()
  • -
  • languageModel(optional) (str) – informs the recognizer which speech model to prefer (see android.speech.RecognizeIntent)
  • -
-
Returns:

An empty string in case the speech cannot be recongnized

-
-
-
-
-

ToneGeneratorFacade

-
-
-generateDtmfTones(phoneNumber, toneDuration)
-

Generate DTMF tones for the given phone number

- --- - - - -
Parameters:
    -
  • phoneNumber (str) – phone number
  • -
  • toneDuration(optional) (int) – default 100, duration of each tone in milliseconds
  • -
-
-
-
-
-

WakeLockFacade

-
-
-wakeLockAcquireFull()
-

Acquires a full wake lock (CPU on, screen bright, keyboard bright)

-
-
-
-wakeLockAcquirePartial()
-

Acquires a partial wake lock (CPU on)

-
-
-
-wakeLockAcquireBright()
-

Acquires a bright wake lock (CPU on, screen bright)

-
-
-
-wakeLockAcquireDim()
-

Acquires a dim wake lock (CPU on, screen dim)

-
-
-
-wakeLockRelease()
-

Releases the wake lock

-
-
-
-

WifiFacade

-
-
-wifiGetScanResults()
-

Returns the list of access points found during the most recent Wifi scan

-
-
-
-wifiLockAcquireFull()
-

Acquires a full Wifi lock

-
-
-
-wifiLockAcquireScanOnly()
-

Acquires a scan only Wifi lock

-
-
-
-wifiLockRelease()
-

Releases a previously acquired Wifi lock

-
-
-
-wifiStartScan()
-

Starts a scan for Wifi access points

- --- - - - -
Returns:True if the scan was initiated successfully
-
-
-
-checkWifiState()
-

Checks Wifi state

- --- - - - -
Returns:True if Wifi is enabled
-
-
-
-toggleWifiState(enabled)
-

Toggle Wifi on and off

- --- - - - - - -
Parameters:enabled(optional) (bool) – enabled
Returns:True if Wifi is enabled
-
-
-
-wifiDisconnect()
-

Disconnects from the currently active access point

- --- - - - -
Returns:True if the operation succeeded
-
-
-
-wifiGetConnectionInfo()
-

Returns information about the currently active access point

-
-
-
-wifiReassociate()
-

Returns information about the currently active access point

- --- - - - -
Returns:True if the operation succeeded
-
-
-
-wifiReconnect()
-

Reconnects to the currently active access point

- --- - - - -
Returns:True if the operation succeeded
-
-
-
-

BatteryManagerFacade

-
-
-readBatteryData()
-

Returns the most recently recorded battery data

-
-
-
-batteryStartMonitoring()
-

Starts tracking battery state

-
-
-
-batteryStopMonitoring()
-

Stops tracking battery state

-
-
-
-batteryGetStatus()
-

Returns the most recently received battery status data: -1 - unknown; -2 - charging; -3 - discharging; -4 - not charging; -5 - full

-
-
-
-batteryGetHealth()
-

Returns the most recently received battery health data: -1 - unknown; -2 - good; -3 - overheat; -4 - dead; -5 - over voltage; -6 - unspecified failure

-
-
-
-batteryGetPlugType()
-

Returns the most recently received plug type data: --1 - unknown -0 - unplugged -1 - power source is an AC charger -2 - power source is a USB port

-
-
-
-batteryCheckPresent()
-

Returns the most recently received battery presence data

-
-
-
-batteryGetLevel()
-

Returns the most recently received battery level (percentage)

-
-
-
-batteryGetVoltage()
-

Returns the most recently received battery voltage

-
-
-
-batteryGetTemperature()
-

Returns the most recently received battery temperature

-
-
-
-batteryGetTechnology()
-

Returns the most recently received battery technology data

-
-
-
-

ActivityResultFacade

-
-
-setResultBoolean(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultByte(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultShort(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultChar(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultInteger(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultLong(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultFloat(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultDouble(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultString(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultBooleanArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultByteArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultShortArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultCharArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultIntegerArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultLongArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultFloatArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultDoubleArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultStringArray(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-setResultSerializable(resultCode, resultValue)
-

Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), -the resulting intent will contain SCRIPT_RESULT extra with the given value

- --- - - - -
Parameters:
    -
  • resultCode (int) –
  • -
  • resultValue (byte) –
  • -
-
-
-
-
-

MediaPlayerFacade

-
-

Control

-
-
-mediaPlay(url, tag, play)
-

Open a media file

- --- - - - - - -
Parameters:
    -
  • url (str) – url of media resource
  • -
  • tag(optional) (str) – string identifying resource (default=default)
  • -
  • play(optional) (bool) – start playing immediately
  • -
-
Returns:

true if play successful

-
-
-
-
-mediaPlayPause(tag)
-

pause playing media file

- --- - - - - - -
Parameters:tag (str) – string identifying resource (default=default)
Returns:true if successful
-
-
-
-mediaPlayStart(tag)
-

start playing media file

- --- - - - - - -
Parameters:tag (str) – string identifying resource (default=default)
Returns:true if successful
-
-
-
-mediaPlayClose(tag)
-

Close media file

- --- - - - - - -
Parameters:tag (str) – string identifying resource (default=default)
Returns:true if successful
-
-
-
-mediaIsPlaying(tag)
-

Checks if media file is playing

- --- - - - - - -
Parameters:tag (str) – string identifying resource (default=default)
Returns:true if successful
-
-
-
-mediaPlaySetLooping(enabled, tag)
-

Set Looping

- --- - - - - - -
Parameters:
    -
  • enabled (bool) – default true
  • -
  • tag (str) – string identifying resource (default=default)
  • -
-
Returns:

True if successful

-
-
-
-
-mediaPlaySeek(msec, tag)
-

Seek To Position

- --- - - - - - -
Parameters:
    -
  • msec (int) – default true
  • -
  • tag (str) – string identifying resource (default=default)
  • -
-
Returns:

New Position (in ms)

-
-
-
-
-

Get Information

-
-
-mediaPlayInfo(tag)
-

Information on current media

- --- - - - - - -
Parameters:tag (str) – string identifying resource (default=default)
Returns:Media Information
-
-
-
-mediaPlayList()
-

Lists currently loaded media

- --- - - - -
Returns:List of Media Tags
-
-
-
-
-

PreferencesFacade

-
-
-prefGetValue(key, filename)
-

Read a value from shared preferences

- --- - - - -
Parameters:
    -
  • key (str) – key
  • -
  • filename(optional) (str) – Desired preferences file. If not defined, uses the default Shared Preferences.
  • -
-
-
-
-
-prefPutValue(key, value, filename)
-

Write a value to shared preferences

- --- - - - -
Parameters:
    -
  • key (str) – key
  • -
  • value (str) – value
  • -
  • filename(optional) (str) – Desired preferences file. If not defined, uses the default Shared Preferences.
  • -
-
-
-
-
-prefGetAll(filename)
-

Get list of Shared Preference Values

- --- - - - -
Parameters:filename(optional) (str) – Desired preferences file. If not defined, uses the default Shared Preferences.
-
-
-
-

QPyInterfaceFacade

-
-
-executeQPy(script)
-

Execute a qpython script by absolute path

- --- - - - - - -
Parameters:script (str) – The absolute path of the qpython script
Returns:bool
-
-
-
-

TextToSpeechFacade

-
-
-ttsSpeak(message)
-

Speaks the provided message via TTS

- --- - - - -
Parameters:message (str) – message
-
-
-
-ttsIsSpeaking()
-

Returns True if speech is currently in progress

-
-
-
-

EyesFreeFacade

-
-
-ttsSpeak(message)
-

Speaks the provided message via TTS

- --- - - - -
Parameters:message (str) – message
-
-
-
-

BluetoothFacade

-
-
-bluetoothActiveConnections()
-

Returns active Bluetooth connections

-
-
-
-bluetoothWriteBinary(base64, connID)
-

Send bytes over the currently open Bluetooth connection

- --- - - - -
Parameters:
    -
  • base64 (str) – A base64 encoded String of the bytes to be sent
  • -
  • connID(optional) (str) – Connection id
  • -
-
-
-
-
-bluetoothReadBinary(bufferSize, connID)
-

Read up to bufferSize bytes and return a chunked, base64 encoded string

- --- - - - -
Parameters:
    -
  • bufferSize (int) – default 4096
  • -
  • connID(optional) (str) – Connection id
  • -
-
-
-
-
-bluetoothConnect(uuid, address)
-

Connect to a device over Bluetooth. Blocks until the connection is established or fails

- --- - - - - - -
Parameters:
    -
  • uuid (str) – The UUID passed here must match the UUID used by the server device
  • -
  • address(optional) (str) – The user will be presented with a list of discovered devices to choose from if an address is not provided
  • -
-
Returns:

True if the connection was established successfully

-
-
-
-
-bluetoothAccept(uuid, timeout)
-

Listens for and accepts a Bluetooth connection. Blocks until the connection is established or fails

- --- - - - -
Parameters:
    -
  • uuid (str) – The UUID passed here must match the UUID used by the server device
  • -
  • timeout (int) – How long to wait for a new connection, 0 is wait for ever (default=0)
  • -
-
-
-
-
-bluetoothMakeDiscoverable(duration)
-

Requests that the device be discoverable for Bluetooth connections

- --- - - - -
Parameters:duration (int) – period of time, in seconds, during which the device should be discoverable (default=300)
-
-
-
-bluetoothWrite(ascii, connID)
-

Sends ASCII characters over the currently open Bluetooth connection

- --- - - - -
Parameters:
    -
  • ascii (str) – text
  • -
  • connID (str) – Connection id
  • -
-
-
-
-
-bluetoothReadReady(connID)
-

Sends ASCII characters over the currently open Bluetooth connection

- --- - - - -
Parameters:
    -
  • ascii (str) – text
  • -
  • connID (str) – Connection id
  • -
-
-
-
-
-bluetoothRead(bufferSize, connID)
-

Read up to bufferSize ASCII characters

- --- - - - -
Parameters:
    -
  • bufferSize (int) – default=4096
  • -
  • connID(optional) (str) – Connection id
  • -
-
-
-
-
-bluetoothReadLine(connID)
-

Read the next line

- --- - - - -
Parameters:connID(optional) (str) – Connection id
-
-
-
-bluetoothGetRemoteDeviceName(address)
-

Queries a remote device for it’s name or null if it can’t be resolved

- --- - - - -
Parameters:address (str) – Bluetooth Address For Target Device
-
-
-
-bluetoothGetLocalName()
-

Gets the Bluetooth Visible device name

-
-
-
-bluetoothSetLocalName(name)
-

Sets the Bluetooth Visible device name, returns True on success

- --- - - - -
Parameters:name (str) – New local name
-
-
-
-bluetoothGetScanMode()
-

Gets the scan mode for the local dongle. -Return values: --1 when Bluetooth is disabled. -0 if non discoverable and non connectable. -1 connectable non discoverable. -3 connectable and discoverable.

-
-
-
-bluetoothGetConnectedDeviceName(connID)
-

Returns the name of the connected device

- --- - - - -
Parameters:connID (str) – Connection id
-
-
-
-checkBluetoothState()
-

Checks Bluetooth state

- --- - - - -
Returns:True if Bluetooth is enabled
-
-
-
-toggleBluetoothState(enabled, prompt)
-

Toggle Bluetooth on and off

- --- - - - - - -
Parameters:
    -
  • enabled (bool) –
  • -
  • prompt (str) – Prompt the user to confirm changing the Bluetooth state, default=true
  • -
-
Returns:

True if Bluetooth is enabled

-
-
-
-
-bluetoothStop(connID)
-

Stops Bluetooth connection

- --- - - - -
Parameters:connID (str) – Connection id
-
-
-
-bluetoothGetLocalAddress()
-

Returns the hardware address of the local Bluetooth adapter

-
-
-
-bluetoothDiscoveryStart()
-

Start the remote device discovery process

- --- - - - -
Returns:true on success, false on error
-
-
-
-bluetoothDiscoveryCancel()
-

Cancel the current device discovery process

- --- - - - -
Returns:true on success, false on error
-
-
-
-bluetoothIsDiscovering()
-

Return true if the local Bluetooth adapter is currently in the device discovery process

-
-
-
-

SignalStrengthFacade

-
-
-startTrackingSignalStrengths()
-

Starts tracking signal strengths

-
-
-
-readSignalStrengths()
-

Returns the current signal strengths

- --- - - - -
Returns:A map of gsm_signal_strength
-
-
-
-stopTrackingSignalStrengths()
-

Stops tracking signal strength

-
-
-
-

WebCamFacade

-
-
-webcamStart(resolutionLevel, jpegQuality, port)
-

Starts an MJPEG stream and returns a Tuple of address and port for the stream

- --- - - - -
Parameters:
    -
  • resolutionLevel (int) – increasing this number provides higher resolution (default=0)
  • -
  • jpegQuality (int) – a number from 0-10 (default=20)
  • -
  • port (int) – If port is specified, the webcam service will bind to port, otherwise it will pick any available port (default=0)
  • -
-
-
-
-
-webcamAdjustQuality(resolutionLevel, jpegQuality)
-

Adjusts the quality of the webcam stream while it is running

- --- - - - -
Parameters:
    -
  • resolutionLevel (int) – increasing this number provides higher resolution (default=0)
  • -
  • jpegQuality (int) – a number from 0-10 (default=20)
  • -
-
-
-
-
-cameraStartPreview(resolutionLevel, jpegQuality, filepath)
-

Start Preview Mode. Throws ‘preview’ events

- --- - - - - - -
Parameters:
    -
  • resolutionLevel (int) – increasing this number provides higher resolution (default=0)
  • -
  • jpegQuality (int) – a number from 0-10 (default=20)
  • -
  • filepath (str) – Path to store jpeg files
  • -
-
Returns:

True if successful

-
-
-
-
-cameraStopPreview()
-

Stop the preview mode

-
-
-
-

UiFacade

-
-

Dialog

-
-
-dialogCreateInput(title, message, defaultText, inputType)
-

Create a text input dialog

- --- - - - -
Parameters:
    -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
  • defaultText(optional) (str) – text to insert into the input box
  • -
  • inputType(optional) (str) – type of input data, ie number or text
  • -
-
-
-
-
-dialogCreatePassword(title, message)
-

Create a password input dialog

- --- - - - -
Parameters:
    -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
-
-
-
-
-dialogGetInput(title, message, defaultText)
-

Create a password input dialog

- --- - - - -
Parameters:
    -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
  • defaultText(optional) (str) – text to insert into the input box
  • -
-
-
-
-
-dialogGetPassword(title, message)
-

Queries the user for a password

- --- - - - -
Parameters:
    -
  • title (str) – title of the password box
  • -
  • message (str) – message to display above the input box
  • -
-
-
-
-
-dialogCreateSeekBar(start, maximum, title)
-

Create seek bar dialog

- --- - - - -
Parameters:
    -
  • start (int) – default=50
  • -
  • maximum (int) – default=100
  • -
  • title (int) – title
  • -
-
-
-
-
-dialogCreateTimePicker(hour, minute, is24hour)
-

Create time picker dialog

- --- - - - -
Parameters:
    -
  • hour (int) – default=0
  • -
  • miute (int) – default=0
  • -
  • is24hour (bool) – default=false
  • -
-
-
-
-
-dialogCreateDatePicker(year, month, day)
-

Create date picker dialog

- --- - - - -
Parameters:
    -
  • year (int) – default=1970
  • -
  • month (int) – default=1
  • -
  • day (int) – default=1
  • -
-
-
-
-
-

NFC

-

Data structs -QPython NFC json result

-
{
-"role": <role>, # could be self/master/slave
-"stat": <stat>, # could be ok / fail / cancl
-"message": <message get>
-}
-
-
-

APIs

-
-
-dialogCreateNFCBeamMaster(title, message, inputType)
-

Create a dialog where you could create a qpython beam master

- --- - - - -
Parameters:
    -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
  • inputType(optional) (str) – type of input data, ie number or text
  • -
-
-
-
-
-NFCBeamMessage(content, title, message)
-

Create a dialog where you could create a qpython beam master

- --- - - - -
Parameters:
    -
  • content (str) – message you want to sent
  • -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
  • inputType(optional) (str) – type of input data, ie number or text
  • -
-
-
-
-
-dialogCreateNFCBeamSlave(title, message)
-

Create a qpython beam slave

- --- - - - -
Parameters:
    -
  • title (str) – title of the input box
  • -
  • message (str) – message to display above the input box
  • -
-
-
-
-
-

Progress

-
-
-dialogCreateSpinnerProgress(message, maximumProgress)
-

Create a spinner progress dialog

- --- - - - -
Parameters:
    -
  • message(optional) (str) – message
  • -
  • maximunProgress(optional) (int) – dfault=100
  • -
-
-
-
-
-dialogSetCurrentProgress(current)
-

Set progress dialog current value

- --- - - - -
Parameters:current (int) – current
-
-
-
-dialogSetMaxProgress(max)
-

Set progress dialog maximum value

- --- - - - -
Parameters:max (int) – max
-
-
-
-dialogCreateHorizontalProgress(title, message, maximumProgress)
-

Create a horizontal progress dialog

- --- - - - -
Parameters:
    -
  • title(optional) (str) – title
  • -
  • message(optional) (str) – message
  • -
  • maximunProgress(optional) (int) – dfault=100
  • -
-
-
-
-
-

Alert

-
-
-dialogCreateAlert(title, message)
-

Create alert dialog

- --- - - - -
Parameters:
    -
  • title(optional) (str) – title
  • -
  • message(optional) (str) – message
  • -
  • maximunProgress(optional) (int) – dfault=100
  • -
-
-
-
-
-

Dialog Control

-
-
-dialogSetPositiveButtonText(text)
-

Set alert dialog positive button text

- --- - - - -
Parameters:text (str) – text
-
-
-
-dialogSetNegativeButtonText(text)
-

Set alert dialog negative button text

- --- - - - -
Parameters:text (str) – text
-
-
-
-dialogSetNeutralButtonText(text)
-

Set alert dialog button text

- --- - - - -
Parameters:text (str) – text
-
-
-
-dialogSetItems(items)
-

Set alert dialog list items

- --- - - - -
Parameters:items (list) – items
-
-
-
-dialogSetSingleChoiceItems(items, selected)
-

Set alert dialog list items

- --- - - - -
Parameters:
    -
  • items (list) – items
  • -
  • selected (int) – selected item index (default=0)
  • -
-
-
-
-
-dialogSetMultiChoiceItems(items, selected)
-

Set dialog multiple choice items and selection

- --- - - - -
Parameters:
    -
  • items (list) – items
  • -
  • selected (int) – selected item index (default=0)
  • -
-
-
-
-
-addContextMenuItem(label, event, eventData)
-

Adds a new item to context menu

- --- - - - -
Parameters:
    -
  • label (str) – label for this menu item
  • -
  • event (str) – event that will be generated on menu item click
  • -
  • eventData (object) – event object
  • -
-
-
-
-
-addOptionsMenuItem(label, event, eventData, iconName)
-

Adds a new item to context menu

- --- - - - -
Parameters: -
-
-
-
-dialogGetResponse()
-

Returns dialog response

-
-
-
-dialogGetSelectedItems()
-

This method provides list of items user selected

-
-
-
-dialogDismiss()
-

Dismiss dialog

-
-
-
-dialogShow()
-

Show dialog

-
-
-
-

Layout

-
-
-fullShow(layout)
-

Show Full Screen

- --- - - - -
Parameters:layout (string) – String containing View layout
-
-
-
-fullDismiss()
-

Dismiss Full Screen

-
-
-
-fullQuery()
-

Get Fullscreen Properties

-
-
-
-fullQueryDetail(id)
-

Get fullscreen properties for a specific widget

- --- - - - -
Parameters:id (str) – id of layout widget
-
-
-
-fullSetProperty(id)
-

Set fullscreen widget property

- --- - - - -
Parameters:
    -
  • id (str) – id of layout widget
  • -
  • property (str) – name of property to set
  • -
  • value (str) – value to set property to
  • -
-
-
-
-
-fullSetList(id, list)
-

Attach a list to a fullscreen widget

- --- - - - -
Parameters:
    -
  • id (str) – id of layout widget
  • -
  • list (list) – List to set
  • -
-
-
-
-
-fullKeyOverride(keycodes, enable)
-

Override default key actions

- --- - - - -
Parameters:
    -
  • keycodes (str) – id of layout widget
  • -
  • enable (bool) – List to set (default=true)
  • -
-
-
-
-
-

WebView

-
-
-webViewShow()
-

Display a WebView with the given URL

- --- - - - -
Parameters:
    -
  • url (str) – url
  • -
  • wait(optional) (bool) – block until the user exits the WebView
  • -
-
-
-
-
-
-

USB Host Serial Facade

-

QPython 1.3.1+ and QPython3 1.0.3+ contains this feature

-

SL4A Facade for USB Serial devices by Android USB Host API.

-

It control the USB-Serial like devices -from Andoroid which has USB Host Controller .

-

The sample -demonstration is also available at youtube video

-
-

Requirements

-
    -
  • Android device which has USB Host controller (and enabled in that firmware).

    -
  • -
  • Android 4.0 (API14) or later.

    -
  • -
  • USB Serial devices (see [Status](#Status)).

    -
  • -
  • USB Serial devices were not handled by Android kernel.

    -

    > I heard some android phone handle USB Serial devices -> make /dev/ttyUSB0 in kernel level. -> In this case, Android does not be able to handle the device -> from OS level.

    -

    please check Android Applications be able to grab the target USB Devices, -such as USB Device Info.

    -
  • -
-
-
-

Status

-
    -
  • probably work with USB CDC, like FTDI, Arduino or else.

    -
  • -
  • 2012/09/10: work with 78K0F0730 device (new RL78) with Tragi BIOS board.

    -

    M78K0F0730

    -
  • -
  • 2012/09/24: work with some pl2303 devcies.

    -
  • -
-
-
-

Author

-

This facade developped by Kuri65536 -you can see the commit log in it.

-
-
-

APIs

-
-
-usbserialGetDeviceList()
-

Returns USB devices reported by USB Host API.

- --- - - - -
Returns:Returns “Map of id and string information Map<String, String>
-
-
-
-usbserialDisconnect(connID)
-

Disconnect all USB-device

- --- - - - -
Parameters:connID (str) – connection ID
-
-
-
-usbserialActiveConnections()
-

Returns active USB-device connections.

- --- - - - -
Returns:Returns “Active USB-device connections by Map UUID vs device-name.”
-
-
-
-usbserialWriteBinary(base64, connID)
-

Send bytes over the currently open USB Serial connection.

- --- - - - -
Parameters:
    -
  • base64 (str) –
  • -
  • connId (str) –
  • -
-
-
-
-
-usbserialReadBinary(bufferSize, connID)
-

Read up to bufferSize bytes and return a chunked, base64 encoded string

- --- - - - -
Parameters:
    -
  • bufferSize (int) –
  • -
  • connId (str) –
  • -
-
-
-
-
-usbserialConnect(hash, options)
-

Connect to a device with USB-Host. request the connection and exit

- --- - - - - - -
Parameters:
    -
  • hash (str) –
  • -
  • options (str) –
  • -
-
Returns:

Returns messages the request status

-
-
-
-
-usbserialHostEnable()
-

Requests that the host be enable for USB Serial connections.

- --- - - - -
Returns:True if the USB Device is accesible
-
-
-
-usbserialWrite(String ascii, String connID)
-

Sends ASCII characters over the currently open USB Serial connection

- --- - - - -
Parameters:
    -
  • ascii (str) –
  • -
  • connID (str) –
  • -
-
-
-
-
-usbserialReadReady(connID)
-
--- - - - - - -
Parameters:connID (str) –
Returns:True if the next read is guaranteed not to block
-
-
-
-usbserialRead(connID, bufferSize)
-

Read up to bufferSize ASCII characters.

- --- - - - -
Parameters:
    -
  • connID (str) –
  • -
  • bufferSize (int) –
  • -
-
-
-
-
-usbserialGetDeviceName(connID)
-

Queries a remote device for it’s name or null if it can’t be resolved

- --- - - - -
Parameters:connID (str) –
-
-
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_contributors.html b/docs/en/guide_contributors.html deleted file mode 100644 index b885560f..00000000 --- a/docs/en/guide_contributors.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - -Welcome contribute — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

Welcome contribute

-

Thanks for supporting this project, QPython is a greate project, and we hope you join us to help with make it more greater.

-

Please send email to us(support at qpython.org) to introduce youself briefly, and which part do you want to contribute.

-

Then we will consider to invite you to join the qpython-collaborator group.

-
- -
-

How to contribute documentation

-
-
-

How to translate

-
-
-

How to launch a local QPython users community

-
-

How to organise a local qpython user sharing event

-
-
-
-

How to became the developer member

-
-

How to develop qpython built-in programs

-
-
-
-

How to sponsor QPython project

-

More detail coming soon...

-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_contributors_test.html b/docs/en/guide_contributors_test.html deleted file mode 100644 index 4bc3ab39..00000000 --- a/docs/en/guide_contributors_test.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - -Join the tester community — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-

QPython is keeping develop! -If you are interested about what we are doing and want to make some contribution, follow this guide to make this project better!

-
-

Join the tester community

-

We create a G+ community where you could report bugs or offer suggestions -> QPython tester G+ community(For QPython testers)

-

Join us now!

-../images/1.png -
-
-

Become a tester

-

After join the tester community, you could become a tester! -Click this and become a tester -> I’m ready for test

-../images/2.png -
-
-

Report or suggest

-

If you find out any bugs or have any cool idea about QPython, please let us know about it. -You could write down your suggestion or bug report on the community.

-../images/3.png -
-
-

Feedback

-

Send your feedback to QPython using the contact information: support@qptyhon.org

-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_developers.html b/docs/en/guide_developers.html deleted file mode 100644 index 4b59144f..00000000 --- a/docs/en/guide_developers.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - -Android — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

Android

-

Android part offers the common Python user interaction functions, like console, editor, file browsing, QRCode reader etc.

-
-

Console

-
-
-

Editor

-
-
-

File browsing

-
-
-

QRCode reader

-
-
-
-

QSL4A

-

QSL4A is the folk of SL4A for QPython, which allows users being able to program with Python script for android.

-
-
-

QPython Core

-

Besides Python core, QPython core offer three types programming mode also.

-
-

Python 2.x

-
-
-

Python 3.x

-
-
-

Console program

-
-
-

Kivy program

-
-
-

WebApp program

-
-
-
-

Pip and libraries

-

Pip and libraries offer great expansion ability for QPython.

-
-

Pip

-
-
-

Libraries

-
-
-
-

Quick tools

-

Quick tools offers better guide for using QPython well for different users.

-
-

QPython API

-
-
-

FTP

-
-
-
-

QPY.IO (Enterprise service)

-

It’s a enterprise service which aim at offering quick android development delivery with QPython.

-

It’s QPython’s maintainers’ main paid service, but not a opensource project.

-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_extend.html b/docs/en/guide_extend.html deleted file mode 100644 index a9d40183..00000000 --- a/docs/en/guide_extend.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - -QPython Open API — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

QPython Open API

-

QPython has an open activity which allow you run qpython from outside.

-

The MPyAPI’s definition seems like the following:

-
<activity
-android:name="org.qpython.qpylib.MPyApi"
-android:label="@string/qpy_run_with_share"
-android:screenOrientation="user"
-android:configChanges="orientation|keyboardHidden"
-android:exported="true">
-<intent-filter>
-<action android:name="org.qpython.qpylib.action.MPyApi" />
-<category android:name="android.intent.category.DEFAULT" />
-<category android:name="android.intent.category.LAUNCHER" />
-</intent-filter>
-<intent-filter>
-<action android:name="android.intent.action.VIEW" />
-<category android:name="android.intent.category.DEFAULT" />
-<category android:name="android.intent.category.BROWSABLE" />
-<data android:scheme="http" />
-<data android:scheme="https" />
-</intent-filter>
-<intent-filter>
-<action android:name="android.intent.action.SEND"/>
-<category android:name="android.intent.category.DEFAULT"/>
-<data android:mimeType="text/plain"/>
-</intent-filter>
-<intent-filter>
-<action android:name="android.intent.action.SEND"/>
-<category android:name="android.intent.category.DEFAULT"/>
-<data android:mimeType="image/*"/>
-</intent-filter>
-</activity>
-
-
-

So, with it’s help, you could:

-
-

Share some content to QPython’s scripts

-

You could choose some content in some app, and share to qpython’s script, then you could handle the content with the sys.argv[2]

-

Watch the demo video on YouTube

-
-
-

Run QPython’s script from your own application

-

You can call QPython to run some script or python code in your application by call this activity, like the following sample:

-
// code sample shows how to call qpython API
-String extPlgPlusName = "org.qpython.qpy";          // QPython package name
-Intent intent = new Intent();
-intent.setClassName(extPlgPlusName, "org.qpython.qpylib.MPyApi");
-intent.setAction(extPlgPlusName + ".action.MPyApi");
-Bundle mBundle = new Bundle();
-mBundle.putString("app", "myappid");
-mBundle.putString("act", "onPyApi");
-mBundle.putString("flag", "onQPyExec"); // any String flag you may use in your context
-mBundle.putString("param", "");         // param String param you may use in your context
-/*
-* The Python code we will run
-*/
-String code = "import androidhelper\n" +
-"droid = androidhelper.Android()\n" +
-"line = droid.dialogGetInput()\n" +
-"s = 'Hello %s' % line.result\n" +
-"droid.makeToast(s)\n"
-mBundle.putString("pycode", code);
-intent.putExtras(mBundle);
-startActivityForResult(intent, SCRIPT_EXEC_PY);
-...
-// And you can handle the qpython callabck result in onActivityResult
-@Override
-protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-if (requestCode == SCRIPT_EXEC_PY) {
-if (data!=null) {
-Bundle bundle = data.getExtras();
-String flag = bundle.getString("flag");
-String param = bundle.getString("param");
-String result = bundle.getString("result"); // Result your Pycode generate
-Toast.makeText(this, "onQPyExec: return ("+result+")", Toast.LENGTH_SHORT).show();
-} else {
-Toast.makeText(this, "onQPyExec: data is null", Toast.LENGTH_SHORT).show();
-}
-}
-}
-
-
-

Checkout the full project from github

-

And there is a production application - QPython Plugin for Tasker

-
-
-
-

QPython Online Service

-

Now the QPython online service only open for QPython, not QPython3.

-
-

QPypi

-

Can I install some packages which required pre-compiled ? -Sure, you could install some pre-compiled packages from QPypi, you could find it through “Libraries” on dashboard.

-../images/guide_extend_pic2.png -

If you couldn’t found the package here, you could send email to river@qpython.org .

-
-
-

QPY.IO

-

Can I build an independent APK from QPython script?

-

Sure you can. now the service is in BETA, it’s a challenging thing. We will publish it as a online service, for we want to let the development process is simple, you don’t need to own the development environment set up when you want to build a application.

-../images/guide_extend_pic1.png -

If you want to try it out or have some business proposal, please contact with us by sending email to river@qpython.org .

-
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_helloworld.html b/docs/en/guide_helloworld.html deleted file mode 100644 index 7d34fcf4..00000000 --- a/docs/en/guide_helloworld.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - -Writing “Hello World” — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

Writing “Hello World”

-
-

Hello world

-hello world -

Well, after you became a bit more familiar with QPython, let’s create our first program in QPython. Obviously, it will be helloworld.py. ;)

-

Start QPython, open editor and enter the following code:

-
import androidhelper
-droid = androidhelper.Android()
-droid.makeToast('Hello, Username!')
-
-
-

No wonder, it’s just similar to any other hello-world program. When executed, it just shows pop-up message on the screen (see screenshot on the top). Anyway, it’s a good example of QPython program.

-
-
-

SL4A library

-

It begins with import androidhelper — the most useful module in QPython, which encapsulates almost all interface with Android, available in Python. Any script developed in QPython starts with this statement (at least if it claims to communicate with user). Read more about Python library here and import statement here

-

By the way, if you’re going to make your script compatible with SL4A, you should replace the first line with the following code (and use android instead androidhelper further in the program):

-
try:
-import androidhelper as android
-except ImportError:
-import android
-
-
-

Ok, next we’re creating an object droid (actually a class), it is necessary to call RPC functions in order to communicate with Android.

-

And the last line of our code calls such function, droid.makeToast(), which shows a small pop-up message (a “toast”) on the screen.

-

Well, let’s add some more functionality. Let it ask the user name and greet them.

-
-
-

More samples

-

We can display a simple dialog box with the title, prompt, edit field and buttons Ok and Cancel using dialogGetInput call. Replace the last line of your code and save it as hello1.py:

-
import androidhelper
-droid = androidhelper.Android()
-respond = droid.dialogGetInput("Hello", "What is your name?")
-
-
-

Well, I think it should return any respond, any user reaction. That’s why I wrote respond = .... But what the call actually returns? Let’s check. Just add print statement after the last line:

-
import androidhelper
-droid = androidhelper.Android()
-respond = droid.dialogGetInput("Hello", "What is your name?")
-print respond
-
-
-

Then save and run it...

-

Oops! Nothing printed? Don’t worry. Just pull notification bar and you will see “QPython Program Output: hello1.py” — tap it!

-

As you can see, droid.dialogGetInput() returns a JSON object with three fields. We need only one — result which contains an actual input from user.

-

Let’s add script’s reaction:

-
import androidhelper
-droid = androidhelper.Android()
-respond = droid.dialogGetInput("Hello", "What is your name?")
-print respond
-message = 'Hello, %s!' % respond.result
-droid.makeToast(message)
-
-
-

Last two lines (1) format the message and (2) show the message to the user in the toast. See Python docs if you still don’t know what % means.

-

Wow! It works! ;)

-

Now I’m going to add a bit of logic there. Think: what happen if the user clicks Cancel button, or clicks Ok leaving the input field blank?

-

You can play with the program checking what contains respond variable in every case.

-

First of all, I want to put text entered by user to a separate variable: name = respond.result. Then I’m going to check it, and if it contains any real text, it will be considered as a name and will be used in greeting. Otherwise another message will be shown. Replace fifth line message = ‘Hello, %s!’ % respond.result with the following code:

-
name = respond.result
-if name:
-message = 'Hello, %s!' % name
-else:
-message = "Hey! And you're not very polite, %Username%!"
-
-
-

Use < and > buttons on the toolbar to indent/unindent lines in if-statement (or just use space/backspace keys). You can read more about indentation in Python here; if-statement described here.

-

First of all, we put user input to the variable name. Then we check does name contain anything? In case the user left the line blank and clicked Ok, the return value is empty string ‘’. In case of Cancel button pressed, the return value is None. Both are treated as false in if-statement. So, only if name contans anything meaninful, then-statement is executed and greeting “Hello, ...!” shown. In case of empty input the user will see “Hey! And you’re not very polite, %Username%!” message.

-

Ok, here is the whole program:

-
import androidhelper
-droid = androidhelper.Android()
-respond = droid.dialogGetInput("Hello", "What is your name?")
-print respond
-name = respond.result
-if name:
-message = 'Hello, %s!' % name
-else:
-message = "Hey! And you're not very polite, %Username%!"
-droid.makeToast(message)
-
-
-

Thanks dmych offer the first draft in his blog

-
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_howtostart.html b/docs/en/guide_howtostart.html deleted file mode 100644 index e1b9d06f..00000000 --- a/docs/en/guide_howtostart.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - -QPython: How To Start — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

QPython: How To Start

-

Now, I will introduce the QPython’s features through it’s interfaces.

-
-

1. Dashboard

-QPython start -

After you installed QPython, start it in the usual way by tapping its icon in the menu. Screenshot on the top of this post shows what you should see when QPython just started.

-

Start button

-

By tapping the big button with Python logo in the center of the screen you can

-

Launch your local script or project

-

Get script from QR code (funny brand new way to share and distribute your code, you can create QRCode through QPython’s QRCode generator

-

Now you can install many 3rd libaries ( pure python libraries mainly ) through pip_console.py script.

-

If you want QPython to run some script of project when you click the start button, you can make it by setting default program in setting activity.

-

Developer kit dashboard

-

If you swipe to the left instead of tapping, you will see another (second) main screen of QPython (Pic. 2). As for me, it is much more useful and comfortable for developer.

-QPython develop dashboard -

Tools available here:

-
    -
  • Console — yes, it’s regular Python console, feel free to comunicate with interpreter directly
  • -
  • Editor — QPython has a nice text editor integrated with the rest, you can write code and run it without leaving the application
  • -
  • My QPython — here you can find your scripts and projects
  • -
  • System — maintain libraries and components: install and uninstall them
  • -
  • Package Index opens the page QPyPI in browser allowing to install packages listed there
  • -
  • Community leads to QPython.org page. Feel free to join or ask&answer questions in the QPython community.
  • -
-

By long clicking on the console or editor, you have chance to create the shortcut on desktop which allow you enter console or editor directly.

-

Next, let’s see the console and the editor.

-
-
-

2. Console and editor

-QPython console -

As I said before, there is an ordinary Python console. Many people usually use it to explore objects’ properties, consult about syntax and test their ideas. You can type your commands directly and Python interpreter will execute them. You can open additional consoles by tapping the plus button (1) and usedrop-down list on the upper left corner to switch between consoles (2). To close the console just tap the close button (3).

-QPython notification -

Please note, there will be notification in the notification bar unless you explicitly close the console and you always can reach the open console by tapping the notification.

-QPython editor -

The editor allows you obviously (hello Cap!) enter and modify text. Here you can develop your scripts, save them and execute. The editor supports Python syntax highlighting and shows line numbers (there is no ability to go to the line by number though). (above picture)

-

When typing, you can easily control indentation level (which is critical for Python code) using two buttons on the toolbar (1). Next buttons on the toolbar are Save and Save As (2), then goes Run (3), Undo, Search, Recent Files and Settings buttons. Also there are two buttons on the top: Open and New (5).

-

When saving, don’t forget to add .py estension to the file name since the editor don’t do it for you.

-
-
-

3. Programs

-

You can find the scripts or projects in My QPython. My QPython contains the scripts and Projects.

-

By long clicking on script or project, you have chance to create the shortcut for the script or project. Once you have created the shortcuts on desktop, you can directly run the script or project from desktop.

-

Scripts -Scripts : A single script. The scripts are in the /sdcard/com.hipipal.qpyplus/scripts directory. -If you want your script could be found in My QPython, please upload it to this directory.

-

When you click the script, you can choose the following actions:

-
    -
  • Run : Run the script
  • -
  • Open : Edit the script with built-in editor
  • -
  • Rename : Rename the script
  • -
  • Delete : Delete the script
  • -
-

Projects -Projects : A directory which should contain the main.py as the project’s default launch script, and you can put other dependency 3rd libraries or resources in the same directory, if you want your project could be found in My QPython, please upload them into this directory.

-

When you click on the project, you can choose the following actions:

-
    -
  • Run : run the project
  • -
  • Open : use it to explore project’s resources
  • -
  • Rename : Rename the project
  • -
  • Delete : Delete the project
  • -
-
-
-

4. Libraries

-

By installing 3rd libraries, you can extend your qpython’s programming ability quickly. There are some ways to install libraries.

-

QPypi

-

You can install some pre-built libraries from QPypi, like numpy etc.

-

Pip console

-

You can install most pure python libraries through pip console.

-

Besides the two ways above, you could copy libraries into the /sdcard/qpython/lib/python2.7/site-packages in your device.

-

Notice: -Some libraries mixed with c/c++ files could not be install through pip console for the android lacks the compiler environment, you could ask help from qpython developer team.

-
-
-

5. Community

-

It will redirect to the QPython.org, including somthe source of this documentation, and there are some qpython user communities’ link, many questions of qpython usage or programming could be asked in the community.

-

Thanks dmych offer the first draft in his blog

-
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_ide.html b/docs/en/guide_ide.html deleted file mode 100644 index 5f54ddb8..00000000 --- a/docs/en/guide_ide.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - -Use the best way for developing — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

Use the best way for developing

-
-

Develop from QEditor

-

QEditor is the QPython’s built-in editor, which supports Python / HTML syntax highlight.

-

QEditor’s main features

-
    -
  • Edit / View plain text file, like Python, Lua, HTML, Javascript and so on
  • -
  • Edit and run Python script & Python syntax highlight
  • -
  • Edit and run Shell script
  • -
  • Preview HTML with built-in HTML browser
  • -
  • Search by keyword, code snippets, code share
  • -
-

You could run the QPython script directly when you develop from QEditor, so when you are moving it’s the most convient way for QPython develop.

-
-
-

Develop from browser

-

QPython has a built-in script which is qedit4web.py, you could see it when you click the start button and choose “Run local script”. -After run it, you could see the result.

-QPython qedit4web -

Then, you could access the url from your PC/Laptop’s browser for developing, just like the below pics.

-QPython qedit4web choose project or file -

After choose some project or script, you could start to develop

-QPython qedit4web -

With it’s help, you could write from browser and run from your android phone. It is very convenient.

-
-
-

Develop from your computer

-

Besides the above ways, you could develop the script with your way, then upload to your phone and run with QPython also.

-
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_libraries.html b/docs/en/guide_libraries.html deleted file mode 100644 index 784344c9..00000000 --- a/docs/en/guide_libraries.html +++ /dev/null @@ -1,567 +0,0 @@ - - - - - -QPython built-in Libraries — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

QPython built-in Libraries

-

QPython is using the Python 2.7.2 and it support most Python stardard libraries. And you could see their documentation through Python documentation.

-
-

QPython dynload libraries

-

Just like Python, QPython contains python built-in .so libraries.

-

Usually, you don’t need to import them manually, they were used in stardard libraries, and could be imported automatically.

-
    -
  • _codecs_cn.so
  • -
  • _codecs_hk.so
  • -
  • _codecs_iso2022.so
  • -
  • _codecs_jp.so
  • -
  • _codecs_kr.so
  • -
  • _codecs_tw.so
  • -
  • _csv.so
  • -
  • _ctypes.so
  • -
  • _ctypes_test.so
  • -
  • _hashlib.so
  • -
  • _heapq.so
  • -
  • _hotshot.so
  • -
  • _io.so
  • -
  • _json.so
  • -
  • _lsprof.so
  • -
  • _multibytecodec.so
  • -
  • _sqlite3.so
  • -
  • _ssl.so
  • -
  • _testcapi.so
  • -
  • audioop.so
  • -
  • future_builtins.so
  • -
  • grp.so
  • -
  • mmap.so
  • -
  • resource.so
  • -
  • syslog.so
  • -
  • termios.so
  • -
  • unicodedata.so
  • -
-
-
-

QPython stardard libraries

-

The following libraries are the stardard QPython libraries which are the same as Python:

-
    -
  • BaseHTTPServer.py
  • -
  • binhex.py
  • -
  • fnmatch.py
  • -
  • mhlib.py
  • -
  • quopri.py
  • -
  • sysconfig.py
  • -
  • Bastion.py
  • -
  • bisect.py
  • -
  • formatter.py
  • -
  • mimetools.py
  • -
  • random.py
  • -
  • tabnanny.py
  • -
  • CGIHTTPServer.py
  • -
  • bsddb
  • -
  • fpformat.py
  • -
  • mimetypes.py
  • -
  • re.py
  • -
  • tarfile.py
  • -
  • ConfigParser.py
  • -
  • cProfile.py
  • -
  • fractions.py
  • -
  • mimify.py
  • -
  • repr.py
  • -
  • telnetlib.py
  • -
  • Cookie.py
  • -
  • calendar.py
  • -
  • ftplib.py
  • -
  • modulefinder.py
  • -
  • rexec.py
  • -
  • tempfile.py
  • -
  • DocXMLRPCServer.py
  • -
  • cgi.py
  • -
  • functools.py
  • -
  • multifile.py
  • -
  • rfc822.py
  • -
  • textwrap.py
  • -
  • HTMLParser.py
  • -
  • cgitb.py
  • -
  • genericpath.py
  • -
  • mutex.py
  • -
  • rlcompleter.py
  • -
  • this.py
  • -
  • chunk.py
  • -
  • getopt.py
  • -
  • netrc.py
  • -
  • robotparser.py
  • -
  • threading.py
  • -
  • MimeWriter.py
  • -
  • cmd.py
  • -
  • getpass.py
  • -
  • new.py
  • -
  • runpy.py
  • -
  • timeit.py
  • -
  • Queue.py
  • -
  • code.py
  • -
  • gettext.py
  • -
  • nntplib.py
  • -
  • sched.py
  • -
  • toaiff.py
  • -
  • SimpleHTTPServer.py
  • -
  • codecs.py
  • -
  • glob.py
  • -
  • ntpath.py
  • -
  • sets.py
  • -
  • token.py
  • -
  • SimpleXMLRPCServer.py
  • -
  • codeop.py
  • -
  • gzip.py
  • -
  • nturl2path.py
  • -
  • sgmllib.py
  • -
  • tokenize.py
  • -
  • SocketServer.py
  • -
  • collections.py
  • -
  • hashlib.py
  • -
  • numbers.py
  • -
  • sha.py
  • -
  • trace.py
  • -
  • StringIO.py
  • -
  • colorsys.py
  • -
  • heapq.py
  • -
  • opcode.py
  • -
  • shelve.py
  • -
  • traceback.py
  • -
  • UserDict.py
  • -
  • commands.py
  • -
  • hmac.py
  • -
  • optparse.py
  • -
  • shlex.py
  • -
  • tty.py
  • -
  • UserList.py
  • -
  • compileall.py
  • -
  • hotshot
  • -
  • os.py
  • -
  • shutil.py
  • -
  • types.py
  • -
  • UserString.py
  • -
  • compiler
  • -
  • htmlentitydefs.py
  • -
  • os2emxpath.py
  • -
  • site.py
  • -
  • unittest
  • -
  • _LWPCookieJar.py
  • -
  • config
  • -
  • htmllib.py
  • -
  • smtpd.py
  • -
  • urllib.py
  • -
  • _MozillaCookieJar.py
  • -
  • contextlib.py
  • -
  • httplib.py
  • -
  • pdb.py
  • -
  • smtplib.py
  • -
  • urllib2.py
  • -
  • __future__.py
  • -
  • cookielib.py
  • -
  • ihooks.py
  • -
  • pickle.py
  • -
  • sndhdr.py
  • -
  • urlparse.py
  • -
  • __phello__.foo.py
  • -
  • copy.py
  • -
  • imaplib.py
  • -
  • pickletools.py
  • -
  • socket.py
  • -
  • user.py
  • -
  • _abcoll.py
  • -
  • copy_reg.py
  • -
  • imghdr.py
  • -
  • pipes.py
  • -
  • sqlite3
  • -
  • uu.py
  • -
  • _pyio.py
  • -
  • csv.py
  • -
  • importlib
  • -
  • pkgutil.py
  • -
  • sre.py
  • -
  • uuid.py
  • -
  • _strptime.py
  • -
  • ctypes
  • -
  • imputil.py
  • -
  • plat-linux4
  • -
  • sre_compile.py
  • -
  • warnings.py
  • -
  • _threading_local.py
  • -
  • dbhash.py
  • -
  • inspect.py
  • -
  • platform.py
  • -
  • sre_constants.py
  • -
  • wave.py
  • -
  • _weakrefset.py
  • -
  • decimal.py
  • -
  • io.py
  • -
  • plistlib.py
  • -
  • sre_parse.py
  • -
  • weakref.py
  • -
  • abc.py
  • -
  • difflib.py
  • -
  • json
  • -
  • popen2.py
  • -
  • ssl.py
  • -
  • webbrowser.py
  • -
  • aifc.py
  • -
  • dircache.py
  • -
  • keyword.py
  • -
  • poplib.py
  • -
  • stat.py
  • -
  • whichdb.py
  • -
  • antigravity.py
  • -
  • dis.py
  • -
  • lib-tk
  • -
  • posixfile.py
  • -
  • statvfs.py
  • -
  • wsgiref
  • -
  • anydbm.py
  • -
  • distutils
  • -
  • linecache.py
  • -
  • posixpath.py
  • -
  • string.py
  • -
  • argparse.py
  • -
  • doctest.py
  • -
  • locale.py
  • -
  • pprint.py
  • -
  • stringold.py
  • -
  • xdrlib.py
  • -
  • ast.py
  • -
  • dumbdbm.py
  • -
  • logging
  • -
  • profile.py
  • -
  • stringprep.py
  • -
  • xml
  • -
  • asynchat.py
  • -
  • dummy_thread.py
  • -
  • macpath.py
  • -
  • pstats.py
  • -
  • struct.py
  • -
  • xmllib.py
  • -
  • asyncore.py
  • -
  • dummy_threading.py
  • -
  • macurl2path.py
  • -
  • pty.py
  • -
  • subprocess.py
  • -
  • xmlrpclib.py
  • -
  • atexit.py
  • -
  • email
  • -
  • mailbox.py
  • -
  • py_compile.py
  • -
  • sunau.py
  • -
  • zipfile.py
  • -
  • audiodev.py
  • -
  • encodings
  • -
  • mailcap.py
  • -
  • pyclbr.py
  • -
  • sunaudio.py
  • -
  • base64.py
  • -
  • filecmp.py
  • -
  • markupbase.py
  • -
  • pydoc.py
  • -
  • symbol.py
  • -
  • bdb.py
  • -
  • fileinput.py
  • -
  • md5.py
  • -
  • pydoc_data
  • -
  • symtable.py
  • -
-
-
-
-

Python 3rd Libraries

- -
- -
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/en/guide_program.html b/docs/en/guide_program.html deleted file mode 100644 index 7d921f9d..00000000 --- a/docs/en/guide_program.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - -QPython’s main features — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-
-

QPython’s main features

-

With QPython, you could build android applications with android application and script language now.

-
-

Why should I choose QPython

-

The smartphone is becomming people’s essential information & technical assitant, so an flexiable script engine could help people complete most jobs efficiently without complex development.

-

QPython offer an amazing developing experience, with it’s help, you could implement the program easily without complex installing IDE, compiling, package progress etc.

-
-
-

QPython’s main features

-

You can do most jobs through QPython just like the way that Python does on PC/Laptop.

-

Libraries

-
    -
  • QPython supports most stardard Python libraries.
  • -
  • QPython supports many 3rd Python libraries which implemented with pure Python code.
  • -
  • QPython supports some Python libraries mixed with C/C++ code which pre-compiled by QPython develop team.
  • -
  • QPython allows you put on the libraries by yourself.
  • -
-

Besides these, QPython offers some extra features which Python doesn’t offer, Like:

-
    -
  • Android APIs Access(Like SMS, GPS, NFC, BLUETOOTH etc)
  • -
-

Why QPython require so many permissions?

-

QPython need these permissions to access Android’s API.

-

Runtime modes

-

QPython supports several runtime modes for android.

-

Console mode

-

It’s the default runtime mode in QPython, it’s very common in PC/laptop.

-

Kivy mode

-

QPython supports Kivy as the GUI programming solution.

-

Kivy is an open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps.

-

Your device should support opengl2.0 for supporting kivy mode.

-

By insert into the following header in your script, you can let your script run with kivy mode.

-
#qpy:kivy
-
-
-

An kivy program in QPython sample

-
#qpy:kivy
-from kivy.app import App
-from kivy.uix.button import Button
-class TestApp(App):
-def build(self):
-return Button(text='Hello World')
-TestApp().run()
-
-
-

If your library require the opengl driver, you shoule declare the kivy mode header in your script, like the jnius.

-

NOTE: QPython3 didn’t support kivy mode yet, we have plan to support it in the future

-

WebApp mode

-

We recommend you implement WebApp with QPython for it offer the easy to accomplish UI and Take advantage of Python’s fast programming strong point.

-

WebApp will start a webview in front, and run a python web service background. -You could use bottle*(QPython built-in library) to implement the web service, or you could install *django / flask framework also.

-

By insert into the following header in your script, you can let your script run with webapp mode.

-
#qpy:webapp:<app title>
-#qpy:<fullscreen or remove this line>
-#qpy://<ip:port:path>
-
-
-

For example

-
#qpy:webapp:Hello QPython
-#qpy://localhost:8080/hello
-
-
-

The previous should start a webview which should load the http://localhost:8080/hello as the default page, and the webview will keep the titlebar which title is “Hello QPython”, if you add the #qpy:fullscreen it will hide the titlebar.

-
#qpy:webapp:Hello Qpython
-#qpy://127.0.0.1:8080/
-"""
-This is a sample for qpython webapp
-"""
-from bottle import Bottle, ServerAdapter
-from bottle import run, debug, route, error, static_file, template
-######### QPYTHON WEB SERVER ###############
-class MyWSGIRefServer(ServerAdapter):
-server = None
-def run(self, handler):
-from wsgiref.simple_server import make_server, WSGIRequestHandler
-if self.quiet:
-class QuietHandler(WSGIRequestHandler):
-def log_request(*args, **kw): pass
-self.options['handler_class'] = QuietHandler
-self.server = make_server(self.host, self.port, handler, **self.options)
-self.server.serve_forever()
-def stop(self):
-#sys.stderr.close()
-import threading
-threading.Thread(target=self.server.shutdown).start()
-#self.server.shutdown()
-self.server.server_close() #<--- alternative but causes bad fd exception
-print "# qpyhttpd stop"
-######### BUILT-IN ROUTERS ###############
-@route('/__exit', method=['GET','HEAD'])
-def __exit():
-global server
-server.stop()
-@route('/assets/<filepath:path>')
-def serverstatic(filepath):
-return static_file(filepath, root='/sdcard')
-######### WEBAPP ROUTERS ###############
-@route('/')
-def home():
-return template('<h1>Hello {{name}} !</h1>'+ \
-'<a href="/assets/qpython/projects/WebApp Sample/main.py">View source</a>',name='QPython')
-######### WEBAPP ROUTERS ###############
-app = Bottle()
-app.route('/', method='GET')(home)
-app.route('/__exit', method=['GET','HEAD'])(__exit)
-app.route('/assets/<filepath:path>', method='GET')(serverstatic)
-try:
-server = MyWSGIRefServer(host="127.0.0.1", port="8080")
-app.run(server=server,reloader=False)
-except Exception,ex:
-print "Exception: %s" % repr(ex)
-
-
-

If you want the webapp could be close when you exit the webview, you have to define the @route(‘/__exit’, method=[‘GET’,’HEAD’]) method , for the qpython will request the http://localhost:8080/__exit when you exit the webview. So you can release other resource in this function.

-QPython WebApp Sample -

Running screenshot

-

In the other part of the code, you could implement a webserver whish serve on localhost:8080 and make the URL /hello implement as your webapp’s homepage.

-

Q mode

-

If you don’t want the QPython display some UI, pelase try to use the QScript mode, it could run a script background, just insert the following header into your script:

-
#qpy:qpyapp
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/favicon.ico b/docs/favicon.ico deleted file mode 100644 index 5650a967..00000000 Binary files a/docs/favicon.ico and /dev/null differ diff --git a/docs/genindex.html b/docs/genindex.html deleted file mode 100644 index 82f09869..00000000 --- a/docs/genindex.html +++ /dev/null @@ -1,821 +0,0 @@ - - - - - -Index — QPython 0.9 documentation - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-

Index

-
-A -| B -| C -| D -| E -| F -| G -| L -| M -| N -| P -| Q -| R -| S -| T -| U -| V -| W -
-

A

- - - -
-
addContextMenuItem() (built-in function) -
-
-
addOptionsMenuItem() (built-in function) -
-
-

B

- - - -
-
batteryCheckPresent() (built-in function) -
-
batteryGetHealth() (built-in function) -
-
batteryGetLevel() (built-in function) -
-
batteryGetPlugType() (built-in function) -
-
batteryGetStatus() (built-in function) -
-
batteryGetTechnology() (built-in function) -
-
batteryGetTemperature() (built-in function) -
-
batteryGetVoltage() (built-in function) -
-
batteryStartMonitoring() (built-in function) -
-
batteryStopMonitoring() (built-in function) -
-
bluetoothAccept() (built-in function) -
-
bluetoothActiveConnections() (built-in function) -
-
bluetoothConnect() (built-in function) -
-
bluetoothDiscoveryCancel() (built-in function) -
-
bluetoothDiscoveryStart() (built-in function) -
-
-
bluetoothGetConnectedDeviceName() (built-in function) -
-
bluetoothGetLocalAddress() (built-in function) -
-
bluetoothGetLocalName() (built-in function) -
-
bluetoothGetRemoteDeviceName() (built-in function) -
-
bluetoothGetScanMode() (built-in function) -
-
bluetoothIsDiscovering() (built-in function) -
-
bluetoothMakeDiscoverable() (built-in function) -
-
bluetoothRead() (built-in function) -
-
bluetoothReadBinary() (built-in function) -
-
bluetoothReadLine() (built-in function) -
-
bluetoothReadReady() (built-in function) -
-
bluetoothSetLocalName() (built-in function) -
-
bluetoothStop() (built-in function) -
-
bluetoothWrite() (built-in function) -
-
bluetoothWriteBinary() (built-in function) -
-
-

C

- - - -
-
cameraCapturePicture() (built-in function) -
-
cameraInteractiveCapturePicture() (built-in function) -
-
cameraStartPreview() (built-in function) -
-
cameraStopPreview() (built-in function) -
-
checkAirplaneMode() (built-in function) -
-
checkBluetoothState() (built-in function) -
-
checkNetworkRoaming() (built-in function) -
-
checkRingerSilentMode() (built-in function) -
-
-
checkScreenOn() (built-in function) -
-
checkWifiState() (built-in function) -
-
contactsGet() (built-in function) -
-
contactsGetAttributes() (built-in function) -
-
contactsGetById() (built-in function) -
-
contactsGetCount() (built-in function) -
-
contactsGetIds() (built-in function) -
-
-

D

- - - -
-
dialogCreateAlert() (built-in function) -
-
dialogCreateDatePicker() (built-in function) -
-
dialogCreateHorizontalProgress() (built-in function) -
-
dialogCreateInput() (built-in function) -
-
dialogCreateNFCBeamMaster() (built-in function) -
-
dialogCreateNFCBeamSlave() (built-in function) -
-
dialogCreatePassword() (built-in function) -
-
dialogCreateSeekBar() (built-in function) -
-
dialogCreateSpinnerProgress() (built-in function) -
-
dialogCreateTimePicker() (built-in function) -
-
dialogDismiss() (built-in function) -
-
dialogGetInput() (built-in function) -
-
-
dialogGetPassword() (built-in function) -
-
dialogGetResponse() (built-in function) -
-
dialogGetSelectedItems() (built-in function) -
-
dialogSetCurrentProgress() (built-in function) -
-
dialogSetItems() (built-in function) -
-
dialogSetMaxProgress() (built-in function) -
-
dialogSetMultiChoiceItems() (built-in function) -
-
dialogSetNegativeButtonText() (built-in function) -
-
dialogSetNeutralButtonText() (built-in function) -
-
dialogSetPositiveButtonText() (built-in function) -
-
dialogSetSingleChoiceItems() (built-in function) -
-
dialogShow() (built-in function) -
-
-

E

- - - -
-
environment() (built-in function) -
-
eventClearBuffer() (built-in function) -
-
eventGetBrodcastCategories() (built-in function) -
-
eventPoll() (built-in function) -
-
eventPost() (built-in function) -
-
-
eventRegisterForBroadcast() (built-in function) -
-
eventUnregisterForBroadcast() (built-in function) -
-
eventWait() (built-in function) -
-
eventWaitFor() (built-in function) -
-
executeQPy() (built-in function) -
-
-

F

- - - -
-
forceStopPackage() (built-in function) -
-
fullDismiss() (built-in function) -
-
fullKeyOverride() (built-in function) -
-
fullQuery() (built-in function) -
-
-
fullQueryDetail() (built-in function) -
-
fullSetList() (built-in function) -
-
fullSetProperty() (built-in function) -
-
fullShow() (built-in function) -
-
-

G

- - - -
-
generateDtmfTones() (built-in function) -
-
geocode() (built-in function) -
-
getCellLocation() (built-in function) -
-
getClipboard() (built-in function) -
-
getConstants() (built-in function) -
-
getDeviceId() (built-in function) -
-
getDeviceSoftwareVersion() (built-in function) -
-
getInput() (built-in function) -
-
getIntent() (built-in function) -
-
getLastKnownLocation() (built-in function) -
-
getLaunchableApplications() (built-in function) -
-
getLine1Number() (built-in function) -
-
getMaxMediaVolume() (built-in function) -
-
getMaxRingerVolume() (built-in function) -
-
getMediaVolume() (built-in function) -
-
getNeighboringCellInfo() (built-in function) -
-
getNetworkOperator() (built-in function) -
-
getNetworkOperatorName() (built-in function) -
-
getNetworkStatus() (built-in function) -
-
-
getNetworkType() (built-in function) -
-
getPackageVersion() (built-in function) -
-
getPackageVersionCode() (built-in function) -
-
getPassword() (built-in function) -
-
getPhoneType() (built-in function) -
-
getRingerVolume() (built-in function) -
-
getRunningPackages() (built-in function) -
-
getScreenBrightness() (built-in function) -
-
getScreenTimeout() (built-in function) -
-
getSimCountryIso() (built-in function) -
-
getSimOperator() (built-in function) -
-
getSimOperatorName() (built-in function) -
-
getSimSerialNumber() (built-in function) -
-
getSimState() (built-in function) -
-
getSubscriberId() (built-in function) -
-
getVibrateMode() (built-in function) -
-
getVoiceMailAlphaTag() (built-in function) -
-
getVoiceMailNumber() (built-in function) -
-
-

L

- - - -
-
launch() (built-in function) -
-
locationProviderEnabled() (built-in function) -
-
-
locationProviders() (built-in function) -
-
log() (built-in function) -
-
-

M

- - - -
-
makeIntent() (built-in function) -
-
makeToast() (built-in function) -
-
mediaIsPlaying() (built-in function) -
-
mediaPlay() (built-in function) -
-
mediaPlayClose() (built-in function) -
-
mediaPlayInfo() (built-in function) -
-
-
mediaPlayList() (built-in function) -
-
mediaPlayPause() (built-in function) -
-
mediaPlaySeek() (built-in function) -
-
mediaPlaySetLooping() (built-in function) -
-
mediaPlayStart() (built-in function) -
-
-

N

- - - -
-
NFCBeamMessage() (built-in function) -
-
-
notify() (built-in function) -
-
-

P

- - - -
-
phoneCall() (built-in function) -
-
phoneCallNumber() (built-in function) -
-
phoneDial() (built-in function) -
-
phoneDialNumber() (built-in function) -
-
pick() (built-in function) -
-
-
pickContact() (built-in function) -
-
pickPhone() (built-in function) -
-
prefGetAll() (built-in function) -
-
prefGetValue() (built-in function) -
-
prefPutValue() (built-in function) -
-
-

Q

- - - -
-
queryAttributes() (built-in function) -
-
-
queryContent() (built-in function) -
-
-

R

- - - -
-
readBatteryData() (built-in function) -
-
readLocation() (built-in function) -
-
readPhoneState() (built-in function) -
-
readSensors() (built-in function) -
-
readSignalStrengths() (built-in function) -
-
receiveEvent() (built-in function) -
-
recognizeSpeech() (built-in function) -
-
-
recorderCaptureVideo() (built-in function) -
-
recorderStartMicrophone() (built-in function) -
-
recorderStartVideo() (built-in function) -
-
recorderStop() (built-in function) -
-
requiredVersion() (built-in function) -
-
rpcPostEvent() (built-in function) -
-
-

S

- - - -
-
scanBarcode() (built-in function) -
-
search() (built-in function) -
-
sendBroadcast() (built-in function) -
-
sendBroadcastIntent() (built-in function) -
-
sendEmail() (built-in function) -
-
sensorsGetAccuracy() (built-in function) -
-
sensorsGetLight() (built-in function) -
-
sensorsReadAccelerometer() (built-in function) -
-
sensorsReadMagnetometer() (built-in function) -
-
sensorsReadOrientation() (built-in function) -
-
setClipboard() (built-in function) -
-
setMediaVolume() (built-in function) -
-
setResultBoolean() (built-in function) -
-
setResultBooleanArray() (built-in function) -
-
setResultByte() (built-in function) -
-
setResultByteArray() (built-in function) -
-
setResultChar() (built-in function) -
-
setResultCharArray() (built-in function) -
-
setResultDouble() (built-in function) -
-
setResultDoubleArray() (built-in function) -
-
setResultFloat() (built-in function) -
-
setResultFloatArray() (built-in function) -
-
setResultInteger() (built-in function) -
-
setResultIntegerArray() (built-in function) -
-
setResultLong() (built-in function) -
-
setResultLongArray() (built-in function) -
-
setResultSerializable() (built-in function) -
-
setResultShort() (built-in function) -
-
setResultShortArray() (built-in function) -
-
setResultString() (built-in function) -
-
-
setResultStringArray() (built-in function) -
-
setRingerVolume() (built-in function) -
-
setScreenBrightness() (built-in function) -
-
setScreenTimeout() (built-in function) -
-
smsDeleteMessage() (built-in function) -
-
smsGetAttributes() (built-in function) -
-
smsGetMessageById() (built-in function) -
-
smsGetMessageCount() (built-in function) -
-
smsGetMessageIds() (built-in function) -
-
smsGetMessages() (built-in function) -
-
smsMarkMessageRead() (built-in function) -
-
smsSend() (built-in function) -
-
startActivity() (built-in function) -
-
startActivityForResult() (built-in function) -
-
startActivityForResultIntent() (built-in function) -
-
startActivityIntent() (built-in function) -
-
startEventDispatcher() (built-in function) -
-
startInteractiveVideoRecording() (built-in function) -
-
startLocating() (built-in function) -
-
startSensing() (built-in function) -
-
startSensingThreshold() (built-in function) -
-
startSensingTimed() (built-in function) -
-
startTrackingPhoneState() (built-in function) -
-
startTrackingSignalStrengths() (built-in function) -
-
stopEventDispatcher() (built-in function) -
-
stopLocating() (built-in function) -
-
stopSensing() (built-in function) -
-
stopTrackingPhoneState() (built-in function) -
-
stopTrackingSignalStrengths() (built-in function) -
-
-

T

- - - -
-
toggleAirplaneMode() (built-in function) -
-
toggleBluetoothState() (built-in function) -
-
toggleRingerSilentMode() (built-in function) -
-
toggleVibrateMode() (built-in function) -
-
-
toggleWifiState() (built-in function) -
-
ttsIsSpeaking() (built-in function) -
-
ttsSpeak() (built-in function), [1] -
-
-

U

- - - -
-
usbserialActiveConnections() (built-in function) -
-
usbserialConnect() (built-in function) -
-
usbserialDisconnect() (built-in function) -
-
usbserialGetDeviceList() (built-in function) -
-
usbserialGetDeviceName() (built-in function) -
-
usbserialHostEnable() (built-in function) -
-
-
usbserialRead() (built-in function) -
-
usbserialReadBinary() (built-in function) -
-
usbserialReadReady() (built-in function) -
-
usbserialWrite() (built-in function) -
-
usbserialWriteBinary() (built-in function) -
-
-

V

- - - -
-
vibrate() (built-in function) -
-
view() (built-in function) -
-
viewContacts() (built-in function) -
-
-
viewHtml() (built-in function) -
-
viewMap() (built-in function) -
-
-

W

- - - -
-
waitForEvent() (built-in function) -
-
wakeLockAcquireBright() (built-in function) -
-
wakeLockAcquireDim() (built-in function) -
-
wakeLockAcquireFull() (built-in function) -
-
wakeLockAcquirePartial() (built-in function) -
-
wakeLockRelease() (built-in function) -
-
webcamAdjustQuality() (built-in function) -
-
webcamStart() (built-in function) -
-
webViewShow() (built-in function) -
-
-
wifiDisconnect() (built-in function) -
-
wifiGetConnectionInfo() (built-in function) -
-
wifiGetScanResults() (built-in function) -
-
wifiLockAcquireFull() (built-in function) -
-
wifiLockAcquireScanOnly() (built-in function) -
-
wifiLockRelease() (built-in function) -
-
wifiReassociate() (built-in function) -
-
wifiReconnect() (built-in function) -
-
wifiStartScan() (built-in function) -
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/images/1.png b/docs/images/1.png deleted file mode 100644 index a539f0e8..00000000 Binary files a/docs/images/1.png and /dev/null differ diff --git a/docs/images/2.png b/docs/images/2.png deleted file mode 100644 index dd65bc6c..00000000 Binary files a/docs/images/2.png and /dev/null differ diff --git a/docs/images/3.png b/docs/images/3.png deleted file mode 100644 index cb9bbea5..00000000 Binary files a/docs/images/3.png and /dev/null differ diff --git a/docs/images/bestpython.png b/docs/images/bestpython.png deleted file mode 100644 index 59940ff3..00000000 Binary files a/docs/images/bestpython.png and /dev/null differ diff --git a/docs/images/guide_extend_pic1.png b/docs/images/guide_extend_pic1.png deleted file mode 100644 index fae7de0e..00000000 Binary files a/docs/images/guide_extend_pic1.png and /dev/null differ diff --git a/docs/images/guide_extend_pic2.png b/docs/images/guide_extend_pic2.png deleted file mode 100644 index bcff8648..00000000 Binary files a/docs/images/guide_extend_pic2.png and /dev/null differ diff --git a/docs/images/guide_helloworld_pic1.png b/docs/images/guide_helloworld_pic1.png deleted file mode 100644 index 712e9864..00000000 Binary files a/docs/images/guide_helloworld_pic1.png and /dev/null differ diff --git a/docs/images/guide_howtostart_pic1.png b/docs/images/guide_howtostart_pic1.png deleted file mode 100644 index 54c666a7..00000000 Binary files a/docs/images/guide_howtostart_pic1.png and /dev/null differ diff --git a/docs/images/guide_howtostart_pic2.png b/docs/images/guide_howtostart_pic2.png deleted file mode 100644 index 296a5150..00000000 Binary files a/docs/images/guide_howtostart_pic2.png and /dev/null differ diff --git a/docs/images/guide_howtostart_pic3.png b/docs/images/guide_howtostart_pic3.png deleted file mode 100644 index f7caf8c7..00000000 Binary files a/docs/images/guide_howtostart_pic3.png and /dev/null differ diff --git a/docs/images/guide_howtostart_pic4.png b/docs/images/guide_howtostart_pic4.png deleted file mode 100644 index 6d2b2fc3..00000000 Binary files a/docs/images/guide_howtostart_pic4.png and /dev/null differ diff --git a/docs/images/guide_howtostart_pic5.png b/docs/images/guide_howtostart_pic5.png deleted file mode 100644 index 9e30aed4..00000000 Binary files a/docs/images/guide_howtostart_pic5.png and /dev/null differ diff --git a/docs/images/guide_ide_qedit4web.png b/docs/images/guide_ide_qedit4web.png deleted file mode 100644 index 09f2ccb3..00000000 Binary files a/docs/images/guide_ide_qedit4web.png and /dev/null differ diff --git a/docs/images/guide_ide_qedit4web_choose.png b/docs/images/guide_ide_qedit4web_choose.png deleted file mode 100644 index 6f3edfd3..00000000 Binary files a/docs/images/guide_ide_qedit4web_choose.png and /dev/null differ diff --git a/docs/images/guide_ide_qedit4web_develop.png b/docs/images/guide_ide_qedit4web_develop.png deleted file mode 100644 index 0fde32ce..00000000 Binary files a/docs/images/guide_ide_qedit4web_develop.png and /dev/null differ diff --git a/docs/images/guide_program_pic1.png b/docs/images/guide_program_pic1.png deleted file mode 100644 index 4cdf975c..00000000 Binary files a/docs/images/guide_program_pic1.png and /dev/null differ diff --git a/docs/images/sl4a.jpg b/docs/images/sl4a.jpg deleted file mode 100644 index cf451532..00000000 Binary files a/docs/images/sl4a.jpg and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100755 index 1361441d..00000000 --- a/docs/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - QPython - Best Mobile Python IDE - - - - - - - - - - -
-
- - - - - -
-
- -
-
-
- - -
-
-
- -
-
-

Welcome to read the QPython guide!

-
- QPython is a script engine that runs Python on android devices. lt lets your android device run Python scripts and projects. lt contains the Python interpreter,console,editor,and the SL4A Libray for Android. lt’s Python on Android! -
-
    -
  • - -
  • -
  • - -
  • -
-
-
-
- -
-
-
-
    -
  • -
    -

    What’s NEW

    -

    QPython project include the QPython and QPython3 applications.

    -

    QPython application is using the Python 2.7.2, and QPyton application is using the Python 3.2.2.

    -

    QPython’s newest version is 1.3.(Released on 2017/3/20),QPython3’s newest ……

    -
    -
  • -
  • -
    -

    QPython communities

    -

    There are many active QPython communities where you could meet the QPython users like you

    -
      -
    •  • Join Facebook community
    • -
    •  • Join Google group
    • -
    •  • Join Gitter chat
    • -
    •  • Join G+ community(For QPython testers)
    • -
    •  • QPython on Stackoverflow
    • -
    -
    -
  • -
  • -
    -

    Support

    -

    We are happy to hear feedback from you, but sometimes some bugs or features demand may not be implented soon for we lack resources.

    -

    We are happy to hear feedback from you, but sometimes some bugs or features demand may not be implented soon for we lack resources.

    -
    -
  • -
-
-
-
-
- -
-
-
-
- - -
- - - - - diff --git a/docs/objects.inv b/docs/objects.inv deleted file mode 100644 index e5f60c63..00000000 Binary files a/docs/objects.inv and /dev/null differ diff --git a/docs/quick-start/index.html b/docs/quick-start/index.html deleted file mode 100644 index 19b2bad9..00000000 --- a/docs/quick-start/index.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - -Quick Start | QPyPI - - - - - - - -
- - -
-
-
- -
-

Quick Start

-
-
-

A hands-on introduction to Python for beginning programmers

-

If you are a new guy to QPython, you should watch the tutorial video and just follow the steps to learn how to run script with QPython -

-
-
-
-

Running with Console

-

Running QPython’s simple script with console model

-
#qpy:2
-#qpy:console
-#qpy:http://qpython.com/s/qpy-sample.py
-
-class Calculator(object):
-    #define class to simulate a simple calculator
-    def __init__ (self):
-        #start with zero
-        self.current = 0
-    def add(self, amount):
-        #add number to current
-        self.current += amount
-    def getCurrent(self):
-        return self.current
-
-myBuddy = Calculator() # make myBuddy into a Calculator object
-myBuddy.add(2) #use myBuddy's new add method derived from the Calculator class
-print(myBuddy.getCurrent()) #print myBuddy's current instance variable
-
-
-
-
-
-

Running with Kivy

-

Running QPython’s script with GUI model ( Kivy library )

-
#qpy:2
-#qpy:kivy
-#qpy:http://qpython.com/s/qpy-guisample.py
-
-from kivy.app import App
-from kivy.uix.button import Button
-
-class TestApp(App):
-    def build(self):
-        # display a button with the text : Hello QPython 
-        return Button(text='Hello QPython')
-
-TestApp().run()
-
-
-
-
-

Running as Web App ( QPython needs >= 0.9.7.x )

-

Running Web App with QPython

-
#qpy:2
-#qpy:webapp:Hello Qpython
-#qpy://localhost:8080/hello
-"""
-This is a sample for qpython webapp
-"""
-from bottle import route, run
-
-@route('/hello')
-def hello():
-    return "Hello World!"
-
-run(host='localhost', port=8080)
-
-
- -
-

-
-
-
-
-
-
-
-
- - diff --git a/docs/search.html b/docs/search.html deleted file mode 100644 index e58bf913..00000000 --- a/docs/search.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - -Search — QPython 0.9 documentation - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
- -
-
- -
-
-
-

Search

-
- -

-Please activate JavaScript to enable the search -functionality. -

-
-

-From here you can search these documents. Enter your search -words into the box below and click "search". Note that the search -function will automatically search for all of the words. Pages -containing fewer words won't appear in the result list. -

-
- - - -
-
-
-
-
-
-
-
-
-
-
-
-
- - -
- - - diff --git a/docs/searchindex.js b/docs/searchindex.js deleted file mode 100644 index 390fa416..00000000 --- a/docs/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({envversion:48,filenames:["document","en/faq","en/guide","en/guide_androidhelpers","en/guide_contributors","en/guide_contributors_test","en/guide_developers","en/guide_extend","en/guide_helloworld","en/guide_howtostart","en/guide_ide","en/guide_libraries","en/guide_program","zh/contributorshowto","zh/howtostart","zh/quickstart","zhindex"],objects:{"":{NFCBeamMessage:[3,0,1,""],addContextMenuItem:[3,0,1,""],addOptionsMenuItem:[3,0,1,""],batteryCheckPresent:[3,0,1,""],batteryGetHealth:[3,0,1,""],batteryGetLevel:[3,0,1,""],batteryGetPlugType:[3,0,1,""],batteryGetStatus:[3,0,1,""],batteryGetTechnology:[3,0,1,""],batteryGetTemperature:[3,0,1,""],batteryGetVoltage:[3,0,1,""],batteryStartMonitoring:[3,0,1,""],batteryStopMonitoring:[3,0,1,""],bluetoothAccept:[3,0,1,""],bluetoothActiveConnections:[3,0,1,""],bluetoothConnect:[3,0,1,""],bluetoothDiscoveryCancel:[3,0,1,""],bluetoothDiscoveryStart:[3,0,1,""],bluetoothGetConnectedDeviceName:[3,0,1,""],bluetoothGetLocalAddress:[3,0,1,""],bluetoothGetLocalName:[3,0,1,""],bluetoothGetRemoteDeviceName:[3,0,1,""],bluetoothGetScanMode:[3,0,1,""],bluetoothIsDiscovering:[3,0,1,""],bluetoothMakeDiscoverable:[3,0,1,""],bluetoothRead:[3,0,1,""],bluetoothReadBinary:[3,0,1,""],bluetoothReadLine:[3,0,1,""],bluetoothReadReady:[3,0,1,""],bluetoothSetLocalName:[3,0,1,""],bluetoothStop:[3,0,1,""],bluetoothWrite:[3,0,1,""],bluetoothWriteBinary:[3,0,1,""],cameraCapturePicture:[3,0,1,""],cameraInteractiveCapturePicture:[3,0,1,""],cameraStartPreview:[3,0,1,""],cameraStopPreview:[3,0,1,""],checkAirplaneMode:[3,0,1,""],checkBluetoothState:[3,0,1,""],checkNetworkRoaming:[3,0,1,""],checkRingerSilentMode:[3,0,1,""],checkScreenOn:[3,0,1,""],checkWifiState:[3,0,1,""],contactsGet:[3,0,1,""],contactsGetAttributes:[3,0,1,""],contactsGetById:[3,0,1,""],contactsGetCount:[3,0,1,""],contactsGetIds:[3,0,1,""],dialogCreateAlert:[3,0,1,""],dialogCreateDatePicker:[3,0,1,""],dialogCreateHorizontalProgress:[3,0,1,""],dialogCreateInput:[3,0,1,""],dialogCreateNFCBeamMaster:[3,0,1,""],dialogCreateNFCBeamSlave:[3,0,1,""],dialogCreatePassword:[3,0,1,""],dialogCreateSeekBar:[3,0,1,""],dialogCreateSpinnerProgress:[3,0,1,""],dialogCreateTimePicker:[3,0,1,""],dialogDismiss:[3,0,1,""],dialogGetInput:[3,0,1,""],dialogGetPassword:[3,0,1,""],dialogGetResponse:[3,0,1,""],dialogGetSelectedItems:[3,0,1,""],dialogSetCurrentProgress:[3,0,1,""],dialogSetItems:[3,0,1,""],dialogSetMaxProgress:[3,0,1,""],dialogSetMultiChoiceItems:[3,0,1,""],dialogSetNegativeButtonText:[3,0,1,""],dialogSetNeutralButtonText:[3,0,1,""],dialogSetPositiveButtonText:[3,0,1,""],dialogSetSingleChoiceItems:[3,0,1,""],dialogShow:[3,0,1,""],environment:[3,0,1,""],eventClearBuffer:[3,0,1,""],eventGetBrodcastCategories:[3,0,1,""],eventPoll:[3,0,1,""],eventPost:[3,0,1,""],eventRegisterForBroadcast:[3,0,1,""],eventUnregisterForBroadcast:[3,0,1,""],eventWait:[3,0,1,""],eventWaitFor:[3,0,1,""],executeQPy:[3,0,1,""],forceStopPackage:[3,0,1,""],fullDismiss:[3,0,1,""],fullKeyOverride:[3,0,1,""],fullQuery:[3,0,1,""],fullQueryDetail:[3,0,1,""],fullSetList:[3,0,1,""],fullSetProperty:[3,0,1,""],fullShow:[3,0,1,""],generateDtmfTones:[3,0,1,""],geocode:[3,0,1,""],getCellLocation:[3,0,1,""],getClipboard:[3,0,1,""],getConstants:[3,0,1,""],getDeviceId:[3,0,1,""],getDeviceSoftwareVersion:[3,0,1,""],getInput:[3,0,1,""],getIntent:[3,0,1,""],getLastKnownLocation:[3,0,1,""],getLaunchableApplications:[3,0,1,""],getLine1Number:[3,0,1,""],getMaxMediaVolume:[3,0,1,""],getMaxRingerVolume:[3,0,1,""],getMediaVolume:[3,0,1,""],getNeighboringCellInfo:[3,0,1,""],getNetworkOperator:[3,0,1,""],getNetworkOperatorName:[3,0,1,""],getNetworkStatus:[3,0,1,""],getNetworkType:[3,0,1,""],getPackageVersion:[3,0,1,""],getPackageVersionCode:[3,0,1,""],getPassword:[3,0,1,""],getPhoneType:[3,0,1,""],getRingerVolume:[3,0,1,""],getRunningPackages:[3,0,1,""],getScreenBrightness:[3,0,1,""],getScreenTimeout:[3,0,1,""],getSimCountryIso:[3,0,1,""],getSimOperator:[3,0,1,""],getSimOperatorName:[3,0,1,""],getSimSerialNumber:[3,0,1,""],getSimState:[3,0,1,""],getSubscriberId:[3,0,1,""],getVibrateMode:[3,0,1,""],getVoiceMailAlphaTag:[3,0,1,""],getVoiceMailNumber:[3,0,1,""],launch:[3,0,1,""],locationProviderEnabled:[3,0,1,""],locationProviders:[3,0,1,""],log:[3,0,1,""],makeIntent:[3,0,1,""],makeToast:[3,0,1,""],mediaIsPlaying:[3,0,1,""],mediaPlay:[3,0,1,""],mediaPlayClose:[3,0,1,""],mediaPlayInfo:[3,0,1,""],mediaPlayList:[3,0,1,""],mediaPlayPause:[3,0,1,""],mediaPlaySeek:[3,0,1,""],mediaPlaySetLooping:[3,0,1,""],mediaPlayStart:[3,0,1,""],notify:[3,0,1,""],phoneCall:[3,0,1,""],phoneCallNumber:[3,0,1,""],phoneDial:[3,0,1,""],phoneDialNumber:[3,0,1,""],pick:[3,0,1,""],pickContact:[3,0,1,""],pickPhone:[3,0,1,""],prefGetAll:[3,0,1,""],prefGetValue:[3,0,1,""],prefPutValue:[3,0,1,""],queryAttributes:[3,0,1,""],queryContent:[3,0,1,""],readBatteryData:[3,0,1,""],readLocation:[3,0,1,""],readPhoneState:[3,0,1,""],readSensors:[3,0,1,""],readSignalStrengths:[3,0,1,""],receiveEvent:[3,0,1,""],recognizeSpeech:[3,0,1,""],recorderCaptureVideo:[3,0,1,""],recorderStartMicrophone:[3,0,1,""],recorderStartVideo:[3,0,1,""],recorderStop:[3,0,1,""],requiredVersion:[3,0,1,""],rpcPostEvent:[3,0,1,""],scanBarcode:[3,0,1,""],search:[3,0,1,""],sendBroadcast:[3,0,1,""],sendBroadcastIntent:[3,0,1,""],sendEmail:[3,0,1,""],sensorsGetAccuracy:[3,0,1,""],sensorsGetLight:[3,0,1,""],sensorsReadAccelerometer:[3,0,1,""],sensorsReadMagnetometer:[3,0,1,""],sensorsReadOrientation:[3,0,1,""],setClipboard:[3,0,1,""],setMediaVolume:[3,0,1,""],setResultBoolean:[3,0,1,""],setResultBooleanArray:[3,0,1,""],setResultByte:[3,0,1,""],setResultByteArray:[3,0,1,""],setResultChar:[3,0,1,""],setResultCharArray:[3,0,1,""],setResultDouble:[3,0,1,""],setResultDoubleArray:[3,0,1,""],setResultFloat:[3,0,1,""],setResultFloatArray:[3,0,1,""],setResultInteger:[3,0,1,""],setResultIntegerArray:[3,0,1,""],setResultLong:[3,0,1,""],setResultLongArray:[3,0,1,""],setResultSerializable:[3,0,1,""],setResultShort:[3,0,1,""],setResultShortArray:[3,0,1,""],setResultString:[3,0,1,""],setResultStringArray:[3,0,1,""],setRingerVolume:[3,0,1,""],setScreenBrightness:[3,0,1,""],setScreenTimeout:[3,0,1,""],smsDeleteMessage:[3,0,1,""],smsGetAttributes:[3,0,1,""],smsGetMessageById:[3,0,1,""],smsGetMessageCount:[3,0,1,""],smsGetMessageIds:[3,0,1,""],smsGetMessages:[3,0,1,""],smsMarkMessageRead:[3,0,1,""],smsSend:[3,0,1,""],startActivity:[3,0,1,""],startActivityForResult:[3,0,1,""],startActivityForResultIntent:[3,0,1,""],startActivityIntent:[3,0,1,""],startEventDispatcher:[3,0,1,""],startInteractiveVideoRecording:[3,0,1,""],startLocating:[3,0,1,""],startSensing:[3,0,1,""],startSensingThreshold:[3,0,1,""],startSensingTimed:[3,0,1,""],startTrackingPhoneState:[3,0,1,""],startTrackingSignalStrengths:[3,0,1,""],stopEventDispatcher:[3,0,1,""],stopLocating:[3,0,1,""],stopSensing:[3,0,1,""],stopTrackingPhoneState:[3,0,1,""],stopTrackingSignalStrengths:[3,0,1,""],toggleAirplaneMode:[3,0,1,""],toggleBluetoothState:[3,0,1,""],toggleRingerSilentMode:[3,0,1,""],toggleVibrateMode:[3,0,1,""],toggleWifiState:[3,0,1,""],ttsIsSpeaking:[3,0,1,""],ttsSpeak:[3,0,1,""],usbserialActiveConnections:[3,0,1,""],usbserialConnect:[3,0,1,""],usbserialDisconnect:[3,0,1,""],usbserialGetDeviceList:[3,0,1,""],usbserialGetDeviceName:[3,0,1,""],usbserialHostEnable:[3,0,1,""],usbserialRead:[3,0,1,""],usbserialReadBinary:[3,0,1,""],usbserialReadReady:[3,0,1,""],usbserialWrite:[3,0,1,""],usbserialWriteBinary:[3,0,1,""],view:[3,0,1,""],viewContacts:[3,0,1,""],viewHtml:[3,0,1,""],viewMap:[3,0,1,""],waitForEvent:[3,0,1,""],wakeLockAcquireBright:[3,0,1,""],wakeLockAcquireDim:[3,0,1,""],wakeLockAcquireFull:[3,0,1,""],wakeLockAcquirePartial:[3,0,1,""],wakeLockRelease:[3,0,1,""],webViewShow:[3,0,1,""],webcamAdjustQuality:[3,0,1,""],webcamStart:[3,0,1,""],wifiDisconnect:[3,0,1,""],wifiGetConnectionInfo:[3,0,1,""],wifiGetScanResults:[3,0,1,""],wifiLockAcquireFull:[3,0,1,""],wifiLockAcquireScanOnly:[3,0,1,""],wifiLockRelease:[3,0,1,""],wifiReassociate:[3,0,1,""],wifiReconnect:[3,0,1,""],wifiStartScan:[3,0,1,""]}},objnames:{"0":["py","function","Python function"]},objtypes:{"0":"py:function"},terms:{"160x120":3,"320x240":3,"352x288":3,"3rd":[0,1,2,3,9],"640x480":3,"78k0f0730":3,"800x480":3,"\u4e16\u754c":14,"\u4e24\u90e8\u5206":13,"\u4e2d\u6587":13,"\u4e2d\u6587\u7528\u6237\u5411\u5bfc":0,"\u4e3b\u8981\u662f\u7528qpython\u6765\u8fdb\u884c\u7f16\u7a0b\u548c\u5f00\u53d1\u7684\u6307\u5357":13,"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u6765\u63d0\u4ea4\u5bf9\u5e94\u56fd\u5bb6\u7684\u7ffb\u8bd1":13,"\u4f60\u597d":14,"\u4f7f\u7528\u4e0a\u7684\u5e2e\u52a9":13,"\u4f7f\u7528\u8bf4\u660e":14,"\u5176\u4e2d\u5185\u5bb9\u5176\u4e2d\u53c8\u5206\u4e3a":13,"\u5206\u4e3a\u5728qpython":13,"\u52a0\u5165qpython":16,"\u548c\u4ee5\u5916\u7684":13,"\u56e2\u961f":14,"\u5728\u5fae\u535a\u95ee\u6211\u4eec\u95ee\u9898":16,"\u5728\u60f3\u8981\u8d21\u732eqpython\u6587\u6863\u4e4b\u524d\u4ed4\u7ec6\u9605\u8bfb\u6211\u4eec\u7684\u6307\u5357":13,"\u5728\u767e\u5ea6\u8d34\u5427\u91cc\u8ba8\u8bba":16,"\u5982\u4f55\u8d21\u732e":0,"\u5982\u679c\u68c0\u67e5\u65e0\u95ee\u9898\u5219\u53ef\u4ee5\u63d0\u4ea4":13,"\u5b83\u5305\u542b\u4e86\u8bb8\u591a\u60ca\u8273\u7684\u7279\u6027":16,"\u5df2\u7ecf\u53d1\u5e03":16,"\u5e38\u89c1\u95ee\u9898":16,"\u5e76\u4e14\u6587\u6863\u4f1a\u901a\u8fc7github":13,"\u5f00\u53d1":14,"\u5feb\u901f\u4e86\u89e3":14,"\u5feb\u901f\u5f00\u59cb":13,"\u60f3\u6210\u4e3a":16,"\u6211\u4eec\u52aa\u529b\u4fdd\u6301\u4e24\u79cd\u8bed\u8a00\u5bf9\u5e94\u5185\u5bb9\u7684\u51c6\u786e\u548c\u540c\u6b65":13,"\u6211\u4eec\u7528sphinx\u6765\u7ec4\u7ec7\u6587\u6863":13,"\u6253\u5f00\u6d4f\u89c8\u5668\u6253\u5f00\u672c\u5730\u6587\u4ef6\u68c0\u67e5":13,"\u62a5\u544a\u95ee\u9898":16,"\u6309\u7167sphinx\u89c4\u5219\u7f16\u8f91source\u4e2d\u7684\u6587\u4ef6\u5373\u53ef":13,"\u6587\u6863\u4f53\u7cfb\u5206\u4e3a":13,"\u6587\u6863\u975e\u5e38\u91cd\u8981":13,"\u66f4\u591a\u94fe\u63a5":0,"\u6700\u540ecd\u5230qpython":13,"\u6765\u548c\u4e2d\u56fd\u6d3b\u8dc3\u7684qpython":16,"\u6765\u548c\u5168\u4e16\u754c\u7684":16,"\u6b22\u8fce":0,"\u6b22\u8fce\u52a0\u5165":14,"\u6df1\u5165\u6298\u817e\u7684\u6307\u5bfc":13,"\u7136\u540e\u6d4f\u89c8qpython":13,"\u7528\u6237\u4e00\u5757\u6765\u73a9\u8f6cqpython":16,"\u7528\u6237\u4e00\u8d77\u73a9\u8f6c":16,"\u7528\u6237\u5f00\u53d1\u7ec4":0,"\u7528\u6237\u5f00\u53d1\u8005\u7ec4":16,"\u7684\u6700\u65b0\u7248\u672c1":16,"\u7684\u8d21\u732e\u8005\u4e48":16,"\u7ed9\u6211\u4eec\u53d1\u90ae\u4ef6":16,"\u7f16\u7a0b\u5411\u5bfc":14,"\u7f16\u7a0b\u6307\u5357":13,"\u82f1\u6587":13,"\u8bf7":16,"\u8bf7\u4ece\u5e94\u7528\u5e02\u573a\u5b89\u88c5":16,"\u8bf7\u52a0\u5165":16,"\u8d21\u732e\u8005\u6307\u5357":13,"\u8d77\u6b65":0,"\u8fdb\u5165\u5230":13,"\u9879\u76ee\u7684qpython":13,"\u9ed1\u5ba2":14,"__exit":12,"__future__":11,"__phello__":11,"_abcol":11,"_codecs_cn":11,"_codecs_hk":11,"_codecs_iso2022":11,"_codecs_jp":11,"_codecs_kr":11,"_codecs_tw":11,"_csv":11,"_ctype":11,"_ctypes_test":11,"_hashlib":11,"_heapq":11,"_hotshot":11,"_io":11,"_json":11,"_lsprof":11,"_lwpcookiejar":11,"_mozillacookiejar":11,"_multibytecodec":11,"_pyio":11,"_sqlite3":11,"_ssl":11,"_strptime":11,"_testcapi":11,"_threading_loc":11,"_weakrefset":11,"boolean":3,"byte":3,"case":[1,3,8],"class":[3,8,11,12],"default":[3,7,9,11,12],"docs\u4e2d\u5e76\u8fd0\u884cbuild":13,"docs\u76ee\u5f55\u4e2d":13,"export":7,"final":3,"float":3,"function":[6,8,11,12],"import":[1,3,7,8,11,12],"int":[3,7],"long":[3,9],"null":[3,7],"org\u5373\u53ef\u770b\u5230\u6700\u65b0\u7684\u66f4\u65b0":13,"org\u7f51\u7ad9\u4e2d":13,"page\u529f\u80fd\u76f4\u63a5\u63a8\u5230qpython":13,"qpython\u662f\u4e00\u4e2a\u652f\u6301\u591a\u8bed\u8a00\u7684\u5e94\u7528":13,"qpython\u8d21\u732e\u8005\u6307\u5357":13,"qpython\u9ed1\u5ba2\u6307\u5357":13,"qq\u7ec4":16,"return":[3,7,8,12],"short":3,"static":3,"switch":9,"team\u5185\u7684":13,"throw":3,"true":[3,7],"try":[0,7,8,12],"var":1,"void":7,"while":3,abc:11,abil:[6,9],abl:[3,6],about:[2,3,5,8,9],abov:[1,3,9,10],abridg:3,absolut:3,acceler:3,acceleromet:3,accept:3,acces:3,access:[3,10,12],accomplish:12,accuraci:3,acquir:3,act:7,action:[3,7,9],activ:[0,2,3,7,9],active:3,activityresultfacad:2,actual:8,adapt:3,add:[3,8,9,12],addcontextmenuitem:3,addit:9,addoptionsmenuitem:3,address:3,adjust:3,advantag:12,after:[5,8,9,10],aifc:11,aim:6,airplan:3,all:[3,8],allow:[3,6,7,9,12],almost:8,alphabet:3,alreadi:0,also:[2,3,6,9,10,12],altern:12,alwai:9,amaz:[0,12],amazon:0,andoroid:3,android5:1,android:[0,1,2,3],androidfacad:2,androidhelp:[0,2,3,7,8],ani:[0,3,5,7,8],anoth:[8,9],answer:9,antigrav:11,any:8,anydbm:11,anymor:3,anyth:8,anywai:8,api14:3,api:[0,2],apk:[3,7],app:[1,7,12,14],appcach:3,applic:[0,2,3],applicat:3,applicationmanagerfacad:2,appstor:0,arduino:3,arg:12,argpars:11,argument:3,argv:7,ascii:3,ase:3,ask:[0,3,8,9],asset:12,assit:12,associ:3,ast:11,asynchat:11,asyncor:11,atexit:11,attach:3,attachmenturi:3,attribut:3,audiodev:11,audioop:11,autofocu:3,automat:11,avail:[3,8,9],availblock:3,axi:3,azimuth:3,background:12,backlight:3,backspac:8,bad:12,bar:[3,8,9],base64:[3,11],basehttpserv:11,bastion:11,batteri:3,batterycheckpres:3,batterygethealth:3,batterygetlevel:3,batterygetplugtyp:3,batterygetstatu:3,batterygettechnolog:3,batterygettemperatur:3,batterygetvoltag:3,batterymanagerfacad:2,batterystartmonitor:3,batterystopmonitor:3,bdb:11,beam:3,beautifulsoup:11,becam:[0,2],becom:[2,4],befor:9,begin:8,below:10,besid:[6,9,10,12],best:[0,2],beta:7,better:[5,6],between:[3,9],big:9,bin:1,bind:3,binhex:11,bios:3,bisect:11,bit:8,blank:8,block:3,blockcount:3,blocksiz:3,blog:[8,9],bluetooth:[3,12],bluetoothaccept:3,bluetoothactiveconnect:3,bluetoothconnect:3,bluetoothdiscoverycancel:3,bluetoothdiscoverystart:3,bluetoothfacad:2,bluetoothgetconnecteddevicenam:3,bluetoothgetlocaladdress:3,bluetoothgetlocalnam:3,bluetoothgetremotedevicenam:3,bluetoothgetscanmod:3,bluetoothisdiscov:3,bluetoothmakediscover:3,bluetoothread:3,bluetoothreadbinari:3,bluetoothreadlin:3,bluetoothreadreadi:3,bluetoothsetlocalnam:3,bluetoothstop:3,bluetoothwrit:3,bluetoothwritebinari:3,board:3,bodi:3,bool:3,both:8,bottl:[11,12,14],bountysourc:0,box:[3,8],brand:9,briefli:4,broadcast:3,brows:2,browsable:7,browser:[2,3,9],bsddb:11,buffer:3,buffers:3,bug:[0,5],build:[7,12],built:[0,2],bundl:7,busi:7,button:[3,8,9,10,12],calendar:11,callabck:7,camera:3,cameracapturepictur:3,camerafacad:2,camerainteractivecapturepictur:3,camerastartpreview:3,camerastoppreview:3,can:[3,7,8,9,12],cancel:[3,8],cancl:3,cannot:3,cap:9,captur:3,card:3,categori:[3,7],caus:12,cdc:3,cdma:3,cell:3,center:9,cgi:11,cgihttpserver:11,cgitb:11,challeng:7,chanc:9,chang:3,charact:3,charg:3,charger:3,chat:0,check:[3,8],checkairplanemod:3,checkbluetoothst:3,checknetworkroam:3,checkout:7,checkringersilentmod:3,checkscreenon:3,checkwifist:3,choic:3,choos:[2,3,7,9,10],chosen:3,chunk:[3,11],claim:8,classnam:3,clear:3,click:[3,5,8,9,10],clone:13,close:[3,9,12],cmd:11,code:[3,7,8,9,10,11,12],codec:11,codeop:11,collabor:4,collect:[3,11],colorsi:11,column:3,com:[3,9,13],come:4,comfort:9,comma:3,command:[9,11],commit:3,common:[6,12],commonintentsfacad:2,compat:8,compil:[7,9,11,12],compileal:11,complet:12,complex:12,compon:9,comput:2,comun:9,config:11,configchang:7,configpars:11,confirm:3,connect:3,connid:3,consid:[1,3,4,8],consol:[0,2],constant:3,consult:9,contact:[3,5,7],contactsfacad:2,contactsget:3,contactsgetattribut:3,contactsgetbyid:3,contactsgetcount:3,contactsgetid:3,contain:[0,3,8,9,11],contan:8,content:[2,3],context:[3,7],contextlib:11,contributor:0,conveni:10,convient:10,cooki:11,cookielib:11,cool:5,copi:[9,11],copy_reg:11,core:[0,2],corner:9,could:[0,1,3,5,7,9,10,11,12],couldn:7,countri:3,cprofil:11,cpu:3,creat:[3,5,8,9],creation:3,creator:2,critic:9,csv:11,ctype:11,current:3,dai:3,dashboard:[2,7],data:1,date:3,dbhash:11,dead:3,debug:12,decim:[3,11],declar:12,def:12,defaulttext:3,defin:[3,12],definit:7,delaytim:3,delet:[3,9],deliveri:6,demand:0,demo:7,demonstr:3,depend:9,deriv:11,describ:8,desir:3,desktop:9,destinationaddress:3,detail:[3,4],dev:3,devci:3,develop:0,devic:[0,1,3,9,12],dfault:3,dial:3,dialogcreatealert:3,dialogcreatedatepick:3,dialogcreatehorizontalprogress:3,dialogcreateinput:3,dialogcreatenfcbeammast:3,dialogcreatenfcbeamslav:3,dialogcreatepassword:3,dialogcreateseekbar:3,dialogcreatespinnerprogress:3,dialogcreatetimepick:3,dialogdismiss:3,dialoggetinput:[3,7,8],dialoggetpassword:3,dialoggetrespons:3,dialoggetselecteditem:3,dialogsetcurrentprogress:3,dialogsetitem:3,dialogsetmaxprogress:3,dialogsetmultichoiceitem:3,dialogsetnegativebuttontext:3,dialogsetneutralbuttontext:3,dialogsetpositivebuttontext:3,dialogsetsinglechoiceitem:3,dialogshow:3,didn:12,differ:[3,6],difflib:11,digit:3,dim:3,dircach:11,directli:[3,9,10],directori:9,disabl:3,discharg:3,disconnect:3,discov:3,discover:3,discoveri:3,dismiss:3,displai:[3,8,12],distribut:9,distutil:11,django:12,dmych:[8,9],doc:8,doctest:11,document:[0,2],docxmlrpcserv:11,doe:[3,8,12],doesn:[1,12],don:[7,8,9,11,12],dongl:3,doubl:3,down:[5,9],download:3,draft:[8,9],drawabl:3,driver:12,droid:[3,7,8],dtmf:3,dumbdbm:11,dummy_thread:11,durat:3,dure:3,dynload:2,each:3,easi:12,easili:[9,12],edit:[8,9,10],editor:[0,2],effici:12,els:[3,7,8],email:[0,4,7,11],empti:[3,8],enabl:3,encapsul:8,encod:[3,11],engin:[0,2,12],enqueu:3,ensornumb:3,enter:[8,9],enterpris:[0,2],env:1,environ:[3,7,9],equal:3,equival:3,error:[3,12],essenti:12,establish:3,estens:9,etc:[0,3,6,9,12],even:1,event:[2,3],eventclearbuff:3,eventdata:3,eventfacad:2,eventgetbrodcastcategori:3,eventnam:3,eventpol:3,eventpost:3,eventregisterforbroadcast:3,eventunregisterforbroadcast:3,eventwait:3,eventwaitfor:3,ever:3,everi:8,exampl:[3,8,12],exceed:3,except:[8,12],exception:12,execut:[1,3,8,9],executeqpi:3,exit:[3,12],expans:6,expect:3,experi:12,explicitli:9,explor:9,extend:[3,9],extplgplusnam:7,extra:[3,12],eyesfreefacad:2,facad:2,facebook:[0,1],fail:3,failur:3,fals:[3,8,12],familiar:8,faq:0,fast:12,featur:[0,2,3,9,10],feedback:[0,2,4],feel:9,field:[3,8],fifth:8,file:[2,3],filecmp:11,fileinput:11,filenam:3,filepath:[3,12],filter:7,find:[5,7,9],firmwar:3,first:[1,8,9],flag:[3,7],flask:12,flexiabl:12,fnmatch:11,folder:3,folk:6,follow:[0,1,2,5,7,8,9,11,12],foo:11,forc:3,forcestoppackag:3,forget:9,fork:0,format:[3,8],formatt:11,forward:0,found:[3,7,9],fpformat:11,fraction:11,framework:12,free:9,from:[0,1,2,3],front:12,ftdi:3,ftp:2,ftplib:11,full:[3,7],fulldismiss:3,fullkeyoverrid:3,fullqueri:3,fullquerydetail:3,fullscreen:[3,12],fullsetlist:3,fullsetproperti:3,fullshow:3,functool:11,funni:9,further:8,futur:12,future_builtin:11,gener:[3,7,9],generatedtmfton:3,genericpath:11,geocod:3,get:[0,1],getcellloc:3,getclipboard:3,getconst:3,getdefault:3,getdeviceid:3,getdevicesoftwarevers:3,getextra:7,getintent:3,getlastknownloc:3,getlaunchableappl:3,getline1numb:3,getmaxmediavolum:3,getmaxringervolum:3,getmediavolum:3,getneighboringcellinfo:3,getnetworkoper:3,getnetworkoperatornam:3,getnetworkstatu:3,getnetworktyp:3,getopt:11,getpackagevers:3,getpackageversioncod:3,getpass:11,getphonetyp:3,getringervolum:3,getrunningpackag:3,getscreenbright:3,getscreentimeout:3,getsimcountryiso:3,getsimoper:3,getsimoperatornam:3,getsimserialnumb:3,getsimst:3,getstr:7,getsubscriberid:3,gettext:11,getvibratemod:3,getvoicemailalphatag:3,getvoicemailnumb:3,git:13,github:[0,7,13],gitter:0,given:3,glob:11,global:12,goal:2,goe:9,good:[3,8],googl:0,gps:12,grab:3,great:[0,2,4,6],greater:[3,4],greet:8,group:[0,4],grp:11,gsm:3,gsm_signal_strength:3,guarante:3,gzip:11,handl:[3,7],handler:12,handler_class:12,happen:8,happi:0,hardwar:3,hash:3,hashlib:11,have:[0,5,7,9,12],head:12,header:12,health:3,heapq:11,hear:0,heard:3,hei:8,hello1:8,hello:[0,2,3,7],helloworld:8,help:[0,2],hepler:11,here:[3,7,8,9],hide:12,higher:[0,3],highlight:[9,10],hipip:9,hmac:11,home:12,homepag:12,hope:4,horizont:3,host:2,hotshot:11,hour:3,how:[0,1,2,3],href:12,html:[3,10],htmlentitydef:11,htmllib:11,htmlparser:11,http:[3,7,12,13],httplib:11,icon:[3,9],iconnam:3,ide:[11,12],idea:[5,9],identifi:3,ihook:11,imag:[3,7],imaplib:11,imei:3,imghdr:11,immedi:3,implement:[0,12],importerror:8,importlib:11,imputil:11,imsi:3,inbox:3,includ:[0,3,9],incom:3,incomingnumb:3,increas:3,indent:[8,9],independ:7,index:[3,9],indic:3,info:3,initi:3,innov:12,input:[3,8],inputtyp:3,insert:[3,12],inspect:11,instal:[7,9,12],instead:[8,9],integr:[3,9],interact:6,interest:5,interfac:[8,9,12],interpret:[0,9],introduc:[4,9],invit:4,is24hour:3,iso:3,issu:[0,3],item:3,java:3,javascript:10,jniu:12,job:12,join:[0,2,4],jpeg:3,jpegqual:3,json:[3,8,11],just:[1,2,8,9,10,11,12],keep:[5,12],kei:[3,8],kernel:3,keyboard:3,keyboardhidden:7,keycod:3,keyword:[10,11],kit:9,kivi:2,know:[2,5,8],known:3,kuri65536:3,label:[3,7],lack:[0,9],languag:[3,12],languagemodel:3,laptop:[10,12],last:[3,8],later:[1,3],latitud:3,launch:[0,2,3],launchabl:3,launcher:7,layer:3,lead:9,least:8,leav:[8,9],left:[8,9],length_short:7,level:[3,9],lib:[9,11],libari:9,librari:[0,2,3],light:3,like:[0,1,3,6,7,9,10,11,12],line:[3,7,8,9,12],linecach:11,link:[1,9],linux4:11,list:[3,9],listen:3,load:[3,12],local:[0,2,3],localhost:12,locationfacad:2,locationprovid:3,locationprovideren:3,lock:3,log:[3,11],log_request:12,logcat:3,logic:8,logo:9,longitud:3,loop:3,lua:10,m78k0f0730:3,macpath:11,macurl2path:11,magnet:3,mai:[0,7],mail:3,mailbox:11,mailcap:11,main:[0,2,6,9,10],mainli:9,maintain:[6,9],make:[3,4,5,8,9,12],make_serv:12,makeint:3,maketext:7,maketoast:[3,7,8],mani:[0,3,9,12],manual:11,map:3,mark:3,markupbas:11,master:3,match:3,max:3,maximum:3,maximumprogress:3,maximunprogress:3,maxresult:3,mbundl:7,mcc:3,md5:11,mean:8,meanin:8,mediaisplai:3,mediaplai:3,mediaplayclos:3,mediaplayerfacad:2,mediaplayinfo:3,mediaplaylist:3,mediaplaypaus:3,mediaplayseek:3,mediaplaysetloop:3,mediaplaystart:3,mediarecorderfacad:2,meet:0,meid:3,member:[0,2],mention:1,menu:[3,9],messag:[3,8],method:[3,12],mhlib:11,microphon:3,million:0,millisecond:3,mime:3,mimetool:11,mimetyp:[7,11],mimewrit:11,mimifi:11,mindist:3,minupdatedist:3,minut:3,miut:3,mix:[9,12],mjpeg:3,mmap:11,mnc:3,mobil:3,model:3,modifi:9,modul:8,modulefind:11,month:3,more:[2,4],most:[3,8,9,10,11,12],move:[0,10],mpyapi:7,msec:3,msisdn:3,much:9,multi:12,multifil:11,multipl:3,must:3,mutex:11,myappid:7,mywsgirefserv:12,name:[3,7,8,9,12],necessari:8,need:[0,1,7,8,11,12],neg:3,neighbor:3,netrc:11,network:[0,3],newest:0,next:[3,8,9],nfcbeammessag:3,nice:9,nntplib:11,non:3,none:[3,8,12],note:[9,12],noth:8,notic:9,notif:[3,8,9],ntpath:11,nturl2path:11,number:[3,9,11],number_of_ev:3,numer:3,numpi:9,object:[3,8,9],obvious:9,obviousli:8,occur:3,off:3,offer:[5,6,8,9,12],offici:0,offset:3,oldest:3,onactivityresult:7,once:9,onli:[2,3,7,8],onlin:7,online:[0,2],onpyapi:7,onqpyexec:7,oop:8,opcod:11,open:[0,2,3],opengl2:12,opengl:12,opensourc:6,oper:3,option:[3,12],optional:3,optpars:11,order:[3,8],ordinari:9,org:[1,3,4,5,7,9],organis:2,orient:[3,7],origin:3,os2emxpath:11,otherwis:[3,8],our:8,out:[2,5,7],output:8,outsid:7,over:3,overheat:3,overrid:[3,7],own:2,packag:[3,7,9,12],packagenam:3,page:[9,12],paid:6,param:7,paramet:3,part:[4,6,12],partial:3,pass:[3,12],password:3,path:[3,12],paus:3,pdb:11,pelas:12,peopl:[9,12],percentag:3,period:3,permiss:12,phone:[3,10],phonecal:3,phonecallnumb:3,phonedi:3,phonedialnumb:3,phonefacad:2,phonenumb:3,pic:[9,10],pick:3,pickcontact:3,picker:3,pickl:11,pickletool:11,pickphon:3,pictur:[3,9],pip:[0,2],pip_consol:9,pipe:11,pitch:3,pizza:3,pkg_resourc:11,pkgutil:11,pl2303:3,plai:[0,3,8],plain:[7,10],plan:12,plat:11,platform:11,pleas:[0,1,3,4,5,7,9],plistlib:11,plu:9,plug:3,plugin:7,plyer:11,point:[3,12],polit:8,poll:3,pop:8,popen2:11,poplib:11,port:[3,12],posit:3,posixfil:11,posixpath:11,possibl:3,post:[3,9],power:[2,3],pprint:11,pre:[7,9,12],prefer:3,preferencesfacad:2,prefgetal:3,prefgetvalu:3,prefputvalu:3,presenc:3,present:3,press:8,preview:[3,10],previou:12,previous:3,print:[8,12],prioriti:0,probabl:3,process:[3,7],product:7,profil:11,program:0,progress:1,project:[0,2,3],prompt:[3,8],properti:[3,9],propos:7,protect:7,pstat:11,pty:11,publish:7,pull:[0,8],pure:[9,12],purpos:3,push:[0,2],put:[3,8,9,12],putextra:7,putstr:7,py_compil:11,pyclbr:11,pycod:7,pydoc:11,pydoc_data:11,pygam:1,python2:9,python:[0,1,2],qedit4web:10,qeditor:2,qptyhon:5,qpy:[0,1,2],qpy_run_with_shar:7,qpyapp:12,qpyhttpd:12,qpyinterfacefacad:2,qpylib:7,qpypi:2,qpyplu:9,qpython3:[0,3,7,12,16],qpythoninit:11,qrcode:2,qscript:12,qsl4a:[0,2],qualiti:3,queri:3,queryattribut:3,querycont:3,question:9,queue:[3,11],quick:[0,2],quickli:[2,9],quiet:12,quiethandl:12,quopri:11,qustion:0,radio:3,random:11,rapid:12,reach:9,reaction:8,readbatterydata:3,reader:2,readi:5,readloc:3,readphonest:3,readsensor:3,readsignalstrength:3,real:8,receiv:3,receiveev:3,recent:[3,9],recipi:3,recogn:3,recognizeint:3,recognizespeech:3,recommend:12,recongn:3,reconnect:3,record:3,recordaudio:3,recordercapturevideo:3,recorderstartmicrophon:3,recorderstartvideo:3,recorderstop:3,redirect:9,refer:3,regist:3,regular:9,releas:[0,3,12],reload:12,remot:3,remov:[3,12],renam:9,replac:8,report:[0,2,3,4],repr:[11,12],repres:3,represent:3,request:[0,3,12],requestcod:7,requiredvers:3,resolut:3,resolutionlevel:3,resolv:3,resourc:[0,3,9,11,12],respond:8,respons:3,rest:9,result:[3,7,8,10],resultcod:[3,7],resultvalu:3,retriev:3,rexec:11,rfc822:11,river:7,rl78:3,rlcomplet:11,roam:3,robotpars:11,role:3,roll:3,root:[1,12],rout:12,routers:12,rpc:8,rpcpostevent:3,run:[0,1,2,3],runpi:11,runtim:12,said:9,same:[9,11],sampl:[1,2,3,7],samples:3,save:[3,8,9],scan:3,scanbarcod:3,scanner:3,sched:11,scheme:7,screenorient:7,screenshot:[8,9,12],script:[0,1,2,3,6],script_exec_py:7,script_result:3,sdcard:[3,9,12],sdk:3,search:[3,9,10],second:[3,9],see:[3,8,9,10,11],seek:3,seem:7,select:3,selectionarg:3,self:[3,12],send:[0,3,4,5,7],sendbroadcastint:3,sensor:3,sensormanagerfacad:2,sensornumb:3,sensorsgetaccuraci:3,sensorsgetlight:3,sensorsreadacceleromet:3,sensorsreadmagnetomet:3,sensorsreadorient:3,sent:3,separ:[3,8],serial:2,serv:12,serve_forev:12,server:[3,12],server_clos:12,server_stat:12,serveradapt:12,servic:[0,2,3],session:3,set:[3,7,9,11],setaction:7,setclassnam:7,setclipboard:3,setmediavolum:3,setresultboolean:3,setresultbooleanarrai:3,setresultbyt:3,setresultbytearrai:3,setresultchar:3,setresultchararrai:3,setresultdoubl:3,setresultdoublearrai:3,setresultfloat:3,setresultfloatarrai:3,setresultinteg:3,setresultintegerarrai:3,setresultlong:3,setresultlongarrai:3,setresultserializ:3,setresultshort:3,setresultshortarrai:3,setresultstr:3,setresultstringarrai:3,setringervolum:3,setscreenbright:3,setscreentimeout:3,settingsfacad:2,setuptool:11,sever:[0,12],sgmllib:11,sha:11,share:[1,2,3],shell:10,shelv:11,shlex:11,shortcut:9,shoul:12,should:[2,3,8,9],show:[3,7,8,9],shown:8,shutdown:12,shutil:11,signal:3,signalstrengthfacad:2,sim:3,similar:8,simpl:[7,8],simple_serv:12,simplehttpserv:11,simplexmlrpcserv:11,simplifi:11,sinc:9,singl:9,site:[9,11],sl4a:[0,2,3,6],slave:3,small:8,smartphon:12,sms:[3,12],smsdeletemessag:3,smsfacad:2,smsgetattribut:3,smsgetmessag:3,smsgetmessagebyid:3,smsgetmessagecount:3,smsgetmessageid:3,smsmarkmessageread:3,smssend:3,smtpd:11,smtplib:11,sndhdr:11,snippet:10,social:0,socket:[3,11],socketserv:11,softwar:3,solut:12,solv:0,some:[0,2,3,5],sometim:0,somth:9,soon:[0,4],sour:1,sourc:[3,9,12],space:8,speak:3,specif:3,specifi:3,speech:3,speechrecognitionfacad:2,spinner:3,spn:3,sponsor:[0,2],sqlite3:11,sre:11,sre_compil:11,sre_const:11,sre_pars:11,ssl:11,stackoverflow:0,stardard:2,start:0,startactivityforresult:[3,7],startactivityforresultint:3,startactivityint:3,starteventdispatch:3,startinteractivevideorecord:3,startloc:3,startsens:3,startsensingthreshold:3,startsensingtim:3,starttrackingphonest:3,starttrackingsignalstrength:3,stat:[3,11],state:3,statement:8,static_fil:12,statvf:11,stderr:12,step:[0,2],still:8,stopeventdispatch:3,stoploc:3,stopsens:3,stoptrackingphonest:3,stoptrackingsignalstrength:3,store:3,str:3,stream:3,street:3,strength:3,string:[3,7,8,11],stringio:11,stringold:11,stringprep:11,strong:12,struct:[3,11],subject:3,subprocess:11,subscrib:3,subtyp:3,succeed:3,success:3,successfulli:3,suggest:[2,4],sunau:11,sunaudio:11,suppli:3,sure:7,swipe:9,symbol:11,symtabl:11,syntax:[9,10],sysconfig:11,syslog:11,tabnanni:11,tag:3,take:[3,12],takepictur:3,talk:0,tap:[8,9],tarfil:11,target:[3,12],targetpath:3,tasker:7,team:[0,2,9,12],technic:12,technolog:[2,3],telnetlib:11,temperatur:3,tempfil:11,templat:12,termin:1,termio:11,test:[0,2],testapp:12,tester:[0,2,4],text:[3,7,8,9,10,12],texttospeechfacad:2,textwrap:11,than:3,thei:[0,11],them:[3,8,9,11],thi:[0,3,4,5,7,8,9,11,12],thing:7,think:8,though:9,thread:[11,12],three:[6,8],threshold:3,through:[0,2,7,9,11,12],time:3,timeit:11,timeout:3,titl:[3,8,12],titlebar:12,toaiff:11,toggl:3,toggleairplanemod:3,togglebluetoothst:3,toggleringersilentmod:3,togglevibratemod:3,togglewifist:3,token:11,tone:3,tonedur:3,tonegeneratorfacad:2,tool:[0,2],toolbar:[8,9],top:[8,9],touch:12,trace:11,traceback:11,track:3,tragi:3,translat:[0,2],treat:8,tts:3,ttsisspeak:3,ttsspeak:3,tty:11,ttyusb0:3,tupl:3,twitter:0,two:[8,9],type:[3,6,9,11],typic:3,uifacad:2,uix:12,unavail:3,undo:9,unicodedata:11,unind:8,uninstal:9,uniqu:3,unittest:11,unknown:3,unless:9,unplug:3,unreadonli:3,unspecifi:3,until:3,updat:3,upgrad:0,upload:[9,10],upper:9,uri:3,url:[3,10,12],urllib2:11,urllib:11,urlpars:11,usag:9,usb:2,usbserialactiveconnect:3,usbserialconnect:3,usbserialdisconnect:3,usbserialgetdevicelist:3,usbserialgetdevicenam:3,usbserialhosten:3,usbserialread:3,usbserialreadbinari:3,usbserialreadreadi:3,usbserialwrit:3,usbserialwritebinari:3,use:[0,2,8],usedrop:9,userdict:11,userlist:11,usernam:8,userstr:11,usual:9,usualli:11,util:3,uuid:[3,11],valu:[3,8],variabl:8,variou:3,veri:[8,10,12],version:[0,3],via:3,videos:3,viewcontact:3,viewhtml:3,viewmap:3,visibl:3,voic:3,voltag:3,wai:[0,2,8,9],wait:3,waitforev:3,wake:3,wakelockacquirebright:3,wakelockacquiredim:3,wakelockacquireful:3,wakelockacquireparti:3,wakelockfacad:2,wakelockreleas:3,want:[0,2,3,4,5,7,8,9,12],warn:11,watch:7,wave:11,weakref:11,web:[12,14],webapp:2,webbrows:11,webcam:3,webcamadjustqu:3,webcamfacad:2,webcamstart:3,webserv:12,webviewshow:3,well:[6,8],were:[3,11],when:[3,7,8,9,10,12],whenev:3,where:[0,3,5],which:[3,4,6,7,8,9,10,11,12],whichdb:11,whish:12,whole:8,why:[2,8],widget:3,wifi:3,wifidisconnect:3,wififacad:2,wifigetconnectioninfo:3,wifigetscanresult:3,wifilockacquireful:3,wifilockacquirescanonli:3,wifilockreleas:3,wifireassoci:3,wifireconnect:3,wifistartscan:3,wiki:1,without:[9,12],wonder:8,work:[3,8],world:[0,2],worri:8,wow:8,write:[0,2,3,5],written:3,wrote:8,wsgiref:[11,12],wsgirequesthandl:12,xdrlib:11,xml:11,xmllib:11,xmlrpclib:11,year:3,yet:12,you:[0,1,2,3,4,5,7,8,9,10,11,12],your:[0,2,5],yourself:12,youself:4,youtub:[3,7],zipfil:11},titles:["Welcome to read the QPython guide!","FAQ","Getting started","AndroidFacade","Welcome contribute","Join the tester community","Android","QPython Open API","Writing “Hello World”","QPython: How To Start","Use the best way for developing","QPython built-in Libraries","QPython’s main features","QPython\u6587\u6863\u4f53\u7cfb\u8bf4\u660e","\u5feb\u901f\u5f00\u59cb","???\u067f?\u02bc","\u4e2d\u6587\u7528\u6237\u5411\u5bfc"],titleterms:{"3rd":11,"\u02bc":15,"\u067f":15,"\u4e2d\u6587\u7528\u6237\u5411\u5bfc":16,"\u5982\u4f55\u63d0\u4ea4\u6587\u6863":13,"\u5982\u4f55\u63d0\u4ea4\u7ffb\u8bd1":13,"\u5982\u4f55\u8d21\u732e":16,"\u5feb\u901f\u5f00\u59cb":14,"\u66f4\u591a\u94fe\u63a5":16,"\u6b22\u8fce":16,"\u7528\u6237\u5f00\u53d1\u7ec4":16,"\u7f16\u7a0b\u6307\u5357":14,"\u8d21\u732e\u8005\u6307\u5357":14,"\u8d77\u6b65":16,"new":0,"qpython\u6587\u6863\u4f53\u7cfb\u8bf4\u660e":13,"qpython\u9ed1\u5ba2\u6307\u5357":14,activityresultfacad:3,airplanermod:3,alert:3,android:6,androidfacad:3,androidhelp:11,api:[3,6,7,11],applic:7,applicationmanagerfacad:3,audio:3,author:3,barcod:3,batterymanagerfacad:3,becam:4,becom:5,best:10,bluetoothfacad:3,bright:3,brows:6,browser:10,built:[4,11],call:3,camerafacad:3,chines:0,choos:12,clipboard:3,commonintentsfacad:3,commun:[0,4,5,9],comput:10,consol:[6,9],contactsfacad:3,content:7,contribut:[0,4],contributor:2,control:3,core:6,dashboard:9,data:3,develop:[2,4,10],dia:3,dialog:3,document:4,dynload:11,editor:[6,9],enterpris:6,event:4,eventfacad:3,eyesfreefacad:3,facad:3,faq:1,featur:12,feedback:5,file:6,from:[7,10],ftp:6,geo:3,get:[2,3],getinput:3,getpassword:3,gui:0,guid:[0,2],hello:8,help:4,host:3,how:[4,9],inform:3,informat:3,intent:3,join:5,kivi:6,launch:4,layout:3,let:0,librari:[6,8,9,11],local:4,locat:3,locationfacad:3,main:12,manag:3,media:3,mediaplayerfacad:3,mediarecorderfacad:3,member:4,mode:3,more:8,networkstatu:3,nfc:3,notifi:3,now:0,online:7,open:7,organis:4,other:0,own:7,packagevers:3,phonefacad:3,phonestat:3,pip:6,preferencesfacad:3,program:[2,4,6,9],progress:3,project:4,provid:3,python:[6,11],qeditor:10,qpy:[6,7],qpyinterfacefacad:3,qpypi:7,qpython:[0,4,6,7,9,11,12,16],qrcode:6,qsl4a:6,quick:6,read:[0,3],reader:6,report:5,requir:3,ringer:3,run:7,sampl:8,screen:3,script:7,sendbroadcast:3,sendemail:3,sensormanagerfacad:3,serial:3,servic:[6,7],settingsfacad:3,share:[4,7],should:12,signalstrengthfacad:3,silent:3,sl4a:8,smsfacad:3,some:7,speechrecognitionfacad:3,sponsor:4,stardard:11,start:[2,3,9],startactiv:3,statu:3,stop:3,suggest:5,support:0,system:3,test:4,tester:5,texttospeechfacad:3,thank:0,toast:3,tonegeneratorfacad:3,tool:6,translat:4,uifacad:3,usb:3,use:10,user:[0,4],vibrat:3,video:3,view:3,volum:3,wai:10,wakelockfacad:3,webapp:6,webcamfacad:3,webview:3,welcom:[0,4],what:0,who:0,why:12,wififacad:3,world:8,write:8,your:[7,10]}}) \ No newline at end of file diff --git a/docs/static/1.png b/docs/static/1.png deleted file mode 100644 index a539f0e8..00000000 Binary files a/docs/static/1.png and /dev/null differ diff --git a/docs/static/2.png b/docs/static/2.png deleted file mode 100644 index dd65bc6c..00000000 Binary files a/docs/static/2.png and /dev/null differ diff --git a/docs/static/3.png b/docs/static/3.png deleted file mode 100644 index cb9bbea5..00000000 Binary files a/docs/static/3.png and /dev/null differ diff --git a/docs/static/ajax-loader.gif b/docs/static/ajax-loader.gif deleted file mode 100644 index 61faf8ca..00000000 Binary files a/docs/static/ajax-loader.gif and /dev/null differ diff --git a/docs/static/basic.css b/docs/static/basic.css deleted file mode 100644 index 2b513f0c..00000000 --- a/docs/static/basic.css +++ /dev/null @@ -1,604 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/static/bestpython.png b/docs/static/bestpython.png deleted file mode 100644 index 59940ff3..00000000 Binary files a/docs/static/bestpython.png and /dev/null differ diff --git a/docs/static/comment-bright.png b/docs/static/comment-bright.png deleted file mode 100644 index 551517b8..00000000 Binary files a/docs/static/comment-bright.png and /dev/null differ diff --git a/docs/static/comment-close.png b/docs/static/comment-close.png deleted file mode 100644 index 09b54be4..00000000 Binary files a/docs/static/comment-close.png and /dev/null differ diff --git a/docs/static/comment.png b/docs/static/comment.png deleted file mode 100644 index 92feb52b..00000000 Binary files a/docs/static/comment.png and /dev/null differ diff --git a/docs/static/doctools.js b/docs/static/doctools.js deleted file mode 100644 index 81634956..00000000 --- a/docs/static/doctools.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keyup(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); \ No newline at end of file diff --git a/docs/static/down-pressed.png b/docs/static/down-pressed.png deleted file mode 100644 index 7c30d004..00000000 Binary files a/docs/static/down-pressed.png and /dev/null differ diff --git a/docs/static/down.png b/docs/static/down.png deleted file mode 100644 index f48098a4..00000000 Binary files a/docs/static/down.png and /dev/null differ diff --git a/docs/static/file.png b/docs/static/file.png deleted file mode 100644 index 254c60bf..00000000 Binary files a/docs/static/file.png and /dev/null differ diff --git a/docs/static/guide_extend_pic1.png b/docs/static/guide_extend_pic1.png deleted file mode 100644 index fae7de0e..00000000 Binary files a/docs/static/guide_extend_pic1.png and /dev/null differ diff --git a/docs/static/guide_extend_pic2.png b/docs/static/guide_extend_pic2.png deleted file mode 100644 index bcff8648..00000000 Binary files a/docs/static/guide_extend_pic2.png and /dev/null differ diff --git a/docs/static/guide_helloworld_pic1.png b/docs/static/guide_helloworld_pic1.png deleted file mode 100644 index 712e9864..00000000 Binary files a/docs/static/guide_helloworld_pic1.png and /dev/null differ diff --git a/docs/static/guide_howtostart_pic1.png b/docs/static/guide_howtostart_pic1.png deleted file mode 100644 index 54c666a7..00000000 Binary files a/docs/static/guide_howtostart_pic1.png and /dev/null differ diff --git a/docs/static/guide_howtostart_pic2.png b/docs/static/guide_howtostart_pic2.png deleted file mode 100644 index 296a5150..00000000 Binary files a/docs/static/guide_howtostart_pic2.png and /dev/null differ diff --git a/docs/static/guide_howtostart_pic3.png b/docs/static/guide_howtostart_pic3.png deleted file mode 100644 index f7caf8c7..00000000 Binary files a/docs/static/guide_howtostart_pic3.png and /dev/null differ diff --git a/docs/static/guide_howtostart_pic4.png b/docs/static/guide_howtostart_pic4.png deleted file mode 100644 index 6d2b2fc3..00000000 Binary files a/docs/static/guide_howtostart_pic4.png and /dev/null differ diff --git a/docs/static/guide_howtostart_pic5.png b/docs/static/guide_howtostart_pic5.png deleted file mode 100644 index 9e30aed4..00000000 Binary files a/docs/static/guide_howtostart_pic5.png and /dev/null differ diff --git a/docs/static/guide_ide_qedit4web.png b/docs/static/guide_ide_qedit4web.png deleted file mode 100644 index 09f2ccb3..00000000 Binary files a/docs/static/guide_ide_qedit4web.png and /dev/null differ diff --git a/docs/static/guide_ide_qedit4web_choose.png b/docs/static/guide_ide_qedit4web_choose.png deleted file mode 100644 index 6f3edfd3..00000000 Binary files a/docs/static/guide_ide_qedit4web_choose.png and /dev/null differ diff --git a/docs/static/guide_ide_qedit4web_develop.png b/docs/static/guide_ide_qedit4web_develop.png deleted file mode 100644 index 0fde32ce..00000000 Binary files a/docs/static/guide_ide_qedit4web_develop.png and /dev/null differ diff --git a/docs/static/guide_program_pic1.png b/docs/static/guide_program_pic1.png deleted file mode 100644 index 4cdf975c..00000000 Binary files a/docs/static/guide_program_pic1.png and /dev/null differ diff --git a/docs/static/ic_appstore@2x.png b/docs/static/ic_appstore@2x.png deleted file mode 100644 index d70ade36..00000000 Binary files a/docs/static/ic_appstore@2x.png and /dev/null differ diff --git a/docs/static/ic_appstore_2x.png b/docs/static/ic_appstore_2x.png deleted file mode 100644 index 1582c40d..00000000 Binary files a/docs/static/ic_appstore_2x.png and /dev/null differ diff --git a/docs/static/ic_community@2x.png b/docs/static/ic_community@2x.png deleted file mode 100644 index 6984f28f..00000000 Binary files a/docs/static/ic_community@2x.png and /dev/null differ diff --git a/docs/static/ic_facebook.png b/docs/static/ic_facebook.png deleted file mode 100644 index 027c863e..00000000 Binary files a/docs/static/ic_facebook.png and /dev/null differ diff --git a/docs/static/ic_faq@2x.png b/docs/static/ic_faq@2x.png deleted file mode 100644 index 1f89df68..00000000 Binary files a/docs/static/ic_faq@2x.png and /dev/null differ diff --git a/docs/static/ic_googleplay@2x.png b/docs/static/ic_googleplay@2x.png deleted file mode 100644 index 3b46dd00..00000000 Binary files a/docs/static/ic_googleplay@2x.png and /dev/null differ diff --git a/docs/static/ic_googleplay_2x.png b/docs/static/ic_googleplay_2x.png deleted file mode 100644 index 1e62373c..00000000 Binary files a/docs/static/ic_googleplay_2x.png and /dev/null differ diff --git a/docs/static/ic_googleplay_3_2x.png b/docs/static/ic_googleplay_3_2x.png deleted file mode 100644 index c5086adf..00000000 Binary files a/docs/static/ic_googleplay_3_2x.png and /dev/null differ diff --git a/docs/static/ic_new@2x.png b/docs/static/ic_new@2x.png deleted file mode 100644 index 215bb040..00000000 Binary files a/docs/static/ic_new@2x.png and /dev/null differ diff --git a/docs/static/ic_search.png b/docs/static/ic_search.png deleted file mode 100644 index 0b6623ad..00000000 Binary files a/docs/static/ic_search.png and /dev/null differ diff --git a/docs/static/ic_support@2x.png b/docs/static/ic_support@2x.png deleted file mode 100644 index c06804c9..00000000 Binary files a/docs/static/ic_support@2x.png and /dev/null differ diff --git a/docs/static/ic_twitter.png b/docs/static/ic_twitter.png deleted file mode 100644 index 8dcf2eeb..00000000 Binary files a/docs/static/ic_twitter.png and /dev/null differ diff --git a/docs/static/img_background.png b/docs/static/img_background.png deleted file mode 100644 index f2009093..00000000 Binary files a/docs/static/img_background.png and /dev/null differ diff --git a/docs/static/img_banner-1.jpg b/docs/static/img_banner-1.jpg deleted file mode 100644 index 35179f4e..00000000 Binary files a/docs/static/img_banner-1.jpg and /dev/null differ diff --git a/docs/static/img_banner-1.png b/docs/static/img_banner-1.png deleted file mode 100644 index 1be1cf32..00000000 Binary files a/docs/static/img_banner-1.png and /dev/null differ diff --git a/docs/static/img_banner-1@2x.jpg b/docs/static/img_banner-1@2x.jpg deleted file mode 100644 index e17b703a..00000000 Binary files a/docs/static/img_banner-1@2x.jpg and /dev/null differ diff --git a/docs/static/img_banner-1@2x.png b/docs/static/img_banner-1@2x.png deleted file mode 100644 index 0942fe79..00000000 Binary files a/docs/static/img_banner-1@2x.png and /dev/null differ diff --git a/docs/static/img_logo.png b/docs/static/img_logo.png deleted file mode 100644 index 1fdedce6..00000000 Binary files a/docs/static/img_logo.png and /dev/null differ diff --git a/docs/static/jquery-1.11.1.js b/docs/static/jquery-1.11.1.js deleted file mode 100644 index d4b67f7e..00000000 --- a/docs/static/jquery-1.11.1.js +++ /dev/null @@ -1,10308 +0,0 @@ -/*! - * jQuery JavaScript Library v1.11.1 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-05-01T17:42Z - */ - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var deletedIds = []; - -var slice = deletedIds.slice; - -var concat = deletedIds.concat; - -var push = deletedIds.push; - -var indexOf = deletedIds.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - version = "1.11.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1, IE<9 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: deletedIds.sort, - splice: deletedIds.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( support.ownLast ) { - for ( key in obj ) { - return hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( indexOf ) { - return indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - while ( j < len ) { - first[ i++ ] = second[ j++ ]; - } - - // Support: IE<9 - // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) - if ( len !== len ) { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: function() { - return +( new Date() ); - }, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v1.10.19 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-04-18 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
"; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowclip^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - - } else if ( !(--remaining) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * Clean-up method for dom ready events - */ -function detach() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } -} - -/** - * The ready event handler and self cleanup method - */ -function completed() { - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - - -var strundefined = typeof undefined; - - - -// Support: IE<9 -// Iteration over object's inherited properties before its own -var i; -for ( i in jQuery( support ) ) { - break; -} -support.ownLast = i !== "0"; - -// Note: most support tests are defined in their respective modules. -// false until the test is run -support.inlineBlockNeedsLayout = false; - -// Execute ASAP in case we need to set body.style.zoom -jQuery(function() { - // Minified: var a,b,c,d - var val, div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - // Return for frameset docs that don't have a body - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - if ( typeof div.style.zoom !== strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); -}); - - - - -(function() { - var div = document.createElement( "div" ); - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( elem ) { - var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], - nodeType = +elem.nodeType || 1; - - // Do not set data on non-element DOM nodes because it will not be cleared (#8335). - return nodeType !== 1 && nodeType !== 9 ? - false : - - // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute("classid") === noData; -}; - - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - -function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements (space-suffixed to avoid Object.prototype collisions) - // throw uncatchable exceptions if you attempt to set expando properties - noData: { - "applet ": true, - "embed ": true, - // ...but Flash objects (which have this classid) *can* handle expandos - "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[0], - attrs = elem && elem.attributes; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; -}; -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); - - // Setup - div.innerHTML = "
a"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName( "tbody" ).length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = - document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - input.type = "checkbox"; - input.checked = true; - fragment.appendChild( input ); - support.appendChecked = input.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE6-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // #11217 - WebKit loses check when the name is after the checked attribute - fragment.appendChild( div ); - div.innerHTML = ""; - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } -})(); - - -(function() { - var i, eventName, - div = document.createElement( "div" ); - - // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) - for ( i in { submit: true, change: true, focusin: true }) { - eventName = "on" + i; - - if ( !(support[ i + "Bubbles" ] = eventName in window) ) { - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - div.setAttribute( eventName, "t" ); - support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: IE < 9, Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - jQuery._removeData( doc, fix ); - } else { - jQuery._data( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!support.noCloneEvent || !support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - deletedIds.push( id ); - } - } - } - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "