Skip to content

Commit

Permalink
no gist.url & no base.url means no Open in Github
Browse files Browse the repository at this point in the history
fixes #1838
  • Loading branch information
gordonwoodhull committed May 12, 2017
1 parent b60fc35 commit de2367a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions htdocs/editor_tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,9 @@ var editor = function () {

RCloud.UI.comments_frame.set_foreign(!!options.source);
RCloud.UI.advanced_menu.enable('pull_and_replace_notebook', !shell.notebook.model.read_only());
promises.push(shell.github_url().then(function(url) {
RCloud.UI.advanced_menu.enable('open_in_github', !!url);
}));
promises.push(RCloud.UI.comments_frame.display_comments());
promises.push(rcloud.is_notebook_published(result.id).then(function(p) {
RCloud.UI.advanced_menu.check('publish_notebook', p);
Expand Down
1 change: 1 addition & 0 deletions htdocs/js/ui/advanced_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RCloud.UI.advanced_menu = (function() {
sort: 1000,
text: "Open in GitHub",
modes: ['view', 'edit'],
disabled_reason: "The notebook source does not support a web interface",
action: function() {
shell.github_url().then(function(url) {
if(!url)
Expand Down
2 changes: 0 additions & 2 deletions rcloud.support/R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ configure.rcloud <- function (mode=c("startup", "script")) {
tryCatch(dir.create(rcloud.home(), FALSE, TRUE, "0700"),
error=function(e) ulog("WARNING: unable to create rcloud.home ", rcloud.home()))

## use public github by default (FIXME: this should go away when set in the githubgist package)
if (!nzConf("github.base.url")) setConf("github.base.url", "https://github.com/")
if (!nzConf("github.api.url")) setConf("github.api.url", "https://api.github.com/")

## set locale - default is UTF-8
Expand Down

0 comments on commit de2367a

Please sign in to comment.