Commit Graph

86 Commits

Author SHA1 Message Date
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
Matt Pass
0dd9535a5b Allow opening of empty files
Allow 'empty' to appear in the MIME type, so we can accept things such
as application/x-empty, which indicates an empty file. Wouldn't open
them previously.
2013-02-09 15:07:45 +00:00
Matt Pass
336ef01dee loadedFile to replace all & chars for textarea
This is so & becomes & ...what you draw out of the textarea
is then &
In turn this allows all HTML entities of this style to work and as we
aren't using PHP's htmlentities(), we don't end with junk chars on
slanted apostrophes, degree symbols etc.
2013-02-08 10:12:35 +00:00
Matt Pass
9c8bb08454 Remove htmlentities() to avoid junk chars
Not needed and just caused junk/rubbish.
2013-01-31 14:05:47 +00:00
Matt Pass
cc6bd40b15 Var name fix, should be $renamed 2013-01-24 07:36:11 +00:00
Matt Pass
5221ba0959 Shows server message to indicate file upload
Users aren't always aware if a file upload has happened OK, this server
message helps put the point across.
2013-01-23 19:48:56 +00:00
Matt Pass
6036b0635d Error catching on rename function
Test if the rename has taken place and only if it has, call
updateFileManagerList etc. If it hasn't set the renamed var to false. If
renamed var is false, show the improved error message (gives note on
permissions).
2013-01-22 19:58:21 +00:00
Matt Pass
74f678076a Don't update openFiles array on upload
Calling updateFileManagerList now includes a 6th argument and if a true
value is passed, then it's indicating an uploaded file and shouldn't set
the openFiles array value.
2013-01-22 18:49:48 +00:00
Matt Pass
0c4741c793 Disallow traversing to parent dir 2013-01-15 11:54:12 +00:00
Matt Pass
4da7024f91 Upload files function added
This function will get uploaded file details for each file uploaded and
when uploaded, move the file to the user selected folder. Also shows
error message if there is an issue. Either way, when finished it will
clear the selectedFiles, file menu and hide the loading mask to return
user to normal view.
2013-01-15 11:47:31 +00:00
Matt Pass
497efaabf0 Fixing multiple & path issies in delete function
Establish a fullPath to begin with and use that
Only show relative path in message re not being able to delete
2013-01-13 16:10:19 +00:00
Matt Pass
2ee777739f Paste same name files with postfixed next nos
$dest now has double slashes replaced with singles
Now also considers if a file exists before copying
If it does, next available number up to 1 billion postfixed to end of
filename
Copy with that new filename, next number postfixed
Slight adjust to filename shown in file manager to match
2013-01-13 15:13:34 +00:00
Matt Pass
ec28de40c9 Checkerboard BG behind image popups
Show checkerboard image behind image popups so you can see transparent
areas on images. Needed black BG as a fallback too.
2013-01-13 12:47:48 +00:00
Matt Pass
0328643c7c Now only loads file if it exists
if file_exists needs now wraps load PHP and JS code to allow escaping
and server message when files don't exist
2012-12-18 09:15:13 +00:00
Matt Pass
09cf5589f5 Use addLineClass and removeLineClass
These are used in place of setLineClass now
2012-12-03 19:11:15 +00:00
Matt Pass
435e1b3b4b Now pastes files and folders
Also includes, sub folders & files
2012-11-25 16:22:36 +00:00
Matt Pass
b1056a19a3 Restrict demo mode to load only
Cannot only make new folder, paste, rename, replace text in file, change
perms, delete or save if demoMode is false
2012-11-17 18:43:32 +00:00
Matt Pass
c4d24c0a4c Pasting a new file
Looks to see if the location is writable and if so, copy our file to
that location
Then adds the new file to the file manager, otherwise, informs you it
couldn't do it
Clears server message eitherway
2012-11-12 09:26:50 +00:00
Matt Pass
75e9f916ec Opening file by mime type now
Detect if it's text based, image based or other and open as appropriate
(text = editor, image = media preview, other = new window)
2012-10-25 12:38:36 +01:00
Matt Pass
bde9010000 init saveType before use, split is now explode 2012-10-23 18:14:34 +01:00
Matt Pass
70a69f1c3b stickyTabWindow now stickyTab
Removed the flag variable stickyTab and stickyTabWindow now becomes this
Saves excess vars
2012-10-20 16:44:55 +01:00
Matt Pass
a01d770044 Condensing JS and PHP syntax format tweaks
Multiple JS lines condensed into fewer, action also placed before
message
Couple of PHP if else statements changed to ternary
2012-09-19 23:44:04 +01:00
Matt Pass
fd974c7bb7 Removed restrictedFile, DOM ready update & tweak
You cannot get access to ICEcoder unless you have logged in, so
restrictedFiles is not needed anymore
Removed it and all instances of it's usage
Only updating pluginsContainer if it's a DOM elem
Change title tag of login/set password screen conditionally
2012-09-19 17:29:10 +01:00
Matt Pass
338ca3bb24 if loggedIn conditions removed
User cannot view this file if not logged in, so not logged in handling
no longer needed
2012-09-19 09:10:08 +01:00
Matt Pass
e2aefab2ae SESSION userLevel now loggedIn
Moving away from the idea of multiple user levels, users will either
have full access or no access
Swapped all userLevel session vars to a loggedIn var, which is a bool
Makes things simpler and paves the way towards the new login screen
(before you see any files, code etc)
2012-09-18 08:53:13 +01:00
Matt Pass
bfbf84ca24 New action process added for replaceText
Upon replaceText being needed, we detect if we have a high enough
userLevel and if it's writable, if not provide an appropriate message to
the user
Otherwise - read, replace and save the new content with the find/replace
combo requested
Clear the server message and item from the queue
2012-09-07 17:25:56 +01:00
Matt Pass
853981b3b0 Graceful & discreet reload on not being ready
If for some reason the createNewCMInstance function isn't ready &
available, reload the iframe containing file-control.php which works
with the issue by giving more time and leave a note in the console.log.
Also move everything to do with the the loading process into the
successful part of the if condition.
2012-08-02 13:45:02 +01:00