Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #141 - Fix Gist paste

  • Loading branch information...
commit 9d2340bf3b59c37ee4057f353a63f5843c8dcc96 1 parent c731c8b
@cpeterso cpeterso authored
Showing with 23 additions and 22 deletions.
  1. +17 −17 Classes/Dialogs/PasteSheet.m
  2. +6 −5 Classes/Library/GistClient.m
View
34 Classes/Dialogs/PasteSheet.m
@@ -38,22 +38,22 @@ - (id)init
if (!SYNTAX_EXT_MAP) {
SYNTAX_EXT_MAP = [[NSDictionary dictionaryWithObjectsAndKeys:
- @".c", @"c",
- @".css", @"css",
- @".diff", @"diff",
- @".hs", @"haskell",
- @".html", @"html",
- @".java", @"java",
- @".js", @"javascript",
- @".m", @"objective-c",
- @".pl", @"perl",
- @".aw", @"php",
- @".txt", @"plain_text",
- @".py", @"python",
- @".rb", @"ruby",
- @".scm", @"scheme",
- @".sh", @"shell script",
- @".sql", @"sql",
+ @"C", @"c",
+ @"CSS", @"css",
+ @"Diff", @"diff",
+ @"Haskell", @"haskell",
+ @"HTML", @"html",
+ @"Java", @"java",
+ @"JavaScript", @"javascript",
+ @"Objective-C", @"objective-c",
+ @"Perl", @"perl",
+ @"PHP", @"php",
+ @"Text", @"plain_text",
+ @"Python", @"python",
+ @"Ruby", @"ruby",
+ @"Scheme", @"scheme",
+ @"Shell", @"shell script",
+ @"SQL", @"sql",
nil, nil] retain];
}
}
@@ -105,7 +105,7 @@ - (void)pasteOnline:(id)sender
NSString* s = bodyText.string;
NSString* fileType = [SYNTAX_EXT_MAP objectForKey:[self syntaxFromTag:syntaxPopup.selectedTag]];
if (!fileType) {
- fileType = @".txt";
+ fileType = @"Text";
}
gist = [GistClient new];
View
11 Classes/Library/GistClient.m
@@ -74,12 +74,13 @@ - (void)postDataWithAutheToken:(NSString*)authToken
stage = kGistClientPost;
NSMutableDictionary* params = [NSMutableDictionary dictionary];
- [params setObject:@"" forKey:@"description"];
- [params setObject:@"" forKey:@"file_name[gistfile1]"];
- [params setObject:text forKey:@"file_contents[gistfile1]"];
- [params setObject:fileType forKey:@"file_ext[gistfile1]"];
+ [params setObject:@"" forKey:@"gist[description]"];
+ [params setObject:@"" forKey:@"gist[files][][oid]"];
+ [params setObject:@"" forKey:@"gist[files][][name]"];
+ [params setObject:text forKey:@"gist[files][][content]"];
+ [params setObject:fileType forKey:@"gist[files][][language]"];
if (isPrivate) {
- [params setObject:@"private" forKey:@"action_button"];
+ [params setObject:@"0" forKey:@"gist[public]"];
}
if (authToken) {
[params setObject:authToken forKey:@"authenticity_token"];
Please sign in to comment.
Something went wrong with that request. Please try again.