mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Cleaning up add folder/site dialog in iPhone app. Still needs autocomplete, but it's nearly done.
This commit is contained in:
parent
8171c2390a
commit
799a0839fe
4 changed files with 41 additions and 23 deletions
10
fabfile.py
vendored
10
fabfile.py
vendored
|
@ -116,16 +116,10 @@ def staging_full():
|
|||
|
||||
@roles('task')
|
||||
def celery():
|
||||
run('git pull')
|
||||
celery_stop()
|
||||
celery_start()
|
||||
|
||||
@roles('task')
|
||||
def celery_stop():
|
||||
with cd(env.NEWSBLUR_PATH):
|
||||
run('git pull')
|
||||
celery_stop()
|
||||
celery_start()
|
||||
celery_stop()
|
||||
celery_start()
|
||||
|
||||
@roles('task')
|
||||
def celery_stop():
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
- (IBAction)doCancelButton;
|
||||
- (IBAction)doAddButton;
|
||||
- (void)animateLoop;
|
||||
- (void)hideFolderPicker;
|
||||
|
||||
@property (nonatomic, retain) IBOutlet NewsBlurAppDelegate *appDelegate;
|
||||
@property (nonatomic, retain) IBOutlet UITextField *inFolderInput;
|
||||
|
|
|
@ -46,9 +46,23 @@
|
|||
[inFolderInput setLeftView:folderImage];
|
||||
[inFolderInput setLeftViewMode:UITextFieldViewModeAlways];
|
||||
[folderImage release];
|
||||
UIImageView *folderImage2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"folder.png"]];
|
||||
[newFolderInput setLeftView:folderImage2];
|
||||
[newFolderInput setLeftViewMode:UITextFieldViewModeAlways];
|
||||
[folderImage2 release];
|
||||
|
||||
UIImageView *urlImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"world.png"]];
|
||||
[siteAddressInput setLeftView:urlImage];
|
||||
[siteAddressInput setLeftViewMode:UITextFieldViewModeAlways];
|
||||
[urlImage release];
|
||||
|
||||
navBar.tintColor = [UIColor colorWithRed:0.16f green:0.36f blue:0.46 alpha:0.9];
|
||||
|
||||
newFolderInput.frame = CGRectMake(self.view.frame.size.width,
|
||||
siteAddressInput.frame.origin.y,
|
||||
siteAddressInput.frame.size.width,
|
||||
siteAddressInput.frame.size.height);
|
||||
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
|
@ -101,6 +115,9 @@
|
|||
}
|
||||
|
||||
- (void)reload {
|
||||
[inFolderInput setText:@""];
|
||||
[siteAddressInput setText:@""];
|
||||
[newFolderInput setText:@""];
|
||||
[folderPicker reloadAllComponents];
|
||||
}
|
||||
|
||||
|
@ -108,6 +125,7 @@
|
|||
#pragma mark Add Site
|
||||
|
||||
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
|
||||
[errorLabel setText:@""];
|
||||
if (textField == inFolderInput && ![inFolderInput isFirstResponder]) {
|
||||
[siteAddressInput resignFirstResponder];
|
||||
[newFolderInput resignFirstResponder];
|
||||
|
@ -119,15 +137,9 @@
|
|||
}];
|
||||
return NO;
|
||||
} else if (textField == siteAddressInput) {
|
||||
[UIView animateWithDuration:.35 animations:^{
|
||||
folderPicker.frame = CGRectMake(0, self.view.bounds.size.height, folderPicker.frame.size.width, folderPicker.frame.size.height);
|
||||
}];
|
||||
|
||||
[self hideFolderPicker];
|
||||
} else if (textField == newFolderInput) {
|
||||
[UIView animateWithDuration:.35 animations:^{
|
||||
folderPicker.frame = CGRectMake(0, self.view.bounds.size.height, folderPicker.frame.size.width, folderPicker.frame.size.height);
|
||||
}];
|
||||
|
||||
[self hideFolderPicker];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
@ -144,6 +156,7 @@
|
|||
}
|
||||
|
||||
- (IBAction)addSite {
|
||||
[self hideFolderPicker];
|
||||
[siteAddressInput resignFirstResponder];
|
||||
[self.addingLabel setHidden:NO];
|
||||
[self.addingLabel setText:@"Adding site..."];
|
||||
|
@ -191,6 +204,7 @@
|
|||
|
||||
|
||||
- (IBAction)addFolder {
|
||||
[self hideFolderPicker];
|
||||
[newFolderInput resignFirstResponder];
|
||||
[self.addingLabel setHidden:NO];
|
||||
[self.addingLabel setText:@"Adding Folder..."];
|
||||
|
@ -200,10 +214,9 @@
|
|||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
// [string rangeOfString:substring options:NSBackwardsSearch].location
|
||||
NSString *parent_folder = [inFolderInput text];
|
||||
int folder_loc = [parent_folder rangeOfString:@" - " options:NSBackwardsSearch].location;
|
||||
if ([parent_folder length] && folder_loc > 0) {
|
||||
if ([parent_folder length] && folder_loc != NSNotFound) {
|
||||
parent_folder = [parent_folder substringFromIndex:(folder_loc + 3)];
|
||||
}
|
||||
[request setPostValue:parent_folder forKey:@"parent_folder"];
|
||||
|
@ -315,6 +328,12 @@ numberOfRowsInComponent:(NSInteger)component {
|
|||
[inFolderInput setText:folder_title];
|
||||
}
|
||||
|
||||
- (void)hideFolderPicker {
|
||||
[UIView animateWithDuration:.35 animations:^{
|
||||
folderPicker.frame = CGRectMake(0, self.view.bounds.size.height, folderPicker.frame.size.width, folderPicker.frame.size.height);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Autocomplete sites
|
||||
|
||||
|
@ -323,4 +342,9 @@ numberOfRowsInComponent:(NSInteger)component {
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView
|
||||
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<object class="IBUILabel" id="30147744">
|
||||
<reference key="NSNextResponder" ref="973185930"/>
|
||||
<int key="NSvFlags">-2147483356</int>
|
||||
<string key="NSFrame">{{20, 294}, {280, 52}}</string>
|
||||
<string key="NSFrame">{{111, 294}, {189, 52}}</string>
|
||||
<reference key="NSSuperview" ref="973185930"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="845365385"/>
|
||||
|
@ -96,12 +96,11 @@
|
|||
</object>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
</object>
|
||||
<object class="IBUILabel" id="845365385">
|
||||
<reference key="NSNextResponder" ref="973185930"/>
|
||||
<int key="NSvFlags">-2147483356</int>
|
||||
<string key="NSFrame">{{20, 294}, {280, 52}}</string>
|
||||
<string key="NSFrame">{{20, 265}, {280, 110}}</string>
|
||||
<reference key="NSSuperview" ref="973185930"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="900763914"/>
|
||||
|
@ -121,13 +120,13 @@
|
|||
<reference key="IBUIShadowColor" ref="444286937"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">17</float>
|
||||
<int key="IBUINumberOfLines">2</int>
|
||||
<int key="IBUINumberOfLines">4</int>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
</object>
|
||||
<object class="IBUIActivityIndicatorView" id="900763914">
|
||||
<reference key="NSNextResponder" ref="973185930"/>
|
||||
<int key="NSvFlags">-2147483356</int>
|
||||
<string key="NSFrame">{{98, 310}, {20, 20}}</string>
|
||||
<string key="NSFrame">{{87, 310}, {20, 20}}</string>
|
||||
<reference key="NSSuperview" ref="973185930"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:824</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue