Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5DA9C11644 for ; Fri, 2 May 2014 18:32:14 +0000 (UTC) Received: (qmail 46081 invoked by uid 500); 2 May 2014 18:30:35 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 44782 invoked by uid 500); 2 May 2014 18:30:02 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 43763 invoked by uid 99); 2 May 2014 18:29:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 18:29:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6B58745E93; Fri, 2 May 2014 18:29:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kamrik@apache.org To: commits@cordova.apache.org Date: Fri, 02 May 2014 18:30:14 -0000 Message-Id: <1b50ca8c0c464751bbaf8041bacf79eb@git.apache.org> In-Reply-To: <7fc515fdc8214ea6b8a47a40cad66e18@git.apache.org> References: <7fc515fdc8214ea6b8a47a40cad66e18@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [39/70] Split out cordova-lib: move cordova-plugman files http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/android/DummyPlugin.java ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/android/DummyPlugin.java b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/android/DummyPlugin.java new file mode 100644 index 0000000..5263b0c --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/android/DummyPlugin.java @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/android/TestLib.jar ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/android/TestLib.jar b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/android/TestLib.jar new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/blackberry10/index.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/blackberry10/index.js b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/blackberry10/index.js new file mode 100644 index 0000000..5263b0c --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/blackberry10/index.js @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/Custom.framework/someFheader.h ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/Custom.framework/someFheader.h b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/Custom.framework/someFheader.h new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/Custom.framework/somebinlib ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/Custom.framework/somebinlib b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/Custom.framework/somebinlib new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPlugin.bundle ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPlugin.bundle b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPlugin.bundle new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPluginCommand.h ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPluginCommand.h b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPluginCommand.h new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPluginCommand.m ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPluginCommand.m b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/DummyPluginCommand.m new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/SourceWithFramework.m ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/SourceWithFramework.m b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/SourceWithFramework.m new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/TargetDirTest.h ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/TargetDirTest.h b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/TargetDirTest.h new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/TargetDirTest.m ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/TargetDirTest.m b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/TargetDirTest.m new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/libsqlite3.dylib ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/libsqlite3.dylib b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/ios/libsqlite3.dylib new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/tizen/dummer.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/tizen/dummer.js b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/tizen/dummer.js new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/windows8/dummer.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/windows8/dummer.js b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/windows8/dummer.js new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp7/DummyPlugin.cs ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp7/DummyPlugin.cs b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp7/DummyPlugin.cs new file mode 100644 index 0000000..273dc3b --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp7/DummyPlugin.cs @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Benn Mapes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp8/DummyPlugin.cs ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp8/DummyPlugin.cs b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp8/DummyPlugin.cs new file mode 100644 index 0000000..273dc3b --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/DummyPlugin/src/wp8/DummyPlugin.cs @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Benn Mapes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin.js b/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin.js new file mode 100644 index 0000000..5263b0c --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin.js @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin/image.jpg ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin/image.jpg b/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin/image.jpg new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/DummyPlugin/www/dummyplugin/image.jpg @@ -0,0 +1 @@ +foo http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/EnginePlugin/megaBoringVersion ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/EnginePlugin/megaBoringVersion b/cordova-lib/spec-plugman/plugins/EnginePlugin/megaBoringVersion new file mode 100755 index 0000000..cbf7911 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/EnginePlugin/megaBoringVersion @@ -0,0 +1,23 @@ +#! /bin/sh + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +echo 4.0.0 +exit 0 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/EnginePlugin/megaFunVersion ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/EnginePlugin/megaFunVersion b/cordova-lib/spec-plugman/plugins/EnginePlugin/megaFunVersion new file mode 100755 index 0000000..1e4c706 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/EnginePlugin/megaFunVersion @@ -0,0 +1,23 @@ +#! /bin/sh + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +echo 1.0.0 +exit 0 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/EnginePlugin/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/EnginePlugin/plugin.xml b/cordova-lib/spec-plugman/plugins/EnginePlugin/plugin.xml new file mode 100644 index 0000000..a58f19e --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/EnginePlugin/plugin.xml @@ -0,0 +1,33 @@ + + + + + + Engine Choo Choo + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/EnginePluginAndroid/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/EnginePluginAndroid/plugin.xml b/cordova-lib/spec-plugman/plugins/EnginePluginAndroid/plugin.xml new file mode 100644 index 0000000..fe2bce2 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/EnginePluginAndroid/plugin.xml @@ -0,0 +1,32 @@ + + + + + + Engine Choo Choo + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/EnginePluginiOS/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/EnginePluginiOS/plugin.xml b/cordova-lib/spec-plugman/plugins/EnginePluginiOS/plugin.xml new file mode 100644 index 0000000..d7a9a8e --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/EnginePluginiOS/plugin.xml @@ -0,0 +1,34 @@ + + + + + + Engine Choo Choo + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/plugin.xml b/cordova-lib/spec-plugman/plugins/FaultyPlugin/plugin.xml new file mode 100644 index 0000000..22564e7 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/FaultyPlugin/plugin.xml @@ -0,0 +1,161 @@ + + + + + + Faulty Plugin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/android/FaultyPlugin.java ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/android/FaultyPlugin.java b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/android/FaultyPlugin.java new file mode 100644 index 0000000..5263b0c --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/android/FaultyPlugin.java @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/blackberry10/client.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/blackberry10/client.js b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/blackberry10/client.js new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.h ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.h b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.h new file mode 100644 index 0000000..6a23ab6 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.h @@ -0,0 +1,49 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +// +// PhoneGap ! ChildBrowserCommand +// +// +// Created by Jesse MacFadyen on 10-05-29. +// Copyright 2010 Nitobi. All rights reserved. +// + +#import +#ifdef PHONEGAP_FRAMEWORK + #import +#else + #import "PGPlugin.h" +#endif +#import "ChildBrowserViewController.h" + + + +@interface ChildBrowserCommand : PGPlugin { + + ChildBrowserViewController* childBrowser; +} + +@property (nonatomic, retain) ChildBrowserViewController *childBrowser; + + +- (void) showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; +-(void) onChildLocationChange:(NSString*)newLoc; + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.m ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.m b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.m new file mode 100644 index 0000000..38aaf64 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/ios/FaultyPlugin.m @@ -0,0 +1,86 @@ +// + +// +// +// Created by Jesse MacFadyen on 10-05-29. +// Copyright 2010 Nitobi. All rights reserved. +// Copyright (c) 2011, IBM Corporation +// Copyright 2011, Randy McMillan +// + +#import "ChildBrowserCommand.h" + +#ifdef PHONEGAP_FRAMEWORK + #import +#else + #import "PhoneGapViewController.h" +#endif + + +@implementation ChildBrowserCommand + +@synthesize childBrowser; + +- (void) showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options // args: url +{ + + if(childBrowser == NULL) + { + childBrowser = [[ ChildBrowserViewController alloc ] initWithScale:FALSE ]; + childBrowser.delegate = self; + } + +/* // TODO: Work in progress + NSString* strOrientations = [ options objectForKey:@"supportedOrientations"]; + NSArray* supportedOrientations = [strOrientations componentsSeparatedByString:@","]; +*/ + PhoneGapViewController* cont = (PhoneGapViewController*)[ super appViewController ]; + childBrowser.supportedOrientations = cont.supportedOrientations; + + if ([cont respondsToSelector:@selector(presentViewController)]) { + //Reference UIViewController.h Line:179 for update to iOS 5 difference - @RandyMcMillan + [cont presentViewController:childBrowser animated:YES completion:nil]; + } else { + [ cont presentModalViewController:childBrowser animated:YES ]; + } + + NSString *url = (NSString*) [arguments objectAtIndex:0]; + + [childBrowser loadURL:url ]; + +} + +-(void) close:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options // args: url +{ + [ childBrowser closeBrowser]; + +} + +-(void) onClose +{ + NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onClose();",@""]; + [self.webView stringByEvaluatingJavaScriptFromString:jsCallback]; +} + +-(void) onOpenInSafari +{ + NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onOpenExternal();",@""]; + [self.webView stringByEvaluatingJavaScriptFromString:jsCallback]; +} + + +-(void) onChildLocationChange:(NSString*)newLoc +{ + + NSString* tempLoc = [NSString stringWithFormat:@"%@",newLoc]; + NSString* encUrl = [tempLoc stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + + NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onLocationChange('%@');",encUrl]; + [self.webView stringByEvaluatingJavaScriptFromString:jsCallback]; + +} + + + + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/windows8/faultyPlugin.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/windows8/faultyPlugin.js b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/windows8/faultyPlugin.js new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp7/FaultyPlugin.cs ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp7/FaultyPlugin.cs b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp7/FaultyPlugin.cs new file mode 100644 index 0000000..5263b0c --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp7/FaultyPlugin.cs @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp8/FaultyPlugin.cs ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp8/FaultyPlugin.cs b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp8/FaultyPlugin.cs new file mode 100644 index 0000000..5263b0c --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/FaultyPlugin/src/wp8/FaultyPlugin.cs @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/PluginsPlistOnly/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/PluginsPlistOnly/plugin.xml b/cordova-lib/spec-plugman/plugins/PluginsPlistOnly/plugin.xml new file mode 100644 index 0000000..0e00504 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/PluginsPlistOnly/plugin.xml @@ -0,0 +1,31 @@ + + + + + + Old Skewl Plugin using Plists + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/VariablePlugin/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/VariablePlugin/plugin.xml b/cordova-lib/spec-plugman/plugins/VariablePlugin/plugin.xml new file mode 100644 index 0000000..9eff729 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/VariablePlugin/plugin.xml @@ -0,0 +1,59 @@ + + + + + + Use Variables + + + + Remember that your api key is $API_KEY! + + + + + $PACKAGE_NAME + + + + + + + + + $PACKAGE_NAME + + + + + + + + + $PACKAGE_NAME + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WebNotifications/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WebNotifications/plugin.xml b/cordova-lib/spec-plugman/plugins/WebNotifications/plugin.xml new file mode 100644 index 0000000..b9026f1 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WebNotifications/plugin.xml @@ -0,0 +1,47 @@ + + + + + + Web Notifications + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/AppDelegate.m.diff ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/AppDelegate.m.diff b/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/AppDelegate.m.diff new file mode 100644 index 0000000..754d079 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/AppDelegate.m.diff @@ -0,0 +1,18 @@ +- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification +{ + // Note: if app wasn't running, you can still get a LN and then it doesn't call this function, + // I think it calls app start but notifies you that LN caused the app start or something like that. + + //UIApplicationState state = [application applicationState]; + //BOOL wasForeground = (state == UIApplicationStateActive); + + //NSString *title = [notification.userInfo objectForKey:@"title"]; + //NSString *body = [notification.userInfo objectForKey:@"body"]; + NSString *tag = [notification.userInfo objectForKey:@"tag"]; + + [(WebNotifications*)[self.viewController getCommandInstance:@"WebNotifications"] clickNotification:tag]; + + application.applicationIconBadgeNumber = 0; + application.scheduledLocalNotifications = [NSArray arrayWithArray:application.scheduledLocalNotifications]; // "hack" to clear seen notifications +} + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.h ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.h b/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.h new file mode 100644 index 0000000..1702f40 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.h @@ -0,0 +1,35 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import +#import + +@interface WebNotifications : CDVPlugin { +} + +@property (nonatomic, strong) NSMutableArray* activeNotifications; + +- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView; + +- (void)createNotification:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; +- (void)closeNotification:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; + +- (void)clickNotification:(NSString*)tag; + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.m ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.m b/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.m new file mode 100644 index 0000000..6f0c11f --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WebNotifications/src/ios/WebNotifications.m @@ -0,0 +1,124 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#define Log(fmt, ...) NSLog((@"%d: %s " fmt), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); + +#import "WebNotifications.h" +#import "MainViewController.h" + +@implementation WebNotifications + +@synthesize activeNotifications; + +- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView +{ + self = [super init]; + if (self) { + self.activeNotifications = [NSMutableArray array]; + } + return self; +} + +- (void)createNotification:(CDVInvokedUrlCommand*)command +{ + NSDictionary* options = [command.arguments objectAtIndex:0]; + + // w3c options: + NSString *title = [options objectForKey:@"title"]; + NSString *body = [options objectForKey:@"body"]; + NSString *tag = [options objectForKey:@"tag"]; + //NSString *iconUrl = [options objectForKey:@"iconUrl"]; // Not supported + + // cordova option extensions: + NSUInteger delay = [[options objectForKey:@"delay"] unsignedIntegerValue]; + NSString *soundUrl = [options objectForKey:@"soundUrl"]; + NSInteger badgeNumber = [[options objectForKey:@"badgeNumber"] intValue]; + + Log(@"addNotification title: %@ body: %@ tag: %@ delay: %u badge: %u", title, body, tag, delay, badgeNumber); + + //NSString *action = [options objectForKey:@"action"]; + //bool hasAction = ([[options objectForKey:@"hasAction"] intValue] == 1) ? YES : NO; + //alertAction + + UILocalNotification *notif = [[UILocalNotification alloc] init]; + notif.alertBody = [NSString stringWithFormat:@"[%@] %@: %@", tag, title, body]; + notif.timeZone = [NSTimeZone defaultTimeZone]; + + notif.soundName = soundUrl; + notif.applicationIconBadgeNumber = badgeNumber; + + NSDictionary *userDict = [NSDictionary dictionaryWithObjectsAndKeys:title,@"title",body,@"body",tag,@"tag",nil]; + notif.userInfo = userDict; + + if (delay != 0) { + notif.fireDate = [[NSDate date] addTimeInterval:delay]; + //notif.repeatInterval = [[repeatDict objectForKey: repeat] intValue]; + + [[UIApplication sharedApplication] scheduleLocalNotification:notif]; + } else { + [[UIApplication sharedApplication] presentLocalNotificationNow:notif]; + } + + [self.activeNotifications addObject:notif]; +} + +- (void)closeNotification:(CDVInvokedUrlCommand*)command +{ +// command.callbackId; + NSDictionary* options = [command.arguments objectAtIndex:0]; + NSString *tag = [options objectForKey:@"tag"]; + + NSArray *notifications = [[UIApplication sharedApplication] scheduledLocalNotifications]; + for (UILocalNotification *notification in notifications) { + if ([[notification.userInfo objectForKey:@"tag"] isEqualToString:tag]) { + Log(@"Cancelling notification with tag: %@", tag); + [[UIApplication sharedApplication] cancelLocalNotification:notification]; + [self.activeNotifications removeObject:notification]; + [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:0] callbackId:command.callbackId]; + } + } + [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:0] callbackId:command.callbackId]; +} + +- (void)clickNotification:(NSString*)tag { + NSString *jsCallBack; + + jsCallBack = [NSString stringWithFormat:@"window.Notification.callOnclickByTag('%@')", tag]; + [((CDVViewController*)self.viewController).webView stringByEvaluatingJavaScriptFromString:jsCallBack]; + + NSArray *scheduledNotifications = [[UIApplication sharedApplication] scheduledLocalNotifications]; + NSMutableArray *toDiscard = [NSMutableArray array]; + for (UILocalNotification *notification in self.activeNotifications) { + if (![scheduledNotifications containsObject:notification]) { + // This notification is active, but no longer scheduled, so it must be displayed + jsCallBack = [NSString stringWithFormat:@"window.Notification.callOncloseByTag('%@')", [notification.userInfo objectForKey:@"tag"]]; + [((CDVViewController*)self.viewController).webView stringByEvaluatingJavaScriptFromString:jsCallBack]; + [toDiscard addObject:notification]; + } + } + [self.activeNotifications removeObjectsInArray:toDiscard]; +} + +/* +- (void)cancelAllNotifications:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options { + [[UIApplication sharedApplication] cancelAllLocalNotifications]; +} +*/ + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WebNotifications/www/webnotifications.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WebNotifications/www/webnotifications.js b/cordova-lib/spec-plugman/plugins/WebNotifications/www/webnotifications.js new file mode 100644 index 0000000..6597337 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WebNotifications/www/webnotifications.js @@ -0,0 +1,123 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +/* + * The W3C window.Notification API: http://www.w3.org/TR/notifications/ + */ +if (typeof window.Notification == 'undefined') { + + /** + * Creates and shows a new notification. + * @param title + * @param options + */ + window.Notification = function(title, options) { + options = options || {}; + + this.title = title || 'defaultTitle'; + + // w3c options: + this.body = options.body || ''; + this.tag = options.tag || 'defaultTag'; + this.iconUrl = options.iconUrl || ''; + // titleDir, bodyDir are not supported + + // cordova option extensions: + this.delay = options.delay || 0; + this.soundUrl = options.soundUrl || ''; + this.badgeNumber = options.badgeNumber || 0; + + // there must be one unique notification per tag, so close any existing outstanding notifications + if (window.Notification.active[this.tag]) + window.Notification.active[this.tag].close(); + window.Notification.active[this.tag] = this; + + // Spec claims these must be defined + this.onclick = options.onclick; + this.onerror = options.onerror; + this.onclose = options.onclose; + this.onshow = options.onshow; + if (this.onshow) { + console.log("Warning, WebNotifications plugin will never call onshow"); // this may change on other platforms + } + + var self = this; + cordova.exec(null, function(error) { + if (self.onerror) { + self.onerror(error); + } + }, 'WebNotifications', 'createNotification', [{ + tag: this.tag, + title: this.title, + body: this.body, + delay: this.delay, + }]); + }; + + // TODO: change name to something internal looking? + window.Notification.permission = 'granted'; + + window.Notification.requestPermission = function(callback) { + setTimeout(function() { + callback(window.Notification.permission); + }, 0); + }; + + // Not part of the W3C API. Used by the native side to call onclick handlers. + // TODO: change name to something internal looking? + window.Notification.callOnclickByTag = function(tag) { + var notification = window.Notification.active[tag]; + if (notification && notification.onclick && typeof notification.onclick == 'function') { + notification.onclick(tag); + } + delete window.Notification.active[tag]; + }; + + window.Notification.callOncloseByTag = function(tag) { + var notification = window.Notification.active[tag]; + if (notification && notification.onclose && typeof notification.onclose == 'function') { + notification.onclose(tag); + } + delete window.Notification.active[tag]; + }; + + // A global map of notifications by tag, so their onclick callbacks can be called. + // TODO: change name to something internal looking? + window.Notification.active = {}; + + /** + * Dismiss a notification. + */ + window.Notification.prototype.close = function() { + var self = this; + cordova.exec(function() { + if (self.onclose) { + self.onclose(); + } + delete window.Notification[self.tag]; + }, function(error) { + if (self.onerror) { + self.onerror(error); + } + delete window.Notification[self.tag]; + }, 'WebNotifications', 'closeNotification', [{ + tag: this.tag, + }]); + }; +} http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/plugin.xml b/cordova-lib/spec-plugman/plugins/WeblessPlugin/plugin.xml new file mode 100644 index 0000000..5522d22 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WeblessPlugin/plugin.xml @@ -0,0 +1,83 @@ + + + + + + Webless Plugin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/android/WeblessPlugin.java ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/android/WeblessPlugin.java b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/android/WeblessPlugin.java new file mode 100644 index 0000000..5263b0c --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/android/WeblessPlugin.java @@ -0,0 +1,19 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png new file mode 100644 index 0000000..530e12b Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png new file mode 100644 index 0000000..530e12b Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png new file mode 100644 index 0000000..8b3d855 Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png new file mode 100644 index 0000000..8b3d855 Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png new file mode 100644 index 0000000..309b6bd Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png new file mode 100644 index 0000000..309b6bd Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png new file mode 100644 index 0000000..46a8901 Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png new file mode 100644 index 0000000..46a8901 Binary files /dev/null and b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.h ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.h b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.h new file mode 100644 index 0000000..6a23ab6 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.h @@ -0,0 +1,49 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +// +// PhoneGap ! ChildBrowserCommand +// +// +// Created by Jesse MacFadyen on 10-05-29. +// Copyright 2010 Nitobi. All rights reserved. +// + +#import +#ifdef PHONEGAP_FRAMEWORK + #import +#else + #import "PGPlugin.h" +#endif +#import "ChildBrowserViewController.h" + + + +@interface ChildBrowserCommand : PGPlugin { + + ChildBrowserViewController* childBrowser; +} + +@property (nonatomic, retain) ChildBrowserViewController *childBrowser; + + +- (void) showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; +-(void) onChildLocationChange:(NSString*)newLoc; + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.m ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.m b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.m new file mode 100644 index 0000000..38aaf64 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.m @@ -0,0 +1,86 @@ +// + +// +// +// Created by Jesse MacFadyen on 10-05-29. +// Copyright 2010 Nitobi. All rights reserved. +// Copyright (c) 2011, IBM Corporation +// Copyright 2011, Randy McMillan +// + +#import "ChildBrowserCommand.h" + +#ifdef PHONEGAP_FRAMEWORK + #import +#else + #import "PhoneGapViewController.h" +#endif + + +@implementation ChildBrowserCommand + +@synthesize childBrowser; + +- (void) showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options // args: url +{ + + if(childBrowser == NULL) + { + childBrowser = [[ ChildBrowserViewController alloc ] initWithScale:FALSE ]; + childBrowser.delegate = self; + } + +/* // TODO: Work in progress + NSString* strOrientations = [ options objectForKey:@"supportedOrientations"]; + NSArray* supportedOrientations = [strOrientations componentsSeparatedByString:@","]; +*/ + PhoneGapViewController* cont = (PhoneGapViewController*)[ super appViewController ]; + childBrowser.supportedOrientations = cont.supportedOrientations; + + if ([cont respondsToSelector:@selector(presentViewController)]) { + //Reference UIViewController.h Line:179 for update to iOS 5 difference - @RandyMcMillan + [cont presentViewController:childBrowser animated:YES completion:nil]; + } else { + [ cont presentModalViewController:childBrowser animated:YES ]; + } + + NSString *url = (NSString*) [arguments objectAtIndex:0]; + + [childBrowser loadURL:url ]; + +} + +-(void) close:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options // args: url +{ + [ childBrowser closeBrowser]; + +} + +-(void) onClose +{ + NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onClose();",@""]; + [self.webView stringByEvaluatingJavaScriptFromString:jsCallback]; +} + +-(void) onOpenInSafari +{ + NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onOpenExternal();",@""]; + [self.webView stringByEvaluatingJavaScriptFromString:jsCallback]; +} + + +-(void) onChildLocationChange:(NSString*)newLoc +{ + + NSString* tempLoc = [NSString stringWithFormat:@"%@",newLoc]; + NSString* encUrl = [tempLoc stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + + NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onLocationChange('%@');",encUrl]; + [self.webView stringByEvaluatingJavaScriptFromString:jsCallback]; + +} + + + + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.h ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.h b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.h new file mode 100644 index 0000000..d6fc139 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.h @@ -0,0 +1,73 @@ +/* + * + * Copyright 2013 Anis Kadri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +// +// ChildBrowserViewController.h +// +// Created by Jesse MacFadyen on 21/07/09. +// Copyright 2009 Nitobi. All rights reserved. +// + +#import + +@protocol ChildBrowserDelegate + + + +/* + * onChildLocationChanging:newLoc + * + * Discussion: + * Invoked when a new page has loaded + */ +-(void) onChildLocationChange:(NSString*)newLoc; +-(void) onOpenInSafari; +-(void) onClose; +@end + + +@interface ChildBrowserViewController : UIViewController < UIWebViewDelegate > { + IBOutlet UIWebView* webView; + IBOutlet UIBarButtonItem* closeBtn; + IBOutlet UIBarButtonItem* refreshBtn; + IBOutlet UILabel* addressLabel; + IBOutlet UIBarButtonItem* backBtn; + IBOutlet UIBarButtonItem* fwdBtn; + IBOutlet UIBarButtonItem* safariBtn; + IBOutlet UIActivityIndicatorView* spinner; + BOOL scaleEnabled; + BOOL isImage; + NSString* imageURL; + NSArray* supportedOrientations; + id delegate; +} + +@property (nonatomic, retain)id delegate; +@property (nonatomic, retain) NSArray* supportedOrientations; +@property(retain) NSString* imageURL; +@property(assign) BOOL isImage; + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation; +- (ChildBrowserViewController*)initWithScale:(BOOL)enabled; +- (IBAction)onDoneButtonPress:(id)sender; +- (IBAction)onSafariButtonPress:(id)sender; +- (void)loadURL:(NSString*)url; +-(void)closeBrowser; + +@end http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.m ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.m b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.m new file mode 100644 index 0000000..167ef98 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.m @@ -0,0 +1,239 @@ +// +// ChildBrowserViewController.m +// +// Created by Jesse MacFadyen on 21/07/09. +// Copyright 2009 Nitobi. All rights reserved. +// Copyright (c) 2011, IBM Corporation +// Copyright 2011, Randy McMillan +// + +#import "ChildBrowserViewController.h" + + +@implementation ChildBrowserViewController + +@synthesize imageURL; +@synthesize supportedOrientations; +@synthesize isImage; +@synthesize delegate; + +/* + // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { + // Custom initialization + } + return self; +} +*/ + ++ (NSString*) resolveImageResource:(NSString*)resource +{ + NSString* systemVersion = [[UIDevice currentDevice] systemVersion]; + BOOL isLessThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedAscending); + + // the iPad image (nor retina) differentiation code was not in 3.x, and we have to explicitly set the path + if (isLessThaniOS4) + { + return [NSString stringWithFormat:@"%@.png", resource]; + } + + return resource; +} + + +- (ChildBrowserViewController*)initWithScale:(BOOL)enabled +{ + self = [super init]; + + + scaleEnabled = enabled; + + return self; +} + +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad { + [super viewDidLoad]; + + refreshBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/but_refresh"]]; + backBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/arrow_left"]]; + fwdBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/arrow_right"]]; + safariBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/compass"]]; + + webView.delegate = self; + webView.scalesPageToFit = TRUE; + webView.backgroundColor = [UIColor whiteColor]; + NSLog(@"View did load"); +} + + + + + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; + NSLog(@"View did UN-load"); +} + + +- (void)dealloc { + + webView.delegate = nil; + + [webView release]; + [closeBtn release]; + [refreshBtn release]; + [addressLabel release]; + [backBtn release]; + [fwdBtn release]; + [safariBtn release]; + [spinner release]; + [ supportedOrientations release]; + [super dealloc]; +} + +-(void)closeBrowser +{ + + if(delegate != NULL) + { + [delegate onClose]; + } + if ([self respondsToSelector:@selector(presentingViewController)]) { + //Reference UIViewController.h Line:179 for update to iOS 5 difference - @RandyMcMillan + [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil]; + } else { + [[self parentViewController] dismissModalViewControllerAnimated:YES]; + } +} + +-(IBAction) onDoneButtonPress:(id)sender +{ + [ self closeBrowser]; + + NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]; + [webView loadRequest:request]; +} + + +-(IBAction) onSafariButtonPress:(id)sender +{ + + if(delegate != NULL) + { + [delegate onOpenInSafari]; + } + + if(isImage) + { + NSURL* pURL = [[ [NSURL alloc] initWithString:imageURL ] autorelease]; + [ [ UIApplication sharedApplication ] openURL:pURL ]; + } + else + { + NSURLRequest *request = webView.request; + [[UIApplication sharedApplication] openURL:request.URL]; + } + + +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation +{ + BOOL autoRotate = [self.supportedOrientations count] > 1; // autorotate if only more than 1 orientation supported + if (autoRotate) + { + if ([self.supportedOrientations containsObject: + [NSNumber numberWithInt:interfaceOrientation]]) { + return YES; + } + } + + return NO; +} + + + + +- (void)loadURL:(NSString*)url +{ + NSLog(@"Opening Url : %@",url); + + if( [url hasSuffix:@".png" ] || + [url hasSuffix:@".jpg" ] || + [url hasSuffix:@".jpeg" ] || + [url hasSuffix:@".bmp" ] || + [url hasSuffix:@".gif" ] ) + { + [ imageURL release ]; + imageURL = [url copy]; + isImage = YES; + NSString* htmlText = @""; + htmlText = [ htmlText stringByReplacingOccurrencesOfString:@"IMGSRC" withString:url ]; + + [webView loadHTMLString:htmlText baseURL:[NSURL URLWithString:@""]]; + + } + else + { + imageURL = @""; + isImage = NO; + NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; + [webView loadRequest:request]; + } + webView.hidden = NO; +} + + +- (void)webViewDidStartLoad:(UIWebView *)sender { + addressLabel.text = @"Loading..."; + backBtn.enabled = webView.canGoBack; + fwdBtn.enabled = webView.canGoForward; + + [ spinner startAnimating ]; + +} + +- (void)webViewDidFinishLoad:(UIWebView *)sender +{ + NSURLRequest *request = webView.request; + NSLog(@"New Address is : %@",request.URL.absoluteString); + addressLabel.text = request.URL.absoluteString; + backBtn.enabled = webView.canGoBack; + fwdBtn.enabled = webView.canGoForward; + [ spinner stopAnimating ]; + + if(delegate != NULL) + { + [delegate onChildLocationChange:request.URL.absoluteString]; + } + +} + +- (void)webView:(UIWebView *)wv didFailLoadWithError:(NSError *)error { + NSLog (@"webView:didFailLoadWithError"); + [spinner stopAnimating]; + addressLabel.text = @"Failed"; + if (error != NULL) { + UIAlertView *errorAlert = [[UIAlertView alloc] + initWithTitle: [error localizedDescription] + message: [error localizedFailureReason] + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [errorAlert show]; + [errorAlert release]; + } +} + + +@end