newTab isn't a tab at all, it's inner contents of an LI, so now called
innerLI
2nd insertBefore should be inserting newText not newLI again
New code to get CSS values via regex
Now only showing the preview if the caretLocType is CSS
No need to return cM in getcMInstance, just return the ternary value
Shortened a few comments for clarity & byte saving
No need to add length as 2nd param on substrs in a couple of places
newTab setup as string to be used in a couple of places
Ternary shortening on elemType
Converted ternary statement back to if else to byte save on 2 ternaries
Reversing bool on codeAssist var by using ! instead
break is shorter & better too, than increasing i's value to escape
Now just usage anonymous objects inline instead of creating for single
use
(saves adding extra vars and is less code)
Removed findLen and replaceLen as only findLen was being used twice
Replaced how we find & replace by using CM's searchcursor
Fix to the selection on hover over nest items, doesn't need -1
(This is because I fixed CM's tagRangeFinder to include last line)
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
Ended config.php write problem messages with 'and press refresh'
No need to set visibility on load anymore as we can only see if logged
in, so should be visible anyway
Removed tabs from login & set password screen (gives clue it's in an if
condition)
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
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
Big set of changes so that you only see a login screen until you're
logged in
Upon receiving a good login password attempt, also now immeditaley
redirect after setting session var
Rearranged a few chunks of code to logically make more sense
SImplified quite a few things by condensing code
Now shows a login/set password screen
Prior to showing this though, if we're setting a password and once
hasn't been set yet, do that and redirect
If we're not logged in or don't have a password plus not on the settings
file, redirect to that to login or set password
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)
resultsPane id setup. This then allows us to change the height to fill
more of the popup if we don't have replaceAll button at the bottom.
Establish findText in both PHP and JS (they need different sources for
their values unfortunately)
(JS for encoding simplicity by just using input field value and PHP to
get GET value as it can't pick up the parent input field value)
Use findText in both JS and PHP variations where appropriate