The 777 perm is now shown with a red background (and white text) so it
stands out as a bad practise. May look to add a setting to turn this
on/off in future.
Only include github.js if in githubDiff mode
Only do recursive dir loading if in gitHub diff mode
Move folderItems splitting out of loop to avoid unnecessary processing
showFiles now begins the process of displaying files - animated into
view (using setInterval) if less than 50 items, or shows immediately (by
setting showContent and skipping recursion) if more
showNextFile() is a function to actually display a file or if the end,
kick off the process of adding deleted files/dirs
treePaths, diffPaths and deletedPaths now all namespaced to top level so
we can access from elsewhere
Check we have excludedArray first before looking at it's index. This is
to avoid issues when switching in and out of GitHub Diff mode.
Excluded array paths have slashes not pipes
Don't add deleted files to diffPaths array also, keep them seperate
Can't use a for loop to add deleted files, only adds last reference as
happens before a tickover
Instead use a setInterval as a loop, with k as the counter instead of j
to avoid confusion
Check if it's not excluded dir/file as an outer if statement, with path
fix for root
3 cases set up for adding deleted dirs/files in a sub-dir, plus folder
or file in the root
Clear the interval when finished looping
Now an HTML type file, had no doctype, header etc previously. Now does
and also loads in 2 x JS files for GitHub API control
Gets full list of files, considers .gitignore files and gets an excluded
list
Always has a GET location now, so no need to consider
If in GitHub diff mode, for each file in our list get file contents and
put the name, SHA and type into 3 arrays
Work out GitHub repo path and set up JS arrays the same as PHP arrays
Then start a github object and begin examining tree for differences
recursively, adding to arrays and removing DOM elems from branch DIV as
needed
With that done, we need to cover the dirs not yet opened and if they
contain no changes, remove them
Finally, remove .gitignore excluded filrs
showFile function set up mostly as per previous code, but now also adds
files that are deleted (ie, to make them show up in the tree)
Error catching and helpful messages and redirections added such as when
you have no diffs or used up your GitHub API rate limit
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
LI tags now draggable
On drag, test if we are dragging with a key down. Also focuses CM editor
to show the cursor incase we want to drop into code and we'll then know
position
On drag end, perform a dropfile function
The branch DIV is now a temp DIV only and not seen. Previously it was
seen onload of ICEcoder as the display of the root. However, there were
inconsistencies in line returns etc and so now even the root has a
branch built for it on load. ie, the init load and branch generating use
the same system.
Set fmReady to true if not when finished animating the folder. This only
happens on load of course and means we run init afterwards
Test if we have a nextSibling before determining a tagName. This is so
if we have a dir with only subdirs (ie, no files) and the last subdir is
empty, there will be no UL list (which we're looking to maybe remove).
No longer need to consider depths as we are getting folder/file listings
for 1 branch at a time. For this reason, the opening UL will always be
block and the closing one shown when it's the last item and $GET
location is available (ie, not the root).