...
|
...
|
@@ -196,7 +196,8 @@ |
|
|
NSString *string = [NSString stringWithFormat:@"var imageElement = document.elementFromPoint(%f, %f);\
|
|
|
var rect = imageElement.getBoundingClientRect();\
|
|
|
var frame = {x:rect.left, y:rect.top, width:rect.width, height:rect.height};\
|
|
|
var dataSet = { url:imageElement.src, displayFrame:frame };\
|
|
|
var className = imageElement.className;\
|
|
|
var dataSet = { url:imageElement.src, displayFrame:frame, class:className, tagName:imageElement.tagName, id:imageElement.id };\
|
|
|
JSON.stringify(dataSet);", p.x, p.y];
|
|
|
return string;
|
|
|
}
|
...
|
...
|
@@ -225,11 +226,17 @@ |
|
|
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:resultData
|
|
|
options:0
|
|
|
error:nil];
|
|
|
if ([self.delegate respondsToSelector:@selector(explorer:didClickPicture:)]) {
|
|
|
|
|
|
if (json) {
|
|
|
|
|
|
NSString *tagName = [json[@"tagName"] lowercaseString];
|
|
|
|
|
|
if ([tagName isEqualToString:@"img"] && [self.delegate respondsToSelector:@selector(explorer:didClickPicture:)]) {
|
|
|
[self.delegate explorer:self.webViewController didClickPicture:json];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
#pragma mark - Method Forwarding
|
...
|
...
|
|