20 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cytoscape.js-tutorials",
3 | "version": "1.0.0",
4 | "description": "Tutorials for Cytoscape.js",
5 | "main": "twitter_api/main.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/cytoscape/cytoscape.js-tutorials.git"
12 | },
13 | "author": "Joseph Stahl",
14 | "license": "ISC",
15 | "bugs": {
16 | "url": "https://github.com/cytoscape/cytoscape.js-tutorials/issues"
17 | },
18 | "homepage": "https://github.com/cytoscape/cytoscape.js-tutorials#readme",
19 | "devDependencies": {
20 | "eslint": "^3.2.2",
21 | "eslint-config-google": "^0.6.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/getting-started/temp.js:
--------------------------------------------------------------------------------
1 | elements: [
2 | // nodes
3 | { data: { id: 'a' } },
4 | { data: { id: 'b' } },
5 | { data: { id: 'c' } },
6 | { data: { id: 'd' } },
7 | { data: { id: 'e' } },
8 | { data: { id: 'f' } },
9 | // edges
10 | {
11 | data: {
12 | id: 'ab',
13 | source: 'a',
14 | target: 'b'
15 | }
16 | },
17 | {
18 | data: {
19 | id: 'cd',
20 | source: 'c',
21 | target: 'd'
22 | }
23 | },
24 | {
25 | data: {
26 | id: 'ef',
27 | source: 'e',
28 | target: 'f'
29 | }
30 | },
31 | {
32 | data: {
33 | id: 'ac',
34 | source: 'a',
35 | target: 'd'
36 | }
37 | },
38 | {
39 | data: {
40 | id: 'be',
41 | source: 'b',
42 | target: 'e'
43 | }
44 | }
45 | ]
--------------------------------------------------------------------------------
/electron_twitter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "twitter-electron",
3 | "version": "0.1.0",
4 | "main": "main.js",
5 | "dependencies": {
6 | "bluebird": "^3.4.1",
7 | "cytoscape": "^2.7.7",
8 | "cytoscape-qtip": "^2.4.0",
9 | "eslint": "^3.2.2",
10 | "jquery": "^2.2.4",
11 | "mkdirp": "^0.5.1",
12 | "qtip2": "^2.2.0",
13 | "twit": "^2.2.4"
14 | },
15 | "devDependencies": {
16 | "electron-packager": "^7.5.1",
17 | "electron-prebuilt": "^1.2.8",
18 | "eslint": "^3.1.1",
19 | "eslint-config-google": "^0.6.0"
20 | },
21 | "scripts": {
22 | "start": "electron .",
23 | "build-win": "electron-packager . --platform=win32 --arch=x64 --out=out/ --ignore=api_key.json",
24 | "build-mac": "electron-packager . --platform=darwin --arch=x64 --out=out/ --ignore=api_key.json"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/cordovacy/.gitignore:
--------------------------------------------------------------------------------
1 | # ANDROID / ECLIPSE
2 |
3 | # built application files
4 | *.apk
5 | *.ap_
6 |
7 | # files for the dex VM
8 | *.dex
9 |
10 | # Java class files
11 | *.class
12 |
13 | # generated files - android project subfolder
14 | Android/bin/
15 | Android/gen/
16 | Android/assets/
17 |
18 | # generated files
19 | bin/
20 | gen/
21 |
22 | # Local configuration file (sdk path, etc)
23 | local.properties
24 |
25 | # IOS / Xcode
26 | build/*
27 | *.pbxuser
28 | !default.pbxuser
29 | *.mode1v3
30 | !default.mode1v3
31 | *.mode2v3
32 | !default.mode2v3
33 | *.perspectivev3
34 | !default.perspectivev3
35 | *.xcworkspace
36 | !default.xcworkspace
37 | xcuserdata
38 | profile
39 | *.moved-aside
40 | IOS/www/
41 |
42 | # OSX
43 | .DS_Store
44 |
45 | # Thumbnails
46 | ._*
47 |
48 | # Files that might appear on external disk
49 | .Spotlight-V100
50 | .Trashes
--------------------------------------------------------------------------------
/getting-started/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tutorial 1: Getting Started
8 |
9 |
10 |
11 |
20 |
21 |
22 |
23 |
38 |
39 |
--------------------------------------------------------------------------------
/twitter_graph/TODO.md:
--------------------------------------------------------------------------------
1 | # TODO
2 |
3 | # NOTES
4 | - Or look at using Heroku for using API with JS. But start with static data and write program for downloading data later.
5 | - "Centrality" measurement for the graph. Or degree. Mapper for size of node based on degree. Degree is a cy function. Try color or border to correlate with number of tweets.
6 | - Feature set: emphasize layout. At least two layout options for user to choose:
7 | - Concentric (circle) AND physics simulation (force directed like cose or cola)
8 | - Look at Qtip extension for putting in additional statistics about nodes/ edges. Ex: link to their twitter profile.
9 |
10 | # QUESTIONS
11 | - In my tutorial I'm currently leaving in some error handling code (relating to HTTP status codes) but not spending much time explaining the details (because errors shouldn't occur on cached data). Should I keep this or remove it?
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CordovaCy
4 |
5 | A sample Apache Cordova application that responds to the deviceready event.
6 |
7 |
8 | Joseph Stahl for GSoC 2016
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/glycolysis/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tutorial 2: Glycolysis
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/www/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CordovaCy
4 |
5 | A sample Apache Cordova application that responds to the deviceready event.
6 |
7 |
8 | Joseph Stahl for GSoC 2016
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/android.json:
--------------------------------------------------------------------------------
1 | {
2 | "prepare_queue": {
3 | "installed": [],
4 | "uninstalled": []
5 | },
6 | "config_munge": {
7 | "files": {
8 | "res/xml/config.xml": {
9 | "parents": {
10 | "/*": [
11 | {
12 | "xml": "",
13 | "count": 1
14 | }
15 | ]
16 | }
17 | }
18 | }
19 | },
20 | "installed_plugins": {
21 | "cordova-plugin-whitelist": {
22 | "PACKAGE_NAME": "com.josephstahl.cordovacy"
23 | }
24 | },
25 | "dependent_plugins": {},
26 | "modules": [],
27 | "plugin_metadata": {
28 | "cordova-plugin-whitelist": "1.2.2"
29 | }
30 | }
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/lib/check_reqs.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | //add methods as we determine what are the requirements
23 |
24 | var Q = require('q');
25 |
26 | module.exports.run = function() {
27 | return Q.resolve();
28 | };
29 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/version:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | // Coho updates this line:
23 | var VERSION = "4.1.0";
24 |
25 | console.log(VERSION);
26 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/res/xml/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | CordovaCy
8 |
9 | A sample Apache Cordova application that responds to the deviceready event.
10 |
11 |
12 | Apache Cordova Team
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/log.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0log"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'log' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/run.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0run"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/build.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0build"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/clean.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0clean"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/run.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0run"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/build.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0build"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/version.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0version"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/version.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0version"
20 | IF EXIST %script_path% (
21 | node %script_path% %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/check_reqs.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0check_reqs"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/version:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | // Coho updates this line:
23 | var VERSION = "5.2.1";
24 |
25 | module.exports.version = VERSION;
26 |
27 | if (!module.parent) {
28 | console.log(VERSION);
29 | }
30 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/list-devices.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0list-devices"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'list-devices' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/install-device.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0install-device"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'install-device' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/start-emulator.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0start-emulator"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'start-emulator' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/install-emulator.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0install-emulator"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'install-emulator' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/hooks/Readme.md:
--------------------------------------------------------------------------------
1 |
21 | # Cordova Hooks
22 |
23 | Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide.
24 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/list-emulator-images.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0list-emulator-images"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'list-emulator-images' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/list-started-emulators.bat:
--------------------------------------------------------------------------------
1 | :: Licensed to the Apache Software Foundation (ASF) under one
2 | :: or more contributor license agreements. See the NOTICE file
3 | :: distributed with this work for additional information
4 | :: regarding copyright ownership. The ASF licenses this file
5 | :: to you under the Apache License, Version 2.0 (the
6 | :: "License"); you may not use this file except in compliance
7 | :: with the License. You may obtain a copy of the License at
8 | ::
9 | :: http://www.apache.org/licenses/LICENSE-2.0
10 | ::
11 | :: Unless required by applicable law or agreed to in writing,
12 | :: software distributed under the License is distributed on an
13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | :: KIND, either express or implied. See the License for the
15 | :: specific language governing permissions and limitations
16 | :: under the License.
17 |
18 | @ECHO OFF
19 | SET script_path="%~dp0list-started-emulators"
20 | IF EXIST %script_path% (
21 | node "%script_path%" %*
22 | ) ELSE (
23 | ECHO.
24 | ECHO ERROR: Could not find 'list-started-emulators' script in 'cordova\lib' folder, aborting...>&2
25 | EXIT /B 1
26 | )
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/android_sdk_version:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var android_sdk_version = require('./lib/android_sdk_version');
23 |
24 | android_sdk_version.run().done(null, function(err) {
25 | console.log(err);
26 | process.exit(2);
27 | });
28 |
29 |
30 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/cordovacy/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CordovaCy
4 |
5 | A sample Apache Cordova application that responds to the deviceready event.
6 |
7 |
8 | Joseph Stahl for GSoC 2016
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/build/intermediates/bundles/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/build/intermediates/bundles/debug/aapt/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/check_reqs:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var check_reqs = require('./lib/check_reqs');
23 |
24 | check_reqs.run().done(
25 | function success() {
26 | console.log('Looks like your environment fully supports cordova-android development!');
27 | }, function fail(err) {
28 | console.log(err);
29 | process.exit(2);
30 | }
31 | );
32 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/build/intermediates/incremental/packageDebugResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/cordovacy/WWW/css/index.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | html, body {
21 | height: 100%;
22 | }
23 |
24 | #deviceready {
25 | height: 100%;
26 | width: 100%;
27 | }
28 |
29 | .container {
30 | display: flex;
31 | flex-flow: column;
32 | height: 100%;
33 | }
34 |
35 | #deviceready {
36 | position: absolute;
37 | left: 0;
38 | top: 50%;
39 | width: 100%;
40 | text-align: center;
41 | margin-top: -0.5em;
42 | font-size: 2em;
43 | color: #fff;
44 | }
45 |
46 | #cy {
47 | flex: 1 1 auto;
48 | }
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package org.apache.cordova;
21 |
22 | public interface ICordovaCookieManager {
23 |
24 | public void setCookiesEnabled(boolean accept);
25 |
26 | public void setCookie(final String url, final String value);
27 |
28 | public String getCookie(final String url);
29 |
30 | public void clearCookies();
31 |
32 | public void flush();
33 | };
34 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/build:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 |
23 | var build = require('./lib/build'),
24 | args = process.argv;
25 |
26 | // provide help
27 | if ( args[2] == '--help' || args[2] == '/?' || args[2] == '-h' || args[2] == '/h' ||
28 | args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
29 | build.help();
30 | process.exit(0);
31 | } else {
32 |
33 | build.run();
34 | }
35 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/www/css/index.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | html, body {
21 | height: 100%;
22 | }
23 |
24 | #deviceready {
25 | height: 100%;
26 | width: 100%;
27 | }
28 |
29 | .container {
30 | display: flex;
31 | flex-flow: column;
32 | height: 100%;
33 | }
34 |
35 | #deviceready {
36 | position: absolute;
37 | left: 0;
38 | top: 50%;
39 | width: 100%;
40 | text-align: center;
41 | margin-top: -0.5em;
42 | font-size: 2em;
43 | color: #fff;
44 | }
45 |
46 | #cy {
47 | flex: 1 1 auto;
48 | }
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/log:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var log = require('./lib/log'),
23 | reqs = require('./lib/check_reqs'),
24 | args = process.argv;
25 |
26 | // Usage support for when args are given
27 | if(args.length > 2) {
28 | log.help();
29 | } else {
30 | reqs.run().done(function() {
31 | return log.run();
32 | }, function(err) {
33 | console.error('ERROR: ' + err);
34 | process.exit(2);
35 | });
36 | }
37 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/src/com/josephstahl/cordovacy/MainActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package com.josephstahl.cordovacy;
21 |
22 | import android.os.Bundle;
23 | import org.apache.cordova.*;
24 |
25 | public class MainActivity extends CordovaActivity
26 | {
27 | @Override
28 | public void onCreate(Bundle savedInstanceState)
29 | {
30 | super.onCreate(savedInstanceState);
31 | // Set by in config.xml
32 | loadUrl(launchUrl);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/list-devices:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var devices = require('./device');
23 |
24 | // Usage support for when args are given
25 | require('../lib/check_reqs').check_android().then(function() {
26 | devices.list().done(function(device_list) {
27 | device_list && device_list.forEach(function(dev) {
28 | console.log(dev);
29 | });
30 | }, function(err) {
31 | console.error('ERROR: ' + err);
32 | process.exit(2);
33 | });
34 | });
35 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/list-started-emulators:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulators = require('./emulator');
23 |
24 | // Usage support for when args are given
25 | require('../lib/check_reqs').check_android().then(function() {
26 | emulators.list_started().done(function(emulator_list) {
27 | emulator_list && emulator_list.forEach(function(emu) {
28 | console.log(emu);
29 | });
30 | }, function(err) {
31 | console.error('ERROR: ' + err);
32 | process.exit(2);
33 | });
34 | });
35 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/list-emulator-images:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulators = require('./emulator');
23 |
24 | // Usage support for when args are given
25 | require('../lib/check_reqs').check_android().then(function() {
26 | emulators.list_images().done(function(emulator_list) {
27 | emulator_list && emulator_list.forEach(function(emu) {
28 | console.log(emu.name);
29 | });
30 | }, function(err) {
31 | console.error('ERROR: ' + err);
32 | process.exit(2);
33 | });
34 | });
35 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
22 | */
23 |
24 | var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
25 | var currentApi = nativeApi;
26 |
27 | module.exports = {
28 | get: function() { return currentApi; },
29 | setPreferPrompt: function(value) {
30 | currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
31 | },
32 | // Used only by tests.
33 | set: function(value) {
34 | currentApi = value;
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/platform_www/cordova-js-src/android/nativeapiprovider.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
22 | */
23 |
24 | var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
25 | var currentApi = nativeApi;
26 |
27 | module.exports = {
28 | get: function() { return currentApi; },
29 | setPreferPrompt: function(value) {
30 | currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
31 | },
32 | // Used only by tests.
33 | set: function(value) {
34 | currentApi = value;
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/assets/www/css/index.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | #deviceready {
21 | height: 100%;
22 | width: 100%;
23 | }
24 |
25 | .app {
26 | position: absolute;
27 | left: 0%;
28 | top: 0%;
29 | height: 100%;
30 | width: 100%;
31 | }
32 |
33 | .event {
34 | color:#000000;
35 | }
36 |
37 | #loading {
38 | position: absolute;
39 | left: 0;
40 | top: 50%;
41 | width: 100%;
42 | text-align: center;
43 | margin-top: -0.5em;
44 | font-size: 2em;
45 | color: #fff;
46 | }
47 |
48 | .event.listening {
49 | display:block;
50 | }
51 |
52 | .event.received {
53 | display:none;
54 | }
55 |
56 | #cy {
57 | height: 100%;
58 | width: 100%;
59 | }
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/clean:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 |
23 | var path = require('path'),
24 | clean = require('./lib/clean'),
25 | reqs = require('./lib/check_reqs'),
26 | args = process.argv;
27 |
28 | // Support basic help commands
29 | if ( args.length > 2
30 | || args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
31 | args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
32 | console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'clean')) );
33 | process.exit(0);
34 | } else {
35 | clean.cleanProject();
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/install-emulator:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulator = require('./emulator'),
23 | args = process.argv;
24 |
25 | var install_target;
26 | if(args.length > 2) {
27 | if (args[2].substring(0, 9) == '--target=') {
28 | install_target = args[2].substring(9, args[2].length);
29 | } else {
30 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
31 | process.exit(2);
32 | }
33 | }
34 |
35 | emulator.install(install_target).done(null, function(err) {
36 | console.error('ERROR: ' + err);
37 | process.exit(2);
38 | });
39 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/start-emulator:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var emulator = require('./emulator'),
23 | args = process.argv;
24 |
25 | var install_target;
26 | if(args.length > 2) {
27 | if (args[2].substring(0, 9) == '--target=') {
28 | install_target = args[2].substring(9, args[2].length);
29 | } else {
30 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
31 | process.exit(2);
32 | }
33 | }
34 |
35 | emulator.start(install_target).done(null, function(err) {
36 | console.error('ERROR: ' + err);
37 | process.exit(2);
38 | });
39 |
40 |
--------------------------------------------------------------------------------
/electron_twitter/ui.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Tutorial 4
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
Tutorial 4
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package org.apache.cordova;
21 |
22 | import org.json.JSONException;
23 |
24 | /*
25 | * Any exposed Javascript API MUST implement these three things!
26 | */
27 | public interface ExposedJsApi {
28 | public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException;
29 | public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException;
30 | public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException;
31 | }
32 |
--------------------------------------------------------------------------------
/cordovacy/plugins/cordova-plugin-whitelist/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
21 |
22 | # Contributing to Apache Cordova
23 |
24 | Anyone can contribute to Cordova. And we need your contributions.
25 |
26 | There are multiple ways to contribute: report bugs, improve the docs, and
27 | contribute code.
28 |
29 | For instructions on this, start with the
30 | [contribution overview](http://cordova.apache.org/contribute/).
31 |
32 | The details are explained there, but the important items are:
33 | - Sign and submit an Apache ICLA (Contributor License Agreement).
34 | - Have a Jira issue open that corresponds to your contribution.
35 | - Run the tests so your patch doesn't break existing functionality.
36 |
37 | We look forward to your contributions!
38 |
--------------------------------------------------------------------------------
/electron_twitter/main.js:
--------------------------------------------------------------------------------
1 | var electron = require('electron');
2 | // Module to control application life.
3 | var app = electron.app;
4 | // Module to create native browser window.
5 | var BrowserWindow = electron.BrowserWindow;
6 |
7 |
8 | // Keep a global reference of the window object, if you don't, the window will
9 | // be closed automatically when the JavaScript object is garbage collected.
10 | let win;
11 |
12 | function createWindow() {
13 | // Create the browser window.
14 | win = new BrowserWindow({ width: 800, height: 600 });
15 |
16 | // and load the graph screen
17 | win.loadURL(`file://${__dirname}/index.html`);
18 |
19 | win.on('closed', () => {
20 | win = null;
21 | });
22 | }
23 |
24 | // This method will be called when Electron has finished
25 | // initialization and is ready to create browser windows.
26 | // Some APIs can only be used after this event occurs.
27 | app.on('ready', createWindow);
28 |
29 | // Quit when all windows are closed.
30 | app.on('window-all-closed', () => {
31 | // On macOS it is common for applications and their menu bar
32 | // to stay active until the user quits explicitly with Cmd + Q
33 | if (process.platform !== 'darwin') {
34 | app.quit();
35 | }
36 | });
37 |
38 | app.on('activate', () => {
39 | // On macOS it's common to re-create a window in the app when the
40 | // dock icon is clicked and there are no other windows open.
41 | if (win === null) {
42 | createWindow();
43 | }
44 | });
45 |
46 | // In this file you can include the rest of your app's specific main process
47 | // code. You can also put them in separate files and require them here.
48 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
22 | * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
23 | */
24 |
25 | module.exports = {
26 | exec: function(bridgeSecret, service, action, callbackId, argsJson) {
27 | return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
28 | },
29 | setNativeToJsBridgeMode: function(bridgeSecret, value) {
30 | prompt(value, 'gap_bridge_mode:' + bridgeSecret);
31 | },
32 | retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
33 | return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | /**
22 | * Specifies interface for HTTP auth handler object which is used to handle auth requests and
23 | * specifying user credentials.
24 | */
25 | public interface ICordovaHttpAuthHandler {
26 | /**
27 | * Instructs the WebView to cancel the authentication request.
28 | */
29 | public void cancel ();
30 |
31 | /**
32 | * Instructs the WebView to proceed with the authentication with the given credentials.
33 | *
34 | * @param username The user name
35 | * @param password The password
36 | */
37 | public void proceed (String username, String password);
38 | }
--------------------------------------------------------------------------------
/cordovacy/platforms/android/platform_www/cordova-js-src/android/promptbasednativeapi.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
22 | * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
23 | */
24 |
25 | module.exports = {
26 | exec: function(bridgeSecret, service, action, callbackId, argsJson) {
27 | return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
28 | },
29 | setNativeToJsBridgeMode: function(bridgeSecret, value) {
30 | prompt(value, 'gap_bridge_mode:' + bridgeSecret);
31 | },
32 | retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
33 | return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/getting-started/index-addingNodes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tutorial 1: Getting Started
8 |
9 |
10 |
11 |
20 |
21 |
22 |
23 |
64 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/install-device:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var device = require('./device'),
23 | args = process.argv;
24 |
25 | if(args.length > 2) {
26 | var install_target;
27 | if (args[2].substring(0, 9) == '--target=') {
28 | install_target = args[2].substring(9, args[2].length);
29 | device.install(install_target).done(null, function(err) {
30 | console.error('ERROR: ' + err);
31 | process.exit(2);
32 | });
33 | } else {
34 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
35 | process.exit(2);
36 | }
37 | } else {
38 | device.install().done(null, function(err) {
39 | console.error('ERROR: ' + err);
40 | process.exit(2);
41 | });
42 | }
43 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/lib/clean.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | var fs = require('fs'),
23 | shjs = require('shelljs'),
24 | path = require('path'),
25 | check_reqs = require('./check_reqs'),
26 | platformBuildDir = path.join('platforms', 'browser', 'build');
27 |
28 | exports.cleanProject = function(){
29 |
30 | // Check that requirements are (stil) met
31 | if (!check_reqs.run()) {
32 | console.error('Please make sure you meet the software requirements in order to clean an browser cordova project');
33 | process.exit(2);
34 | }
35 |
36 | console.log('Cleaning Browser project');
37 | try {
38 | if (fs.existsSync(platformBuildDir)) {
39 | shjs.rm('-r', platformBuildDir);
40 | }
41 | }
42 | catch(err) {
43 | console.log('could not remove '+platformBuildDir+' : '+err.message);
44 | }
45 | };
46 |
47 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/www/platform.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | *
20 | */
21 |
22 | module.exports = {
23 | id: 'browser',
24 | cordovaVersion: '3.4.0',
25 |
26 | bootstrap: function() {
27 |
28 | var modulemapper = require('cordova/modulemapper');
29 | var channel = require('cordova/channel');
30 |
31 | modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
32 |
33 | channel.onNativeReady.fire();
34 |
35 | // FIXME is this the right place to clobber pause/resume? I am guessing not
36 | // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
37 | document.addEventListener('webkitvisibilitychange', function() {
38 | if (document.webkitHidden) {
39 | channel.onPause.fire();
40 | }
41 | else {
42 | channel.onResume.fire();
43 | }
44 | }, false);
45 |
46 | // End of bootstrap
47 | }
48 | };
49 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/platform_www/platform.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | *
20 | */
21 |
22 | module.exports = {
23 | id: 'browser',
24 | cordovaVersion: '3.4.0',
25 |
26 | bootstrap: function() {
27 |
28 | var modulemapper = require('cordova/modulemapper');
29 | var channel = require('cordova/channel');
30 |
31 | modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
32 |
33 | channel.onNativeReady.fire();
34 |
35 | // FIXME is this the right place to clobber pause/resume? I am guessing not
36 | // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
37 | document.addEventListener('webkitvisibilitychange', function() {
38 | if (document.webkitHidden) {
39 | channel.onPause.fire();
40 | }
41 | else {
42 | channel.onResume.fire();
43 | }
44 | }, false);
45 |
46 | // End of bootstrap
47 | }
48 | };
49 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/www/cordova-js-src/platform.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | *
20 | */
21 |
22 | module.exports = {
23 | id: 'browser',
24 | cordovaVersion: '3.4.0',
25 |
26 | bootstrap: function() {
27 |
28 | var modulemapper = require('cordova/modulemapper');
29 | var channel = require('cordova/channel');
30 |
31 | modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
32 |
33 | channel.onNativeReady.fire();
34 |
35 | // FIXME is this the right place to clobber pause/resume? I am guessing not
36 | // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
37 | document.addEventListener('webkitvisibilitychange', function() {
38 | if (document.webkitHidden) {
39 | channel.onPause.fire();
40 | }
41 | else {
42 | channel.onResume.fire();
43 | }
44 | }, false);
45 |
46 | // End of bootstrap
47 | }
48 | };
49 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/platform_www/cordova-js-src/platform.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | *
20 | */
21 |
22 | module.exports = {
23 | id: 'browser',
24 | cordovaVersion: '3.4.0',
25 |
26 | bootstrap: function() {
27 |
28 | var modulemapper = require('cordova/modulemapper');
29 | var channel = require('cordova/channel');
30 |
31 | modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
32 |
33 | channel.onNativeReady.fire();
34 |
35 | // FIXME is this the right place to clobber pause/resume? I am guessing not
36 | // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
37 | document.addEventListener('webkitvisibilitychange', function() {
38 | if (document.webkitHidden) {
39 | channel.onPause.fire();
40 | }
41 | else {
42 | channel.onResume.fire();
43 | }
44 | }, false);
45 |
46 | // End of bootstrap
47 | }
48 | };
49 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/build:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var args = process.argv;
23 | var Api = require('./Api');
24 | var nopt = require('nopt');
25 | var path = require('path');
26 |
27 | // Support basic help commands
28 | if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0)
29 | require('./lib/build').help();
30 |
31 | // Do some basic argument parsing
32 | var buildOpts = nopt({
33 | 'verbose' : Boolean,
34 | 'silent' : Boolean,
35 | 'debug' : Boolean,
36 | 'release' : Boolean,
37 | 'nobuild': Boolean,
38 | 'buildConfig' : path
39 | }, { 'd' : '--verbose' });
40 |
41 | // Make buildOptions compatible with PlatformApi build method spec
42 | buildOpts.argv = buildOpts.argv.original;
43 |
44 | require('./loggingHelper').adjustLoggerLevel(buildOpts);
45 |
46 | new Api().build(buildOpts)
47 | .catch(function(err) {
48 | console.error(err.stack);
49 | process.exit(2);
50 | });
51 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/clean:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var Api = require('./Api');
23 | var path = require('path');
24 | var nopt = require('nopt');
25 |
26 | // Support basic help commands
27 | if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
28 | console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]));
29 | console.log('Cleans the project directory.');
30 | process.exit(0);
31 | }
32 |
33 | // Do some basic argument parsing
34 | var opts = nopt({
35 | 'verbose' : Boolean,
36 | 'silent' : Boolean
37 | }, { 'd' : '--verbose' });
38 |
39 | // Make buildOptions compatible with PlatformApi clean method spec
40 | opts.argv = opts.argv.original;
41 |
42 | // Skip cleaning prepared files when not invoking via cordova CLI.
43 | opts.noPrepare = true;
44 |
45 | require('./loggingHelper').adjustLoggerLevel(opts);
46 |
47 | new Api().clean(opts)
48 | .catch(function(err) {
49 | console.error(err.stack);
50 | process.exit(2);
51 | });
52 |
--------------------------------------------------------------------------------
/twitterAPI_express/app.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var path = require('path');
3 | var favicon = require('serve-favicon');
4 | var logger = require('morgan');
5 | var cookieParser = require('cookie-parser');
6 | var bodyParser = require('body-parser');
7 |
8 | var routes = require('./routes/index');
9 | var twitter = require('./routes/twitter');
10 |
11 | var app = express();
12 |
13 | // view engine setup
14 | app.set('views', path.join(__dirname, 'views'));
15 | app.set('view engine', 'jade');
16 |
17 | // uncomment after placing your favicon in /public
18 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
19 | app.use(logger('dev'));
20 | app.use(bodyParser.json());
21 | app.use(bodyParser.urlencoded({ extended: false }));
22 | app.use(cookieParser());
23 | app.use(express.static(path.join(__dirname, 'public')));
24 |
25 | app.use(function(req, res, next) {
26 | res.header("Access-Control-Allow-Origin", "*");
27 | res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
28 | next();
29 | });
30 |
31 | app.use('/', routes);
32 | app.use('/twitter', twitter);
33 |
34 | // catch 404 and forward to error handler
35 | app.use(function(req, res, next) {
36 | var err = new Error('Not Found');
37 | err.status = 404;
38 | next(err);
39 | });
40 |
41 | // error handlers
42 |
43 | // development error handler
44 | // will print stacktrace
45 | if (app.get('env') === 'development') {
46 | app.use(function(err, req, res, next) {
47 | res.status(err.status || 500);
48 | res.render('error', {
49 | message: err.message,
50 | error: err
51 | });
52 | });
53 | }
54 |
55 | // production error handler
56 | // no stacktraces leaked to user
57 | app.use(function(err, req, res, next) {
58 | res.status(err.status || 500);
59 | res.render('error', {
60 | message: err.message,
61 | error: {}
62 | });
63 | });
64 |
65 |
66 | module.exports = app;
67 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/run:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var Api = require('./Api');
23 | var nopt = require('nopt');
24 | var path = require('path');
25 |
26 | // Support basic help commands
27 | if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0)
28 | require('./lib/run').help();
29 |
30 | // Do some basic argument parsing
31 | var runOpts = nopt({
32 | 'verbose' : Boolean,
33 | 'silent' : Boolean,
34 | 'debug' : Boolean,
35 | 'release' : Boolean,
36 | 'nobuild': Boolean,
37 | 'buildConfig' : path,
38 | 'archs' : String,
39 | 'device' : Boolean,
40 | 'emulator': Boolean,
41 | 'target' : String
42 | }, { 'd' : '--verbose' });
43 |
44 | // Make runOptions compatible with PlatformApi run method spec
45 | runOpts.argv = runOpts.argv.remain;
46 |
47 | require('./loggingHelper').adjustLoggerLevel(runOpts);
48 |
49 | new Api().run(runOpts)
50 | .catch(function(err) {
51 | console.error(err, err.stack);
52 | process.exit(2);
53 | });
54 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import android.webkit.HttpAuthHandler;
22 |
23 | /**
24 | * Specifies interface for HTTP auth handler object which is used to handle auth requests and
25 | * specifying user credentials.
26 | */
27 | public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler {
28 |
29 | private final HttpAuthHandler handler;
30 |
31 | public CordovaHttpAuthHandler(HttpAuthHandler handler) {
32 | this.handler = handler;
33 | }
34 |
35 | /**
36 | * Instructs the WebView to cancel the authentication request.
37 | */
38 | public void cancel () {
39 | this.handler.cancel();
40 | }
41 |
42 | /**
43 | * Instructs the WebView to proceed with the authentication with the given credentials.
44 | *
45 | * @param username
46 | * @param password
47 | */
48 | public void proceed (String username, String password) {
49 | this.handler.proceed(username, password);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/builders/builders.js:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | var CordovaError = require('cordova-common').CordovaError;
21 |
22 | var knownBuilders = {
23 | ant: 'AntBuilder',
24 | gradle: 'GradleBuilder',
25 | none: 'GenericBuilder'
26 | };
27 |
28 | /**
29 | * Helper method that instantiates and returns a builder for specified build
30 | * type.
31 | *
32 | * @param {String} builderType Builder name to construct and return. Must
33 | * be one of 'ant', 'gradle' or 'none'
34 | *
35 | * @return {Builder} A builder instance for specified build type.
36 | */
37 | module.exports.getBuilder = function (builderType, projectRoot) {
38 | if (!knownBuilders[builderType])
39 | throw new CordovaError('Builder ' + builderType + ' is not supported.');
40 |
41 | try {
42 | var Builder = require('./' + knownBuilders[builderType]);
43 | return new Builder(projectRoot);
44 | } catch (err) {
45 | throw new CordovaError('Failed to instantiate ' + knownBuilders[builderType] + ' builder: ' + err);
46 | }
47 | };
48 |
--------------------------------------------------------------------------------
/twitterAPI_express/bin/www:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /**
4 | * Module dependencies.
5 | */
6 |
7 | var app = require('../app');
8 | var debug = require('debug')('twitterAPI_express:server');
9 | var http = require('http');
10 |
11 | /**
12 | * Get port from environment and store in Express.
13 | */
14 |
15 | var port = normalizePort(process.env.PORT || '3000');
16 | app.set('port', port);
17 |
18 | /**
19 | * Create HTTP server.
20 | */
21 |
22 | var server = http.createServer(app);
23 |
24 | /**
25 | * Listen on provided port, on all network interfaces.
26 | */
27 |
28 | server.listen(port);
29 | server.on('error', onError);
30 | server.on('listening', onListening);
31 |
32 | /**
33 | * Normalize a port into a number, string, or false.
34 | */
35 |
36 | function normalizePort(val) {
37 | var port = parseInt(val, 10);
38 |
39 | if (isNaN(port)) {
40 | // named pipe
41 | return val;
42 | }
43 |
44 | if (port >= 0) {
45 | // port number
46 | return port;
47 | }
48 |
49 | return false;
50 | }
51 |
52 | /**
53 | * Event listener for HTTP server "error" event.
54 | */
55 |
56 | function onError(error) {
57 | if (error.syscall !== 'listen') {
58 | throw error;
59 | }
60 |
61 | var bind = typeof port === 'string'
62 | ? 'Pipe ' + port
63 | : 'Port ' + port;
64 |
65 | // handle specific listen errors with friendly messages
66 | switch (error.code) {
67 | case 'EACCES':
68 | console.error(bind + ' requires elevated privileges');
69 | process.exit(1);
70 | break;
71 | case 'EADDRINUSE':
72 | console.error(bind + ' is already in use');
73 | process.exit(1);
74 | break;
75 | default:
76 | throw error;
77 | }
78 | }
79 |
80 | /**
81 | * Event listener for HTTP server "listening" event.
82 | */
83 |
84 | function onListening() {
85 | var addr = server.address();
86 | var bind = typeof addr === 'string'
87 | ? 'pipe ' + addr
88 | : 'port ' + addr.port;
89 | debug('Listening on ' + bind);
90 | }
91 |
--------------------------------------------------------------------------------
/learning-electron/main.js:
--------------------------------------------------------------------------------
1 | const electron = require('electron.js');
2 | // Module to control application life.
3 | const app = electron.app;
4 | // Module to create native browser window.
5 | const BrowserWindow = electron.BrowserWindow;
6 |
7 | // Keep a global reference of the window object, if you don't, the window will
8 | // be closed automatically when the JavaScript object is garbage collected.
9 | let mainWindow;
10 |
11 | function createWindow() {
12 | // Create the browser window.
13 | mainWindow = new BrowserWindow({ width: 800, height: 600 });
14 |
15 | // and load the index.html of the app.
16 | mainWindow.loadURL(`file://${__dirname}/index.html`);
17 |
18 | // Open the DevTools.
19 | mainWindow.webContents.openDevTools();
20 |
21 | // Emitted when the window is closed.
22 | mainWindow.on('closed', function() {
23 | // Dereference the window object, usually you would store windows
24 | // in an array if your app supports multi windows, this is the time
25 | // when you should delete the corresponding element.
26 | mainWindow = null;
27 | });
28 | }
29 |
30 | // This method will be called when Electron has finished
31 | // initialization and is ready to create browser windows.
32 | // Some APIs can only be used after this event occurs.
33 | app.on('ready', createWindow);
34 |
35 | // Quit when all windows are closed.
36 | app.on('window-all-closed', function() {
37 | // On OS X it is common for applications and their menu bar
38 | // to stay active until the user quits explicitly with Cmd + Q
39 | if (process.platform !== 'darwin') {
40 | app.quit();
41 | }
42 | });
43 |
44 | app.on('activate', function() {
45 | // On OS X it's common to re-create a window in the app when the
46 | // dock icon is clicked and there are no other windows open.
47 | if (mainWindow === null) {
48 | createWindow();
49 | }
50 | });
51 |
52 | // In this file you can include the rest of your app's specific main process
53 | // code. You can also put them in separate files and require them here.
54 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/build.gradle:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one
2 | or more contributor license agreements. See the NOTICE file
3 | distributed with this work for additional information
4 | regarding copyright ownership. The ASF licenses this file
5 | to you under the Apache License, Version 2.0 (the
6 | "License"); you may not use this file except in compliance
7 | with the License. You may obtain a copy of the License at
8 |
9 | http://www.apache.org/licenses/LICENSE-2.0
10 |
11 | Unless required by applicable law or agreed to in writing,
12 | software distributed under the License is distributed on an
13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | KIND, either express or implied. See the License for the
15 | specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 |
20 |
21 | buildscript {
22 | repositories {
23 | mavenCentral()
24 | }
25 |
26 | dependencies {
27 | classpath 'com.android.tools.build:gradle:2.1.0'
28 | }
29 |
30 | }
31 |
32 | apply plugin: 'com.android.library'
33 |
34 | ext {
35 | apply from: 'cordova.gradle'
36 | cdvCompileSdkVersion = privateHelpers.getProjectTarget()
37 | cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
38 | }
39 |
40 | android {
41 | compileSdkVersion cdvCompileSdkVersion
42 | buildToolsVersion cdvBuildToolsVersion
43 | publishNonDefault true
44 |
45 | compileOptions {
46 | sourceCompatibility JavaVersion.VERSION_1_6
47 | targetCompatibility JavaVersion.VERSION_1_6
48 | }
49 |
50 | sourceSets {
51 | main {
52 | manifest.srcFile 'AndroidManifest.xml'
53 | java.srcDirs = ['src']
54 | resources.srcDirs = ['src']
55 | aidl.srcDirs = ['src']
56 | renderscript.srcDirs = ['src']
57 | res.srcDirs = ['res']
58 | assets.srcDirs = ['assets']
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/index.html:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Hello World
28 |
29 |
30 |
31 |
Apache Cordova
32 |
33 |
Connecting to Device
34 |
Device is Ready
35 |
36 |
37 |
38 |
39 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/js/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | var app = {
20 | // Application Constructor
21 | initialize: function() {
22 | this.bindEvents();
23 | },
24 | // Bind Event Listeners
25 | //
26 | // Bind any events that are required on startup. Common events are:
27 | // 'load', 'deviceready', 'offline', and 'online'.
28 | bindEvents: function() {
29 | document.addEventListener('deviceready', this.onDeviceReady, false);
30 | },
31 | // deviceready Event Handler
32 | //
33 | // The scope of 'this' is the event. In order to call the 'receivedEvent'
34 | // function, we must explicity call 'app.receivedEvent(...);'
35 | onDeviceReady: function() {
36 | app.receivedEvent('deviceready');
37 | },
38 | // Update DOM on a Received Event
39 | receivedEvent: function(id) {
40 | var parentElement = document.getElementById(id);
41 | var listeningElement = parentElement.querySelector('.listening');
42 | var receivedElement = parentElement.querySelector('.received');
43 |
44 | listeningElement.setAttribute('style', 'display:none;');
45 | receivedElement.setAttribute('style', 'display:block;');
46 |
47 | console.log('Received Event: ' + id);
48 | }
49 | };
50 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/AuthenticationToken.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | /**
22 | * The Class AuthenticationToken defines the userName and password to be used for authenticating a web resource
23 | */
24 | public class AuthenticationToken {
25 | private String userName;
26 | private String password;
27 |
28 | /**
29 | * Gets the user name.
30 | *
31 | * @return the user name
32 | */
33 | public String getUserName() {
34 | return userName;
35 | }
36 |
37 | /**
38 | * Sets the user name.
39 | *
40 | * @param userName
41 | * the new user name
42 | */
43 | public void setUserName(String userName) {
44 | this.userName = userName;
45 | }
46 |
47 | /**
48 | * Gets the password.
49 | *
50 | * @return the password
51 | */
52 | public String getPassword() {
53 | return password;
54 | }
55 |
56 | /**
57 | * Sets the password.
58 | *
59 | * @param password
60 | * the new password
61 | */
62 | public void setPassword(String password) {
63 | this.password = password;
64 | }
65 |
66 |
67 |
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/twitter_graph/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tutorial 3: Twitter
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/cordovacy/plugins/cordova-plugin-whitelist/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
24 | Whitelist
25 | Cordova Network Whitelist Plugin
26 | Apache 2.0
27 | cordova,whitelist,policy
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/getting-started/index-layout.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tutorial 1: Getting Started
8 |
9 |
10 |
11 |
20 |
21 |
22 |
23 |
85 |
--------------------------------------------------------------------------------
/cordovacy/WWW/js/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | var app = {
20 | // Application Constructor
21 | initialize: function() {
22 | this.bindEvents();
23 | },
24 | // Bind Event Listeners
25 | //
26 | // Bind any events that are required on startup. Common events are:
27 | // 'load', 'deviceready', 'offline', and 'online'.
28 | bindEvents: function() {
29 | document.addEventListener('deviceready', this.onDeviceReady, false);
30 | },
31 | // deviceready Event Handler
32 | //
33 | // The scope of 'this' is the event. In order to call the 'receivedEvent'
34 | // function, we must explicitly call 'app.receivedEvent(...);'
35 | onDeviceReady: function() {
36 | app.receivedEvent('deviceready');
37 | },
38 | // Update DOM on a Received Event
39 | receivedEvent: function(id) {
40 | var parentElement = document.getElementById(id);
41 | var listeningElement = parentElement.querySelector('.listening');
42 | // var receivedElement = parentElement.querySelector('.received');
43 |
44 | listeningElement.setAttribute('style', 'display:none;');
45 | // receivedElement.setAttribute('style', 'display:block;');
46 |
47 | console.log('Received Event: ' + id);
48 | // deviceready event should also resize the cy graph
49 | window.cy.resize().center();
50 | }
51 | };
52 |
53 | app.initialize();
54 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/assets/www/js/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | var app = {
20 | // Application Constructor
21 | initialize: function() {
22 | this.bindEvents();
23 | },
24 | // Bind Event Listeners
25 | //
26 | // Bind any events that are required on startup. Common events are:
27 | // 'load', 'deviceready', 'offline', and 'online'.
28 | bindEvents: function() {
29 | document.addEventListener('deviceready', this.onDeviceReady, false);
30 | },
31 | // deviceready Event Handler
32 | //
33 | // The scope of 'this' is the event. In order to call the 'receivedEvent'
34 | // function, we must explicitly call 'app.receivedEvent(...);'
35 | onDeviceReady: function() {
36 | app.receivedEvent('deviceready');
37 | },
38 | // Update DOM on a Received Event
39 | receivedEvent: function(id) {
40 | var parentElement = document.getElementById(id);
41 | var listeningElement = parentElement.querySelector('.listening');
42 | var receivedElement = parentElement.querySelector('.received');
43 |
44 | listeningElement.setAttribute('style', 'display:none;');
45 | receivedElement.setAttribute('style', 'display:block;');
46 |
47 | console.log('Received Event: ' + id);
48 | // deviceready event should also resize the cy graph
49 | window.cy.resize().center();
50 | }
51 | };
52 |
53 | app.initialize();
54 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/log.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var path = require('path'),
23 | os = require('os'),
24 | Q = require('q'),
25 | child_process = require('child_process'),
26 | ROOT = path.join(__dirname, '..', '..');
27 |
28 | /*
29 | * Starts running logcat in the shell.
30 | * Returns a promise.
31 | */
32 | module.exports.run = function() {
33 | var d = Q.defer();
34 | var adb = child_process.spawn('adb', ['logcat'], {cwd: os.tmpdir()});
35 |
36 | adb.stdout.on('data', function(data) {
37 | var lines = data ? data.toString().split('\n') : [];
38 | var out = lines.filter(function(x) { return x.indexOf('nativeGetEnabledTags') < 0; });
39 | console.log(out.join('\n'));
40 | });
41 |
42 | adb.stderr.on('data', console.error);
43 | adb.on('close', function(code) {
44 | if (code > 0) {
45 | d.reject('Failed to run logcat command.');
46 | } else d.resolve();
47 | });
48 |
49 | return d.promise;
50 | };
51 |
52 | module.exports.help = function() {
53 | console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'cordova', 'log')));
54 | console.log('Gives the logcat output on the command line.');
55 | process.exit(0);
56 | };
57 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/www/js/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | var app = {
20 | // Application Constructor
21 | initialize: function() {
22 | this.bindEvents();
23 | },
24 | // Bind Event Listeners
25 | //
26 | // Bind any events that are required on startup. Common events are:
27 | // 'load', 'deviceready', 'offline', and 'online'.
28 | bindEvents: function() {
29 | document.addEventListener('deviceready', this.onDeviceReady, false);
30 | },
31 | // deviceready Event Handler
32 | //
33 | // The scope of 'this' is the event. In order to call the 'receivedEvent'
34 | // function, we must explicitly call 'app.receivedEvent(...);'
35 | onDeviceReady: function() {
36 | app.receivedEvent('deviceready');
37 | },
38 | // Update DOM on a Received Event
39 | receivedEvent: function(id) {
40 | var parentElement = document.getElementById(id);
41 | var listeningElement = parentElement.querySelector('.listening');
42 | // var receivedElement = parentElement.querySelector('.received');
43 |
44 | listeningElement.setAttribute('style', 'display:none;');
45 | // receivedElement.setAttribute('style', 'display:block;');
46 |
47 | console.log('Received Event: ' + id);
48 | // deviceready event should also resize the cy graph
49 | window.cy.resize().center();
50 | }
51 | };
52 |
53 | app.initialize();
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/node
2 |
3 | ### Node ###
4 | # Logs
5 | logs
6 | *.log
7 | npm-debug.log*
8 |
9 | # Runtime data
10 | pids
11 | *.pid
12 | *.seed
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # node-waf configuration
27 | .lock-wscript
28 |
29 | # Compiled binary addons (http://nodejs.org/api/addons.html)
30 | build/Release
31 |
32 | # Dependency directories
33 | node_modules
34 | jspm_packages
35 |
36 | # Optional npm cache directory
37 | .npm
38 |
39 | # Optional REPL history
40 | .node_repl_history
41 |
42 |
43 | ### Typings ###
44 | ## Ignore downloaded typings
45 | typings
46 |
47 |
48 | ### User defined ###
49 | .env
50 |
51 | ### Bower ###
52 | bower_components
53 | .bower-cache
54 | .bower-registry
55 | .bower-tmp
56 |
57 |
58 | # Created by https://www.gitignore.io/api/windows,macos,linux
59 |
60 | ### Windows ###
61 | # Windows image file caches
62 | Thumbs.db
63 | ehthumbs.db
64 |
65 | # Folder config file
66 | Desktop.ini
67 |
68 | # Recycle Bin used on file shares
69 | $RECYCLE.BIN/
70 |
71 | # Windows Installer files
72 | *.cab
73 | *.msi
74 | *.msm
75 | *.msp
76 |
77 | # Windows shortcuts
78 | *.lnk
79 |
80 |
81 | ### macOS ###
82 | *.DS_Store
83 | .AppleDouble
84 | .LSOverride
85 |
86 |
87 | # Thumbnails
88 | ._*
89 |
90 | # Files that might appear in the root of a volume
91 | .DocumentRevisions-V100
92 | .fseventsd
93 | .Spotlight-V100
94 | .TemporaryItems
95 | .Trashes
96 | .VolumeIcon.icns
97 | .com.apple.timemachine.donotpresent
98 |
99 | # Directories potentially created on remote AFP share
100 | .AppleDB
101 | .AppleDesktop
102 | Network Trash Folder
103 | Temporary Items
104 | .apdisk
105 |
106 |
107 | ### Linux ###
108 | *~
109 |
110 | # temporary files which can be created if a process still has a handle open of a deleted file
111 | .fuse_hidden*
112 |
113 | # KDE directory preferences
114 | .directory
115 |
116 | # Linux trash folder which might appear on any partition or disk
117 | .Trash-*
118 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova.engine;
20 |
21 | import android.webkit.JavascriptInterface;
22 |
23 | import org.apache.cordova.CordovaBridge;
24 | import org.apache.cordova.ExposedJsApi;
25 | import org.json.JSONException;
26 |
27 | /**
28 | * Contains APIs that the JS can call. All functions in here should also have
29 | * an equivalent entry in CordovaChromeClient.java, and be added to
30 | * cordova-js/lib/android/plugin/android/promptbasednativeapi.js
31 | */
32 | class SystemExposedJsApi implements ExposedJsApi {
33 | private final CordovaBridge bridge;
34 |
35 | SystemExposedJsApi(CordovaBridge bridge) {
36 | this.bridge = bridge;
37 | }
38 |
39 | @JavascriptInterface
40 | public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException {
41 | return bridge.jsExec(bridgeSecret, service, action, callbackId, arguments);
42 | }
43 |
44 | @JavascriptInterface
45 | public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException {
46 | bridge.jsSetNativeToJsBridgeMode(bridgeSecret, value);
47 | }
48 |
49 | @JavascriptInterface
50 | public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException {
51 | return bridge.jsRetrieveJsMessages(bridgeSecret, fromOnlineEvent);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/lib/build.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | var path = require('path'),
23 | fs = require('fs'),
24 | shjs = require('shelljs'),
25 | zip = require('adm-zip'),
26 | Q = require('q'),
27 | clean = require('./clean'),
28 | check_reqs = require('./check_reqs'),
29 | platformWwwDir = path.join('platforms', 'browser', 'www'),
30 | platformBuildDir = path.join('platforms', 'browser', 'build'),
31 | packageFile = path.join(platformBuildDir, 'package.zip');
32 |
33 | /**
34 | * run
35 | * Creates a zip file int platform/build folder
36 | */
37 | module.exports.run = function(){
38 |
39 | return check_reqs.run()
40 | .then(function(){
41 | return clean.cleanProject();
42 | },
43 | function checkReqsError(err){
44 | console.error('Please make sure you meet the software requirements in order to build a browser cordova project');
45 | })
46 | .then(function(){
47 |
48 | if (!fs.existsSync(platformBuildDir)) {
49 | fs.mkdirSync(platformBuildDir);
50 | }
51 |
52 | // add the project to a zipfile
53 | var zipFile = zip();
54 | zipFile.addLocalFolder(platformWwwDir, '.');
55 | zipFile.writeZip(packageFile);
56 |
57 | return Q.resolve();
58 |
59 | });
60 | };
61 |
62 | module.exports.help = function() {
63 | console.log('Usage: cordova build browser');
64 | console.log('Build will create the packaged app in \''+platformBuildDir+'\'.');
65 | };
66 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import java.security.Principal;
22 | import java.security.PrivateKey;
23 | import java.security.cert.X509Certificate;
24 |
25 | /**
26 | * Specifies interface for handling certificate requests.
27 | */
28 | public interface ICordovaClientCertRequest {
29 | /**
30 | * Cancel this request
31 | */
32 | public void cancel();
33 |
34 | /*
35 | * Returns the host name of the server requesting the certificate.
36 | */
37 | public String getHost();
38 |
39 | /*
40 | * Returns the acceptable types of asymmetric keys (can be null).
41 | */
42 | public String[] getKeyTypes();
43 |
44 | /*
45 | * Returns the port number of the server requesting the certificate.
46 | */
47 | public int getPort();
48 |
49 | /*
50 | * Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
51 | */
52 | public Principal[] getPrincipals();
53 |
54 | /*
55 | * Ignore the request for now. Do not remember user's choice.
56 | */
57 | public void ignore();
58 |
59 | /*
60 | * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
61 | *
62 | * @param privateKey The privateKey
63 | * @param chain The certificate chain
64 | */
65 | public void proceed(PrivateKey privateKey, X509Certificate[] chain);
66 | }
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/android_sdk_version.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var child_process = require('child_process'),
23 | Q = require('q');
24 |
25 | var get_highest_sdk = function(results){
26 | var reg = /\d+/;
27 | var apiLevels = [];
28 | for(var i=0;i getPluginEntries() {
62 | return parser.getPluginEntries();
63 | }
64 |
65 | public static CordovaPreferences getPreferences() {
66 | return parser.getPreferences();
67 | }
68 |
69 | public static boolean isInitialized() {
70 | return parser != null;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package org.apache.cordova.engine;
21 |
22 | import android.annotation.TargetApi;
23 | import android.os.Build;
24 | import android.webkit.CookieManager;
25 | import android.webkit.WebView;
26 |
27 | import org.apache.cordova.ICordovaCookieManager;
28 |
29 | class SystemCookieManager implements ICordovaCookieManager {
30 |
31 | protected final WebView webView;
32 | private final CookieManager cookieManager;
33 |
34 | //Added because lint can't see the conditional RIGHT ABOVE this
35 | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
36 | public SystemCookieManager(WebView webview) {
37 | webView = webview;
38 | cookieManager = CookieManager.getInstance();
39 |
40 | //REALLY? Nobody has seen this UNTIL NOW?
41 | cookieManager.setAcceptFileSchemeCookies(true);
42 |
43 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
44 | cookieManager.setAcceptThirdPartyCookies(webView, true);
45 | }
46 | }
47 |
48 | public void setCookiesEnabled(boolean accept) {
49 | cookieManager.setAcceptCookie(accept);
50 | }
51 |
52 | public void setCookie(final String url, final String value) {
53 | cookieManager.setCookie(url, value);
54 | }
55 |
56 | public String getCookie(final String url) {
57 | return cookieManager.getCookie(url);
58 | }
59 |
60 | public void clearCookies() {
61 | cookieManager.removeAllCookie();
62 | }
63 |
64 | public void flush() {
65 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
66 | cookieManager.flush();
67 | }
68 | }
69 | };
70 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import org.apache.cordova.CordovaPlugin;
22 |
23 | /**
24 | * This class represents a service entry object.
25 | */
26 | public final class PluginEntry {
27 |
28 | /**
29 | * The name of the service that this plugin implements
30 | */
31 | public final String service;
32 |
33 | /**
34 | * The plugin class name that implements the service.
35 | */
36 | public final String pluginClass;
37 |
38 | /**
39 | * The pre-instantiated plugin to use for this entry.
40 | */
41 | public final CordovaPlugin plugin;
42 |
43 | /**
44 | * Flag that indicates the plugin object should be created when PluginManager is initialized.
45 | */
46 | public final boolean onload;
47 |
48 | /**
49 | * Constructs with a CordovaPlugin already instantiated.
50 | */
51 | public PluginEntry(String service, CordovaPlugin plugin) {
52 | this(service, plugin.getClass().getName(), true, plugin);
53 | }
54 |
55 | /**
56 | * @param service The name of the service
57 | * @param pluginClass The plugin class name
58 | * @param onload Create plugin object when HTML page is loaded
59 | */
60 | public PluginEntry(String service, String pluginClass, boolean onload) {
61 | this(service, pluginClass, onload, null);
62 | }
63 |
64 | private PluginEntry(String service, String pluginClass, boolean onload, CordovaPlugin plugin) {
65 | this.service = service;
66 | this.pluginClass = pluginClass;
67 | this.onload = onload;
68 | this.plugin = plugin;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/retry.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | /* jshint node: true */
23 |
24 | 'use strict';
25 |
26 | var events = require('cordova-common').events;
27 |
28 | /*
29 | * Retry a promise-returning function a number of times, propagating its
30 | * results on success or throwing its error on a failed final attempt.
31 | *
32 | * @arg {Number} attemts_left - The number of times to retry the passed call.
33 | * @arg {Function} promiseFunction - A function that returns a promise.
34 | * @arg {...} - Arguments to pass to promiseFunction.
35 | *
36 | * @returns {Promise}
37 | */
38 | module.exports.retryPromise = function (attemts_left, promiseFunction) {
39 |
40 | // NOTE:
41 | // get all trailing arguments, by skipping the first two (attemts_left and
42 | // promiseFunction) because they shouldn't get passed to promiseFunction
43 | var promiseFunctionArguments = Array.prototype.slice.call(arguments, 2);
44 |
45 | return promiseFunction.apply(undefined, promiseFunctionArguments).then(
46 |
47 | // on success pass results through
48 | function onFulfilled(value) {
49 | return value;
50 | },
51 |
52 | // on rejection either retry, or throw the error
53 | function onRejected(error) {
54 |
55 | attemts_left -= 1;
56 |
57 | if (attemts_left < 1) {
58 | throw error;
59 | }
60 |
61 | events.emit('verbose', 'A retried call failed. Retrying ' + attemts_left + ' more time(s).');
62 |
63 | // retry call self again with the same arguments, except attemts_left is now lower
64 | var fullArguments = [attemts_left, promiseFunction].concat(promiseFunctionArguments);
65 | return module.exports.retryPromise.apply(undefined, fullArguments);
66 | }
67 | );
68 | };
69 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/cordova/lib/plugin-build.gradle:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one
2 | or more contributor license agreements. See the NOTICE file
3 | distributed with this work for additional information
4 | regarding copyright ownership. The ASF licenses this file
5 | to you under the Apache License, Version 2.0 (the
6 | "License"); you may not use this file except in compliance
7 | with the License. You may obtain a copy of the License at
8 |
9 | http://www.apache.org/licenses/LICENSE-2.0
10 |
11 | Unless required by applicable law or agreed to in writing,
12 | software distributed under the License is distributed on an
13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | KIND, either express or implied. See the License for the
15 | specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | // GENERATED FILE! DO NOT EDIT!
20 |
21 | buildscript {
22 | repositories {
23 | mavenCentral()
24 | }
25 |
26 | // Switch the Android Gradle plugin version requirement depending on the
27 | // installed version of Gradle. This dependency is documented at
28 | // http://tools.android.com/tech-docs/new-build-system/version-compatibility
29 | // and https://issues.apache.org/jira/browse/CB-8143
30 | if (gradle.gradleVersion >= "2.2") {
31 | dependencies {
32 | classpath 'com.android.tools.build:gradle:1.0.0+'
33 | }
34 | } else if (gradle.gradleVersion >= "2.1") {
35 | dependencies {
36 | classpath 'com.android.tools.build:gradle:0.14.0+'
37 | }
38 | } else {
39 | dependencies {
40 | classpath 'com.android.tools.build:gradle:0.12.0+'
41 | }
42 | }
43 | }
44 |
45 | apply plugin: 'com.android.library'
46 |
47 | dependencies {
48 | compile fileTree(dir: 'libs', include: '*.jar')
49 | debugCompile project(path: ":CordovaLib", configuration: "debug")
50 | releaseCompile project(path: ":CordovaLib", configuration: "release")
51 | }
52 |
53 | android {
54 | compileSdkVersion cdvCompileSdkVersion
55 | buildToolsVersion cdvBuildToolsVersion
56 | publishNonDefault true
57 |
58 | compileOptions {
59 | sourceCompatibility JavaVersion.VERSION_1_6
60 | targetCompatibility JavaVersion.VERSION_1_6
61 | }
62 |
63 | sourceSets {
64 | main {
65 | manifest.srcFile 'AndroidManifest.xml'
66 | java.srcDirs = ['src']
67 | resources.srcDirs = ['src']
68 | aidl.srcDirs = ['src']
69 | renderscript.srcDirs = ['src']
70 | res.srcDirs = ['res']
71 | assets.srcDirs = ['assets']
72 | jniLibs.srcDirs = ['libs']
73 | }
74 | }
75 | }
76 |
77 | if (file('build-extras.gradle').exists()) {
78 | apply from: 'build-extras.gradle'
79 | }
80 |
--------------------------------------------------------------------------------
/cordovacy/platforms/browser/cordova/run:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 | */
21 |
22 | var fs = require('fs'),
23 | path = require('path'),
24 | nopt = require('nopt'),
25 | url = require('url'),
26 | cordovaServe = require('cordova-serve');
27 |
28 | var args = process.argv;
29 |
30 | start(args);
31 |
32 | function start(argv) {
33 | var args = nopt({'help': Boolean, 'target': String, 'port': Number}, {'help': ['/?', '-h', 'help', '-help', '/help']}, argv);
34 | if(args.help) {
35 | help();
36 | }
37 |
38 | // defaults
39 | args.port = args.port || 8000;
40 | args.target = args.target || "chrome";
41 |
42 | var root = path.join(__dirname, '../'),
43 | configFile = path.resolve(path.join(root, 'config.xml')),
44 | configXML = fs.readFileSync(configFile, 'utf8'),
45 | sourceFile = / ] [ --port= ]");
62 | console.log(" --target= : Launches the specified browser. Chrome is default.");
63 | console.log(" --port= : Http server uses specified port number.");
64 | console.log("Examples:");
65 | console.log(" run");
66 | console.log(" run -- --target=ie");
67 | console.log(" run -- --target=chrome --port=8000");
68 | console.log("");
69 | process.exit(0);
70 | }
71 |
--------------------------------------------------------------------------------
/cordovacy/platforms/android/CordovaLib/src/org/apache/cordova/CallbackMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import android.util.Pair;
22 | import android.util.SparseArray;
23 |
24 | /**
25 | * Provides a collection that maps unique request codes to CordovaPlugins and Integers.
26 | * Used to ensure that when plugins make requests for runtime permissions, those requests do not
27 | * collide with requests from other plugins that use the same request code value.
28 | */
29 | public class CallbackMap {
30 | private int currentCallbackId = 0;
31 | private SparseArray> callbacks;
32 |
33 | public CallbackMap() {
34 | this.callbacks = new SparseArray>();
35 | }
36 |
37 | /**
38 | * Stores a CordovaPlugin and request code and returns a new unique request code to use
39 | * in a permission request.
40 | *
41 | * @param receiver The plugin that is making the request
42 | * @param requestCode The original request code used by the plugin
43 | * @return A unique request code that can be used to retrieve this callback
44 | * with getAndRemoveCallback()
45 | */
46 | public synchronized int registerCallback(CordovaPlugin receiver, int requestCode) {
47 | int mappedId = this.currentCallbackId++;
48 | callbacks.put(mappedId, new Pair(receiver, requestCode));
49 | return mappedId;
50 | }
51 |
52 | /**
53 | * Retrieves and removes a callback stored in the map using the mapped request code
54 | * obtained from registerCallback()
55 | *
56 | * @param mappedId The request code obtained from registerCallback()
57 | * @return The CordovaPlugin and orignal request code that correspond to the
58 | * given mappedCode
59 | */
60 | public synchronized Pair getAndRemoveCallback(int mappedId) {
61 | Pair callback = callbacks.get(mappedId);
62 | callbacks.remove(mappedId);
63 | return callback;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------