From 414e814de27b9f36e5bd2b22fb73bdbb0f76c434 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 11 Oct 2014 15:20:15 +0100 Subject: [PATCH] Establish paths & call github.php with read action --- lib/file-control.php | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/lib/file-control.php b/lib/file-control.php index 26b9f8f..d78aa6d 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -423,46 +423,32 @@ if (action=="load") { // If we're in GitHub diff mode and have a split pane display, get the content for the diff pane if (top.ICEcoder.githubDiff && top.ICEcoder.splitPane) { - /* - - THIS IS NOT WORKING AT PRESENT, WON'T PULL IN CONTENT FROM GITHUB - - // Start our github object - var github = new Github({token: "", auth: "oauth"}); - console.log(""); - top.repo = ''; - var githubFilePath = ''; + ?> - console.log(top.repo.split("/")[0] + " / " + top.repo.split("/")[1] + " : " + githubFilePath); - - var repo = github.getRepo(top.repo.split("/")[0], top.repo.split("/")[1]); - - repo.getTree('master?recursive=true', function(err, tree) { - console.log(err); - console.log(tree); - }); - //repo.read('master', githubFilePath, function(err, data) { - // console.log(err); - // console.log(data); - //}); - */ + top.ICEcoder.filesFrame.contentWindow.frames['processControl'].location.href = "github.php?action=read&repo=&filePath=&csrf="+top.ICEcoder.csrf; } // Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on ICEcoder's load)