Commit Graph

112 Commits

Author SHA1 Message Date
Matt Pass
fa97918684 Use doFold now, pass string instead of object 2014-05-22 07:07:39 +01:00
Matt Pass
fa48d0d2f0 Strip ../ so we don't have dir traversal vuln 2014-04-26 12:24:01 +01:00
Matt Pass
6e7612d3ec Inform user they can't delete the root
Stops the root accidentally being deleted
2014-04-23 08:22:44 +01:00
Matt Pass
b45817ec65 headers.php included and csrf POST added 2014-04-18 18:10:50 +01:00
Matt Pass
83f6c5cf53 Only move to different folder and 3 x bug fixes
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
2014-04-15 08:39:46 +01:00
Matt Pass
68e5e0b5a5 Specify if it's a file or folder on updating FM
folder on new folder
set $fileOrFolder on pasting, that is used then on updating
file on uploading
file on saving
2014-04-14 08:35:26 +01:00
Matt Pass
02565fa3b8 Getting rid of rightClickedFile
Now using last item on selectedFiles array
2014-02-21 09:04:57 +00:00
Matt Pass
4124d64a58 Also need iceRoot in $dest path 2014-02-17 08:09:30 +00:00
Matt Pass
7df2a8c0ac Default type is text, 2nd array defines 'other'
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).
2014-02-17 07:47:51 +00:00
Matt Pass
0da9371c4d Move event added
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
2013-12-11 06:20:20 +00:00
Matt Pass
77b7a88651 Use FILEINFO_MIME instead to get mime type
FILEINFO_MIME_TYPE is only available on PHP 5.3+ and on some servers
it'll use finfo_open but then get nothing back using this newer param
option.
2013-10-13 13:22:44 +01:00
Matt Pass
ee917776f0 Set savedPoints on reverting, load or save
On reverting set back to the changeGeneration integer
On loading set to the new changeGeneration integer
On saving set to the current changeGeneration integer
2013-09-25 09:52:16 +01:00
Matt Pass
f4e2f24f65 JSON added as a supported filetype
Need to only add to array and a CSS classname
2013-09-16 08:30:52 +01:00
Matt Pass
fd2197eace SQL mode added
Chose MySQL as the default dialect, others possible so added a comment
on that
2013-08-11 17:07:50 +01:00
Matt Pass
60cbfd486c Call switchMode after saving
So it colors code after saving new files, renames to a different file
type etc.
2013-08-07 20:09:43 +01:00
Matt Pass
90a531d2a8 focus method added and only actions if not iThing
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
2013-07-25 07:17:09 +01:00
Matt Pass
b366e47197 Condensing code, only need $renamed once 2013-07-07 15:25:32 +01:00
Matt Pass
9bbc41d7b7 Remove all the script tags
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
2013-07-06 19:45:27 +01:00
Matt Pass
46c0ec9c63 No need to unset selectedFiles on new paste 2013-06-29 22:26:38 +01:00
Matt Pass
5b32c96f1d Determin fold type by { char existence
Don't assume if it's a certain file type it will be folding on braces,
instead fold on braces if there's a brace char on that line
2013-06-29 17:25:50 +01:00
Matt Pass
31bbbe098a Remove line class on CM instance not selected tab
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.
2013-06-29 15:00:37 +01:00
Matt Pass
24d68efd4b Get 1st array value seperately
Some older versions of PHP don't seem to like calling [0] on the same
line as explode
Now getting value on seperate line of code
2013-06-04 14:14:49 +01:00
Matt Pass
7255ea4805 Consider extensions up to a space char
This enables ICEcoder to understand that image.jpg (2) is a jpeg and can
be opened as an image
2013-05-31 21:16:18 +01:00
Matt Pass
5576c9e2e9 If we have no fileLoc, show /
This covers saving new files/save as in the root
2013-05-31 14:35:08 +01:00
Matt Pass
c2e92fa355 Brace folding on applicable filetypes
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
2013-05-29 08:57:37 +01:00
Matt Pass
6a3e15aabf On load also set the gutter marks
Using tagRangeFinder for now, need to also handle braceRangeFinder and
put into a function within ICEcoder
2013-05-25 18:26:24 +01:00
Matt Pass
f436aa835d Set a stream context timeout for file reading
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.
2013-05-23 17:45:00 +01:00
Matt Pass
0de8405906 Remove old highlight & save dialog now filename
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
2013-05-23 10:08:11 +01:00
Matt Pass
3710fa9e79 Convert content to UTF8 no BOM
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
2013-05-22 12:58:33 +01:00
Matt Pass
7b1b91ca14 lineEnding setting added
Now replacing \r\n, \r and \n with whatever we chose to be the
lineEnding setting
lineEnding is \n by default
2013-05-22 08:40:38 +01:00
Matt Pass
fc79be3010 getRemote file function added
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
2013-05-12 17:12:14 +01:00
Matt Pass
5f0ee6d95e Trim + and space from end of file
Not something that should/could be used consistently across enviro's so
am trimming these chars off
2013-05-10 17:41:37 +01:00
Matt Pass
3f15cb8fff Python now supported as a language
Also minor fixes to Ruby's usage
2013-05-08 08:51:50 +01:00
Matt Pass
525e73e179 stickyTab now previewWindow 2013-05-06 17:33:42 +01:00
Matt Pass
0ba4803154 Canvas elem plus 4 x input boxes added
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
2013-05-04 13:51:51 +01:00
Matt Pass
1d5c049c01 Don't reload MD files
Stick with the Markdown parsed version shown via editing.
2013-05-02 17:19:04 +01:00
Matt Pass
6e061cbc30 Markdown (md) files can now be opened in editor 2013-04-30 17:47:58 +01:00
Matt Pass
3104065437 Dimensions now shown under image
The natural image dimensions are now shown next to the image name (now
in bold) along with a note that it's displayed at a reduced size, if it
is.
2013-04-21 15:47:15 +01:00
Matt Pass
54088daa67 Replace \r\n and \r line endings with \n
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
2013-04-20 16:08:26 +01:00
Matt Pass
df481aaf07 Ensure we have a slash for the root level
Need a slash to specify the root level when updating the file manager
2013-03-11 17:37:55 +00:00
Matt Pass
000fda848b Get filemtime after saving
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.
2013-03-04 12:56:58 +00:00
Matt Pass
62ad6dde67 Correction to previous condition swapping
Put the isset bit before the comparison bit, but made a mistake with the
parens bit. This is how it should be.
2013-03-04 10:11:32 +00:00
Matt Pass
8750fe7a43 Pasting of folders in same dir adds (num)
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.
2013-03-02 21:59:01 +00:00
Matt Pass
2025e8f10b Check if fileMDT doesn't exist first
Performing comparison when it doesn't is an error. Just swap aruments.
2013-03-02 17:13:39 +00:00
Matt Pass
cc306475b2 Condensing code & fileMDT fallbacks
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)
2013-03-02 16:26:02 +00:00
Matt Pass
04f7e84642 Set $finfo as a blank var to begin with 2013-03-01 17:43:08 +00:00
Matt Pass
8c7fbcd7d4 Fallback for finfo_open
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
2013-03-01 16:20:51 +00:00
Matt Pass
05b0ef75c9 Only set newFileName if not false (ie, something) 2013-02-27 16:09:33 +00:00
Matt Pass
2d79b5a988 Reset fileInput and only act if we have file
Reset fileInput back to an empty value after upload (success or fail)
Only if value isn't empty action the upload
2013-02-17 18:04:32 +00:00
Matt Pass
82e3698dd2 Change of operator to consider empty files
Was giving false positives on false, !==false is what we require here
2013-02-09 15:42:20 +00:00