cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject cordova-plugins git commit: Renamed SACordovaLocalWebServer -> CDVLocalWebServer
Date Wed, 12 Nov 2014 15:11:53 GMT
Repository: cordova-plugins
Updated Branches:
  refs/heads/master 71a72594f -> 6e91e595b


Renamed SACordovaLocalWebServer -> CDVLocalWebServer


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/6e91e595
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/6e91e595
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/6e91e595

Branch: refs/heads/master
Commit: 6e91e595b68f27e9dfb68045d68529cfb9dbae82
Parents: 71a7259
Author: Shazron Abdullah <shazron@apache.org>
Authored: Wed Nov 12 07:11:51 2014 -0800
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Wed Nov 12 07:11:51 2014 -0800

----------------------------------------------------------------------
 local-webserver/plugin.xml                      |  4 +-
 local-webserver/src/ios/CDVLocalWebServer.h     | 26 ++++++++
 local-webserver/src/ios/CDVLocalWebServer.m     | 70 ++++++++++++++++++++
 .../src/ios/SACordovaLocalWebServer.h           | 26 --------
 .../src/ios/SACordovaLocalWebServer.m           | 70 --------------------
 5 files changed, 98 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6e91e595/local-webserver/plugin.xml
----------------------------------------------------------------------
diff --git a/local-webserver/plugin.xml b/local-webserver/plugin.xml
index 979b1b3..0d9461f 100644
--- a/local-webserver/plugin.xml
+++ b/local-webserver/plugin.xml
@@ -41,8 +41,8 @@
             <preference name="CordovaLocalWebServerStartOnSimulator" value="true" />
         </config-file>
 
-	    <header-file src="src/ios/SACordovaLocalWebServer.h" />
-	    <source-file src="src/ios/SACordovaLocalWebServer.m" />
+	    <header-file src="src/ios/CDVLocalWebServer.h" />
+	    <source-file src="src/ios/CDVLocalWebServer.m" />
 	    
 	    <header-file src="src/ios/GCDWebServer+LocalhostOnlyBaseHandler.h" />
 	    <source-file src="src/ios/GCDWebServer+LocalhostOnlyBaseHandler.m" />

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6e91e595/local-webserver/src/ios/CDVLocalWebServer.h
----------------------------------------------------------------------
diff --git a/local-webserver/src/ios/CDVLocalWebServer.h b/local-webserver/src/ios/CDVLocalWebServer.h
new file mode 100644
index 0000000..e5be9f6
--- /dev/null
+++ b/local-webserver/src/ios/CDVLocalWebServer.h
@@ -0,0 +1,26 @@
+/*
+ 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 <Cordova/CDVPlugin.h>
+#import "GCDWebServer.h"
+
+@interface CDVLocalWebServer : CDVPlugin
+
+@property (nonatomic, strong) GCDWebServer* server;
+@end

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6e91e595/local-webserver/src/ios/CDVLocalWebServer.m
----------------------------------------------------------------------
diff --git a/local-webserver/src/ios/CDVLocalWebServer.m b/local-webserver/src/ios/CDVLocalWebServer.m
new file mode 100644
index 0000000..ed6490f
--- /dev/null
+++ b/local-webserver/src/ios/CDVLocalWebServer.m
@@ -0,0 +1,70 @@
+/*
+ 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 "CDVLocalWebServer.h"
+#import "GCDWebServerPrivate.h"
+#import "GCDWebServer+LocalhostOnlyBaseHandler.h"
+#import <Cordova/CDVViewController.h>
+
+@implementation CDVLocalWebServer
+
+- (void) pluginInitialize {
+
+    BOOL useLocalWebServer = NO;
+    NSString* indexPage = @"index.html";
+    NSUInteger port = 80;
+
+    // check the content tag src
+    CDVViewController* vc = (CDVViewController*)self.viewController;
+    NSURL* startPageUrl = [NSURL URLWithString:vc.startPage];
+    if (startPageUrl != nil) {
+        if ([[startPageUrl scheme] isEqualToString:@"http"] && [[startPageUrl host]
isEqualToString:@"localhost"]) {
+            port = [[startPageUrl port] unsignedIntegerValue];
+            useLocalWebServer = YES;
+        }
+    }
+    
+    // check setting
+#if TARGET_IPHONE_SIMULATOR
+    if (useLocalWebServer) {
+        NSNumber* startOnSimulatorSetting = [[self.commandDelegate settings] objectForKey:[@"CordovaLocalWebServerStartOnSimulator"
lowercaseString]];
+        if (startOnSimulatorSetting) {
+            useLocalWebServer = [startOnSimulatorSetting boolValue];
+        }
+    }
+#endif
+    
+    if (useLocalWebServer) {
+		// Create server
+        self.server = [[GCDWebServer alloc] init];
+        NSString* path = [self.commandDelegate pathForResource:indexPage];
+		NSString* authToken = [NSString stringWithFormat:@"cdvToken=%@", [[NSProcessInfo processInfo]
globallyUniqueString]];
+		[self.server addLocalhostOnlyGETHandlerForBasePath:@"/" directoryPath:[path stringByDeletingLastPathComponent]
indexFilename:indexPage cacheAge:0 allowRangeRequests:YES authToken:authToken];
+        [self.server startWithPort:port bonjourName:nil];
+        [GCDWebServer setLogLevel:kGCDWebServerLoggingLevel_Error];
+        
+        // Update the startPage (supported in cordova-ios 3.7.0, see https://issues.apache.org/jira/browse/CB-7857)
+		vc.startPage = [NSString stringWithFormat:@"http://localhost:%lu/%@?%@", self.server.port,
indexPage, authToken];
+        
+    } else {
+        NSLog(@"WARNING: CordovaLocalWebServer: <content> tag src is not http://localhost[:port]
(is %@), local web server not started.", vc.startPage);
+    }
+}
+
+@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6e91e595/local-webserver/src/ios/SACordovaLocalWebServer.h
----------------------------------------------------------------------
diff --git a/local-webserver/src/ios/SACordovaLocalWebServer.h b/local-webserver/src/ios/SACordovaLocalWebServer.h
deleted file mode 100644
index b792c4c..0000000
--- a/local-webserver/src/ios/SACordovaLocalWebServer.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- 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 <Cordova/CDVPlugin.h>
-#import "GCDWebServer.h"
-
-@interface SACordovaLocalWebServer : CDVPlugin
-
-@property (nonatomic, strong) GCDWebServer* server;
-@end

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/6e91e595/local-webserver/src/ios/SACordovaLocalWebServer.m
----------------------------------------------------------------------
diff --git a/local-webserver/src/ios/SACordovaLocalWebServer.m b/local-webserver/src/ios/SACordovaLocalWebServer.m
deleted file mode 100644
index be7070d..0000000
--- a/local-webserver/src/ios/SACordovaLocalWebServer.m
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- 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 "SACordovaLocalWebServer.h"
-#import "GCDWebServerPrivate.h"
-#import "GCDWebServer+LocalhostOnlyBaseHandler.h"
-#import <Cordova/CDVViewController.h>
-
-@implementation SACordovaLocalWebServer
-
-- (void) pluginInitialize {
-
-    BOOL useLocalWebServer = NO;
-    NSString* indexPage = @"index.html";
-    NSUInteger port = 80;
-
-    // check the content tag src
-    CDVViewController* vc = (CDVViewController*)self.viewController;
-    NSURL* startPageUrl = [NSURL URLWithString:vc.startPage];
-    if (startPageUrl != nil) {
-        if ([[startPageUrl scheme] isEqualToString:@"http"] && [[startPageUrl host]
isEqualToString:@"localhost"]) {
-            port = [[startPageUrl port] unsignedIntegerValue];
-            useLocalWebServer = YES;
-        }
-    }
-    
-    // check setting
-#if TARGET_IPHONE_SIMULATOR
-    if (useLocalWebServer) {
-        NSNumber* startOnSimulatorSetting = [[self.commandDelegate settings] objectForKey:[@"CordovaLocalWebServerStartOnSimulator"
lowercaseString]];
-        if (startOnSimulatorSetting) {
-            useLocalWebServer = [startOnSimulatorSetting boolValue];
-        }
-    }
-#endif
-    
-    if (useLocalWebServer) {
-		// Create server
-        self.server = [[GCDWebServer alloc] init];
-        NSString* path = [self.commandDelegate pathForResource:indexPage];
-		NSString* authToken = [NSString stringWithFormat:@"cdvToken=%@", [[NSProcessInfo processInfo]
globallyUniqueString]];
-		[self.server addLocalhostOnlyGETHandlerForBasePath:@"/" directoryPath:[path stringByDeletingLastPathComponent]
indexFilename:indexPage cacheAge:0 allowRangeRequests:YES authToken:authToken];
-        [self.server startWithPort:port bonjourName:nil];
-        [GCDWebServer setLogLevel:kGCDWebServerLoggingLevel_Error];
-        
-        // Update the startPage (supported in cordova-ios 3.7.0, see https://issues.apache.org/jira/browse/CB-7857)
-		vc.startPage = [NSString stringWithFormat:@"http://localhost:%lu/%@?%@", self.server.port,
indexPage, authToken];
-        
-    } else {
-        NSLog(@"WARNING: CordovaLocalWebServer: <content> tag src is not http://localhost[:port]
(is %@), local web server not started.", vc.startPage);
-    }
-}
-
-@end
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message