cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject mac commit: Enable HTML5 localStorage.
Date Mon, 15 Apr 2013 23:59:04 GMT
Updated Branches:
  refs/heads/master 24e37235d -> cdf7f295c


Enable HTML5 localStorage.


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

Branch: refs/heads/master
Commit: cdf7f295cbcbfcc35ecb25ded1cad50e8c4e7a11
Parents: 24e3723
Author: Shazron Abdullah <shazron@apache.org>
Authored: Mon Apr 15 16:58:58 2013 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Mon Apr 15 16:58:58 2013 -0700

----------------------------------------------------------------------
 .../__TESTING__/Classes/MainViewController.m       |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/cdf7f295/bin/templates/project/__TESTING__/Classes/MainViewController.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/Classes/MainViewController.m b/bin/templates/project/__TESTING__/Classes/MainViewController.m
index d82132b..366291d 100644
--- a/bin/templates/project/__TESTING__/Classes/MainViewController.m
+++ b/bin/templates/project/__TESTING__/Classes/MainViewController.m
@@ -61,11 +61,22 @@
 }
 
 
-- (void)windowDidLoad
+- (void)awakeFromNib
 {
-    [super windowDidLoad];
+    [super awakeFromNib];
     
     // Implement this method to handle any initialization after your window controller's
window has been loaded from its nib file.
+
+    // enable HTML5 webStorage
+    WebPreferences* prefs = [self.webView preferences];
+    if ([prefs respondsToSelector:@selector(_setLocalStorageDatabasePath:)]) {
+        NSString* webStoragePath = @"~/Library/Application Support/__TESTING__";
+        [prefs performSelector:@selector(_setLocalStorageDatabasePath:) withObject:webStoragePath];
+        NSLog(@"WebStoragePath is '%@', modify in MainViewController.m.", webStoragePath);
+    }
+    if ([prefs respondsToSelector:@selector(setLocalStorageEnabled:)]) {
+        [prefs performSelector:@selector(setLocalStorageEnabled:) withObject:[NSNumber numberWithBool:YES]];
+    }
 }
 
 @end


Mime
View raw message