diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 3cb52e6..14bdf82 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -123,4 +123,9 @@ contextMenuItemsForElement:(NSDictionary *)element [[NSWorkspace sharedWorkspace] openURL:[request URL]]; } +- getConfig:(NSString *)config +{ + return [historyController valueForKeyPath:[@"repository.config." stringByAppendingString:config]]; +} + @end diff --git a/html/commit.js b/html/commit.js index 5d1f757..7ac89c0 100644 --- a/html/commit.js +++ b/html/commit.js @@ -58,8 +58,15 @@ var gistie = function() { }; // TODO: Replace true with private preference - if (true) + token = Controller.getConfig_("github.token"); + login = Controller.getConfig_("github.user"); + if (token && login) + { + parameters.login = login; + parameters.token = token; + } else { parameters.private = true; + } new Ajax.Request("http://gist.github.com/gists", { method: 'post',