From c256c8c5d2f7e3483957f54ffe32435e7071dd43 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Sun, 3 May 2015 23:10:57 +0900 Subject: [PATCH] make samples docs go to README for now --- docs/js/samples.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/js/samples.js b/docs/js/samples.js index 634ecc02..684128ae 100644 --- a/docs/js/samples.js +++ b/docs/js/samples.js @@ -50,22 +50,26 @@ requirejs([ var search = parseSearchString(window.location.search); if (search.repo && search.owner) { + if (search.type === "docs") { + window.location.href = "http://github.com/" + search.owner + "/" + search.repo + "/blob/master/README.md"; + } else { - setButtonTarget("github", "http://github.com/" + search.owner + "/" + search.repo); - setButtonTarget("files", "http://github.com/" + search.owner + "/" + search.repo + "/releases/latest"); + setButtonTarget("github", "http://github.com/" + search.owner + "/" + search.repo); + setButtonTarget("files", "http://github.com/" + search.owner + "/" + search.repo + "/releases/latest"); - var url = "https://api.github.com/repos/" + search.owner + "/" + search.repo + "/releases/latest"; - console.log(url); - if (isLocal) { - downloadLatest(null, JSON.stringify({ - assets: [ - { - browser_download_url: "https://foo.com/foo.bar.unitypackage", - }, - ], - })); - } else { - io.get(url, "", downloadLatest); + var url = "https://api.github.com/repos/" + search.owner + "/" + search.repo + "/releases/latest"; + console.log(url); + if (isLocal) { + downloadLatest(null, JSON.stringify({ + assets: [ + { + browser_download_url: "https://foo.com/foo.bar.unitypackage", + }, + ], + })); + } else { + io.get(url, "", downloadLatest); + } } }