This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)tableView:(UITableView *)tableView didUpdateFocusInContext:(UITableViewFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator { | |
switch( tableView.tag ) { | |
case InboxTable_Folders: { | |
// Expand folders | |
self.folderWidth.constant = FOLDERS_OPEN; | |
self.threadWidth.constant = THREADS_OPEN; | |
[self.view setNeedsLayout]; | |
[self.view setNeedsUpdateConstraints]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fix table-cells | |
NSArray *cells = [document nodesMatchingSelector:@"td"]; | |
for (HTMLElement *cell in cells) { | |
NSString *align = [[cell attributes] objectForKey:@"align"]; | |
// Replace center aligned cells with a centered span | |
if ( align && [align isEqualToString:@"center"] ) { | |
NSString *newContent = [[cell serializedFragment] stringByReplacingOccurrencesOfString:[cell innerHTML] withString:[NSString stringWithFormat:@"<span style=\"text-align:center\">%@</span>", [cell innerHTML]]]; | |
htmlString = [htmlString stringByReplacingOccurrencesOfString:[cell serializedFragment] withString:newContent]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tweak background styling | |
UIColor *backgroundColor = [UIColor whiteColor]; | |
HTMLDocument *document = [HTMLDocument documentWithString:htmlString]; | |
htmlString = [[document rootElement] serializedFragment]; | |
// Fetch the body tag to look for inline background styles | |
HTMLElement *body = [document firstNodeMatchingSelector:@"body"]; | |
if ( [body attributes] && [[body attributes] count] ) { | |
Boolean foundColor = NO; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <MailCore/MailCore.h> | |
#import <MailCore/MCOIMAP.h> | |
- (void)loginToServer:(NSString*)server withUsername:(NSString*)username andPassword:(NSString*)password { | |
MCOIMAPSession *session = [[MCOIMAPSession alloc] init]; | |
session.hostname = server; | |
session.port = 993; | |
session.username = username; | |
session.password = password; | |
session.connectionType = MCOConnectionTypeTLS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var __slice = Array.prototype.slice; | |
(function($) { | |
var Sketch; | |
$.fn.sketch = function() { | |
var args, key, sketch; | |
key = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | |
if (this.length > 1) { | |
$.error('Sketch.js can only be called on one element at a time.'); | |
} | |
sketch = this.data('sketch'); |