moveLine(dir) func added as combo of moveLineUp and moveLineDown funcs
Move initialising vars to start of func
Used indexOf to check array for shortURL instead of for loop in 2 places
Improving/removing a few comments
Condensed code to now check if selectedFiles is empty or contains right
clicked file and also condensed code to use indexOf on array instead of
for loop
Don't need foundFile because of this condensing
Using ICEcoder ref for filesFrame and also showing dropdown higher up
(next to mouse pointer/inline with file/folder name)
Syntax format improvements on fileManager function
selectFileFolder improvements:
- Removed a load of vars we no longer need & new tgtFile var added
- 2 x areas where we deselect files/folders now done via new function
- tgtFile now avail to avoid duplicate setup
- Other much more efficient and clearer processes setup to achieve same
result
New function added to deselect all files
Ternary shortening on colouring of selected/deselected files & folders
Swapped var order around
Checking state.curState.context can cause issues is state.curState
doesn't exist so just check state.curState instead
Swapped a couple of vars round to match order of usage in func
updateNestingIndicator now setup on a setInterval every 30 ms
(This is due to timing issues and solves this without being noticable)
Only if we have a context for the given tag build up the array
If so, reset htmlTagArray and build up the array again
This means we stick with the old array if we're in a script or style
block (for example)
Set the tagString to be the last item in the array
If caretLocType is JS, set the tagString to script
(This is because CodeMirror doesn't recognise this as a tag)
updateNestingIndicator now works by:
- checking if we have a cM instance and not in JS, Coffee etc filetypes
- gets token information for the very end of the document
- detects if it's className is an error or not to determin if the
nesting is broken
Fix to detecting the code type we're in as without -1, JavaScript is
ignored as it's array item 0
Uses a method from Marijn Haverbeke to establish an array of nested
tokens
This means chars in the document don't need to be scanned and the array
worked out in a more complex way
It means quite a few lines can be condensed down to just 3
Also means it's far less expensive on the CPU, meaning there is no
sluggishness onCursorActivity on large documents (ie typing etc)
No longer setting the cursor ch position on moving line up/down
Instead now highlighting the line that has been moved
This is done via the new function highlightLine
Clear iceRoot from the beginning of location (needed for when you set
your own ICEroot), so it doesn't cause DOM ID issues/mismatches
Also remove it from the file path passed through to file-control when
changing perms when you have your own ICEroot and don't show in server
message either
Reworked detecting if it's a JS, CoffeeScript, Ruby, CSS or LESS file by
switching the indexOf around
Also performed indexOf on an array rather than looking at each array
item in a for loop
Ternary shortening of code in a few areas
accountLogin removed as an aliasArray to create
login param not needed on init function
Remove the if & else condition depending on login, this is not done here
anymore
No need to set login, not there anymore
refreshFileManager no longer needs to take action on logging in, user
would already be logged in
Don't need cM anymore
Replace apostrophes with HTML entity value
If we have something that should be URI encoded, encode it but also with
an ICEcoder: prefix, so we know we need to unencode it
New isOpen function added
This receives a file ref (absolute or relative) and checks a relative,
pipe replaced version against the openFiles array
If it finds a match, the file is already open, it will return the array
position, otherwise return false
The openFile function now uses this array when attempting to open a file
It firstly checks if it's open or not, if it is, it will switch to that
tab, otherwise proceed to open it
autoOpenFiles no longer has to check for this, as it's handled by
openFile function anyway
New function added which takes 3 params for fileRef, find & replace
Adds a new job to the server queue with an action of replaceText and the
3 params
Also adds a serverMessage
New shortcuts added for next/previous tab, move line up/down, new tab
and close tab
switchTab function now accepts a noFocus param to stop focusing on the
document
Fix to set the visibility on the content area when starting a new tab,
wasn't showing otherwise
Functions added for nextTab, previousTab, moveLineUp and moveLineDown
(Other 2 functions newTab & closeTab already exist)
helpScreen taller to accomodate the 6 new shortcuts
Move webkit & moz animation CSS declarations to the style attribute on
progressBar span
Give the span an ID and on showing the loadingMask again, clear the
declaration
4ms later start it again so it starts from 0% again
Replacing pipes with slashes in oldName
Not setting href on a tag to stop snapping to top
Path references should be location + "/" + file (or pipe)
Also updating perms ID ref
No need to add add / to end of getInput dialog default
Double // replaced with / in error catching
Correct perms shown on update of file manager; 705 on folders, 644 on
files
if condition block tabbed to right depth, for syntax clarity only
Due to new DOM structure and relative paths how we add new files &
folders, including how they're added into empty folders has been
realigned and reworked.
minFilesW should be 14px not 15px (could just about see edge of icons)
Not setting account width. Wasn't really necessary and caused icons to
collapse into smaller space when file manager reduced in width.
Ternary statements shortened where possible
Account now has it's width set too when setting layout
fmLock now moved into another DIV container, adjust marginLeft value
No need to add last argument to substr as we want up to the end
Few hex codes shortened
Have removed shortURLStarts from everywhere, too problematic
Close button highlights on mouse hover
File refs used client side are relative/local now
(Means less messing with strings and better security)
fullPath now also gone for same reason
Now only highlight files in File Manager if link exists
shortURL is now basePath conditionally with shortURLStarts removed from
start also
Files stored in config.php are now full paths
(So autoOpenFiles function now no longer needs to prefix this)
openLastFiles function now triggered from:
init (this is for reloads of the browser) and
refreshFileManager (for logins)
Also now only changing cursor if we have iFrames in DOM
causes probs if you have the same term more than once in your path
(ie, var/www/mysite/www), previously took first www
Now takes last one and solves path issues in quite a few areas
Width and height now 100% rather then 100px
This is to avoid occasional issues with non resizing on login
No longer setting the width, no need
(Could also leave the height to 100% but it's only as high as the no of
lines in the document, looks a bit weird)
Now passing through the area the function was triggered from
If it's not the top strip, add on 40+50 px
If it's the editor, add on the filesW value
This gives us an XY position across the whole of ICEcoder
Icon applied to top, content & filesFrame now
Fix to closing tabs as now using CodeMirror 2.3
oldName & newName params passed to renameFile
This is used by the replace in filenames function, but can also be API
updateFileManagerList now has new param
This again is so it can be used by find/replace, passed from
file-control.php
Now focuses on the password field if you're not logged in
Width now set on the .CodeMirror class and not .CodeMirror-scroll
Removed visible & hidden classes so no need to update this
Hiding & showing instances happens in better way now with CodeMirror 2.3
(So no longer applying theme + hidden/visible to theme)
(Instead changing display none/block on wrapper and applying theme with
setOption only)
No longer using open & closed classes (italic text on open dirs)
This is because we have new icon to show open dirs
Reworked code to handle new UL & LI structure
Target querystring passed through if we're finding in files or filenames
Comma added before next file ref in previousFiles array string
settingsScreen now determins if it's being hidden or not
(used by update button)
Showing & hiding tabs now works again in useNewSettings function
alert calls now routed to message function
confirm calls now routed to ask function
prompt calls now routed to getInput function
This is so you can replace how these are handled if you wish
(Useful if you want to get away from browser chrome & UA dialogs)
updateFileManagerList now takes a perms param
This is used when action=="chmod"
The target element is established and the new perm set in the span
New chmod function to receive file & new permission
This then adds to the server queue and server message