Merge pull request #45 from ethereum/fixImport

Fixed import from github.
pull/1/head
chriseth 9 years ago
commit 3bd4603809
  1. 2
      src/app.js
  2. 2
      src/app/compiler.js

@ -403,7 +403,7 @@ 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);
} }

@ -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