Some hosts have a loop around issue with no session being available
after a header location redirect
After much research, I've found this is due to some hosts not having a
session save path and it needs to be set using PHP
Setting this means ICEcoder works on those few hosts
Fix to bad URL on logout
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
Store original $file value in $fileOrig
rtrim [NEW] from the $file path as that is messing with realpath
checking
Move debugging alert and console.log line into the for loop and use
allFiles[$i]
If a local path and not the doc root or parent dir starts with the doc
root
Check on $fileOrig when saving as
No need to str_replace ../, as that isn't real protection, use realpath
instead
Always turn into a real path (we'll only pass relative paths here
anyway), and change \ to / on Windows setups
Only if file exists and begins with the root path do anything, die
otherwise
When adding files, location should be a slash if not set
Remove any initial double slashes
When removing files, location should be blank if not set. Then replace
iceRoot with a slash, before reducing double slashes at start, slashes
for pipes and tack together with file to make the targetElem, which is
what we end up looking for
Show loading screen on clicking Commit button
Committed filepaths need to have pipes replaced with slashes
Splice from diffPaths or deletedPaths array so we remove committed files
Hide Loading mask if we don't have more to commit
Only display alert message and toggle GitHub diff mode if we have no
diff or deleted paths left to deal with
Error message is an object, so inform user that we'll console.log that.
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
Replace iceRoot with nothing on location
If we have no location, it should be a nothing to start with, not a
slash
Use this.childNodes[1].id instead of made up hardcoded ref
onClick event added also, wasn't there previously?!
xssClean call needs "html" context
Commit action added, displays screen to allow user to input the commit
title and message
Gets content of files ready and puts into textareas with IDs to be
picked up after cleaning up filenames
Start a github object with JS and push to GitHub, running through files
until it's done them all, and displaying error message if there's a
problem. If all is OK though, it simulates a CTRL-click to deselect file
and remove from file manager list.
When done, it will state it is switching back and switch back
ctrlSim param available to simiulate a CTRL key
In githubDiff mode, show the number of selected files and update button
and text colours
gitHubAction function added to call the github.php file with that action
in the URL in the centre of screen
Function also added to show/hide GitHub nav
Removed old alert message as we're much closer to being finished now