21 |
22 | @class CDVInvokedUrlCommand;
23 | @class CDVViewController;
24 |
25 | @interface CDVCommandQueue : NSObject
26 |
27 | @property (nonatomic, readonly) BOOL currentlyExecuting;
28 |
29 | - (id)initWithViewController:(CDVViewController*)viewController;
30 | - (void)dispose;
31 |
32 | - (void)resetRequestId;
33 | - (void)enqueCommandBatch:(NSString*)batchJSON;
34 |
35 | - (void)maybeFetchCommandsFromJs:(NSNumber*)requestId;
36 | - (void)fetchCommandsFromJs;
37 | - (void)executePending;
38 | - (BOOL)execute:(CDVInvokedUrlCommand*)command;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/platforms/ios/CordovaLib/Classes/CDV.h:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | #import "CDVAvailability.h"
21 |
22 | #import "CDVPlugin.h"
23 | #import "CDVViewController.h"
24 | #import "CDVCommandDelegate.h"
25 | #import "CDVURLProtocol.h"
26 | #import "CDVInvokedUrlCommand.h"
27 |
28 | #import "CDVDebug.h"
29 | #import "CDVPluginResult.h"
30 | #import "CDVWhitelist.h"
31 | #import "CDVLocalStorage.h"
32 | #import "CDVScreenOrientationDelegate.h"
33 | #import "CDVTimer.h"
34 |
35 | #import "NSArray+Comparisons.h"
36 | #import "NSData+Base64.h"
37 | #import "NSDictionary+Extensions.h"
38 | #import "NSMutableArray+QueueAdditions.h"
39 | #import "UIDevice+Extensions.h"
40 |
41 | #import "CDVJSON.h"
42 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/sed.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 | var fs = require('fs');
3 |
4 | //@
5 | //@ ### sed([options ,] search_regex, replace_str, file)
6 | //@ Available options:
7 | //@
8 | //@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_
9 | //@
10 | //@ Examples:
11 | //@
12 | //@ ```javascript
13 | //@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');
14 | //@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js');
15 | //@ ```
16 | //@
17 | //@ Reads an input string from `file` and performs a JavaScript `replace()` on the input
18 | //@ using the given search regex and replacement string. Returns the new string after replacement.
19 | function _sed(options, regex, replacement, file) {
20 | options = common.parseOptions(options, {
21 | 'i': 'inplace'
22 | });
23 |
24 | if (typeof replacement === 'string')
25 | replacement = replacement; // no-op
26 | else if (typeof replacement === 'number')
27 | replacement = replacement.toString(); // fallback
28 | else
29 | common.error('invalid replacement string');
30 |
31 | if (!file)
32 | common.error('no file given');
33 |
34 | if (!fs.existsSync(file))
35 | common.error('no such file or directory: ' + file);
36 |
37 | var result = fs.readFileSync(file, 'utf8').replace(regex, replacement);
38 | if (options.inplace)
39 | fs.writeFileSync(file, result, 'utf8');
40 |
41 | return common.ShellString(result);
42 | }
43 | module.exports = _sed;
44 |
--------------------------------------------------------------------------------
/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 run = require('./lib/run'),
23 | reqs = require('./lib/check_reqs'),
24 | args = process.argv;
25 |
26 | // Support basic help commands
27 | if (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
28 | args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
29 | run.help();
30 | } else {
31 | reqs.run().done(function() {
32 | return run.run(args);
33 | }, function(err) {
34 | console.error('ERROR: ' + err);
35 | process.exit(2);
36 | });
37 | }
38 |
--------------------------------------------------------------------------------
/platforms/android/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 exec = require('./exec'),
23 | path = require('path'),
24 | ROOT = path.join(__dirname, '..', '..');
25 |
26 | /*
27 | * Cleans the project using ant
28 | * Returns a promise.
29 | */
30 | module.exports.run = function() {
31 | return exec('ant clean -f "' + path.join(ROOT, 'build.xml') + '"');
32 | }
33 |
34 | module.exports.help = function() {
35 | console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]));
36 | console.log('Cleans the project directory.');
37 | process.exit(0);
38 | }
39 |
--------------------------------------------------------------------------------
/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 build = require('./lib/build'),
23 | reqs = require('./lib/check_reqs'),
24 | args = process.argv;
25 |
26 | // Support basic help commands
27 | if(args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
28 | args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
29 | build.help();
30 | } else {
31 | reqs.run().then(function() {
32 | return build.run(args[2]);
33 | }).done(null, function(err) {
34 | console.error(err);
35 | process.exit(2);
36 | });
37 | }
38 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/http/AbstractHttpOutputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.squareup.okhttp.internal.http;
18 |
19 | import java.io.IOException;
20 | import java.io.OutputStream;
21 |
22 | /**
23 | * An output stream for the body of an HTTP request.
24 | *
25 | * Since a single socket's output stream may be used to write multiple HTTP
26 | * requests to the same server, subclasses should not close the socket stream.
27 | */
28 | abstract class AbstractHttpOutputStream extends OutputStream {
29 | protected boolean closed;
30 |
31 | @Override public final void write(int data) throws IOException {
32 | write(new byte[] { (byte) data });
33 | }
34 |
35 | protected final void checkNotClosed() throws IOException {
36 | if (closed) {
37 | throw new IOException("stream closed");
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/spdy/IncomingStreamHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.squareup.okhttp.internal.spdy;
18 |
19 | import java.io.IOException;
20 |
21 | /** Listener to be notified when a connected peer creates a new stream. */
22 | public interface IncomingStreamHandler {
23 | IncomingStreamHandler REFUSE_INCOMING_STREAMS = new IncomingStreamHandler() {
24 | @Override public void receive(SpdyStream stream) throws IOException {
25 | stream.close(SpdyStream.RST_REFUSED_STREAM);
26 | }
27 | };
28 |
29 | /**
30 | * Handle a new stream from this connection's peer. Implementations should
31 | * respond by either {@link SpdyStream#reply replying to the stream} or
32 | * {@link SpdyStream#close closing it}. This response does not need to be
33 | * synchronous.
34 | */
35 | void receive(SpdyStream stream) throws IOException;
36 | }
37 |
--------------------------------------------------------------------------------
/platforms/android/src/com/performanceactive/plugins/camera/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.performanceactive.plugins.camera;
21 |
22 | import android.os.Bundle;
23 |
24 | import org.apache.cordova.Config;
25 | import org.apache.cordova.CordovaActivity;
26 |
27 | public class MainActivity extends CordovaActivity {
28 | @Override
29 | public void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | super.init();
32 | // Set by in config.xml
33 | super.loadUrl(Config.getStartUrl());
34 | //super.loadUrl("file:///android_asset/www/index.html")
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/OkResponseCache.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.okhttp;
17 |
18 | import java.io.IOException;
19 | import java.net.CacheResponse;
20 | import java.net.HttpURLConnection;
21 |
22 | /**
23 | * A response cache that supports statistics tracking and updating stored
24 | * responses. Implementations of {@link java.net.ResponseCache} should implement
25 | * this interface to receive additional support from the HTTP engine.
26 | */
27 | public interface OkResponseCache {
28 |
29 | /** Track an HTTP response being satisfied by {@code source}. */
30 | void trackResponse(ResponseSource source);
31 |
32 | /** Track an conditional GET that was satisfied by this cache. */
33 | void trackConditionalCacheHit();
34 |
35 | /** Updates stored HTTP headers using a hit on a conditional GET. */
36 | void update(CacheResponse conditionalCacheHit, HttpURLConnection httpConnection)
37 | throws IOException;
38 | }
39 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/find.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var common = require('./common');
3 | var _ls = require('./ls');
4 |
5 | //@
6 | //@ ### find(path [,path ...])
7 | //@ ### find(path_array)
8 | //@ Examples:
9 | //@
10 | //@ ```javascript
11 | //@ find('src', 'lib');
12 | //@ find(['src', 'lib']); // same as above
13 | //@ find('.').filter(function(file) { return file.match(/\.js$/); });
14 | //@ ```
15 | //@
16 | //@ Returns array of all files (however deep) in the given paths.
17 | //@
18 | //@ The main difference from `ls('-R', path)` is that the resulting file names
19 | //@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`.
20 | function _find(options, paths) {
21 | if (!paths)
22 | common.error('no path specified');
23 | else if (typeof paths === 'object')
24 | paths = paths; // assume array
25 | else if (typeof paths === 'string')
26 | paths = [].slice.call(arguments, 1);
27 |
28 | var list = [];
29 |
30 | function pushFile(file) {
31 | if (common.platform === 'win')
32 | file = file.replace(/\\/g, '/');
33 | list.push(file);
34 | }
35 |
36 | // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs
37 | // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory
38 |
39 | paths.forEach(function(file) {
40 | pushFile(file);
41 |
42 | if (fs.statSync(file).isDirectory()) {
43 | _ls('-RA', file+'/*').forEach(function(subfile) {
44 | pushFile(subfile);
45 | });
46 | }
47 | });
48 |
49 | return list;
50 | }
51 | module.exports = _find;
52 |
--------------------------------------------------------------------------------
/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.h:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | #import
21 |
22 | /**
23 | * Distinguishes top-level navigations from sub-frame navigations.
24 | * shouldStartLoadWithRequest is called for every request, but didStartLoad
25 | * and didFinishLoad is called only for top-level navigations.
26 | * Relevant bug: CB-2389
27 | */
28 | @interface CDVWebViewDelegate : NSObject {
29 | __weak NSObject * _delegate;
30 | NSInteger _loadCount;
31 | NSInteger _state;
32 | NSInteger _curLoadToken;
33 | NSInteger _loadStartPollCount;
34 | }
35 |
36 | - (id)initWithDelegate:(NSObject *)delegate;
37 | - (BOOL)request:(NSURLRequest*)newRequest isFragmentIdentifierToRequest:(NSURLRequest*)originalRequest;
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/AbstractOutputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.squareup.okhttp.internal;
18 |
19 | import java.io.IOException;
20 | import java.io.OutputStream;
21 |
22 | /**
23 | * An output stream for an HTTP request body.
24 | *
25 | * Since a single socket's output stream may be used to write multiple HTTP
26 | * requests to the same server, subclasses should not close the socket stream.
27 | */
28 | public abstract class AbstractOutputStream extends OutputStream {
29 | protected boolean closed;
30 |
31 | @Override public final void write(int data) throws IOException {
32 | write(new byte[] { (byte) data });
33 | }
34 |
35 | protected final void checkNotClosed() throws IOException {
36 | if (closed) {
37 | throw new IOException("stream closed");
38 | }
39 | }
40 |
41 | /** Returns true if this stream was closed locally. */
42 | public boolean isClosed() {
43 | return closed;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/src/grep.js:
--------------------------------------------------------------------------------
1 | var common = require('./common');
2 | var fs = require('fs');
3 |
4 | //@
5 | //@ ### grep([options ,] regex_filter, file [, file ...])
6 | //@ ### grep([options ,] regex_filter, file_array)
7 | //@ Available options:
8 | //@
9 | //@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria.
10 | //@
11 | //@ Examples:
12 | //@
13 | //@ ```javascript
14 | //@ grep('-v', 'GLOBAL_VARIABLE', '*.js');
15 | //@ grep('GLOBAL_VARIABLE', '*.js');
16 | //@ ```
17 | //@
18 | //@ Reads input string from given files and returns a string containing all lines of the
19 | //@ file that match the given `regex_filter`. Wildcard `*` accepted.
20 | function _grep(options, regex, files) {
21 | options = common.parseOptions(options, {
22 | 'v': 'inverse'
23 | });
24 |
25 | if (!files)
26 | common.error('no paths given');
27 |
28 | if (typeof files === 'string')
29 | files = [].slice.call(arguments, 2);
30 | // if it's array leave it as it is
31 |
32 | files = common.expand(files);
33 |
34 | var grep = '';
35 | files.forEach(function(file) {
36 | if (!fs.existsSync(file)) {
37 | common.error('no such file or directory: ' + file, true);
38 | return;
39 | }
40 |
41 | var contents = fs.readFileSync(file, 'utf8'),
42 | lines = contents.split(/\r*\n/);
43 | lines.forEach(function(line) {
44 | var matched = line.match(regex);
45 | if ((options.inverse && !matched) || (!options.inverse && matched))
46 | grep += line + '\n';
47 | });
48 | });
49 |
50 | return common.ShellString(grep);
51 | }
52 | module.exports = _grep;
53 |
--------------------------------------------------------------------------------
/platforms/ios/CustomCamera/Classes/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | //
21 | // AppDelegate.h
22 | // CustomCamera
23 | //
24 | // Created by ___FULLUSERNAME___ on ___DATE___.
25 | // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
26 | //
27 |
28 | #import
29 |
30 | #import
31 |
32 | @interface AppDelegate : NSObject {}
33 |
34 | // invoke string is passed to your app on launch, this is only valid if you
35 | // edit CustomCamera-Info.plist to add a protocol
36 | // a simple tutorial can be found here :
37 | // http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
38 |
39 | @property (nonatomic, strong) IBOutlet UIWindow* window;
40 | @property (nonatomic, strong) IBOutlet CDVViewController* viewController;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/platforms/ios/CordovaLib/Classes/NSDictionary+Extensions.h:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | #import
21 |
22 | @interface NSDictionary (org_apache_cordova_NSDictionary_Extension)
23 |
24 | - (bool)existsValue:(NSString*)expectedValue forKey:(NSString*)key;
25 | - (NSInteger)integerValueForKey:(NSString*)key defaultValue:(NSInteger)defaultValue withRange:(NSRange)range;
26 | - (NSInteger)integerValueForKey:(NSString*)key defaultValue:(NSInteger)defaultValue;
27 | - (BOOL)typeValueForKey:(NSString*)key isArray:(BOOL*)bArray isNull:(BOOL*)bNull isNumber:(BOOL*)bNumber isString:(BOOL*)bString;
28 | - (BOOL)valueForKeyIsArray:(NSString*)key;
29 | - (BOOL)valueForKeyIsNull:(NSString*)key;
30 | - (BOOL)valueForKeyIsString:(NSString*)key;
31 | - (BOOL)valueForKeyIsNumber:(NSString*)key;
32 |
33 | - (NSDictionary*)dictionaryWithLowercaseKeys;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/platforms/android/CordovaLib/src/org/apache/cordova/JSONUtils.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.util.ArrayList;
22 | import java.util.List;
23 |
24 | import org.json.JSONArray;
25 | import org.json.JSONException;
26 |
27 | @Deprecated // Deprecated in 3.1. To be removed in 4.0.
28 | public class JSONUtils {
29 | public static List toStringList(JSONArray array) throws JSONException {
30 | if(array == null) {
31 | return null;
32 | }
33 | else {
34 | List list = new ArrayList();
35 |
36 | for (int i = 0; i < array.length(); i++) {
37 | list.add(array.get(i).toString());
38 | }
39 |
40 | return list;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/platforms/android/cordova/node_modules/shelljs/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012, Artur Adib
2 | All rights reserved.
3 |
4 | You may use this project under the terms of the New BSD license as follows:
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 | * Neither the name of Artur Adib nor the
14 | names of the contributors may be used to endorse or promote products
15 | derived from this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY
21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
--------------------------------------------------------------------------------
/platforms/ios/CordovaLib/Classes/NSMutableArray+QueueAdditions.m:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | #import "NSMutableArray+QueueAdditions.h"
21 |
22 | @implementation NSMutableArray (QueueAdditions)
23 |
24 | - (id)queueHead
25 | {
26 | if ([self count] == 0) {
27 | return nil;
28 | }
29 |
30 | return [self objectAtIndex:0];
31 | }
32 |
33 | - (__autoreleasing id)dequeue
34 | {
35 | if ([self count] == 0) {
36 | return nil;
37 | }
38 |
39 | id head = [self objectAtIndex:0];
40 | if (head != nil) {
41 | // [[head retain] autorelease]; ARC - the __autoreleasing on the return value should so the same thing
42 | [self removeObjectAtIndex:0];
43 | }
44 |
45 | return head;
46 | }
47 |
48 | - (id)pop
49 | {
50 | return [self dequeue];
51 | }
52 |
53 | - (void)enqueue:(id)object
54 | {
55 | [self addObject:object];
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/platforms/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/platforms/ios/cordova/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello Cordova
4 |
5 | A sample Apache Cordova application that responds to the deviceready event.
6 |
7 |
8 | Apache Cordova Team
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | CustomCamera
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/platforms/ios/CustomCamera/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello Cordova
4 |
5 | A sample Apache Cordova application that responds to the deviceready event.
6 |
7 |
8 | Apache Cordova Team
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | CustomCamera
28 | CustomCamera
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------