draggingWithKey is new param, to indicate which key we have down while
dragging, false if no key
pasteURL is new function to paste a URL into the editor. If CTRL/Cmd is
down, add the protocol and // as a prefix
draggingWithKeyTest - another new function, this will work out a key
that may be down whilst dragging, For now we set to CTRL (for CTRL/Cmd)
or false but could take other keys in future
dropFile is a final new function, when dropping a file, it will do
something. If we're in the editor area, paste the URL, if we're in the
files area, we'll move a file (a future update here). Finally, we set
mouseDown to false as we may have crossed from one area to another and
the event wouldn't trigger and flag not set otherwise
Also setting top.ICEcoder.area on mouse move, very useful so we can work
with that info (in the case of dropFile above)
savedPoints now replaces changedContent
It's role is also different - it contains the integer change num from CM
on load/save/revert etc. We can compare this against the current change
num provided by CM (changeGeneration) to see if content has changed
Removed redoChangedContent function. This was only called once (by
editor.php) on all keyup's and we used ropey key detection to set
changedContent. As we're no longer storing changed doc values, we no
longer need this, and as redoTabHighlight is already called on CM change
(much more efficient BTW), we now don't need this function at all
getcMInstance can now accept a tab number, 'new' string or nothing (both
those last 2 use selectedTab)
Wrap fMIconVis setting in an if condition so we don't try to set it when
doc isn't there yet
All instances of changedContent now savedPoints where it still remains
Sets width and BG depending on wanting to show/hide
If we're showing, also perform an expand on the file manager incase it's
collapsed
(This is so we get to see both FM and plugins panes)
Settings screen now 10px taller to help accomodate new Autocomplete
setting
Visible tabs have -1px margin left offset
Autocomplete updated live in session on settings change
More subdued tab colours for normal tabs (BG & FG)
Slimmer header and no footer to consider
No need to set margin left pos of lock, it's moved to within files.php
For this reason, we need to change our DOM targeting
Only focus or do CSS colour blocks if we have cM
Because the file manager is now the whole height we no longer consider
if the Y mouse is > 40 or < 30 from bottom
Checkbox now styled and using a BG, so set the pos on change
No need to hardcode setting in the main ICEcoder object
Moved function param for tagWrapperCommand placement
Minor syntax tweaks for consistency
Also removed now old comment
Nest indicator now works with XML too
Set cx as false and then set if we have a matching object structure
Do nest indicator even if we don't have a html or body tag, as we may
have XML
Always show 'content' after the nest tags, except if it's JavaScript
lineCount and charCount are var's no longer used, removed
Add scrollBarVisible var, is true or false depending on if we have a
scrollbar
Removed numChars and charsToCursor vars as we're now using
cM.indexFromPos which gives the same result, but using CodeMirror so
probably more efficient
A new ICEcoder.resultsLines array is now available, populated with
unique line numbers of found results
4 other new vars added for new functionality and also filesQS which I'd
missed adding before
New functionality to create colored blocks and add into the container,
at heights determined by the amount of content and colored according to
which line we're on
Else clause added to clear results and this container if we have a blank
find string
This is because AltGr+4 is used by { on French keyboards, it's a $ on
Turkish keyboards etc
Many people won't go beyond h3 anyway and so it's best to have h1-h3 and
have AltGr+4 working as expected for non English keyboards
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
Remove unused vars & whitespace
File manager menu won't get cut off if we trigger it near bottom of
screen. Now works out height of it and takes that into account so the
bottom sits 5px from the window.innerHeight bottom
Redo working out chPos in a more logical way
Tidy up formatting etc and add comments
Only run file.replace once, set in var
Only action replace on buttonClick (same as replace all), as having a
result selected and changing replace value can replace selection without
a button click, which is undesirable
if condition was wrong, should be based on if we already have that char
ref point in ICEcoder.results
Remove old code re counting no of chars previous to cursors line, and
other old chunks of code that seem to do nothing
Use a much shorter and more efficient way to count chars to our cursor
now
Same for building up filesQS, just join the array values with a colon
New fmReady var, set to true when the file manager is ready
An interval is set up and auto opens files as soon as this var changes
Simplifying for loop
Text and comment improvements and additions in many places
Can now just use window.innerWidth/height, no need for ternary condition
Simplifying an if and ternary condition
contentCleanUp should happen on all files
Put the line swapping into 1 operation so an undo makes sense
Replace document.getElementById() with top.get() in many places
Add/remove vars to avoid global leaks/clear away old vars
Use break instead of escaping through var setting
Add != "/[NEW}" to if condition so we can open multiple new files
Remove old code re switch tabs to open file, this is handled by isOpen
if condition now
Condensing a lot of code on deleteFiles function
Condensed code a little on showMenu function re folderMenuItems
codeAssist is now set along with other settings in index.php
solarized and xq-light should have lighter active lines too
If codeAssist isn't the same as out session setting, set it to the
updated setting and toggle the switch
Adjusts to CSS stylesheet targeting. New CSS file meant it's now
position 4 in the array and child item 4 where we'll find the content
style
I also changed background to background-color on the activeLine style
Both functions can now duplicate and remove multiple lines as well as
specified line or current line
Tries to handle duplicating intelligently with line breaks if selection
ends at a line end getting a line break
Remove updateHints function, upgraded to new gutter based JS Hint system
On toggle of codeAssist, clear the gutter and set lintWith to false if
we're turning off
1st tab position is now an extra 12px, so 53px not 41px
This will openClose a folder without requesting a reload. This means if
it's a closed folder it will stay closed and if it's an open folders it
will get closed. This is done before hiding the folder, without this the
child contents will still be seen even though the parent folder display
itself is hidden.
Function is now named deleteFiles
Comparisons on files such as xyz9.txt and xyz10.txt would come out as
xyz9.txt being higher and cause issues as startFile and endFile would be
the wrong way round. I'm therefore now comparing on regex replaced
values, where numbers may be prefixed by up to 20 zeros (note
substr(-20) to right align our value.
delete, copy and paste file functions now plural as they handle multiple
files.
copyFiles works with a given fileList and not just the selectedFiles
array. Also passing params to control if we hide or show paste option
and file menu
pasteFiles will refuse to paste the root, that would cause bad looping &
compound pasting issues
duplicateFiles function added which takes a snapshot of the copiedFiles
array, copies the files while not showing paste menu or hiding menu. It
then sets the paste location to be the parent of the duplicate target
and pastes into that location. Once done copiedFiles is returned to the
snapshot image.
Declare all vars at the top of function
If the R, G or B values have less than 50% saturation or we have a high
yellow like color, use a white text color, otherwise black
Set that on both the X&Y preview and the clicked color preview
We can only set the CaretLocType if we have a fileName to inspect, an
edge case brought up by unit testing
Extra param added to closeTab to allow us to not ask the user for close
permission on unsaved files
tabBGopen now a lighter color, plus tabFGcurrent and tabFGopenFile
colors added
Removed bgVPos and no longer setting BG position as we're not using an
image anymore
(Instead we set either the current or open tabBG color
We also set the FG color of the filename to current or openFile
No longer manually set display to none on fileMenu on actions, should be
calling hideFileMenu
On showing the menu, set the opacity to 1 4ms after setting the display
to inline-block
Simply set opacity to 0 on hiding so it's more an instant hide
Get rid of progress bar reset
Will only now begin to select a range of files if we have selected files
already.
If not, it will add this first file as a start point.
Will also only range select if we are range selecting in the same
folder, otherwise will add this file. This enables you to select ranges
of files in different folders.
Lastly, the root has a very slightly different node structure, as we
can't start at 0 and step in increments of 2, it needs to be 1, 3, 5
etc. So as a failsafe, if the node we're looking at is not a LI,
increase the i counter by 1.
New vars added for the new event of shift-clicking to select ranges of
files in the file manager
Get the last file clicked and work out if the file we've just clicked is
alphabetically greater than it or not, so we end up with a startFile <
endFile and are therefore selecting from startFile downwards
In a for loop, run until we find our startFile and begin selecting.
If we're selecting and the file we're looking at isn't in our
selectedFiles array, select that file and add it to the array
Finally, when we reach our endFile, break out of the loop