This file contains hidden or 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 getAllTextInColumn = function(rect){ | |
/* | |
rect should be the size and x,y of the column | |
*/ | |
if(document.caretPositionFromPoint){ | |
var caretRangeStart = document.caretPositionFromPoint(rect.left, rect.top); | |
var caretRangeEnd = document.caretPositionFromPoint(rect.left+rect.width-1, rect.top+rect.height-1); | |
} else if(document.caretRangeFromPoint){ | |
var caretRangeStart = document.caretRangeFromPoint(rect.left, rect.top); |
This file contains hidden or 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) forceRedrawInWebView:(UIWebView*)webView { | |
NSArray *views = webView.scrollView.subviews; | |
for(int i = 0; i<views.count; i++){ | |
UIView *view = views[i]; | |
//if([NSStringFromClass([view class]) isEqualToString:@"UIWebBrowserView"]){ | |
[view setNeedsDisplayInRect:webView.bounds]; // Webkit Repaint, usually fast | |
[view setNeedsLayout]; // Webkit Relayout (slower than repaint) |
This file contains hidden or 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 LinkGrabber = { | |
textarea: null, | |
/* Textarea Management */ | |
attach_ta: function(){ | |
if(LinkGrabber.textarea != null) return; | |
var textarea = LinkGrabber.textarea = document.createElement("textarea"); | |
textarea.setAttribute("style", "position: fixed; width: 100%; margin: 0; top: 0; bottom: 0; right: 0; left: 0; z-index: 99999999"); |
This file contains hidden or 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
package | |
{ | |
import flash.events.Event; | |
import mx.controls.SWFLoader; | |
import mx.core.Application; | |
import mx.managers.SystemManager; | |
public class AppSwitcher extends Application | |
{ |
This file contains hidden or 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
id<UITextInputTokenizer> tokenizer = textView.tokenizer; | |
UITextPosition *pos = textView.endOfDocument; | |
NSInteger lines = 0; | |
while (true){ | |
UITextPosition *lineEnd = [tokenizer positionFromPosition:pos toBoundary:UITextGranularityLine inDirection:UITextStorageDirectionBackward]; | |
if([textView comparePosition:pos toPosition:lineEnd] == NSOrderedSame){ | |
pos = [tokenizer positionFromPosition:lineEnd toBoundary:UITextGranularityCharacter inDirection:UITextStorageDirectionBackward]; | |
This file contains hidden or 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 <UIKit/UIKit.h> | |
@interface NumberPadDoneBtn : UIView | |
@end | |
@interface NumberPadButton : UIButton | |
@end |
This file contains hidden or 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
@implementation MyNavBar | |
- (NSArray*) subviews { | |
NSArray *subviews = [super subviews]; | |
if(_animationDisabled) [self removeAllAnimationsInViews:subviews]; | |
return subviews; | |
} |
This file contains hidden or 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
/* | |
1.) Add any extra libraries as "html" files (New > HTML File) | |
*/ | |
/* 2.) */ eval(HtmlService.createTemplateFromFile("JSLib").getRawContent()); /* exclude the .html extension */ |
This file contains hidden or 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 getNodeTreeXPath = function(node){ | |
// Built from Firebug source - | |
// https://github.com/firebug/firebug/blob/235efff40332f85cb34b55f2da0de6bf98d083e4/extension/content/firebug/lib/xpath.js | |
var paths = [], nodePath, element = node; | |
// If text node find its place among its siblings | |
if(element.nodeType == Node.TEXT_NODE){ | |
var siblings = node.parentElement.childNodes; | |
var nodeIndex = Array.prototype.indexOf.call(siblings, node)+1; |
This file contains hidden or 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) viewWillAppear:(BOOL)animated { | |
[super viewWillAppear:animated]; | |
if(!self.navigationItem.titleView){ | |
self.navigationItem.titleView = ({ | |
UILabel *titleView = [UILabel new]; | |
titleView.numberOfLines = 0; | |
titleView.textAlignment = NSTextAlignmentCenter; | |
titleView.attributedText = [[NSAttributedString alloc] initWithString:@"2\nLINES" attributes: | |
self.navigationController.navigationBar.titleTextAttributes |
OlderNewer