Commit Graph

133 Commits

Author SHA1 Message Date
Matt Pass
ebfafc66cb Show light or dark text on picker previews
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
2013-06-21 20:53:00 +01:00
Matt Pass
13e1b933e1 Only action on fileName and dontAsk param
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
2013-06-10 09:49:54 +01:00
Matt Pass
8db478d8f0 New color settings added, BG image removed
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
2013-06-05 18:11:54 +01:00
Matt Pass
eaf39661ba Fade menu in/out plus get rid of progress bar
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
2013-06-05 17:08:21 +01:00
Matt Pass
ebc8e3a27b Error catching on range select
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.
2013-06-04 18:47:06 +01:00
Matt Pass
ad8c3da48b Shift click now available to select file ranges
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
2013-05-31 23:37:35 +01:00
Matt Pass
7bdeefd7e1 Only do layout things if ready, fix to path
Can only resize the file manager if ICEcoder is ready
Need a selectedFiles[0] in order to prefix to filePath
If we add a new file to the root, we end up with a ||[NEW], so replace
|| with | to fix this
Can only set tab widths if ICEcoder is ready
2013-05-31 14:32:02 +01:00
Matt Pass
f541fae982 Get function added for byte saving and clarity
New global function added called 'get'
This is because top.document.getElementById is used so often, we
actually save 2kb by having a function to return the object, plus it's
much more readable to have:
get('serverMessage').style.opacity = '1';
rather than
document.getElementById('#serverMessage').style.opacity = '1';
2013-05-30 18:11:04 +01:00
Matt Pass
054cc5cad9 newTab behind others and fix move glitch
newTab now has a z-index of 0 so that it slides behind other tabs when
new tabs are opened
serverMessage is now display: inline-block and hiding and showing is
done on moving the left position to 0 or 2000px to show or hide (doing
the show/hide on changing the display type was causing reflow issues
which seemed to mean occassionally the newTab wasn't moving to the
correct position)
2013-05-30 08:41:39 +01:00
Matt Pass
7c2d6f6fb5 Organise alpha tabs on openFiles.length
Don't run this process based on cMInstances.length but openFiles.length
which represents the tabs open
2013-05-28 18:41:16 +01:00
Matt Pass
b05954eccd Error catching when no tabs are open
Look to openFiles.length on if statements within openPreviewWindow,
closeAllTabs and alphaTabs functions so we only do these processes if we
have 1 or more tabs open
2013-05-24 09:10:37 +01:00
Matt Pass
c18630b0a5 RGB color value added to picker
Farbtastic color picker now setting RGB value and BG color in colorRGB
elem
insertColorValue function adjusted to receive any value and replace
2013-05-23 17:46:44 +01:00
Matt Pass
39d4bfe858 If our file is |[NEW], prefix selectedFiles[0]
This is so we can pick up where we are saving the new file.
2013-05-23 09:56:56 +01:00
Matt Pass
83c99f34a3 Lowercase hex used
Use lowercase hex values to be consistent with rest of ICEcoder
2013-05-21 17:05:04 +01:00
Matt Pass
59e1bc3c56 New settings to style highlights
Formatted settings to make them easier to read
Added new settings tabBGselected to tabFGnormalTab. This is so you can
change styling of ICEcoder itself a bit easier, as these colors are used
in a few places
Extra ternary conditions added to handle things better.
Black is now current, selected is blue, open is grey and normal is
transparent. Also set the FG text colour on these things too, to go with
new color scheme.
2013-05-21 16:55:09 +01:00
Matt Pass
9c4c33aa76 Increase the variations on definition matching
Covers a few more variations here, will one day integrate Tern to better
handle this.
2013-05-16 16:57:05 +01:00
Matt Pass
0c7fad798c updateByte Display and showDisplay functions
byteDisplay added as DOM elem ref
updateByteDisplay added which sets the inner HTML to be the length of
the content spilt by commas on thousands
showDisplay function added to toggle between the 2 displays
Call updateByteDisplay on switching tabs
2013-05-14 18:40:41 +01:00
Matt Pass
b8f921dab2 CTRL+o can now get remote URL
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
2013-05-12 17:13:44 +01:00
Matt Pass
7fa39f645d Space shortcut to refocus on document
Hit space when outside of document to refocus on it
2013-05-12 16:06:55 +01:00
Matt Pass
535677fc8e onclick needs if check and simpler title updating
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.
2013-05-12 13:56:30 +01:00
Matt Pass
c335b6b7fb Check htmlState also plus put into dev mode
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)
2013-05-10 18:50:14 +01:00
Matt Pass
43ae4ac317 Dropping eval for function closure and slashes
Stop using eval here in favor of a function that returns the value, also
replacing pipes with slashes to display correctly on mouse hover
2013-05-10 17:45:11 +01:00
Matt Pass
0947172391 Copying of multiple items
Celecting copy will now store an array of the selected items and when
pasting, add each to the server queue for pasting.
2013-05-09 09:10:16 +01:00
Matt Pass
ba94a3bba0 Add system as a DOM elem
Not used as yet but available as a hook
2013-05-08 08:59:13 +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
a1574af5e0 Working with previewWindow, plus new sys tools
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
2013-05-06 17:40:02 +01:00
Matt Pass
cafa9d521a Making JS Google Compiler compatible
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 &#39; apos ref to avoid issues there.
2013-05-06 15:59:59 +01:00
mattpass
a5b395d888 3rd param should be false
The 3rd param is to define buttonClick, which isn't true in this case.
2013-05-05 19:52:25 +02:00
Matt Pass
c214640bb1 Jump to Definition variations setup
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.
2013-05-05 13:35:38 +01:00
Matt Pass
d7a8b35ded Jump to Definition, opening up findReplace func
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.
2013-05-04 15:19:31 +01:00
Matt Pass
e58f9cae28 overPopup flag, canvas display & hex/RGB convert
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
2013-05-04 13:48:33 +01:00
Matt Pass
d43a758a37 Markdown mode added, fix to tag display
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
2013-04-30 17:54:19 +01:00
Matt Pass
444695a908 CTRL, Alt & Shift keys now established natively
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.
2013-04-21 15:42:55 +01:00
Matt Pass
b5050acba0 Set font size on updating settings
New font size passed thru to this function to apply to the class
property on demand
2013-04-20 16:13:24 +01:00
Matt Pass
2c6bcacb25 New functions to show color picker & insert value
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
2013-04-15 16:18:59 +01:00
Matt Pass
3c4872c231 indentSize and indentWithTabs
tabWidth is now indentSize
indentWithTabs is a new setting which can be true/false (false means
spaces)
Applied immediately after updating on settings screen
2013-04-14 14:12:18 +01:00
Matt Pass
cc82304996 overCloseLink flag and position new tab on close
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
2013-03-22 16:52:43 +00:00
Matt Pass
2938014b33 Set tabs on mouse y over 62px not mouseout 2013-03-20 18:41:16 +00:00
Matt Pass
591ec57c49 nest display err catching and tab sliding
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.
2013-03-20 18:27:38 +00:00
Matt Pass
9197d24fff Check for file/folder at location before adding 2013-03-19 17:11:37 +00:00
Matt Pass
9fa87c5141 Get rid of global, CSS & Voke URL tweak
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
2013-03-18 17:10:12 +00:00
Matt Pass
33ea31f1fa Show/hide text next to nest display
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
2013-03-17 19:23:49 +00:00
Matt Pass
e2adcabc5b Open file promp function added & help updated
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.
2013-03-16 12:54:04 +00:00
Matt Pass
6161518d8b duplicateLine & removeLine functions
Functions added to duplicate line and remove line. Triggered from CTRL+
+ and CTRL+ - shortcuts whilst in editor area.
2013-03-16 12:28:52 +00:00
Matt Pass
bf40cb2009 Use voke.fm for PHP and CSS searches
Continue to use Google for other searches
2013-03-16 12:06:35 +00:00
Matt Pass
0f460483f3 Show tagName or content after nest display 2013-03-16 11:03:11 +00:00
Matt Pass
bf22cd1638 Now considering depth on highlight nest
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.
2013-03-16 10:42:26 +00:00
Matt Pass
1e09ccbc0c Extra code to find target tag
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.
2013-03-14 17:21:02 +00:00
Matt Pass
33308688aa Ignore deleting nothing & strip trailing slashes
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.
2013-03-11 17:40:42 +00:00
Matt Pass
82190b330b Remove console.log and taller help screen
Help screen needs to accomodate 2 new shortcuts
2013-03-11 09:02:18 +00:00