Global iceRoot so it can be used
Escape apostrophe's in $fileName on upload
Establish $srcDir and $tgtDir and only consider moving if $srcDir !=
$tgtDir and $fileLoc != ""
$fileOrFolder now established on moving and passed as param to
updateFileManagerList
Changed the default type to 'text' so ICEcoder will want to open any
file in the editor to begin with.
This is overridden by the images array and the newly purposed 2nd array
which defines types to instead pop open in a window (doc, docx, ppt,
rtf, pdf ...etc).
If we're due to move a file and it's writable, rename it to new location
Call move event once done to update file list
Show message if we failed or clear server message if all is OK
On reverting set back to the changeGeneration integer
On loading set to the new changeGeneration integer
On saving set to the current changeGeneration integer
CodeMirror focus method was causing no keyboard issues on
iPad/iPhone/iPod
All focus() calls nowrunning through new focus method, which acts as a
single point to do this
Will not do this if iPhone|iPad|iPod test is true
This not only saves bytes but I suspect opening & closing so many in
succession is causing a problem.
About 1 in 50 times it wouldn't get all the way through the file, it
would stop somewhere near the end
We were trying to remove a line class based on tab number and not CM
instance, this ended up causing an error after 2nd open. Because of the
error, CM instance numbers were not being set correctly, so we ended up
with the same number and so when switching tabs it would show the same
editor instance.
On both load and change we need to use braceRangeFinder or
tagRangeFinder depending on filetype
Also get rid of old, commented foldStyle marker CSS historical reference
as we're now using that
Add a context array to all instances of file_get_contents(). This is so
we don't end up with a timeout too early if the system is set to
something short (ie, 15 secs) and we try to open a large file that takes
longer than this short limit.
If we have a new filename and our file is not [NEW], we must be
peforming a Save As.
In this case, establish the old filename and if it's visible, change its
BG & FG colors to the default
Also now set previousFiles when any save happens to avoid previousFiles
still having old filenames
The dialog now wants only a filename in both Save As and New File cases
Condensed code a little here
Detect bad chars and BOMs in loaded content and convert plus show
message to inform user
Affects: Loaded files, remote loaded files, replacing text in files,
saving files
Firstly, avoid establishing a full path if we have a getRemoteFile
action as it will be a URL
If we want to get a remote URL, attempt to get remote contents,
standardise all line endings to be Linux based, create a new tab, new
textarea and finally set the value of the new tab. If we don't manage to
get the file, show an error message
Canvas element added to drop a dup of our image into
4 input boxes also added to show current mouse XY hex & RGB values and
similar values when clicking the canvas image.
New flags added to stop closing the popup unless we click outside of
these elems
Finally, split everything onto multiple lines for readability
To set it to Unix as the default. Opening files with \n line endings in
relatively modern programs will know to use line breaks here if not the
native OS preference
We weren't getting the new filemtime after saving and using the
$filemtime var value prior to the save. Needs to be reestablished prior
to setting the array value.
If the dir exists, run thru from 2 to 1billion looking for next
available number and set the $dest name as that. All exactly the same as
how it works for pasting files.
Ternary expression to get same saveType results
Create a new $filemtime var and set to 1000000 for non Linux systems
We now have something to compare with
(Tho will always be this on Windows etc)
Detect if the finfo_open function is available and if not, grab the file
extension and compare against an array to work out accepted text based
and image based file types to know wether to open in editor or pop open
as an image