Fixed import from github.

pull/1/head
chriseth 9 years ago
parent 054dec7846
commit 398f3fea66
  1. 4
      src/app.js
  2. 2
      src/app/compiler.js

@ -403,8 +403,8 @@ var run = function() {
// ----------------- compiler ---------------------- // ----------------- compiler ----------------------
function handleGithubCall(root, path, cb) { function handleGithubCall(root, path, cb) {
$('#output').append($('<div/>').append($('<pre/>').text("Loading github.com/" + root + " ..."))); $('#output').append($('<div/>').append($('<pre/>').text("Loading github.com/" + root + "/" + path + " ...")));
return $.getJSON('https://api.github.com/repos/' + root + '/contents/' + path, cb); return $.getJSON('https://api.github.com/repos/' + root + '/contents/' + path, cb);
} }
var compiler = new Compiler(web3, editor, handleGithubCall, $('#output'), getHidingRHP, updateFiles); var compiler = new Compiler(web3, editor, handleGithubCall, $('#output'), getHidingRHP, updateFiles);

@ -181,7 +181,7 @@ function Compiler(web3, editor, handleGithubCall, outputField, hidingRHP, update
files[m] = cachedRemoteFiles[m]; files[m] = cachedRemoteFiles[m];
reloop = true; reloop = true;
} else if (githubMatch = /^(https?:\/\/)?(www.)?github.com\/([^\/]*\/[^\/]*)\/(.*)/.exec(m)) { } else if (githubMatch = /^(https?:\/\/)?(www.)?github.com\/([^\/]*\/[^\/]*)\/(.*)/.exec(m)) {
handleGithubCall(function(result) { handleGithubCall(githubMatch[3], githubMatch[4], function(result) {
if ('content' in result) if ('content' in result)
{ {
var content = Base64.decode(result.content); var content = Base64.decode(result.content);

Loading…
Cancel
Save