Skip to content

Commit

Permalink
re-map 127.0.0.1 to localhost since ATS in El-Capitan is buggy and ca…
Browse files Browse the repository at this point in the history
…nnot whitelist it

git-svn-id: https://svn.r-project.org/R-packages/trunk/Mac-GUI@7337 694ef91d-65df-0310-b7bb-92e67a308ead
  • Loading branch information
s-u committed Apr 19, 2017
1 parent 14447cf commit bef6515
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DataManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ - (IBAction)showHelp:(id)sender
if (r.length > 0 && [topic length] - r.length > 3) // some datasets have the topic in parents
topic = [topic substringWithRange: NSMakeRange(r.location + 2, [topic length] - r.location - 3)];

urlText = [NSString stringWithFormat:@"http://127.0.0.1:%d/library/%@/html/%@.html", port, [selectedItem objectForKey:kDataManagerPackage], topic];
urlText = [NSString stringWithFormat:@"http://localhost:%d/library/%@/html/%@.html", port, [selectedItem objectForKey:kDataManagerPackage], topic];

[[dataInfoView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];

Expand Down
9 changes: 3 additions & 6 deletions GUI-tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,12 @@ add.fn("quit", function (save = "default", status = 0, runLast = TRUE)


add.fn("aqua.browser", function(x, ...) {
## El Capitan has a bug in ATS that makes it impossible to white-list 127.0.0.1 so we have to use localhost
x <- gsub("http://127.0.0.1", "http://localhost", x, fixed=TRUE)
.Call("aqua.custom.print", "help-files", x)
invisible(x)})

add.fn("main.help.url",
function() help.start(browser = function(x, ...) {
.Call("aqua.custom.print", "help-files", x)
invisible(x)
})
)
add.fn("main.help.url", function() help.start(browser = aqua.browser))

add.fn("wsbrowser", function(IDS, IsRoot, Container, ItemsPerContainer,
ParentID, NAMES, TYPES, DIMS)
Expand Down
2 changes: 1 addition & 1 deletion HelpManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ - (void)showHelpUsingFile: (NSString *)file topic: (NSString*) topic
if (!home) home = [[RController sharedController] home];
if ([file hasPrefix:home])
file = [file substringFromIndex:[home length]];
url = [NSString stringWithFormat:@"http://127.0.0.1:%d%@", port, file];
url = [NSString stringWithFormat:@"http://localhost:%d%@", port, file];
}
SLog(@"HelpManager.showHelpUsingFile:\"%@\", topic=%@, URL=%@", file, topic, url);
if(url != nil) {
Expand Down
2 changes: 1 addition & 1 deletion PackageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ - (IBAction) showInfo:(id)sender
NSRunInformationalAlertPanel(NLS(@"Cannot start HTML help server."), NLS(@"Help"), NLS(@"Ok"), nil, nil);
return;
}
urlText = [NSString stringWithFormat:@"http://127.0.0.1:%d/library/%@/html/00Index.html", port, package[row].name];
urlText = [NSString stringWithFormat:@"http://localhost:%d/library/%@/html/00Index.html", port, package[row].name];
SLog(@"PackageManager.showInfo: URL=%@", urlText);
[[PackageInfoView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];
}
Expand Down
2 changes: 1 addition & 1 deletion SearchTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ - (IBAction) showInfo:(id)sender
urlText = [NSString stringWithFormat:@"file://%@", urlText];
else {
if ([urlText hasPrefix:home]) urlText = [urlText substringFromIndex:[home length]];
urlText = [NSString stringWithFormat:@"http://127.0.0.1:%d%@", port, urlText];
urlText = [NSString stringWithFormat:@"http://localhost:%d%@", port, urlText];
}
}
SLog(@" - invoking help sub-panel with %@", urlText);
Expand Down

0 comments on commit bef6515

Please sign in to comment.