rhodes 2.0.0.beta7 → 2.0.0.beta8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +20 -1
- data/bin/rhodes-setup +6 -2
- data/lib/extensions/digest/ext/Rakefile +2 -2
- data/lib/framework/rho/render.rb +2 -0
- data/lib/framework/rho/rho.rb +159 -95
- data/lib/framework/rho/rhoapplication.rb +24 -5
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhom/rhom_model.rb +32 -23
- data/lib/framework/rhom/rhom_object_factory.rb +2 -2
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/jni/src/callbacks.cpp +8 -1
- data/platform/android/Rhodes/jni/src/mapview.cpp +4 -1
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +5 -1
- data/platform/android/Rhodes/jni/src/webview.cpp +3 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +3 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +1 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +3 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +24 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +7 -2
- data/platform/android/build/android.rake +11 -38
- data/platform/android/build/androidcommon.rb +50 -2
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/android/build/libsqlite_build.files +1 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +2 -1
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -5
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +3 -6
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +4 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +12 -35
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +2 -1
- data/platform/iphone/Classes/DateTimePickerDelegate.m +4 -4
- data/platform/iphone/Classes/NativeBar.m +12 -6
- data/platform/iphone/Classes/NavBar.m +1 -1
- data/platform/iphone/Classes/RhoMainView.h +4 -1
- data/platform/iphone/Classes/Rhodes.h +6 -2
- data/platform/iphone/Classes/Rhodes.m +23 -3
- data/platform/iphone/Classes/SimpleMainView.h +3 -7
- data/platform/iphone/Classes/SimpleMainView.m +108 -54
- data/platform/iphone/Classes/TabbedMainView.h +3 -2
- data/platform/iphone/Classes/TabbedMainView.m +21 -10
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +8 -0
- data/platform/shared/common/IRhoClassFactory.h +1 -0
- data/platform/shared/common/RhodesApp.cpp +7 -2
- data/platform/shared/common/ThreadQueue.cpp +110 -0
- data/platform/shared/common/ThreadQueue.h +75 -0
- data/platform/shared/logging/RhoLogCat.h +4 -0
- data/platform/shared/net/AsyncHttp.cpp +134 -135
- data/platform/shared/net/AsyncHttp.h +74 -33
- data/platform/shared/net/HttpServer.cpp +7 -1
- data/platform/shared/ruby/thread.c +4 -0
- data/platform/shared/ruby/thread_win32.c +9 -8
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +26 -5
- data/platform/shared/rubyJVM/src/com/rho/net/INetworkAccess.java +0 -2
- data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +4 -13
- data/platform/shared/rubyJVM/src/com/rho/net/URI.java +2 -2
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +3 -3
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/ObjectFactory.java +12 -2
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyString.java +6 -3
- data/platform/shared/rubyJVM/src/javolution/util/FastTable.java +12 -2
- data/platform/shared/sync/SyncEngine.cpp +15 -3
- data/platform/shared/sync/SyncEngine.h +1 -1
- data/platform/shared/sync/SyncThread.cpp +18 -101
- data/platform/shared/sync/SyncThread.h +30 -22
- data/platform/wm/RhoLib/RhoLib.vcproj +8 -0
- data/platform/wm/rhodes/Rhodes.cpp +143 -1
- data/platform/wm/rhodes/memory_helper.cpp +273 -0
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.cpp +1 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +46 -3
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +29 -1
- data/res/build-tools/db/syncdb.schema +1 -0
- data/res/generators/rhogen.rb +1 -1
- data/rhodes.gemspec +2 -2
- metadata +23 -6
- data/Manifest.txt +0 -5289
- data/rhobuild.yml +0 -37
@@ -25,7 +25,7 @@
|
|
25
25
|
NSString *title = [args objectAtIndex:0];
|
26
26
|
NSArray *left = [args objectAtIndex:1];
|
27
27
|
NSArray *right = [args objectAtIndex:2];
|
28
|
-
[[[Rhodes sharedInstance] mainView]
|
28
|
+
[[[Rhodes sharedInstance] mainView] addNavBar:title left:left right:right];
|
29
29
|
}
|
30
30
|
@end
|
31
31
|
|
@@ -11,6 +11,9 @@
|
|
11
11
|
@protocol RhoMainView
|
12
12
|
|
13
13
|
- (UIView*)view;
|
14
|
+
- (UIView*)parent;
|
15
|
+
|
16
|
+
- (UIWebView*)detachWebView;
|
14
17
|
|
15
18
|
- (void)loadHTMLString:(NSString*)data;
|
16
19
|
|
@@ -27,7 +30,7 @@
|
|
27
30
|
- (void)switchTab:(int)index;
|
28
31
|
- (int)activeTab;
|
29
32
|
|
30
|
-
- (void)
|
33
|
+
- (void)addNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right;
|
31
34
|
- (void)removeNavBar;
|
32
35
|
|
33
36
|
@end
|
@@ -32,13 +32,12 @@
|
|
32
32
|
LogViewController* logViewController;
|
33
33
|
DateTimePickerDelegate* dateTimePickerDelegate;
|
34
34
|
PickImageDelegate* pickImageDelegate;
|
35
|
-
|
35
|
+
|
36
36
|
id<RhoMainView,NSObject> mainView;
|
37
37
|
}
|
38
38
|
|
39
39
|
@property (nonatomic, retain) UIWindow *window;
|
40
40
|
@property (nonatomic, retain) AVAudioPlayer *player;
|
41
|
-
@property (nonatomic, retain) id<RhoMainView,NSObject> mainView;
|
42
41
|
@property (nonatomic, retain) NSMutableDictionary *cookies;
|
43
42
|
|
44
43
|
+ (Rhodes*)sharedInstance;
|
@@ -48,6 +47,8 @@
|
|
48
47
|
+ (CGRect)applicationFrame;
|
49
48
|
+ (void)setStatusBarHidden:(BOOL)v;
|
50
49
|
|
50
|
+
//+ (UIView*)subviewWithTag:(NSInteger)tag ofView:(UIView*)view;
|
51
|
+
|
51
52
|
+ (void)performOnUiThread:(id)runnable wait:(BOOL)wait;
|
52
53
|
+ (void)performOnUiThread:(id)runnable arg:(id)arg wait:(BOOL)wait;
|
53
54
|
+ (void)performOnUiThread:(id)runnable arg:(id)arg1 arg:(id)arg2 wait:(BOOL)wait;
|
@@ -60,4 +61,7 @@
|
|
60
61
|
- (void)setCookie:(NSString*)cookie forUrl:(NSString*)url;
|
61
62
|
- (NSString*)cookie:(NSString*)url;
|
62
63
|
|
64
|
+
- (id<RhoMainView,NSObject>)mainView;
|
65
|
+
- (void)setMainView:(id<RhoMainView,NSObject>)view;
|
66
|
+
|
63
67
|
@end
|
@@ -17,7 +17,7 @@ void rho_geoimpl_init();
|
|
17
17
|
|
18
18
|
@implementation Rhodes
|
19
19
|
|
20
|
-
@synthesize window, player,
|
20
|
+
@synthesize window, player, cookies;
|
21
21
|
|
22
22
|
static Rhodes *instance = NULL;
|
23
23
|
|
@@ -46,6 +46,24 @@ static Rhodes *instance = NULL;
|
|
46
46
|
[[[[Rhodes sharedInstance] mainView] view] setFrame:[Rhodes applicationFrame]];
|
47
47
|
}
|
48
48
|
|
49
|
+
#if 0
|
50
|
+
+ (UIView*)subviewWithTag:(NSInteger)tag ofView:(UIView*)view {
|
51
|
+
if (!view)
|
52
|
+
return nil;
|
53
|
+
|
54
|
+
for (int i = 0, lim = [view.subviews count]; i < lim; ++i) {
|
55
|
+
UIView *subview = [view.subviews objectAtIndex:i];
|
56
|
+
if (subview.tag == tag)
|
57
|
+
return subview;
|
58
|
+
subview = [self subviewWithTag:tag ofView:subview];
|
59
|
+
if (subview)
|
60
|
+
return subview;
|
61
|
+
}
|
62
|
+
|
63
|
+
return nil;
|
64
|
+
}
|
65
|
+
#endif
|
66
|
+
|
49
67
|
- (void)runRunnable:(NSArray*)args {
|
50
68
|
id runnable = [args objectAtIndex:0];
|
51
69
|
if ([runnable respondsToSelector:@selector(run)])
|
@@ -231,12 +249,15 @@ static Rhodes *instance = NULL;
|
|
231
249
|
splashViewController = nil;
|
232
250
|
}
|
233
251
|
|
234
|
-
[mainView.view removeFromSuperview];
|
235
252
|
[mainView release];
|
236
253
|
mainView = [view retain];
|
237
254
|
[window addSubview:mainView.view];
|
238
255
|
}
|
239
256
|
|
257
|
+
- (id<RhoMainView,NSObject>)mainView {
|
258
|
+
return mainView;
|
259
|
+
}
|
260
|
+
|
240
261
|
- (void) showLoadingPage
|
241
262
|
{
|
242
263
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
@@ -288,7 +309,6 @@ static Rhodes *instance = NULL;
|
|
288
309
|
dateTimePickerDelegate = [[DateTimePickerDelegate alloc] init];
|
289
310
|
pickImageDelegate = [[PickImageDelegate alloc] init];
|
290
311
|
|
291
|
-
rho_geoimpl_init();
|
292
312
|
rho_rhodesapp_start();
|
293
313
|
|
294
314
|
#ifdef __IPHONE_3_0
|
@@ -18,13 +18,9 @@
|
|
18
18
|
}
|
19
19
|
|
20
20
|
@property (retain) UIView *root;
|
21
|
-
@property (retain) UIWebView *webView;
|
22
|
-
@property (retain) UIToolbar *toolbar;
|
23
|
-
@property (retain) UINavigationBar *navbar;
|
24
21
|
|
25
|
-
- (id)
|
26
|
-
- (id)
|
27
|
-
- (id)initWithParentView:(UIView *)
|
28
|
-
- (id)initWithParentView:(UIView *)v frame:(CGRect)frame toolbar:(NSArray*)items;
|
22
|
+
- (id)initWithMainView:(id<RhoMainView>)v;
|
23
|
+
- (id)initWithMainView:(id<RhoMainView>)v toolbar:(NSArray*)items;
|
24
|
+
- (id)initWithParentView:(UIView *)p frame:(CGRect)frame;
|
29
25
|
|
30
26
|
@end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
//
|
2
2
|
// SimpleMainView.m
|
3
3
|
// rhorunner
|
4
4
|
//
|
@@ -17,6 +17,10 @@
|
|
17
17
|
#undef DEFAULT_LOGCATEGORY
|
18
18
|
#define DEFAULT_LOGCATEGORY "SimpleMainView"
|
19
19
|
|
20
|
+
#define RHO_TAG_WEBVIEW 1
|
21
|
+
#define RHO_TAG_TOOLBAR 2
|
22
|
+
#define RHO_TAG_NAVBAR 3
|
23
|
+
|
20
24
|
@interface RhoToolbarButtonItemAction : NSObject
|
21
25
|
{
|
22
26
|
NSString *url;
|
@@ -53,7 +57,7 @@
|
|
53
57
|
|
54
58
|
@implementation SimpleMainView
|
55
59
|
|
56
|
-
@synthesize root
|
60
|
+
@synthesize root;
|
57
61
|
|
58
62
|
- (UIBarButtonItem*)newButton:(NSString*)url label:(NSString*)label icon:(NSString*)icon {
|
59
63
|
UIImage *img = nil;
|
@@ -176,50 +180,66 @@
|
|
176
180
|
return tb;
|
177
181
|
}
|
178
182
|
|
179
|
-
- (
|
180
|
-
|
183
|
+
- (void)removeToolbar {
|
184
|
+
if (toolbar) {
|
185
|
+
CGRect wFrame = webView.frame;
|
186
|
+
CGRect tbFrame = toolbar.frame;
|
187
|
+
wFrame.size.height += tbFrame.size.height;
|
188
|
+
webView.frame = wFrame;
|
189
|
+
}
|
190
|
+
|
191
|
+
[toolbar removeFromSuperview];
|
192
|
+
toolbar = nil;
|
181
193
|
}
|
182
194
|
|
183
|
-
- (
|
184
|
-
|
195
|
+
- (void)addToolbar:(NSArray*)items {
|
196
|
+
[self removeToolbar];
|
197
|
+
|
198
|
+
if (!items)
|
199
|
+
return;
|
200
|
+
|
201
|
+
CGRect wFrame = webView.frame;
|
202
|
+
|
203
|
+
[toolbar removeFromSuperview];
|
204
|
+
toolbar = [self newToolbar:items frame:wFrame];
|
205
|
+
toolbar.tag = RHO_TAG_TOOLBAR;
|
206
|
+
[root addSubview:toolbar];
|
207
|
+
|
208
|
+
CGRect tbFrame = toolbar.frame;
|
209
|
+
wFrame.size.height -= tbFrame.size.height;
|
210
|
+
webView.frame = wFrame;
|
185
211
|
}
|
186
212
|
|
187
|
-
- (
|
188
|
-
|
213
|
+
- (UIWebView*)newWebView:(CGRect)frame {
|
214
|
+
UIWebView *w = [[UIWebView alloc] initWithFrame:frame];
|
215
|
+
w.scalesPageToFit = YES;
|
216
|
+
w.userInteractionEnabled = YES;
|
217
|
+
w.multipleTouchEnabled = YES;
|
218
|
+
w.autoresizesSubviews = YES;
|
219
|
+
w.clipsToBounds = NO;
|
220
|
+
w.dataDetectorTypes = UIDataDetectorTypeNone;
|
221
|
+
w.delegate = self;
|
222
|
+
w.tag = RHO_TAG_WEBVIEW;
|
223
|
+
|
224
|
+
return w;
|
189
225
|
}
|
190
226
|
|
191
|
-
- (id)
|
192
|
-
parent =
|
227
|
+
- (id)init:(UIView*)p webView:(UIWebView*)w frame:(CGRect)frame toolbar:(NSArray*)items {
|
228
|
+
parent = p;
|
193
229
|
|
194
230
|
root = [[UIView alloc] initWithFrame:frame];
|
195
231
|
root.userInteractionEnabled = YES;
|
196
232
|
|
233
|
+
[webView removeFromSuperview];
|
234
|
+
webView = w;
|
235
|
+
if (!webView)
|
236
|
+
webView = [self newWebView:frame];
|
237
|
+
[root addSubview:webView];
|
197
238
|
CGRect wFrame = frame;
|
198
239
|
wFrame.origin.y = 0;
|
199
|
-
webView =
|
200
|
-
webView.scalesPageToFit = YES;
|
201
|
-
webView.userInteractionEnabled = YES;
|
202
|
-
//webView.detectsPhoneNumbers = YES;
|
203
|
-
webView.multipleTouchEnabled = YES;
|
204
|
-
webView.autoresizesSubviews = YES;
|
205
|
-
webView.clipsToBounds = NO;
|
206
|
-
webView.delegate = self;
|
207
|
-
|
208
|
-
[root addSubview:webView];
|
209
|
-
|
210
|
-
if (items) {
|
211
|
-
UIToolbar *tb = [self newToolbar:items frame:wFrame];
|
212
|
-
self.toolbar = tb;
|
213
|
-
[root addSubview:toolbar];
|
214
|
-
|
215
|
-
CGRect newFrame = wFrame;
|
216
|
-
CGRect tbFrame = tb.frame;
|
217
|
-
newFrame.size.height -= tbFrame.size.height;
|
218
|
-
webView.frame = newFrame;
|
219
|
-
|
220
|
-
[tb release];
|
221
|
-
}
|
240
|
+
webView.frame = wFrame;
|
222
241
|
|
242
|
+
[self addToolbar:items];
|
223
243
|
navbar = nil;
|
224
244
|
|
225
245
|
self.view = root;
|
@@ -227,6 +247,26 @@
|
|
227
247
|
return self;
|
228
248
|
}
|
229
249
|
|
250
|
+
- (id)initWithParentView:(UIView *)p frame:(CGRect)frame toolbar:(NSArray*)items {
|
251
|
+
return [self init:p webView:nil frame:frame toolbar:items];
|
252
|
+
}
|
253
|
+
|
254
|
+
- (id)initWithParentView:(UIView *)p frame:(CGRect)frame {
|
255
|
+
return [self initWithParentView:p frame:frame toolbar:nil];
|
256
|
+
}
|
257
|
+
|
258
|
+
- (id)initWithMainView:(id<RhoMainView>)v {
|
259
|
+
return [self initWithMainView:v toolbar:nil];
|
260
|
+
}
|
261
|
+
|
262
|
+
- (id)initWithMainView:(id<RhoMainView>)v toolbar:(NSArray*)items {
|
263
|
+
UIView *p = [v parent];
|
264
|
+
CGRect frame = [[v view] frame];
|
265
|
+
//UIWebView *w = (UIWebView*)[Rhodes subviewWithTag:RHO_TAG_WEBVIEW ofView:[v view]];
|
266
|
+
UIWebView *w = [v detachWebView];
|
267
|
+
return [self init:p webView:w frame:frame toolbar:items];
|
268
|
+
}
|
269
|
+
|
230
270
|
- (void)didReceiveMemoryWarning {
|
231
271
|
// Releases the view if it doesn't have a superview.
|
232
272
|
[super didReceiveMemoryWarning];
|
@@ -236,13 +276,10 @@
|
|
236
276
|
|
237
277
|
- (void)viewDidUnload {
|
238
278
|
[super viewDidUnload];
|
239
|
-
[root removeFromSuperview];
|
240
279
|
}
|
241
280
|
|
242
281
|
- (void)dealloc {
|
243
|
-
[
|
244
|
-
[toolbar release];
|
245
|
-
[webView release];
|
282
|
+
[root removeFromSuperview];
|
246
283
|
[root release];
|
247
284
|
[super dealloc];
|
248
285
|
}
|
@@ -277,6 +314,18 @@
|
|
277
314
|
return root;
|
278
315
|
}
|
279
316
|
|
317
|
+
- (UIView*)parent {
|
318
|
+
return parent;
|
319
|
+
}
|
320
|
+
|
321
|
+
- (UIWebView*)detachWebView {
|
322
|
+
UIWebView *w = [webView retain];
|
323
|
+
[w removeFromSuperview];
|
324
|
+
webView = nil;
|
325
|
+
|
326
|
+
return w;
|
327
|
+
}
|
328
|
+
|
280
329
|
- (void)loadHTMLString:(NSString *)data {
|
281
330
|
[webView loadHTMLString:data baseURL:[NSURL URLWithString:@""]];
|
282
331
|
}
|
@@ -290,17 +339,14 @@
|
|
290
339
|
}
|
291
340
|
|
292
341
|
- (void)navigate:(NSString *)url tab:(int)index {
|
293
|
-
|
294
|
-
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:escapedUrl]];
|
342
|
+
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
|
295
343
|
[webView loadRequest:request];
|
296
344
|
}
|
297
345
|
|
298
346
|
- (void)navigateRedirect:(NSString *)url tab:(int)index {
|
299
|
-
NSString* escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
300
|
-
NSString* redirector = [@"/system/redirect_to?url=" stringByAppendingString:escapedUrl];
|
301
347
|
NSString* homeurl = [NSString stringWithUTF8String:rho_rhodesapp_gethomeurl()];
|
302
|
-
NSString*
|
303
|
-
[self navigate:
|
348
|
+
NSString *redirect = [NSString stringWithFormat:@"%@/system/redirect_to?url=%@", homeurl, url];
|
349
|
+
[self navigate:redirect tab:index];
|
304
350
|
}
|
305
351
|
|
306
352
|
- (void)reload:(int)index {
|
@@ -326,10 +372,11 @@
|
|
326
372
|
return 0;
|
327
373
|
}
|
328
374
|
|
329
|
-
- (void)
|
375
|
+
- (void)addNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
|
330
376
|
[self removeNavBar];
|
331
377
|
|
332
378
|
UINavigationBar *nb = [[UINavigationBar alloc] initWithFrame:CGRectZero];
|
379
|
+
nb.tag = RHO_TAG_NAVBAR;
|
333
380
|
[nb sizeToFit];
|
334
381
|
|
335
382
|
UINavigationItem *ni = [[UINavigationItem alloc] initWithTitle:title];
|
@@ -352,9 +399,8 @@
|
|
352
399
|
}
|
353
400
|
|
354
401
|
[nb pushNavigationItem:ni animated:NO];
|
355
|
-
|
356
|
-
|
357
|
-
|
402
|
+
[navbar removeFromSuperview];
|
403
|
+
navbar = nb;
|
358
404
|
[root addSubview:navbar];
|
359
405
|
|
360
406
|
CGRect nFrame = navbar.frame;
|
@@ -374,7 +420,7 @@
|
|
374
420
|
}
|
375
421
|
|
376
422
|
[navbar removeFromSuperview];
|
377
|
-
|
423
|
+
navbar = nil;
|
378
424
|
}
|
379
425
|
|
380
426
|
// UIWebViewDelegate imlementation
|
@@ -382,12 +428,20 @@
|
|
382
428
|
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
|
383
429
|
navigationType:(UIWebViewNavigationType)navigationType {
|
384
430
|
NSString *url = [[request URL] absoluteString];
|
385
|
-
if (url)
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
431
|
+
if (!url)
|
432
|
+
return NO;
|
433
|
+
|
434
|
+
if (![url hasPrefix:@"http:"]) {
|
435
|
+
// This is not http url so try to open external application for it
|
436
|
+
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
|
437
|
+
return NO;
|
438
|
+
}
|
439
|
+
|
440
|
+
// Retrieve cookie for http url
|
441
|
+
NSString *c = [[Rhodes sharedInstance] cookie:url];
|
442
|
+
if (c && [request isKindOfClass:[NSMutableURLRequest class]]) {
|
443
|
+
NSMutableURLRequest *r = (NSMutableURLRequest*)request;
|
444
|
+
[r addValue:c forHTTPHeaderField:@"Cookie"];
|
391
445
|
}
|
392
446
|
return YES;
|
393
447
|
}
|
@@ -18,7 +18,8 @@
|
|
18
18
|
@property (nonatomic,retain) UITabBarController *tabbar;
|
19
19
|
@property (nonatomic,retain) NSArray *tabbarData;
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
//- (id)initWithParentView:(UIView*)v items:(NSArray*)items;
|
22
|
+
//- (id)initWithParentView:(UIView*)v frame:(CGRect)frame items:(NSArray*)items;
|
23
|
+
- (id)initWithMainView:(id<RhoMainView>)v tabs:(NSArray*)items;
|
23
24
|
|
24
25
|
@end
|
@@ -54,12 +54,15 @@
|
|
54
54
|
|
55
55
|
@synthesize tabbar, tabbarData;
|
56
56
|
|
57
|
-
|
58
|
-
return [self initWithParentView:v frame:v.frame items:items];
|
59
|
-
}
|
57
|
+
//- (id)initWithParentView:(UIView *)v items:(NSArray *)items {
|
58
|
+
// return [self initWithParentView:v frame:v.frame items:items];
|
59
|
+
//}
|
60
60
|
|
61
|
-
|
62
|
-
|
61
|
+
//- (id)initWithParentView:(UIView *)v frame:(CGRect)frame items:(NSArray*)items {
|
62
|
+
- (id)initWithMainView:(id<RhoMainView>)v tabs:(NSArray *)items {
|
63
|
+
parent = [v parent];
|
64
|
+
|
65
|
+
CGRect frame = [[v view] frame];
|
63
66
|
|
64
67
|
tabbar = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
|
65
68
|
tabbar.delegate = [Rhodes sharedInstance];
|
@@ -90,7 +93,7 @@
|
|
90
93
|
subController.title = label;
|
91
94
|
NSString *imagePath = [[AppManager getApplicationsRootPath] stringByAppendingPathComponent:icon];
|
92
95
|
subController.tabBarItem.image = [UIImage imageWithContentsOfFile:imagePath];
|
93
|
-
[subController
|
96
|
+
[subController navigateRedirect:url tab:0];
|
94
97
|
|
95
98
|
[tabs addObject:td];
|
96
99
|
[views addObject:subController];
|
@@ -118,11 +121,11 @@
|
|
118
121
|
|
119
122
|
- (void)viewDidUnload {
|
120
123
|
[super viewDidUnload];
|
121
|
-
self.tabbar = nil;
|
122
124
|
}
|
123
125
|
|
124
126
|
- (void)dealloc {
|
125
|
-
[tabbar
|
127
|
+
[tabbar.view removeFromSuperview];
|
128
|
+
[tabbarData release];
|
126
129
|
[super dealloc];
|
127
130
|
}
|
128
131
|
|
@@ -140,6 +143,14 @@
|
|
140
143
|
return tabbar.view;
|
141
144
|
}
|
142
145
|
|
146
|
+
- (UIView*)parent {
|
147
|
+
return parent;
|
148
|
+
}
|
149
|
+
|
150
|
+
- (UIWebView*)detachWebView {
|
151
|
+
return [[self subView:[self activeTab]] detachWebView];
|
152
|
+
}
|
153
|
+
|
143
154
|
- (void)loadHTMLString:(NSString *)data {
|
144
155
|
[[self subView:[self activeTab]] loadHTMLString:data];
|
145
156
|
}
|
@@ -190,8 +201,8 @@
|
|
190
201
|
return tabbar.selectedIndex;
|
191
202
|
}
|
192
203
|
|
193
|
-
- (void)
|
194
|
-
[[self subView:[self activeTab]]
|
204
|
+
- (void)addNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
|
205
|
+
[[self subView:[self activeTab]] addNavBar:title left:left right:right];
|
195
206
|
}
|
196
207
|
|
197
208
|
- (void)removeNavBar {
|