Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: soffes/sstoolkit
...
head fork: zhaozhongke/sstoolkit
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 19, 2012
@inamiy inamiy SSWebView: added isDOMLoaded c60ffa6
Showing with 10 additions and 0 deletions.
  1. +2 −0  SSToolkit/SSWebView.h
  2. +8 −0 SSToolkit/SSWebView.m
View
2  SSToolkit/SSWebView.h
@@ -157,6 +157,8 @@
*/
@property (nonatomic, readonly, getter=isLoadingPage) BOOL loadingPage;
+@property (nonatomic, readonly) BOOL isDOMLoaded;
+
/**
Stops the loading of any web content managed by the receiver.
View
8 SSToolkit/SSWebView.m
@@ -31,6 +31,7 @@ @implementation SSWebView {
@synthesize consoleEnabled = _consoleEnabled;
@synthesize lastRequest = _lastRequest;
@synthesize loadingPage = _loadingPage;
+@synthesize isDOMLoaded = _isDOMLoaded;
#pragma mark - NSObject
@@ -120,6 +121,7 @@ - (void)reset {
[_lastRequest release];
_lastRequest = nil;
+ _isDOMLoaded = NO;
}
@@ -182,6 +184,7 @@ - (void)_finishedLoading {
- (void)_DOMLoaded {
+ _isDOMLoaded = YES;
if ([_delegate respondsToSelector:@selector(webViewDidLoadDOM:)]) {
[_delegate webViewDidLoadDOM:self];
}
@@ -292,6 +295,7 @@ - (void)goForward {
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL {
[_lastRequest release];
_lastRequest = nil;
+ _isDOMLoaded = NO;
[_webView loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL];
}
@@ -300,6 +304,7 @@ - (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL {
[_lastRequest release];
_lastRequest = nil;
+ _isDOMLoaded = NO;
if (!baseURL) {
baseURL = [NSURL URLWithString:@"http://localhost/"];
@@ -311,6 +316,7 @@ - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL {
- (void)loadRequest:(NSURLRequest *)aRequest {
[_lastRequest release];
_lastRequest = nil;
+ _isDOMLoaded = NO;
[_webView loadRequest:aRequest];
}
@@ -319,6 +325,7 @@ - (void)loadRequest:(NSURLRequest *)aRequest {
- (void)reload {
[_lastRequest release];
_lastRequest = nil;
+ _isDOMLoaded = NO;
[_webView reload];
}
@@ -420,6 +427,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
[_lastRequest release];
_lastRequest = [aRequest retain];
_testedDOM = NO;
+ _isDOMLoaded = NO;
[self _startLoading];
}

No commit comments for this range

Something went wrong with that request. Please try again.