From f5cd2b46b940b7128d1784b4a8187783bd4bb332 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Tue, 3 Jun 2014 08:40:48 +0100 Subject: [PATCH] Else & if conds added to get GitHub repo Added an else condition to work with empty folders, establishes local and remote paths and works out of the $iceRoot is one of our local paths If so, inform the user their folder is empty and ask the user if they'd like to clone the repo If so, show the loading mask and call our GitHub script to begin the process --- lib/get-branch.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/get-branch.php b/lib/get-branch.php index 8a1877f..57733d3 100644 --- a/lib/get-branch.php +++ b/lib/get-branch.php @@ -90,6 +90,20 @@ if (isset($_GET['location'])) { newUL.innerHTML = showContent; locNest.parentNode.insertBefore(newUL,locNest.nextSibling); },4); + } else { + + if (top.ICEcoder.ask("Your local folder is empty, would you like to clone ?")) { + setTimeout(function() { + top.ICEcoder.showHide('show',top.get('loadingMask')); + top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/github.php?action=clone&csrf="+top.ICEcoder.csrf; + },4); + } + }