You can enter an absolute URL path (ie, anything that has :// in it) and
it will trigger a different function to get the remote URL by sending
that action to the server queue
onclick function needed is statement plus passing of event on anon
function to solve repeated CTRL+click issue
Update title not by adjusting hardcoded values but by looking to ID of
targetElem
We're able to get rid of a lot of code here as the onmouseover function
is now looking to a child node item in get-branch.php, so no need to
mess with updating hardcoded string values.
Extra CodeMirror object child level needs to be checked too plus put
into dev mode until I resolve 2nd eval issue on renaming file (occurs in
.min.js file)
stickyTab now previewWindow in all places
nestDisplay text now gone, was just clutter
nestValid and nestDisplay now move to be under editor when resizing file
manager
Now setting nesting OK/broken on title on new look nesting indicator
new functions for openPreviewWindow and openTerminal, tidied up code a
little
stickyTabMaybe now removed as a flag
Needed to alter a few things to make it Compiler compatible. These
include stop using </textarea> even if it's in a comment, escape it when
using it as a string, comment tag openings need to be escaped too, plus
we cannot use char as a var, so renamed many references to ch instead.
Finally, needed to escape the ' apos ref to avoid issues there.
If something is selected and we have an orig cursor pos, set it back to
that. If not, we set the orig cursor pos, define an array of possible
definition matches and attempt to find them one after another in a for
loop, escaping when we do. Altered findReplace function to provide a
return of true or false depending on if anything is found.
New function jumptToDefinition. This takes token at the current cursor
position and then looks for that function definition as a set piece of
text 'function '+tokenString. This is triggered from CTRL+J so you can
hit this whenever you're on a function call and it will jump to it's
declaration.
In doing this I have repurposed the 1st param in findReplace function to
now accept a string to find. Previously we had this set to action, but
this variable was never used, must have just been a placeholder. In the
couple of places we call this function now we are passing the find input
box value.
New flag to determin if we are over a popup or not, won't hide popup on
click if we are
drawCanvasImage function added, takes img node, creates a new canvas and
on load of a JS img object, puts the same image into the canvas, scaled
to same size. This then has 2 functions applied to update RGB and Hex
values and BG colors as the mouse moves and also on click sets another
set
rgbToHex and toHex functions added to help return hex values on demand
Markdown added as a mode
CodeMirror changed their object structure to include another child -
htmlState
If it's a markdown file we're editing, after loading our file into the
stickyTab, onload of this parse our content through mmd to this window
Instead of having toggle variables for CTRL, Alt and Shift we are now
establishing if these keys are up/down from the event object passed in.
This means we don't need these flags, it's less code, and more reliable
too as we query if these keys are down from the event hooks.
delKeyDown is also removed though was never really used.
CSS color preview now clickable to show color picker, passing color
value
showColorPicker function shows Farbtastic picker and if we have a color
passed as a param, it sets that
Also new function added to insert color which actually replaces token
value at current cursor position
tabWidth is now indentSize
indentWithTabs is a new setting which can be true/false (false means
spaces)
Applied immediately after updating on settings screen
The 3 x instances where we define closeTabLink needs the
setting/unsetting of a new var flag called overCloseLink. This is so we
can choose not to start or end a drag function.
After processing a closeTab function, set canSwitchTabs back to true in
0.1s
Finally, the newTab left position should be set according to the length
of open files, not 1 less than it and we also need to have a tab width
of 0 but compensate for the padding, so needs to be -18
Only show nest display if we have the cM variable
On close setTabWidths with param to only set newTab position
If we have that param, get values for the last tab by setting i to the
last tab, but if we don't have posOnlyNewTab set, we can set widths &
left pos's of tabs.
Create a new var - cursorTemp and reduce the amount of code used to set
cursor position
The left side of 1st nest tag should have a cursor: pointer styling
Simplify and tweak the CTRL+i code to prefix voke.fm URLs with CSS or
PHP
New array item for nestDisplayText
Clear this to begin with then set with text if we have a nest, clear
otherwise
Only show the cursor position item if we have a nest
Prompt opens asking user to input relative file path, which on hitting
OK will attempt to open. Triggered with CTRL+o shortcut, which is also
added to help screen. Also clarified CTRL+g and noted it's anywhere, not
elsewhere.
Made this chunk of code active by removing 1==2 condition.
Now also defining 3 events in a variable and applying to text section
and arrow start ends. Also needed cursor: pointer.
Without this extra code, we would just be finding the previous tag with
the matching name and not consider the depth. This code sets the cursor
inside the potentially correct tag, gets the nest location without
updating the display and if it's not at the correct depth, do i++ so we
end up with another for loop to find the tag previous to that one and so
on. The only way to escape out of this is to find a tag at the right
depth.
Set ch before line in the object, so it's similar to the order of the
endPos object.
Don't ask the user for any confirmation if there is nothing to delete.
This could occur when you select something, delete it, then try to
delete again.
We need to also strip trailing slashes for deleting files when updating
the file manager. This is much like what we needed to do with adding
files to the root of the file manager. Locations should end without a
trailing slash, but a root is a trailing slash as its only char. A regex
here solves the issue.
Mainly to cover the root so / becomes nothing so we don't end up with a
double slash. Worth removing anyway incase it's passed elsewhere
somehow/through the API.
Tweaking comments to be more accurate
Removed snippetLine, no longer used
Handling openClose dir in a more simplistic way, only need to define
iframe.src once
Replaced text is no longer lowercase
Setting the cursor by setting zone as a variable and then using that
Removed 2 x calls to removeSnippet, no longer a function
Correcting unnecessary .parent
We are no longer setting display block here, this is now done once we
have injected the DOM elems into the tree at that dir. Once that is
done, we set the display to block. We still set none here when
collapsing. This avoids a flash of possibly unsorted files.
No need to set node to nextSibling again, only once is needed
If condition is now else if and calling the get-tree.php script
subsequent times and only if we're opening
This means we fix the open/close dir problem and also reload the dir
each time we open
Change onclick event by setting 2nd param to false so it doesn't reload
Broke setting of node.nextSibling down into 2 new items, may revise this
If we're due to load, pass that through to get-tree.php in the
fileControl iFrame to begin the process
The fileManager function was only being called once onLoad of files.php
This was really only adding onClick events and setting classNames and
style.displays, no need to do this really with JS, merged into files.php
as it's creating the tree
openCloseDir function now available to deal with open & close of dirs
This is less code, less JS to run on boot and paves the way towards
multiple treeTypes