|
11 | 11 | // ANY KIND, either express or implied. See the License for the specific language governing |
12 | 12 | // permissions and limitations under the License. |
13 | 13 | // |
14 | | - |
15 | | -#import "QWebElement.h" |
16 | | -#import "QuickDialog.h" |
17 | | -#import "QWebViewController.h" |
18 | | - |
19 | | -@implementation QWebElement |
20 | | - |
21 | | -- (QWebElement *)initWithTitle:(NSString *)title url:(NSString *)url { |
22 | | - self = [super init]; |
23 | | - if (self!=nil){ |
24 | | - _url = url; |
25 | | - _title = title; |
26 | | - } |
27 | | - return self; |
28 | | -} |
29 | | - |
30 | | -- (QWebElement *)initWithTitle:(NSString *)title HTML:(NSString *)html { |
31 | | - |
32 | | - self = [super init]; |
33 | | - if (self!=nil){ |
34 | | - _url = nil; |
35 | | - _title = title; |
36 | | - _html = html; |
37 | | - } |
38 | | - return self; |
39 | | -} |
40 | | - |
41 | | --(void)setFile:(NSString *)filename { |
42 | | - _url = [[NSBundle mainBundle] pathForResource:filename ofType:@"html"]; |
43 | | -} |
44 | | - |
45 | | -- (UITableViewCell *)getCellForTableView:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller { |
46 | | - self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; |
47 | | - UITableViewCell *cell = [super getCellForTableView:tableView controller:controller]; |
48 | | - cell.selectionStyle = UITableViewCellSelectionStyleBlue; |
49 | | - return cell; |
50 | | -} |
51 | | - |
52 | | - |
53 | | -- (void)selected:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller indexPath:(NSIndexPath *)path { |
54 | | - [self performAction]; |
55 | | - if (_html) { |
56 | | - QWebViewController *webController = [[QWebViewController alloc] initWithHTML:_html]; |
57 | | - webController.title = self.title; |
58 | | - [controller displayViewController:webController]; |
59 | | - } |
60 | | - else { |
61 | | - if ([_url hasPrefix:@"http"] || [_url hasPrefix:@"/"]) { |
62 | | - QWebViewController *webController = [[QWebViewController alloc] initWithUrl:_url]; |
63 | | - [controller displayViewController:webController withPresentationMode:self.presentationMode]; |
64 | | - } else { |
65 | | - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:_url]]; |
66 | | - [tableView deselectRowAtIndexPath:path animated:NO]; |
67 | | - } |
68 | | - } |
69 | | -} |
70 | | -@end |
| 14 | +// |
| 15 | +//#import "QWebElement.h" |
| 16 | +//#import "QuickDialog.h" |
| 17 | +//#import "QWebViewController.h" |
| 18 | +// |
| 19 | +//@implementation QWebElement |
| 20 | +// |
| 21 | +//- (QWebElement *)initWithTitle:(NSString *)title url:(NSString *)url { |
| 22 | +// self = [super init]; |
| 23 | +// if (self!=nil){ |
| 24 | +// _url = url; |
| 25 | +// _title = title; |
| 26 | +// } |
| 27 | +// return self; |
| 28 | +//} |
| 29 | +// |
| 30 | +//- (QWebElement *)initWithTitle:(NSString *)title HTML:(NSString *)html { |
| 31 | +// |
| 32 | +// self = [super init]; |
| 33 | +// if (self!=nil){ |
| 34 | +// _url = nil; |
| 35 | +// _title = title; |
| 36 | +// _html = html; |
| 37 | +// } |
| 38 | +// return self; |
| 39 | +//} |
| 40 | +// |
| 41 | +//-(void)setFile:(NSString *)filename { |
| 42 | +// _url = [[NSBundle mainBundle] pathForResource:filename ofType:@"html"]; |
| 43 | +//} |
| 44 | +// |
| 45 | +//- (UITableViewCell *)getCellForTableView:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller { |
| 46 | +// self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; |
| 47 | +// UITableViewCell *cell = [super getCellForTableView:tableView controller:controller]; |
| 48 | +// cell.selectionStyle = UITableViewCellSelectionStyleBlue; |
| 49 | +// return cell; |
| 50 | +//} |
| 51 | +// |
| 52 | +// |
| 53 | +//- (void)selected:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller indexPath:(NSIndexPath *)path { |
| 54 | +// [self performAction]; |
| 55 | +// if (_html) { |
| 56 | +// QWebViewController *webController = [[QWebViewController alloc] initWithHTML:_html]; |
| 57 | +// webController.title = self.title; |
| 58 | +// [controller displayViewController:webController]; |
| 59 | +// } |
| 60 | +// else { |
| 61 | +// if ([_url hasPrefix:@"http"] || [_url hasPrefix:@"/"]) { |
| 62 | +// QWebViewController *webController = [[QWebViewController alloc] initWithUrl:_url]; |
| 63 | +// [controller displayViewController:webController withPresentationMode:self.presentationMode]; |
| 64 | +// } else { |
| 65 | +// [[UIApplication sharedApplication] openURL:[NSURL URLWithString:_url]]; |
| 66 | +// [tableView deselectRowAtIndexPath:path animated:NO]; |
| 67 | +// } |
| 68 | +// } |
| 69 | +//} |
| 70 | +//@end |
0 commit comments