Compare commits

..

131 Commits
v5.0 ... v5.3

Author SHA1 Message Date
Matt Pass
68eb4a0393 Version 5.3 2015-11-13 12:30:43 +00:00
Matt Pass
5fc4ae596a Disabled closing tag completion till fixed 2015-11-13 10:26:09 +00:00
Matt Pass
e31f435640 Show editor and add functions to 2 x buttons
Include settings instead, plus CodeMirror lib and CSS
Set some CSS classes, and CodeMirror CSS files
Display clickable list of backups
DIV container added for editor display and buttons
Display CodeMirror instance and setup 2 x functions to open backup in
new tab or diff pane
2015-10-25 11:46:29 +00:00
Matt Pass
80acab0bf0 .button class added 2015-10-25 11:42:41 +00:00
Matt Pass
a95484d044 Load chosen backup, show buttons and set preview 2015-10-25 11:42:18 +00:00
Matt Pass
d979d76866 PT BR translation tweaks by Adir Prawutzki 2015-10-15 18:52:05 +01:00
Matt Pass
5f6c6838a0 Use singular term if 1 2015-10-09 08:47:55 +01:00
Matt Pass
cb6d339183 Display list of backups per date 2015-10-08 09:27:34 +01:00
Matt Pass
815578eb34 Now getting count info & as 2nd part use arrray val 2015-10-08 09:26:09 +01:00
Matt Pass
c5996f7b23 Returns count and array now, rev scandir order 2015-10-08 09:25:11 +01:00
Matt Pass
e89d449805 onclick open versions screen and pass sel filepath 2015-10-08 09:24:01 +01:00
Matt Pass
5b549c5102 Text pieces added for backup-versions 2015-10-08 09:22:49 +01:00
Matt Pass
fa793564d9 Display backups instead & can show versions screen 2015-10-08 09:21:50 +01:00
Matt Pass
395fdf0727 Merge pull request #592 from unix4you2/master
Spanish upgrade for multiple strings
2015-10-07 18:28:45 +01:00
Matt Pass
7f8e052a26 Handle newly saved files to avoid NaN 2015-10-03 18:31:53 +01:00
Matt Pass
b349891321 html, 3 x meta tags and favicon added
Missing html tag, set UTF-8, no index or follow for robots, a mobile
viewport that's scalable and use a favicon
2015-10-03 17:47:25 +01:00
Matt Pass
592c8ccda4 Clear iceRoot from checked path and check locNest
These couple of bug fixes ensure paths aren't compounded and also handle
empty dirs correctly
2015-10-03 17:40:19 +01:00
unix4you2
a366a84d00 Spanish upgrade for multiple strings 2015-09-28 14:00:42 -05:00
Matt Pass
f4762fbaf3 Working with file version counter now 2015-09-18 11:09:30 +01:00
Matt Pass
b00ce2f7c9 Get number of versions for this file 2015-09-18 11:06:53 +01:00
Matt Pass
6ccf0fb135 Working with file versions now
Establish and use version URL part
Add 1 to count on saving local or FTP and update version display after
doing this
All backed up files now have incremental numbers in parens postfixed on
filename
.versions-index file written to with new file line or if line exists
update count on it
On re-getting file due to save conflict, get the count and set in JS
array
2015-09-18 11:04:42 +01:00
Matt Pass
3c6a60f96d Class added for versions display container 2015-09-18 10:50:45 +01:00
Matt Pass
84fefcbad0 On opening file, push in version count and display 2015-09-18 10:49:48 +01:00
Matt Pass
139ca019bb Versions display container added 2015-09-18 10:48:59 +01:00
Matt Pass
0245ae418a Wording change and now shows 'X days of backups' 2015-09-09 08:43:36 +01:00
Matt Pass
a78d847f4e More text added re backups 2015-09-09 08:38:06 +01:00
Matt Pass
0592459666 Backup system working with params now
Only run backup process if user has this turned on. Some code
simplification added. Removes old backups past X days as per user
setting.
2015-09-08 08:03:53 +01:00
Matt Pass
6492068717 Update 2 new backup settings on updating 2015-09-08 08:00:38 +01:00
Matt Pass
36ea3eabc4 Backup settings added to turn on/off and for X days 2015-09-08 07:59:52 +01:00
Matt Pass
5c19367b87 disabled pseudo added for text input fields 2015-09-08 07:59:15 +01:00
Matt Pass
3a08ccf350 backupsKept and backupsDays settings added
Decided to go with it being turned on and kept for 14 days as default
2015-09-08 07:58:15 +01:00
Matt Pass
f5897cd036 Language pieces added for backups 2015-09-08 07:57:28 +01:00
Matt Pass
4f7ea84754 Use yyyy-mm-dd structure instead 2015-09-07 10:27:41 +01:00
Matt Pass
b46e2f324a Redone backup dir struc for subdirs & efficiency
Now establishes path from base and if full path doesn't exist, it fills
in the blanks, including sub-dir structure to file from base.
2015-09-07 09:49:18 +01:00
Matt Pass
0c3390929b Store a backup of our file each time we save
Saves into a host > year > month-day dir, with in incremental backup
names, number in parens
2015-09-05 19:02:45 +01:00
Matt Pass
857fa2580c Pane scroll position tweaks for soother scrolling
Match scroll pos on going split pane.
Only sync both panes if we're in split pane mode
Action the scrollTo after a 0ms tickover to give priority to browser
controls over syncing. This means on manic scrolling there may be very
slight judder, but it avoids 99% and appears smooth for reasonable
scrolling
2015-09-05 17:17:51 +01:00
Matt Pass
40e699828b FTP check file/dir & use string, FTP delete added 2015-09-05 16:28:17 +01:00
Matt Pass
60b527d5a4 Function added to delete file/dir over FTP 2015-09-05 16:25:57 +01:00
Matt Pass
1c99f127be Replace alert with message 2015-09-05 16:24:29 +01:00
Matt Pass
3221bea7a7 Message added re deleting >1 item under FTP 2015-09-05 16:22:55 +01:00
Matt Pass
96bba6972a Can now use regular +/- chars also 2015-09-05 13:42:13 +01:00
Matt Pass
b9546dfaa4 Small tweak to Portuguese BR char 2015-09-05 13:32:32 +01:00
Matt Pass
340e3b3d4d Chars replaced with HTML entites
Thanks for Reinaldo César Guedes for this!
2015-09-05 13:18:17 +01:00
Matt Pass
e1a2a8da71 FTP enhancements
FTP items: ongoing connection, save finished, improved/multiple doNext
messages, check dir/file, JSON details output
2015-09-01 20:05:47 +01:00
Matt Pass
38a5bea898 Merge pull request #581 from bhz6344/patch-1
To fix Chinese character display abnormal
2015-08-21 06:06:54 +01:00
Matt Pass
fa5b549081 Tweaks to save and move
Only use docRoot if not FTP (ie, local)
srcDir and tgtDir need prefixed slashes removed
Use JS isFileFolder function to establish dir/file type as short term
measure, to be replaced with FTP call to establish type so can all be
handled server side
2015-08-20 10:30:33 +01:00
Matt Pass
379f6ac1c3 Return info on a file over FTP 2015-08-20 09:26:29 +01:00
Matt Pass
87be112d9f isFileFolder function added to return DOM elem type
Detects by classname and returns folder/file or false if not found
2015-08-20 09:25:47 +01:00
Matt Pass
491edf256e Can now move a file/dir over FTP 2015-08-20 09:21:00 +01:00
Matt Pass
f38e984b31 Rename now working for FTP 2015-08-19 07:07:31 +01:00
Matt Pass
b1df1e8403 Use ftpStart and ftpEnd functions 2015-08-19 06:36:04 +01:00
Matt Pass
41592007b9 ftpStart and ftpEnd functions added 2015-08-19 06:34:51 +01:00
Matt Pass
78ddfe61ba FTP processes added to handle mkdir and chmod 2015-08-18 07:06:04 +01:00
Matt Pass
2bfef30c03 New FTP functions added to mkdir and change perms 2015-08-18 07:03:45 +01:00
bhz6344
ac65cd89c1 To fix Chinese character display abnormal
When "default_charset" was not set in php.ini,and the file contents chinese char,it may show incorrectly.
Because the function htmlentities() takes "ISO-8859-1" as default value of "default_charset"  if PHP version is lower than 5.4.
So I think it's better to check the "default_charset" before function htmlentities().
What's your opinion?
2015-08-17 14:23:45 +08:00
Matt Pass
7540ef846f Version 5.2 2015-08-13 11:22:28 +01:00
Matt Pass
57bf19d69c Undo change, overwrote commit by mistake 2015-08-13 10:47:24 +01:00
Matt Pass
e330a57da8 Rename var, as used in isset checks
Renamed var to distinguish from ftpSite, which is checked for existance
with isset and if available jumps into FTP mode. Having it previously
set to false, it's available, so erroneously goes into FTP mode with no
creds. This is a standalone var name now just to establish connection
channel.
2015-08-13 09:31:12 +01:00
Matt Pass
2ef1637d0b Clarify var by calling it ftpRoot 2015-08-13 09:23:11 +01:00
Matt Pass
01dc2f7943 FTP control started, with list, open and save
Function added to get a raw list from the FTP connection and work with
this string to return simple and detailed lists as arrays to use
Get contents function added to get content from file over FTP and stream
it back as the return
Finally, function added to save over FTP
2015-08-13 09:16:11 +01:00
Matt Pass
0606025a46 Can now save content over FTP
Include FTP control lib and include/exclude items if we have ftpSite
If ftpSite, establish connection and if no errors, write the content to
the filepath before closing connection
2015-08-13 09:12:41 +01:00
Matt Pass
aefee93cf6 Can now load content over FTP
Include new FTP control lib, no need for saveType here and
exclude/include doing certain things if we have an ftpSite
Getting file over FTP creates connection and establishes any errors plus
loads conent
Image display uses ftpSite and also remove stray end script tag
2015-08-13 09:10:09 +01:00
Matt Pass
3222a3202c FTP param structure added 2015-08-13 09:06:31 +01:00
Matt Pass
4d1b4e2237 Can now get branch over FTP
Include new FTP lib and if we have FTP site params available connect
over FTP as the list to show
2015-08-13 08:57:38 +01:00
Matt Pass
8afacd3ef8 Update to match main JS file 2015-08-13 08:55:20 +01:00
Matt Pass
b07cdd6fc7 Allow images to populate canvas cross-origin 2015-08-13 08:52:01 +01:00
Matt Pass
1237d5868a Changes to UTF-8 encoding logic 2015-08-13 08:51:38 +01:00
Matt Pass
f9418db57f Check if string is strict UTF8 and if not encode
Handles other ISO formatted filetypes this way
2015-07-30 19:19:55 +01:00
Matt Pass
e741d6c207 Cache params added and ensuring app/octet-stream 2015-07-30 19:16:05 +01:00
Matt Pass
66ec7c34c6 Tweaked BG and simultaneous tags 2015-07-19 21:40:39 +01:00
Matt Pass
15ff1534c3 Tweaked BG 2015-07-19 21:16:53 +01:00
Matt Pass
fca567d53c Tweaked BG and more subtle footer strip BG 2015-07-19 21:16:39 +01:00
Matt Pass
2db6c44dbc Tweaked BG 2015-07-19 21:16:00 +01:00
Matt Pass
45e18a5daf More line height, tweaked BG & call before change 2015-07-19 21:15:35 +01:00
Matt Pass
2802e20401 Brighter pink, error moved to after tag class
Needs to move to avoid being overidden
2015-07-19 19:04:18 +01:00
Matt Pass
a2bdab0bcf Merge pull request #576 from pietrondo/master
update italian language
2015-07-19 11:07:00 +01:00
pietrondo
4ea49c197b update italian language 2015-07-16 16:54:30 +02:00
Matt Pass
fae387002c Merge pull request #573 from unix4you2/master
Spanish upgrade when F5 (Ctrl-R) is pressed
2015-07-12 09:33:28 +01:00
unix4you2
9a2fa27010 Spanish upgrade when F5 (Ctrl-R) is pressed 2015-07-09 15:53:06 -05:00
Matt Pass
0e82fb8c97 Settings section tabbed and tidied up also 2015-07-09 12:11:13 +01:00
Matt Pass
9cc53f474e Don't update the preview window if curr tab is new 2015-07-09 12:10:42 +01:00
Matt Pass
9d661e454e Responsive helper plugin ready plus 500x500px PW 2015-07-09 12:08:19 +01:00
Matt Pass
e52b7c673f Notes added as these are updated via JS obj update 2015-07-03 21:53:29 +01:00
Matt Pass
d676c11473 Rename vars, update top and FM on font size change 2015-07-03 21:52:14 +01:00
Matt Pass
b87f5ba969 Need to declare as function, error handling 2015-06-30 17:18:36 +01:00
Matt Pass
0f29baf504 Tweaks and comments
Need a semi colon for inline JS, improved and added comments
2015-06-30 17:17:55 +01:00
Matt Pass
166d27ca4c Show anim on trial bar, new checkExists function
Run autoOpenFiles after 200ms, giving time for ICEcoder to finish
displaying onscreen, including the trial bar animating (over 150ms)
checkExists is a new function which will take a path and give you back a
status object, stored under lastFileDirCheckStatusObj
Only set fileControl URL if serverQueueItems[0] is available, it isn't
under new setup with extra AJAX call
2015-06-30 17:05:50 +01:00
Matt Pass
f39093c78f Better way of handling file existence checking
Vars to determine if we have overwrite OK permission from user or
there's no conflict with filenames, so it's a new one and we can save
Don't check for DOM node to decide if we can save or not anymore,
instead run an XHR that ends up setting lastFileDirCheckStatusObj from
false to something
On spotting that, clear the interval and continue by asking user if they
want to overwrite, or if there's no conflict, set that value instead
If we have no newFileName or we have one but no permission to overwrite
yet, set the content for use in a moment under saveAsContent and we loop
back around
2015-06-30 16:45:51 +01:00
Matt Pass
f7d9b050b3 Don't consider adding commas to comment lines
As the comma won't be at the end, but in the middle and adding one to
the end causes PHP issues
2015-06-26 14:34:10 +01:00
Matt Pass
ab0cef93b7 isset check to avoid PHP notice 2015-06-26 13:58:10 +01:00
Matt Pass
9fffd73f13 Version 5.1 2015-06-26 13:48:53 +01:00
Matt Pass
24cd0f8f36 Change comment wording only 2015-06-26 13:41:34 +01:00
Matt Pass
1c79062baa Only if logged in consider going to donate screen
Can't redir with PHP as targetting window, so do with JS and exit after
die also.
2015-06-26 12:16:52 +01:00
Matt Pass
f31ddf3dec Text added for trial bar info 2015-06-26 12:15:27 +01:00
Matt Pass
76d9b6a860 Login no longer shows/animates the trial bar 2015-06-26 12:14:45 +01:00
Matt Pass
61bfeaa536 Editor area now shows trial bar
Onload of body animates the bar
2015-06-26 12:12:15 +01:00
Matt Pass
76421a4fd7 Trial bar styles moved to editor now 2015-06-26 12:10:27 +01:00
Matt Pass
3c370d8ec7 ino is now alias for C++ language 2015-06-26 08:55:36 +01:00
Matt Pass
13eff9ce40 New function to update last 10 list
Called when setting previous files, this manages the last 10 files
opened by rotating thru the list
2015-06-25 18:15:04 +01:00
Matt Pass
0ec7c5a8fc ID added as hook, remove line breaks, fix path
Also remove <br> and only PHP_EOL if not last item
2015-06-25 18:12:47 +01:00
Matt Pass
94e1c61b58 CTRL+G shortcut noted 2015-06-25 18:09:50 +01:00
Matt Pass
d6a21c9b71 Can now press CTRL+F and CTRL+G to go next/prev
5th param added to tell function we want to find previous, set as false
if not available
Work out find result position whichever direction we're travelling
Also actually find next/prev, don't select same instance on first
find/prev operation processed
Looparound cases for next/prev to cycle to start/end
Processes also set up to do the search cursor movement
CTRL+F and CTRL+G now combined function
2015-06-25 16:05:25 +01:00
Matt Pass
f2f9dc441e ID added as a hook for click event trigger later 2015-06-25 15:58:28 +01:00
Matt Pass
168d635ab8 initCanvasImage setup and hover zoom preview also
initCanvasImage function added to draw image on init and set
backgroundSize of floatingContainer
interactCanvasImage is new name for drawCanvasImage. Function also makes
zoom hover preview follow mouse pointer and move the backgroundPosition
of the image in that hover DIV
2 new events added to show/hide the hover DIV on mouse over the canvas
2015-06-25 13:40:25 +01:00
Matt Pass
ed4f8078a8 initCanvasImage first 2015-06-25 13:37:18 +01:00
Matt Pass
4691c7e2b0 initCanvasImage first, floatingContainer BG set 2015-06-25 13:36:34 +01:00
Matt Pass
7b99febba1 floatingContainer added and CSS class & pseudo set
DOM elem has an ID as a hook so we can target later
Class sets a 55px square block for a 11x11 grid of 5px squares, hidden
to begin with, also with border for contrast and image-rendering value
of pixelated, so we get sharp pixels squares at our 5x zoom
Pseudo class added, 3px square as it has a 1px border, positioned to sit
over the 6th square (centre) in our 11px square grid
2015-06-25 13:33:00 +01:00
Matt Pass
fe0436762c b, i, strong, em, li tag wrappers removed
Shortcut keys caused problems for various keyboard types/languages and
these are more style based HTML tags. Keeping to a simpler set of
structural and hyperlink tags only - div, span, p, a and h1-h3.
2015-06-25 11:20:22 +01:00
Matt Pass
7b4ba0008b Focus on Go to Line field is now CTRL+L 2015-06-25 11:02:04 +01:00
Matt Pass
1699a1ada7 Recursively rename child node elem attributes also 2015-06-25 10:53:52 +01:00
Matt Pass
55cccdecc9 Action diffs after 0ms and handle wrapped lines
Need to call updateDiffs after 0ms as char change hasn't yet registered
Add on the extra heights for wrapped lines per line number
2015-05-23 11:23:23 +01:00
Matt Pass
05996618d7 Use a value of 0 if timeStart not available 2015-05-22 19:41:13 +01:00
Matt Pass
9572394962 Global var and echo progress on creation 2015-05-22 19:15:04 +01:00
Matt Pass
2dc72de62b Needs to be enclosed in PHP tags 2015-05-22 19:14:48 +01:00
Matt Pass
379026143f Include params file & write it if it doesn't exist 2015-05-22 18:59:31 +01:00
Matt Pass
7cab1933df Include our new params file 2015-05-22 18:58:55 +01:00
Matt Pass
dcfd4f3ed2 System params file started
Contains value in var to use to output to a file
2015-05-22 18:58:44 +01:00
Matt Pass
7e633128cf log error info on that event and always clear queue 2015-05-22 18:30:56 +01:00
Matt Pass
48c42f0523 Set error info on bad filename
Also only do the next parts with a filename if no error by that point
2015-05-22 18:29:53 +01:00
Matt Pass
2521dafde1 Break into more if/elseif/else so can handle error 2015-05-09 09:42:21 +01:00
Matt Pass
db5348cd68 Escape apostrophes 2015-05-09 09:41:44 +01:00
Matt Pass
6881f9d79b Enhancements to XHR reponse
On readyState 4 (finished), output response to dev tools console if user
wants that. Then if status 200, display error info or doNext. If not
200, display error message and output object to console.
2015-05-09 09:29:17 +01:00
Matt Pass
4b8808f498 Error message for non 4/200 XHR response 2015-05-09 09:26:22 +01:00
Matt Pass
93b38b55d3 Set fileDirResOutput in top.ICEcoder
To determine what response output to provide to JS
2015-05-09 09:26:01 +01:00
Matt Pass
fe2391e6ad fileDirResOutput added and comments 2015-05-09 09:25:20 +01:00
Matt Pass
0c86f5718e Now establishing line number and goto on open 2015-05-03 18:30:22 +01:00
Matt Pass
53e0252afc Enhanced open+goto, own func & used to get remote 2015-05-03 18:29:47 +01:00
Matt Pass
55fe5e7199 loadingFile = false should end processes 2015-05-03 18:28:38 +01:00
Matt Pass
d92b35fe23 Merge pull request #562 from Atatoth/patch-1
Update updater.php
2015-05-03 17:09:40 +01:00
Konrad Kałowski
1ec27a4df9 Update updater.php
missing \ and ' on update
2015-05-03 13:06:11 +02:00
Matt Pass
c982c6d2c7 Needs Saving value swap order to match ice-coder.js 2015-05-03 08:26:50 +01:00
33 changed files with 2023 additions and 752 deletions

View File

@@ -3,7 +3,7 @@
ICEcoder is a web IDE / browser based code editor, which allows you to develop websites directly within the web browser. It uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work. ICEcoder is a web IDE / browser based code editor, which allows you to develop websites directly within the web browser. It uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
<img src="https://icecoder.net/images/icecoder-v5-0-browser-code-editor.png" alt="ICEcoder web IDE"> <img src="https://icecoder.net/images/icecoder-v5-3-browser-code-editor.png" alt="ICEcoder web IDE">
###Requirements ###Requirements
You can run ICEcoder either online or locally, on Linux, Windows or Mac based platforms. The only requirement is to have PHP 5 available (5.3 recommended). You can have this either as a vanilla installation or via a program such as WAMP or XAMPP (for Windows) or MAMP (for Mac). You can run ICEcoder either online or locally, on Linux, Windows or Mac based platforms. The only requirement is to have PHP 5 available (5.3 recommended). You can have this either as a vanilla installation or via a program such as WAMP or XAMPP (for Windows) or MAMP (for Mac).

View File

@@ -38,6 +38,10 @@ if (file_exists(dirname(__FILE__)."/plugins/pesticide/pesticide.js")) {
if (file_exists(dirname(__FILE__)."/plugins/stats.js/stats.min.js")) { if (file_exists(dirname(__FILE__)."/plugins/stats.js/stats.min.js")) {
echo '<script src="plugins/stats.js/stats.min.js?microtime='.microtime(true).'"></script>'; echo '<script src="plugins/stats.js/stats.min.js?microtime='.microtime(true).'"></script>';
};?> };?>
<?php
if (file_exists(dirname(__FILE__)."/plugins/responsive-helper/responsive-helper.js")) {
echo '<script src="plugins/responsive-helper/responsive-helper.js?microtime='.microtime(true).'"></script>';
};?>
<link rel="stylesheet" href="<?php <link rel="stylesheet" href="<?php
if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';}; if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';};
echo "?microtime=".microtime(true); echo "?microtime=".microtime(true);
@@ -52,7 +56,7 @@ if (array_search($ICEcoder["theme"],array("3024-day","base16-light","eclipse","e
<style type="text/css"> <style type="text/css">
/* Make sure this next one remains the 1st item, updated with JS */ /* Make sure this next one remains the 1st item, updated with JS */
.CodeMirror {position: absolute; top: 0; width: 100%; font-size: <?php echo $ICEcoder["fontSize"];?>; z-index: 1} .CodeMirror {position: absolute; top: 0; width: 100%; font-size: <?php echo $ICEcoder["fontSize"];?>; line-height: 1.3; z-index: 1}
.CodeMirror-scroll {} /* was: height: auto; overflow: visible */ .CodeMirror-scroll {} /* was: height: auto; overflow: visible */
/* Make sure this next one remains the 3rd item, updated with JS */ /* Make sure this next one remains the 3rd item, updated with JS */
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important} .cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
@@ -77,15 +81,21 @@ h2 {color: rgba(0,198,255,0.7)}
.diffGreen {background: #0b0 !important; color: #000 !important} .diffGreen {background: #0b0 !important; color: #000 !important}
.diffRed {background: #800 !important; color: #fff !important} .diffRed {background: #800 !important; color: #fff !important}
.diffGrey {background: #444 !important; color: #fff !important} .diffGrey {background: #444 !important; color: #fff !important}
.diffGreyLighter {background: #888 !important; color: #222 !important} .diffGreyLighter {background: #888 !important; color: #1d1d1b !important}
.diffNone {} .diffNone {}
.info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help} .info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}
.trialBarContainer {display: inline-block; width: 170px; height: 8px; background: #0b0b0b; margin-bottom: 40px}
.trialBarRemaining {display: inline-block; width: 170px; height: 8px; background: rgba(0,198,255,0.7); box-shadow: 0 0 10px 1px rgba(0,198,255,0.5);
transition: width 0.7s ease-in-out;
}
.trialBarText {margin-top: 6px; color: #888}
.trialBarText a {color: #fff; text-decoration: none}
</style> </style>
<link rel="stylesheet" href="lib/file-types.css?microtime=<?php echo microtime(true);?>"> <link rel="stylesheet" href="lib/file-types.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="lib/file-type-icons.css?microtime=<?php echo microtime(true);?>"> <link rel="stylesheet" href="lib/file-type-icons.css?microtime=<?php echo microtime(true);?>">
</head> </head>
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);"> <body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);" onload="if (document.getElementById('trialBarRemaining')) {setTimeout(function(){document.getElementById('trialBarRemaining').style.width = '<?php echo $tRemainingPerc*170;?>px';},150)}">
<div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div> <div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div>
@@ -110,10 +120,18 @@ h2 {color: rgba(0,198,255,0.7)}
</div> </div>
<div style="float: left"> <div style="float: left">
<?php
// No valid license code - show the trial remaining bar
if (generateHash(strClean($ICEcoder['licenseEmail']),$ICEcoder['licenseCode'])!=$ICEcoder['licenseCode']) {?>
<h2><?php echo $t['trial remaining'];?></h2>
<div class="trialBarContainer"><div class="trialBarRemaining" id="trialBarRemaining"></div><br>
<div class="trialBarText"><?php echo $tDaysRemaining;?> <?php echo $t['days left'];?> - <a href="lib/login.php?get=code&csrf=<?php echo $_SESSION["csrf"];?>" target="_parent">Unlock now</a></div>
</div>
<?php ;}; ?>
<h2><?php echo $t['files'];?></h2> <h2><?php echo $t['files'];?></h2>
<span class="heading"><?php echo $t['Last 10 files...'];?></span><br> <span class="heading"><?php echo $t['Last 10 files...'];?></span><br>
<ul class="fileManager" style="margin-left: 0; line-height: 20px"> <ul class="fileManager" id="last10Files" style="margin-left: 0; line-height: 20px"><?php
<?php
$last10FilesArray = explode(",",$ICEcoder["last10Files"]); $last10FilesArray = explode(",",$ICEcoder["last10Files"]);
for ($i=0;$i<count($last10FilesArray);$i++) { for ($i=0;$i<count($last10FilesArray);$i++) {
if ($ICEcoder["last10Files"]=="") { if ($ICEcoder["last10Files"]=="") {
@@ -123,14 +141,13 @@ h2 {color: rgba(0,198,255,0.7)}
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers) // Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION); $ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
echo '<li class="pft-file '.strtolower($ext).'" style="margin-left: -21px">'; echo '<li class="pft-file '.strtolower($ext).'" style="margin-left: -21px">';
echo '<a style="cursor:pointer" onClick="top.ICEcoder.openFile(\''.str_replace("|","/",$last10FilesArray[$i]).'\')">'; echo '<a style="cursor:pointer" onClick="top.ICEcoder.openFile(\''.str_replace($docRoot,"",str_replace("|","/",$last10FilesArray[$i])).'\')">';
echo str_replace($docRoot,"",str_replace("|","/",$last10FilesArray[$i])); echo str_replace($docRoot,"",str_replace("|","/",$last10FilesArray[$i]));
echo '</a></li>'.PHP_EOL; echo '</a></li>';
if ($i==count($last10FilesArray)-1) {echo '<br>'.PHP_EOL;}; if ($i<count($last10FilesArray)-1) {echo PHP_EOL;};
} }
} }
;?> ;?></ul>
</ul>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
@@ -252,6 +269,10 @@ function createNewCMInstance(num) {
window['cM'+num] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num,changeObj)}); window['cM'+num] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num,changeObj)});
window['cM'+num+'diff'] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num+'diff',changeObj)}); window['cM'+num+'diff'] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num+'diff',changeObj)});
// Before change
window['cM'+num] .on("beforeChange", function(thisCM, changeObj) {top.ICEcoder.cMonBeforeChange(thisCM,'cM'+num,changeObj,CodeMirror)});
window['cM'+num+'diff'] .on("beforeChange", function(thisCM, changeObj) {top.ICEcoder.cMonBeforeChange(thisCM,'cM'+num+'diff',changeObj,CodeMirror)});
// Scroll // Scroll
window['cM'+num] .on("scroll", function(thisCM) {top.ICEcoder.cMonScroll(thisCM,'cM'+num)}); window['cM'+num] .on("scroll", function(thisCM) {top.ICEcoder.cMonScroll(thisCM,'cM'+num)});
window['cM'+num+'diff'] .on("scroll", function(thisCM) {top.ICEcoder.cMonScroll(thisCM,'cM'+num+'diff')}); window['cM'+num+'diff'] .on("scroll", function(thisCM) {top.ICEcoder.cMonScroll(thisCM,'cM'+num+'diff')});

View File

@@ -16,6 +16,7 @@ $isGitHubRepoDir = in_array($ICEcoder["root"],$ICEcoder['githubLocalPaths']);
<link rel="stylesheet" type="text/css" href="lib/file-types.css?microtime=<?php echo microtime(true);?>"> <link rel="stylesheet" type="text/css" href="lib/file-types.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" type="text/css" href="lib/file-type-icons.css?microtime=<?php echo microtime(true);?>"> <link rel="stylesheet" type="text/css" href="lib/file-type-icons.css?microtime=<?php echo microtime(true);?>">
<script src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';}; echo ".js?microtime=".microtime(true);?>" type="text/javascript"></script> <script src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';}; echo ".js?microtime=".microtime(true);?>" type="text/javascript"></script>
<!--Updated via settings so must remain 4th stylesheet//-->
<style> <style>
ul.fileManager li a span { font-size: <?php echo $ICEcoder["fontSize"];?>; } ul.fileManager li a span { font-size: <?php echo $ICEcoder["fontSize"];?>; }
</style> </style>

View File

@@ -40,6 +40,7 @@ $isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}" onMouseWheel="if (!top.ICEcoder.getcMInstance().hasFocus() && !top.ICEcoder.getcMdiffInstance().hasFocus()) {event.wheelDelta > 0 ? top.ICEcoder.nextTab() : top.ICEcoder.previousTab();}"> <html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}" onMouseWheel="if (!top.ICEcoder.getcMInstance().hasFocus() && !top.ICEcoder.getcMdiffInstance().hasFocus()) {event.wheelDelta > 0 ? top.ICEcoder.nextTab() : top.ICEcoder.previousTab();}">
<head> <head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title> <title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
<!--Updated via settings so must remain 1st stylesheet//-->
<style> <style>
#tabsBar.tabsBar .tab { font-size: <?php echo $ICEcoder["fontSize"];?>; } #tabsBar.tabsBar .tab { font-size: <?php echo $ICEcoder["fontSize"];?>; }
</style> </style>
@@ -107,6 +108,7 @@ $t = $text['index'];
"top.ICEcoder.bugFilePaths = ['".implode("','",$ICEcoder["bugFilePaths"])."'];". "top.ICEcoder.bugFilePaths = ['".implode("','",$ICEcoder["bugFilePaths"])."'];".
"top.ICEcoder.bugFileCheckTimer = ".$ICEcoder["bugFileCheckTimer"].";". "top.ICEcoder.bugFileCheckTimer = ".$ICEcoder["bugFileCheckTimer"].";".
"top.ICEcoder.bugFileMaxLines = ".$ICEcoder["bugFileMaxLines"].";". "top.ICEcoder.bugFileMaxLines = ".$ICEcoder["bugFileMaxLines"].";".
"top.ICEcoder.fileDirResOutput = '".$ICEcoder["fileDirResOutput"]."';".
"top.ICEcoder.newDirPerms = ".$ICEcoder["newDirPerms"].";". "top.ICEcoder.newDirPerms = ".$ICEcoder["newDirPerms"].";".
"top.ICEcoder.newFilePerms = ".$ICEcoder["newFilePerms"].";"; "top.ICEcoder.newFilePerms = ".$ICEcoder["newFilePerms"].";";
if($ICEcoder["githubAuthToken"] != "") { if($ICEcoder["githubAuthToken"] != "") {
@@ -120,6 +122,7 @@ $t = $text['index'];
<div class="popupVCenter"> <div class="popupVCenter">
<div class="popup" id="mediaContainer"></div> <div class="popup" id="mediaContainer"></div>
</div> </div>
<div class="floatingContainer" id="floatingContainer"></div>
</div> </div>
<div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false"> <div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false">
@@ -294,7 +297,7 @@ $t = $text['index'];
<option><?php echo $t['all filenames'];?></option> <option><?php echo $t['all filenames'];?></option>
</select> </select>
</div> </div>
<input type="submit" name="submit" value="&gt;&gt;" class="submit"> <input type="submit" name="submit" id="findReplaceSubmit" value="&gt;&gt;" class="submit">
<div class="results" id="results"></div> <div class="results" id="results"></div>
</div> </div>
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>"> <input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
@@ -315,6 +318,7 @@ $t = $text['index'];
<div class="footer" id="footer" onContextMenu="return false"> <div class="footer" id="footer" onContextMenu="return false">
<div class="nesting" id="nestValid"></div> <div class="nesting" id="nestValid"></div>
<div class="versionsDisplay" id="versionsDisplay" onclick="top.ICEcoder.versionsScreen(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1].replace(/\//g,'|'))"></div>
<div class="splitPaneControls" id="splitPaneControls"><div class="off" id="splitPaneControlsOff" title="<?php echo $t['Single pane'];?>" onclick="top.ICEcoder.setSplitPane('off')"></div><div class="on" id="splitPaneControlsOn" title="<?php echo $t['Diff pane also'];?>" onclick="top.ICEcoder.setSplitPane('on')" style="opacity: 0.5"></div></div> <div class="splitPaneControls" id="splitPaneControls"><div class="off" id="splitPaneControlsOff" title="<?php echo $t['Single pane'];?>" onclick="top.ICEcoder.setSplitPane('off')"></div><div class="on" id="splitPaneControlsOn" title="<?php echo $t['Diff pane also'];?>" onclick="top.ICEcoder.setSplitPane('on')" style="opacity: 0.5"></div></div>
<div class="byteDisplay" id="byteDisplay" style="display: none" onClick="top.ICEcoder.showDisplay('char')"></div> <div class="byteDisplay" id="byteDisplay" style="display: none" onClick="top.ICEcoder.showDisplay('char')"></div>
<div class="charDisplay" id="charDisplay" style="display: inline-block" onClick="top.ICEcoder.showDisplay('byte')"></div> <div class="charDisplay" id="charDisplay" style="display: inline-block" onClick="top.ICEcoder.showDisplay('byte')"></div>

View File

@@ -20,6 +20,8 @@ $text = array(
"your device" => "your device", "your device" => "your device",
"Browser" => "Browser:", "Browser" => "Browser:",
"Your IP" => "Your IP:", "Your IP" => "Your IP:",
"trial remaining" => "trial remaining",
"days left" => "days left",
"files" => "files", "files" => "files",
"Last 10 files..." => "Last 10 files opened:", "Last 10 files..." => "Last 10 files opened:",
"none" => "[none]", "none" => "[none]",
@@ -110,6 +112,13 @@ $text = array(
// /LIB // /LIB
"backup-versions" =>
array(
"backup" => "backup",
"backups" => "backups",
"available for" => "available for"
),
"bug-files-check" => "bug-files-check" =>
array( array(
"Found in" => "Found in:" "Found in" => "Found in:"
@@ -117,6 +126,7 @@ $text = array(
"file-control" => "file-control" =>
array( array(
"Sorry, bad filename..." => "Sorry, bad filename provided. Check the dev tools console for more info?",
"Sorry" => "Sorry", "Sorry" => "Sorry",
"does not seem..." => "does not seem to exist on the server", "does not seem..." => "does not seem to exist on the server",
"Sorry, could not..." => "Sorry, could not get contents of", "Sorry, could not..." => "Sorry, could not get contents of",
@@ -132,6 +142,7 @@ $text = array(
"Sorry, cannot save" => "Sorry, cannot save", "Sorry, cannot save" => "Sorry, cannot save",
"Sorry, cannot replace..." => "Sorry, cannot replace text in", "Sorry, cannot replace..." => "Sorry, cannot replace text in",
"Sorry, cannot change..." => "Sorry, cannot change permissions on", "Sorry, cannot change..." => "Sorry, cannot change permissions on",
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
"Sorry, cannot delete..." => "Sorry, cannot delete the root level", "Sorry, cannot delete..." => "Sorry, cannot delete the root level",
"Sorry, cannot delete" => "Sorry, cannot delete", "Sorry, cannot delete" => "Sorry, cannot delete",
"Sorry, this file..." => "Sorry, this file has changed, cannot save", "Sorry, this file..." => "Sorry, this file has changed, cannot save",
@@ -238,6 +249,7 @@ $text = array(
"Close current tab" => "Close current tab", "Close current tab" => "Close current tab",
"Open file prompt" => "Open file prompt", "Open file prompt" => "Open file prompt",
"Find" => "Find", "Find" => "Find",
"Previous" => "Previous",
"Focus on Go..." => "Focus on Go to line input", "Focus on Go..." => "Focus on Go to line input",
"Save" => "Save", "Save" => "Save",
"Save as" => "Save as...", "Save as" => "Save as...",
@@ -250,6 +262,7 @@ $text = array(
"ice-coder" => "ice-coder" =>
array( array(
"results" => "results",
"No text selected..." => "No text selected to search on", "No text selected..." => "No text selected to search on",
"all files" => "all files", "all files" => "all files",
"all filenames" => "all filenames", "all filenames" => "all filenames",
@@ -260,6 +273,7 @@ $text = array(
"Opening File" => "Opening File", "Opening File" => "Opening File",
"Enter relative file..." => "Enter relative file path (prefixed with /) or remote URL\\nYou can enter \\n'/path/file:123' or \\n'/path/file(123)' or \\n'/path/file.ext line 123' \\nto go directly to particular line", "Enter relative file..." => "Enter relative file path (prefixed with /) or remote URL\\nYou can enter \\n'/path/file:123' or \\n'/path/file(123)' or \\n'/path/file.ext line 123' \\nto go directly to particular line",
"Getting" => "Getting", "Getting" => "Getting",
"Saving" => "Saving:",
"Please enter the..." => "Please enter the new name for", "Please enter the..." => "Please enter the new name for",
"Renaming to" => "Renaming to", "Renaming to" => "Renaming to",
"Moving to" => "Moving to", "Moving to" => "Moving to",
@@ -273,6 +287,7 @@ $text = array(
"replace all" => "replace all", "replace all" => "replace all",
"file" => "file", "file" => "file",
"Replacing text in" => "Replacing text in", "Replacing text in" => "Replacing text in",
"Sorry there was..." => "Sorry, there was an error with your request.\\n\\nPlease check your dev tools console for more info.",
"Cancelled tasks" => "Cancelled tasks", "Cancelled tasks" => "Cancelled tasks",
"Open previous files" => "Open previous files?", "Open previous files" => "Open previous files?",
"Please enter your..." => "Please enter your GitHub token (either personal access token or client/secret pair token). See tooltip next to Github Auth Token on Help > Settings screen for more info", "Please enter your..." => "Please enter your GitHub token (either personal access token or client/secret pair token). See tooltip next to Github Auth Token on Help > Settings screen for more info",
@@ -282,8 +297,7 @@ $text = array(
"Error cannot find..." => "Error: cannot find/access the error file paths", "Error cannot find..." => "Error: cannot find/access the error file paths",
"No new errors..." => "No new errors found", "No new errors..." => "No new errors found",
"You have made..." => "You have made changes. Are you sure you want to close without saving?", "You have made..." => "You have made changes. Are you sure you want to close without saving?",
"Close all tabs" => "Close all tabs?", "Close all tabs" => "Close all tabs?"
"results" => "results"
), ),
"login" => "login" =>
@@ -377,6 +391,11 @@ $text = array(
"codemirror dir" => "codemirror dir", "codemirror dir" => "codemirror dir",
"codemirror version" => "codemirror version", "codemirror version" => "codemirror version",
"file manager root" => "file manager root", "file manager root" => "file manager root",
"backups" => "backups",
"keep version control..." => "keep version control backups for",
"day" => "day",
"days" => "days",
"of backups stored..." => "of backups stored currently",
"Get in contact..." => "Get in contact by...", "Get in contact..." => "Get in contact by...",
"You may use..." => "You may use ICEcoder for your own purposes, commercial or not, just let us know of any cool uses or customisations. :)<br><br>No warranty or liability accepted for anything, all responsibility of use is your own.", "You may use..." => "You may use ICEcoder for your own purposes, commercial or not, just let us know of any cool uses or customisations. :)<br><br>No warranty or liability accepted for anything, all responsibility of use is your own.",
"functionality" => "functionality", "functionality" => "functionality",

View File

@@ -11,7 +11,6 @@ $text = array(
"editor" => "editor" =>
array( array(
"Click icons for..." => "<b>Clicca le icone<br>per l&#39;aiuto &amp;<br>la guida</b>",
"server" => "server", "server" => "server",
"Server name, OS..." => "Nome server, Sistema operativo e indirizzo IP...", "Server name, OS..." => "Nome server, Sistema operativo e indirizzo IP...",
"Root" => "Root:", "Root" => "Root:",
@@ -25,6 +24,8 @@ $text = array(
"Last 10 files..." => "Ultimi 10 file aperti:", "Last 10 files..." => "Ultimi 10 file aperti:",
"none" => "[none]", "none" => "[none]",
"test suite" => "prova suite", "test suite" => "prova suite",
"trial remaining" => "tempo rimanente alla fine del periodo di prova",
"days left" => "giorni rimanenti",
"Run unit tests" => "Esegui test di unità", "Run unit tests" => "Esegui test di unità",
"dev mode" => "modalit&agrave; sviluppo", "dev mode" => "modalit&agrave; sviluppo",
"Status" => "Stato", "Status" => "Stato",
@@ -37,6 +38,7 @@ $text = array(
array( array(
"Lock" => "Blocca", "Lock" => "Blocca",
"Refresh" => "Aggiorna", "Refresh" => "Aggiorna",
"Plugins" => "Plugins",
"ROOT" => "[ROOT]" "ROOT" => "[ROOT]"
), ),
@@ -51,6 +53,7 @@ $text = array(
"Are you sure you want to close?" => "Are you sure you want to close?", "Are you sure you want to close?" => "Are you sure you want to close?",
"working" => "working", "working" => "working",
"Color picker" => "Selettore di colore", "Color picker" => "Selettore di colore",
"Plugins Manager" => "Plugins Manager",
"New File" => "Nuovo file", "New File" => "Nuovo file",
"New Folder" => "Nuova cartella", "New Folder" => "Nuova cartella",
"Upload File(s)" => "Carica File", "Upload File(s)" => "Carica File",
@@ -102,7 +105,9 @@ $text = array(
"Code Assist" => "Code Assist", "Code Assist" => "Code Assist",
"Go to Line" => "Vai alla linea", "Go to Line" => "Vai alla linea",
"View" => "Visualizza", "View" => "Visualizza",
"Bug reporting not active" => "Segnalazione bug non attiva" "Bug reporting not active" => "Segnalazione bug non attiva",
"Single pane" => "Pannello singolo",
"Diff pane also" => "Pannello delle differenze"
), ),
// /LIB // /LIB
@@ -157,6 +162,7 @@ $text = array(
"Choose existing path" => "Scegli il percorso esistente", "Choose existing path" => "Scegli il percorso esistente",
"Local path" => "Percorso locale", "Local path" => "Percorso locale",
"Remote GitHub path" => "Remote GitHub path", "Remote GitHub path" => "Remote GitHub path",
"Absolute URL beginning..." => "Url assoluto che comincia con https://github.com",
"Choose" => "Scegli", "Choose" => "Scegli",
"Set local and..." => "Imposta percorso locale e remoto, lasciare vuoto per per rimuovere", "Set local and..." => "Imposta percorso locale e remoto, lasciare vuoto per per rimuovere",
"Update" => "Aggiorna", "Update" => "Aggiorna",
@@ -243,6 +249,7 @@ $text = array(
"ice-coder" => "ice-coder" =>
array( array(
"results" => "risultati",
"No text selected..." => "Nessun testo selezionato per la ricerc", "No text selected..." => "Nessun testo selezionato per la ricerc",
"all files" => "tutti i file", "all files" => "tutti i file",
"all filenames" => "tutti i nomi dei file", "all filenames" => "tutti i nomi dei file",
@@ -431,6 +438,19 @@ token di accesso personale (https://help.github.com/articles/creating-an-access-
"updater" => "updater" =>
array( array(
"Update appears to..." => "L'aggiornamento sembra andato bene" "Update appears to..." => "L'aggiornamento sembra andato bene"
),
"find-in-files" =>
array(
"Enter path to search in" => "Inserire il percorso in cui ricercare",
"Enter semicolon-separated masks of files to look at (e.g. *.php;*.html;*.js)" => "
Inserisci maschere separate da punto e virgola i dei file da cercare (e.s. *.php;*.html;*.js)",
"Type of text" => "Tipo di testo",
"Fixed text" => "Testo fisso",
"Regular expression" => "Espressione regolare",
"Case sensitive" => "Case sensitive",
"Yes" => "Si",
"No" => "No",
"Search" => "Cerca",
) )
); );

View File

@@ -1,5 +1,5 @@
<?php <?php
// Português do Brasil // Portugu&ecirc;s do Brasil
// by: @leonardoroese (GitHub) // by: @leonardoroese (GitHub)
@@ -11,25 +11,25 @@ $text = array(
"editor" => "editor" =>
array( array(
"Click icons for..." => "<b>Ícones<br>para ajuda &amp;<br>info. utilização</b>", "Click icons for..." => "<b>&Iacute;cones<br>para ajuda &amp;<br>info. utiliza&ccedil;&atilde;o</b>",
"server" => "Servidor", "server" => "Servidor",
"Server name, OS..." => "Nome do Servidor, OS & IP:", "Server name, OS..." => "Nome do Servidor, OS & IP:",
"Root" => "Raiz:", "Root" => "Raiz:",
"ICEcoder root" => "ICEcoder raiz:", "ICEcoder root" => "ICEcoder raiz:",
"PHP version" => "Versâo do PHP:", "PHP version" => "Vers&atilde;o do PHP:",
"Date & time" => "Data e Hora:", "Date & time" => "Data e Hora:",
"your device" => "seu dispositivo", "your device" => "seu dispositivo",
"Browser" => "Exibir:", "Browser" => "Exibir:",
"Your IP" => "Seu IP:", "Your IP" => "Seu IP:",
"files" => "arquivos", "files" => "arquivos",
"Last 10 files..." => "ùltimos 10 arquivos abertos:", "Last 10 files..." => "&uacute;ltimos 10 arquivos abertos:",
"none" => "[nenhum]", "none" => "[nenhum]",
"test suite" => "suíte de teste", "test suite" => "su&iacute;te de teste",
"Run unit tests" => "Executar testes unitários", "Run unit tests" => "Executar testes unit&atilde;rios",
"dev mode" => "modo desenv.", "dev mode" => "modo desenv.",
"Status" => "Status", "Status" => "Status",
"Using" => "Usando", "Using" => "Usando",
"You can switch..." => "Você pode alterar modo desenv. on/off em lib/config__settings.php" "You can switch..." => "Voc&ecirc; pode alterar modo desenv. on/off em lib/config__settings.php"
), ),
@@ -43,14 +43,14 @@ $text = array(
"index" => "index" =>
array( array(
"UPDATE INFO" => "INFO ATUALIZAÇÃO", "UPDATE INFO" => "INFORMA&Ccedil;&Atilde; DE ATUALIZA&Ccedil;&Atilde;O",
"now available" => "disponível agora", "now available" => "dispon&iacute;vel agora",
"Your version is" => "Sua versão é", "Your version is" => "Sua vers&atilde;o &eacute;",
"Update now" => "Atualizar já", "Update now" => "Atualizar j&atilde;",
"You have some..." => "Voce possui alterações não salvas", "You have some..." => "Voce possui altera&ccedil;&otilde;es n&atilde;o salvas",
"Are you sure you want to close?" => "Are you sure you want to close?", "Are you sure you want to close?" => "Voc&ecirc; tem certeza que deseja fechar?",
"working" => "trabalhando", "working" => "trabalhando",
"Color picker" => "Color picker", "Color picker" => "Seletor de Cores",
"New File" => "Novo Arquivo", "New File" => "Novo Arquivo",
"New Folder" => "Nova Pasta", "New Folder" => "Nova Pasta",
"Upload File(s)" => "Carregar arquivo(s)", "Upload File(s)" => "Carregar arquivo(s)",
@@ -60,7 +60,7 @@ $text = array(
"Duplicate" => "Duplicar", "Duplicate" => "Duplicar",
"Delete" => "Excluir", "Delete" => "Excluir",
"Rename" => "Renomear", "Rename" => "Renomear",
"View Webpage" => "Exibir Página Web", "View Webpage" => "Exibir P&atilde;gina Web",
"Download" => "Download", "Download" => "Download",
"Properties" => "Propriedades", "Properties" => "Propriedades",
"File" => "Arquivo", "File" => "Arquivo",
@@ -70,8 +70,8 @@ $text = array(
"Help" => "Ajuda", "Help" => "Ajuda",
"Save" => "Salvar", "Save" => "Salvar",
"Save As" => "Salvar Como", "Save As" => "Salvar Como",
"Live Preview" => "Preview", "Live Preview" => "Visualizar",
"Upload" => "Upload", "Upload" => "Enviar",
"Zip" => "Zip", "Zip" => "Zip",
"Print" => "Imprimir", "Print" => "Imprimir",
"Fullscreen toggle" => "Exibir tela cheia", "Fullscreen toggle" => "Exibir tela cheia",
@@ -82,10 +82,10 @@ $text = array(
"Indent less" => "Indentar -", "Indent less" => "Indentar -",
"Autocomplete" => "Autocompletar", "Autocomplete" => "Autocompletar",
"Comment/Uncomment" => "Comentar/Descomentar", "Comment/Uncomment" => "Comentar/Descomentar",
"Jump to Definition" => "Ir para definição", "Jump to Definition" => "Ir para defini&ccedil;&atilde;o",
"Manual" => "Manual", "Manual" => "Manual",
"Shortcuts" => "Atalhos", "Shortcuts" => "Atalhos",
"Settings" => "Configurações", "Settings" => "Configura&ccedil;&otilde;es",
"Search for selected" => "Procurar por selecionado", "Search for selected" => "Procurar por selecionado",
"website" => "website", "website" => "website",
"Close all tabs" => "Fechar todas as abas", "Close all tabs" => "Fechar todas as abas",
@@ -103,7 +103,7 @@ $text = array(
"Code Assist" => "Assistente", "Code Assist" => "Assistente",
"Go to Line" => "Ir para linha", "Go to Line" => "Ir para linha",
"View" => "Exibir", "View" => "Exibir",
"Bug reporting not active" => "Relatório de Bug desativado" "Bug reporting not active" => "Relat&oacute;rio de Bug desativado"
), ),
// /LIB // /LIB
@@ -116,42 +116,42 @@ $text = array(
"file-control" => "file-control" =>
array( array(
"Sorry" => "Desculpe", "Sorry" => "Desculpe",
"does not seem..." => "Não encontrado no servidor", "does not seem..." => "N&atilde;o encontrado no servidor",
"Sorry, could not..." => "Desculpe, conteudo não encontrado para", "Sorry, could not..." => "Desculpe, conteudo n&atilde;o encontrado para",
"Sorry, cannot create..." => "Desculpe, não é possível criar pasta", "Sorry, cannot create..." => "Desculpe, n&atilde;o &eacute; poss&iacute;vel criar pasta",
"Sorry, cannot copy" => "Desculpe, não é possível copy", "Sorry, cannot copy" => "Desculpe, n&atilde;o &eacute; poss&iacute;vel copy",
"into" => "into", "into" => "into",
"Uploaded file(s) OK" => "Arquivos carregados", "Uploaded file(s) OK" => "Arquivos carregados",
"Sorry, cannot upload" => "Desculpe, não é possível carregar", "Sorry, cannot upload" => "Desculpe, n&atilde;o &eacute; poss&iacute;vel carregar",
"Sorry, cannot upload..." => "Desculpe, não é possível carregar lista no modo DEMO", "Sorry, cannot upload..." => "Desculpe, n&atilde;o &eacute; poss&iacute;vel carregar lista no modo DEMO",
"Sorry, cannot rename" => "Desculpe, não é possível renomear", "Sorry, cannot rename" => "Desculpe, n&atilde;o &eacute; poss&iacute;vel renomear",
"Maybe public write..." => "A pasta superior possui permissão de escrita?", "Maybe public write..." => "A pasta superior possui permiss&atilde;o de escrita?",
"Sorry, cannot move" => "Desculpe, não é possível mover", "Sorry, cannot move" => "Desculpe, n&atilde;o &eacute; poss&iacute;vel mover",
"Sorry, cannot save" => "Desculpe, não é possível salvar", "Sorry, cannot save" => "Desculpe, n&atilde;o &eacute; poss&iacute;vel salvar",
"Sorry, cannot replace..." => "Desculpe, não é possível substituir texto em", "Sorry, cannot replace..." => "Desculpe, n&atilde;o &eacute; poss&iacute;vel substituir texto em",
"Sorry, cannot change..." => "Desculpe, não é possível mudar permissões para", "Sorry, cannot change..." => "Desculpe, n&atilde;o &eacute; poss&iacute;vel mudar permiss&otilde;es para",
"Sorry, cannot delete..." => "Desculpe, não é possível excluir nível raiz", "Sorry, cannot delete..." => "Desculpe, n&atilde;o &eacute; poss&iacute;vel excluir n&iacute;vel raiz",
"Sorry, cannot delete" => "Desculpe, não é possível remover", "Sorry, cannot delete" => "Desculpe, n&atilde;o &eacute; poss&iacute;vel remover",
"Sorry, this file..." => "Desculpe, este arquivo foi modificado, não é possível salvar", "Sorry, this file..." => "Desculpe, este arquivo foi modificado, n&atilde;o &eacute; poss&iacute;vel salvar",
"Reload this file..." => "Recarregar e copiar sua versão?", "Reload this file..." => "Recarregar e copiar sua vers&atilde;o?",
"There was a..." => "Ocorreu algum problema. O ICEcoder recarregou o arquivo de controle novamente", "There was a..." => "Ocorreu algum problema. O ICEcoder recarregou o arquivo de controle novamente",
"displayed at" => "exibido em", "displayed at" => "exibido em",
"Enter filename to..." => "Informe o nome do aquivo para salvar", "Enter filename to..." => "Informe o nome do aquivo para salvar",
"That file exists..." => "Este arquivo já existe, sobrescrever?", "That file exists..." => "Este arquivo j&atilde; existe, sobrescrever?",
"Saving" => "Salvando" "Saving" => "Salvando"
), ),
"get-branch" => "get-branch" =>
array( array(
"There are no..." => "Não há diferenças entre loca/Github. Retornar para modo normal?", "There are no..." => "N&atilde;o h&atilde; diferen&ccedil;as entre loca/Github. Retornar para modo normal?",
"Sorry, there was..." => "Desculpe, ocorreu um erro, código:", "Sorry, there was..." => "Desculpe, ocorreu um erro, c&oacute;digo:",
"Your local folder..." => "Sua pasta local está vazia, gostaria de clonar" "Your local folder..." => "Sua pasta local est&atilde; vazia, gostaria de clonar"
), ),
"github-manager" => "github-manager" =>
array( array(
"Sorry, cannot create..." => "Desculpe, não foi possível criar em", "Sorry, cannot create..." => "Desculpe, n&atilde;o foi poss&iacute;vel criar em",
"Cannot update config..." => "Não é possível atualizar config. Habilitar permissões públicas", "Cannot update config..." => "N&atilde;o &eacute; poss&iacute;vel atualizar config. Habilitar permiss&otilde;es p&uacute;blicas",
"and try again" => "e tentar novamente", "and try again" => "e tentar novamente",
"saving github paths" => "salvando caminhos Github...", "saving github paths" => "salvando caminhos Github...",
"github paths" => "caminhos Github", "github paths" => "caminhos Github",
@@ -159,20 +159,20 @@ $text = array(
"Local path" => "Caminho local", "Local path" => "Caminho local",
"Remote GitHub path" => "Caminho remoto Github", "Remote GitHub path" => "Caminho remoto Github",
"Choose" => "Selecione", "Choose" => "Selecione",
"Set local and..." => "Alterar caminho local e remoto como vazio para excluír", "Set local and..." => "Alterar caminho local e remoto como vazio para exclu&iacute;r",
"Update" => "Atualizar", "Update" => "Atualizar",
"Add new path" => "Adicionar novo caminho", "Add new path" => "Adicionar novo caminho",
"Add" => "Adicionar", "Add" => "Adicionar",
"Usage Info" => "Info. de utilização:", "Usage Info" => "Info. de utiliza&ccedil;&atilde;o:",
"Enter relative local..." => "Informe os caminhos relativos (ex.: /server/myfiles) e absolutos do GitHub (ex.: https://github.com/user/repo ou https://github.com/user/repo/tree/branch for branches).Com isso estabelece os caminho dos fontes em ambos locais, como pares.", "Enter relative local..." => "Informe os caminhos relativos (ex.: /server/myfiles) e absolutos do GitHub (ex.: https://github.com/user/repo ou https://github.com/user/repo/tree/branch for branches).Com isso estabelece os caminho dos fontes em ambos locais, como pares.",
"You can then..." => "Você pode então escolher um caminho par para ser a raiz do ICEcoder.", "You can then..." => "Voc&ecirc; pode ent&atilde;o escolher um caminho par para ser a raiz do ICEcoder.",
"The file manager..." => "O gerenciador de arquivo exibirá o ícone GitHub, você pode clicar para verificar a diferença entre arquivos.Essas diferenças podem ser efetivadas e enviadas ao diretório remoto do GitHub ou clonado para pasta local, para sincronizar seus arquivos.", "The file manager..." => "O gerenciador de arquivo exibir&atilde; o &iacute;cone GitHub, voc&ecirc; pode clicar para verificar a diferen&ccedil;a entre arquivos.Essas diferen&ccedil;as podem ser efetivadas e enviadas ao diret&oacute;rio remoto do GitHub ou clonado para pasta local, para sincronizar seus arquivos.",
"If you want..." => "Se quiser configurar novo caminho raiz, pode ser feito na tela de configurações." "If you want..." => "Se quiser configurar novo caminho raiz, pode ser feito na tela de configura&ccedil;&otilde;es."
), ),
"github" => "github" =>
array( array(
"Sorry, you do..." => "Desculpe, o OpenSSL não foi encontrado, https indisponível. Isso é necessário para o GitHub transferir dados, verificar php.ini, reinicie o sistema e tente novamente" "Sorry, you do..." => "Desculpe, o OpenSSL n&atilde;o foi encontrado, https indispon&iacute;vel. Isso &eacute; necess&atilde;rio para o GitHub transferir dados, verificar php.ini, reinicie o sistema e tente novamente"
), ),
"headers" => "headers" =>
@@ -187,7 +187,7 @@ $text = array(
"On Tabs" => "Em abas", "On Tabs" => "Em abas",
"Within file manager" => "No gerenciador de arquivos", "Within file manager" => "No gerenciador de arquivos",
"Anywhere" => "Qualquer Lugar", "Anywhere" => "Qualquer Lugar",
"Space" => "Espaço", "Space" => "Espa&ccedil;o",
"Click" => "Clique", "Click" => "Clique",
"or" => "ou", "or" => "ou",
"Left click" => "Clique esquerdo", "Left click" => "Clique esquerdo",
@@ -197,16 +197,16 @@ $text = array(
"Middle scrollwheel" => "Meio scroll", "Middle scrollwheel" => "Meio scroll",
"Drag" => "Arrastar", "Drag" => "Arrastar",
"Autocomplete add snippet" => "Auto-completar / adicionar snippet", "Autocomplete add snippet" => "Auto-completar / adicionar snippet",
"Multiple select" => "Multipla seleção", "Multiple select" => "Multipla sele&ccedil;&atilde;o",
"Move line up" => "Move linha acima", "Move line up" => "Move linha acima",
"Move line down" => "Move linha abaixo", "Move line down" => "Move linha abaixo",
"Duplicate lines" => "Duplicar linha(s)", "Duplicate lines" => "Duplicar linha(s)",
"Remove lines" => "Remover linha(s)", "Remove lines" => "Remover linha(s)",
"Insert line before" => "Inserir linha antes", "Insert line before" => "Inserir linha antes",
"Insert line after" => "Inserir linha após", "Insert line after" => "Inserir linha ap&oacute;s",
"Search for selected" => "Procurar selecionado", "Search for selected" => "Procurar selecionado",
"Jump to definition" => "Ir para definição / voltar", "Jump to definition" => "Ir para defini&ccedil;&atilde;o / voltar",
"Comment uncomment" => "Commentar / descomentar", "Comment uncomment" => "Comentar / Descomentar",
"Insert tab indent" => "Inserir aba / auto indent selected", "Insert tab indent" => "Inserir aba / auto indent selected",
"Insert more" => "Indentar +", "Insert more" => "Indentar +",
"Insert less" => "Indentar -", "Insert less" => "Indentar -",
@@ -224,11 +224,11 @@ $text = array(
"Close tab" => "Fechar aba", "Close tab" => "Fechar aba",
"Select file folder" => "Selecionar arquivo / pasta", "Select file folder" => "Selecionar arquivo / pasta",
"Open file" => "Abrir arquivo", "Open file" => "Abrir arquivo",
"Range select" => "Seleção", "Range select" => "Sele&ccedil;&atilde;o",
"Options for selected" => "Opções para seleção", "Options for selected" => "Op&ccedil;&otilde;es para sele&ccedil;&atilde;o",
"Delete selected" => "Excluir selecionado", "Delete selected" => "Excluir selecionado",
"Next previous tab" => "Próxima aba / anterior", "Next previous tab" => "Pr&oacute;xima aba / anterior",
"Next tab" => "Próxima aba", "Next tab" => "Pr&oacute;xima aba",
"Previous tab" => "Aba anterior", "Previous tab" => "Aba anterior",
"New tab" => "Nova aba", "New tab" => "Nova aba",
"Close current tab" => "Fechar aba atual", "Close current tab" => "Fechar aba atual",
@@ -237,7 +237,7 @@ $text = array(
"Focus on Go..." => "Foco campo ir para linha", "Focus on Go..." => "Foco campo ir para linha",
"Save" => "Salvar", "Save" => "Salvar",
"Save as" => "Salvar como...", "Save as" => "Salvar como...",
"View webpage" => "Exibir página", "View webpage" => "Exibir p&atilde;gina",
"Contract expand file..." => "Contrair / expandir gerenciador de arquivos", "Contract expand file..." => "Contrair / expandir gerenciador de arquivos",
"Fold unfold current..." => "Contrair / expandir linha atual", "Fold unfold current..." => "Contrair / expandir linha atual",
"Refocus on document" => "Foco no documento", "Refocus on document" => "Foco no documento",
@@ -252,7 +252,7 @@ $text = array(
"selected files" => "arquivos selecionados", "selected files" => "arquivos selecionados",
"selected filenames" => "nomes de arquivos selecionados", "selected filenames" => "nomes de arquivos selecionados",
"Creating Folder" => "Criando pasta", "Creating Folder" => "Criando pasta",
"Sorry you can..." => "Deculpe, permitido abrir máx. 100 arquivos!", "Sorry you can..." => "Deculpe, permitido abrir m&atilde;x. 100 arquivos!",
"Opening File" => "Abrindo arquivo", "Opening File" => "Abrindo arquivo",
"Enter relative file..." => "Informe caminho relativo (prefixado por /) ou URL remota", "Enter relative file..." => "Informe caminho relativo (prefixado por /) ou URL remota",
"Getting" => "Selecionando", "Getting" => "Selecionando",
@@ -261,7 +261,7 @@ $text = array(
"Moving to" => "Movendo para", "Moving to" => "Movendo para",
"Deleting File" => "Excluindo arquivo", "Deleting File" => "Excluindo arquivo",
"Pasting File" => "Colando arquivo", "Pasting File" => "Colando arquivo",
"Sorry cannot paste..." => "Desculpe, não é possível colar em toda raiz", "Sorry cannot paste..." => "Desculpe, n&atilde;o &eacute; poss&iacute;vel colar em toda raiz",
"Nothing to paste..." => "Nada para colar,copiar arquivo/pasta primeiro!", "Nothing to paste..." => "Nada para colar,copiar arquivo/pasta primeiro!",
"and" => "e", "and" => "e",
"this document" => "este documento", "this document" => "este documento",
@@ -271,13 +271,13 @@ $text = array(
"Replacing text in" => "Substituindo texto em", "Replacing text in" => "Substituindo texto em",
"Cancelled tasks" => "Tarefas canceladas", "Cancelled tasks" => "Tarefas canceladas",
"Open previous files" => "Abrir arquivos anteriores?", "Open previous files" => "Abrir arquivos anteriores?",
"Please enter your..." => "Informe sua chave GitHub (chave pessoal ou par). Veja dica próximo à chave Github em Ajuda > Configurações para mais informações", "Please enter your..." => "Informe sua chave GitHub (chave pessoal ou par). Veja dica pr&oacute;ximo à chave Github em Ajuda > Configura&ccedil;&otilde;es para mais informa&ccedil;&otilde;es",
"This will compare..." => "Esta ação irá comparar e exibir diferenças do seu repositório local. OK?", "This will compare..." => "Esta a&ccedil;&atilde;o ir&atilde; comparar e exibir diferen&ccedil;as do seu reposit&oacute;rio local. OK?",
"Please note for..." => "Atenção: para atualizar corretamente, é necessário permissâo de escrita em todos os diretórios/arquivos do ICEcoder. \\n\\nSe por algum motivo necessite recuperar esta versão do ICEcoder, estará disponível na pasta /tmp.\\n\\nClique OK para prosseguir com a atualização, ou cancelar para visitar a página do ICEcoder na internet onde poderá baixar a atualização manualmente.", "Please note for..." => "Aten&ccedil;&atilde;o: para atualizar corretamente, &eacute; necess&atilde;rio permiss&atilde;o de escrita em todos os diret&oacute;rios/arquivos do ICEcoder. \\n\\nSe por algum motivo necessite recuperar esta vers&atilde;o do ICEcoder, estar&atilde; dispon&iacute;vel na pasta /tmp.\\n\\nClique OK para prosseguir com a atualiza&ccedil;&atilde;o, ou cancelar para visitar a p&atilde;gina do ICEcoder na internet onde poder&atilde; baixar a atualiza&ccedil;&atilde;o manualmente.",
"You can start..." => "Voce pode reportar um bug em Ajuda > Configurações", "You can start..." => "Voce pode reportar um bug em Ajuda > Configura&ccedil;&otilde;es",
"Error cannot find..." => "Erro: não é possível acessar caminho/arquivo de erros", "Error cannot find..." => "Erro: n&atilde;o &eacute; poss&iacute;vel acessar caminho/arquivo de erros",
"No new errors..." => "Nenhum erro encontrado", "No new errors..." => "Nenhum erro encontrado",
"You have made..." => "Voce fez alterações. Deseja realmente fechar sem salvar?", "You have made..." => "Voce fez altera&ccedil;&otilde;es. Deseja realmente fechar sem salvar?",
"Close all tabs" => "Fechar todas as abas?", "Close all tabs" => "Fechar todas as abas?",
"results" => "resultados" "results" => "resultados"
), ),
@@ -286,11 +286,11 @@ $text = array(
array( array(
"set password" => "altera senha", "set password" => "altera senha",
"login" => "login", "login" => "login",
"To disable registration..." => "Para desabilitar modo registro, acesse menu/configurações ou em lib/config___settings.php altere enableRegistration para false e recarregue esta página", "To disable registration..." => "Para desabilitar modo registro, acesse menu/configura&ccedil;&otilde;es ou em lib/config___settings.php altere enableRegistration para false e recarregue esta p&atilde;gina",
"Registration mode enabled" => "Modo registro habilitado", "Registration mode enabled" => "Modo registro habilitado",
"auto-check for updates" => "verificar atualizações auto.", "auto-check for updates" => "verificar atualiza&ccedil;&otilde;es auto.",
"To put into..." => "Para habilitar multi-usuários, acesse menu/configurações ou em lib/config___settings.php altere multiUser para true e recarregue esta página", "To put into..." => "Para habilitar multi-usu&atilde;rios, acesse menu/configura&ccedil;&otilde;es ou em lib/config___settings.php altere multiUser para true e recarregue esta p&atilde;gina",
"multi-user" => "multi-usuários" "multi-user" => "multi-usu&atilde;rios"
), ),
"multiple-results" => "multiple-results" =>
@@ -308,17 +308,17 @@ $text = array(
"No matches found" => "Nenhum resultado encontrado", "No matches found" => "Nenhum resultado encontrado",
"selected" => "selecionado", "selected" => "selecionado",
"found in" => "encontrado em", "found in" => "encontrado em",
"Replaced" => "Substituído(s)" "Replaced" => "Substitu&iacute;do(s)"
), ),
"plugins-manager" => "plugins-manager" =>
array( array(
"ICEcoder needs to..." => "ICEcoder deve ser reiniciado para habilitar plugin. Deseja Reiniciar?", "ICEcoder needs to..." => "ICEcoder deve ser reiniciado para habilitar plugin. Deseja Reiniciar?",
"saving plugins" => "salvando plugins...", "saving plugins" => "salvando plugins...",
"Cannot update config..." => "Não foi possível atualizar arquivo de configuração. Verifique permissões de escrita.", "Cannot update config..." => "N&atilde;o foi poss&iacute;vel atualizar arquivo de configura&ccedil;&atilde;o. Verifique permiss&otilde;es de escrita.",
"and try again" => "e tente novamente", "and try again" => "e tente novamente",
"couldnt delete dir" => "não foi possível excluir pasta", "couldnt delete dir" => "n&atilde;o foi poss&iacute;vel excluir pasta",
"couldnt delete file" => "não foi possível excluir arquivo", "couldnt delete file" => "n&atilde;o foi poss&iacute;vel excluir arquivo",
"plugins" => "plugins", "plugins" => "plugins",
"Guide to writing..." => "Guia para criar plugins", "Guide to writing..." => "Guia para criar plugins",
"Manage Installed" => "Gerenciar plugins", "Manage Installed" => "Gerenciar plugins",
@@ -328,7 +328,7 @@ $text = array(
"Update" => "Atualizar", "Update" => "Atualizar",
"Install" => "Instalar", "Install" => "Instalar",
"Uninstall" => "Desinstalar", "Uninstall" => "Desinstalar",
"Reload after install..." => "Atualização necessária após instalação" "Reload after install..." => "Atualiza&ccedil;&atilde;o necess&atilde;ria ap&oacute;s instala&ccedil;&atilde;o"
), ),
"properties" => "properties" =>
@@ -342,10 +342,10 @@ $text = array(
"Relative path" => "Caminho relativo", "Relative path" => "Caminho relativo",
"Absolute path" => "Caminho absoluto", "Absolute path" => "Caminho absoluto",
"Contains" => "Contem", "Contains" => "Contem",
"Permissions" => "Permissões", "Permissions" => "Permiss&otilde;es",
"Owner" => "Proprietário", "Owner" => "Propriet&atilde;rio",
"Group" => "Grupo", "Group" => "Grupo",
"Public" => "Público", "Public" => "P&uacute;blico",
"Read" => "Ler", "Read" => "Ler",
"Write" => "Salvar", "Write" => "Salvar",
"Execute" => "Executar", "Execute" => "Executar",
@@ -355,44 +355,44 @@ $text = array(
"settings-common" => "settings-common" =>
array( array(
"Your document does..." => "Seu arquivo não está no formato UTF-8, deve ser convertido" "Your document does..." => "Seu arquivo n&atilde;o est&atilde; no formato UTF-8, deve ser convertido"
), ),
"settings-save-current-files" => "settings-save-current-files" =>
array( array(
"Cannot update config..." => "Não foi possível atualizar arquivo de configuração. Verifique permissões de acesso (públicas)", "Cannot update config..." => "N&atilde;o foi poss&iacute;vel atualizar arquivo de configura&ccedil;&atilde;o. Verifique permiss&otilde;es de acesso (p&uacute;blicas)",
"and try again" => "e tente novamente" "and try again" => "e tente novamente"
), ),
"settings-screen" => "settings-screen" =>
array( array(
"settings" => "configurações", "settings" => "configura&ccedil;&otilde;es",
"version" => "versão", "version" => "vers&atilde;o",
"website" => "website", "website" => "website",
"git" => "git", "git" => "git",
"codemirror dir" => "pasta codemirror", "codemirror dir" => "pasta codemirror",
"codemirror version" => "versão codemirror", "codemirror version" => "vers&atilde;o codemirror",
"file manager root" => "Raiz gerenciador de arquivos", "file manager root" => "Raiz gerenciador de arquivos",
"Free to use..." => "Livre para utilização para seus propósitos, comercial ou não, mas aviseme sobre sua implementação se puder. :)<br><br>Sem garantias, Muitas empresas e pessoas fantásticas contribuiram para desenvolver o ICEcoder, há muito o que agradecermos aqui. Veja a lista completa aqui", "Free to use..." => "Livre para utiliza&ccedil;&atilde;o para seus prop&oacute;sitos, comercial ou n&atilde;o, mas aviseme sobre sua implementa&ccedil;&atilde;o se puder. :)<br><br>Sem garantias, Muitas empresas e pessoas fant&atilde;sticas contribuiram para desenvolver o ICEcoder, h&atilde; muito o que agradecermos aqui. Veja a lista completa aqui",
"functionality" => "funcionalidade", "functionality" => "funcionalidade",
"check for updates..." => "verificar atualizações ao iniciar", "check for updates..." => "verificar atualiza&ccedil;&otilde;es ao iniciar",
"auto open last..." => "carregar últimos arquvos abertos ao iniciar", "auto open last..." => "carregar &uacute;ltimos arquvos abertos ao iniciar",
"when finding in..." => "ao buscar arquivos, excluir", "when finding in..." => "ao buscar arquivos, excluir",
"assisting" => "assistindo", "assisting" => "assistindo",
"code assist" => "Assist. de cód.", "code assist" => "Assist. de c&oacute;d.",
"visible tabs" => "Abas visíveis", "visible tabs" => "Abas vis&iacute;veis",
"locked nav" => "Trava Nav.", "locked nav" => "Trava Nav.",
"tag wrapper command" => "comando de quebra", "tag wrapper command" => "comando de quebra",
"auto-complete on" => "hab. auto-completar", "auto-complete on" => "hab. auto-completar",
"security" => "segurança", "security" => "seguran&ccedil;a",
"new password" => "nova senha", "new password" => "nova senha",
"8 chars min" => "mín. 8 carac.", "8 chars min" => "m&iacute;n. 8 carac.",
"confirm password" => "confirmar senha", "confirm password" => "confirmar senha",
"banned files/folders" => "arquivos/pastas bloqueados", "banned files/folders" => "arquivos/pastas bloqueados",
"banned paths" => "caminhos bloqueados", "banned paths" => "caminhos bloqueados",
"ip addresses" => "endereços IP", "ip addresses" => "endere&ccedil;os IP",
"Slash prefixed comma..." => "Prefixo barra, separado por vígula", "Slash prefixed comma..." => "Prefixo barra, separado por v&iacute;gula",
"Comma delimited" => "Separado por vírgula", "Comma delimited" => "Separado por v&iacute;rgula",
"style" => "estilo", "style" => "estilo",
"theme" => "tema", "theme" => "tema",
"line wrapping" => "quebra de linha", "line wrapping" => "quebra de linha",
@@ -408,31 +408,31 @@ $text = array(
"bug reporting" => "reportar erro", "bug reporting" => "reportar erro",
"check in files" => "verificar em arquivos", "check in files" => "verificar em arquivos",
"every" => "tudo", "every" => "tudo",
"secs getting last" => "segs, pegando últimos", "secs getting last" => "segs, pegando &uacute;ltimos",
"lines" => "linhas", "lines" => "linhas",
"multi-user" => "multi-usuário", "multi-user" => "multi-usu&aacute;rio",
"Make sure you..." => "Cuidado para nâo travar seu usuário", "Make sure you..." => "Cuidado para n&atilde;o travar seu usu&atilde;rio",
"Registration" => "Cadastro", "Registration" => "Cadastro",
"auth token" => "Chave de Autenticação", "auth token" => "Chave de Autentica&ccedil;&atilde;o",
"Required to get..." => "RNecessário para verificar diferenças, e efetivar alterações no GitHub. Se não tiver uma pode usar:".PHP_EOL.PHP_EOL. "Required to get..." => "RNecess&atilde;rio para verificar diferen&ccedil;as, e efetivar altera&ccedil;&otilde;es no GitHub. Se n&atilde;o tiver uma pode usar:".PHP_EOL.PHP_EOL.
"- chave de acesso pessoal (https://help.github.com/articles/creating-an-access-token-for-command-line-use), or".PHP_EOL. "- chave de acesso pessoal (https://help.github.com/articles/creating-an-access-token-for-command-line-use), or".PHP_EOL.
"- cliente/par secreto (http://developer.github.com/v3/oauth).".PHP_EOL.PHP_EOL. "- cliente/par secreto (http://developer.github.com/v3/oauth).".PHP_EOL.PHP_EOL.
"Não é recomendado configurar sua chave aqui, mas quando solicitado pelo ICEcoderpara mantes em sessão apenas.".PHP_EOL.PHP_EOL. "N&atilde;o &eacute; recomendado configurar sua chave aqui, mas quando solicitado pelo ICEcoderpara mantes em sess&atilde;o apenas.".PHP_EOL.PHP_EOL.
"No entanto, se trabalhar em ambiente seguro, é melhor setar essa propriedade.", "No entanto, se trabalhar em ambiente seguro, &eacute; melhor setar essa propriedade.",
"Sorry cannot commit..." => "Desculpe, não é permitido efetivar atulização no modo DEMO", "Sorry cannot commit..." => "Desculpe, n&atilde;o &eacute; permitido efetivar atuliza&ccedil;&atilde;o no modo DEMO",
"update" => "atualizar" "update" => "atualizar"
), ),
"settings-update" => "settings-update" =>
array( array(
"Cannot update config..." => "Não foi possível atualizar arquivo de configuração. Verifique permissões de acesso (públicas)", "Cannot update config..." => "N&atilde;o foi poss&iacute;vel atualizar arquivo de configura&ccedil;&atilde;o. Verifique permiss&otilde;es de acesso (p&uacute;blicas)",
"and try again" => "e tentar novamente", "and try again" => "e tentar novamente",
"and press refresh" => "e pressione atulizar" "and press refresh" => "e pressione atulizar"
), ),
"updater" => "updater" =>
array( array(
"Update appears to..." => "Atualização completada" "Update appears to..." => "Atualiza&ccedil;&atilde;o completada"
) )
); );

View File

@@ -20,6 +20,8 @@ $text = array(
"your device" => "su dispositivo", "your device" => "su dispositivo",
"Browser" => "Navegador:", "Browser" => "Navegador:",
"Your IP" => "Su IP:", "Your IP" => "Su IP:",
"trial remaining" => "prueba restante",
"days left" => "dias",
"files" => "archivos", "files" => "archivos",
"Last 10 files..." => "Ultimos 10 archivos abiertos:", "Last 10 files..." => "Ultimos 10 archivos abiertos:",
"none" => "[ninguno]", "none" => "[ninguno]",
@@ -36,6 +38,7 @@ $text = array(
array( array(
"Lock" => "Bloquear", "Lock" => "Bloquear",
"Refresh" => "Actualizar", "Refresh" => "Actualizar",
"Plugins" => "Complementos",
"ROOT" => "[RAIZ]" "ROOT" => "[RAIZ]"
), ),
@@ -47,9 +50,10 @@ $text = array(
"Your version is" => "Su versi&oacute;n es", "Your version is" => "Su versi&oacute;n es",
"Update now" => "Actualizar ahora", "Update now" => "Actualizar ahora",
"You have some..." => "Usted tiene cambios sin guardar", "You have some..." => "Usted tiene cambios sin guardar",
"Are you sure you want to close?" => "Are you sure you want to close?", "Are you sure..." => "Est&aacute; seguro que desea cerrar?",
"working" => "trabajando", "working" => "trabajando",
"Color picker" => "Selector de color", "Color picker" => "Selector de color",
"Plugins Manager" => "Administrar complementos",
"New File" => "Nuevo archivo", "New File" => "Nuevo archivo",
"New Folder" => "Nueva carpeta", "New Folder" => "Nueva carpeta",
"Upload File(s)" => "Cargar archivo(s)", "Upload File(s)" => "Cargar archivo(s)",
@@ -101,7 +105,9 @@ $text = array(
"Code Assist" => "Asistente de c&oacute;digo", "Code Assist" => "Asistente de c&oacute;digo",
"Go to Line" => "Ir a la l&iacute;nea", "Go to Line" => "Ir a la l&iacute;nea",
"View" => "Ver", "View" => "Ver",
"Bug reporting not active" => "Reporte de Errores no activado" "Bug reporting not active" => "Reporte de Errores no activado",
"Single pane" => "Panel unico",
"Diff pane also" => "Panel de diferencias tambien"
), ),
// /LIB // /LIB
@@ -113,6 +119,7 @@ $text = array(
"file-control" => "file-control" =>
array( array(
"Sorry, bad filename..." => "Lo siento, nombre de archivo incorrecto. Verifique la consola de desarrollo para mas informacion?",
"Sorry" => "Lo siento", "Sorry" => "Lo siento",
"does not seem..." => "parace no existir en el servidor", "does not seem..." => "parace no existir en el servidor",
"Sorry, could not..." => "Lo siento, no puedo obtener el contenido de", "Sorry, could not..." => "Lo siento, no puedo obtener el contenido de",
@@ -128,6 +135,7 @@ $text = array(
"Sorry, cannot save" => "Lo siento, no puedo guardar", "Sorry, cannot save" => "Lo siento, no puedo guardar",
"Sorry, cannot replace..." => "Lo siento, no puedo reemplazar texto en", "Sorry, cannot replace..." => "Lo siento, no puedo reemplazar texto en",
"Sorry, cannot change..." => "Lo siento, no puedo cambiar permisos sobre", "Sorry, cannot change..." => "Lo siento, no puedo cambiar permisos sobre",
"Sorry, cannot delete more..." => "Lo siento, no puedo eliminar mas de un item a la vez bajo modo FTP",
"Sorry, cannot delete..." => "Lo siento, no puedo eliminar el nivel raiz", "Sorry, cannot delete..." => "Lo siento, no puedo eliminar el nivel raiz",
"Sorry, cannot delete" => "Lo siento, no puedo eliminar", "Sorry, cannot delete" => "Lo siento, no puedo eliminar",
"Sorry, this file..." => "Lo siento, este archivo ha cambiado, no puedo almacenar", "Sorry, this file..." => "Lo siento, este archivo ha cambiado, no puedo almacenar",
@@ -155,7 +163,9 @@ $text = array(
"github paths" => "Rutas de GitHub", "github paths" => "Rutas de GitHub",
"Choose existing path" => "Seleccionar una ruta existente", "Choose existing path" => "Seleccionar una ruta existente",
"Local path" => "Ruta local", "Local path" => "Ruta local",
"Slash prefixed" => "Prefijo de slash",
"Remote GitHub path" => "Ruta remota GitHub", "Remote GitHub path" => "Ruta remota GitHub",
"Absolute URL beginning..." => "URL absoluta, iniciando https://github.com",
"Choose" => "Seleccionar", "Choose" => "Seleccionar",
"Set local and..." => "Establecer las rutas locales y remotas en blanco para removerlas", "Set local and..." => "Establecer las rutas locales y remotas en blanco para removerlas",
"Update" => "Actualizar", "Update" => "Actualizar",
@@ -232,6 +242,7 @@ $text = array(
"Close current tab" => "Cerrar ficha actual", "Close current tab" => "Cerrar ficha actual",
"Open file prompt" => "L&iacute;nea de apertura de archivos", "Open file prompt" => "L&iacute;nea de apertura de archivos",
"Find" => "Buscar", "Find" => "Buscar",
"Previous" => "Previo",
"Focus on Go..." => "Obtener foco en la opci&oacute;n Ir a Linea", "Focus on Go..." => "Obtener foco en la opci&oacute;n Ir a Linea",
"Save" => "Guardar", "Save" => "Guardar",
"Save as" => "Guardar como...", "Save as" => "Guardar como...",
@@ -244,6 +255,7 @@ $text = array(
"ice-coder" => "ice-coder" =>
array( array(
"results" => "resultados",
"No text selected..." => "No hay texto seleccionado para buscar", "No text selected..." => "No hay texto seleccionado para buscar",
"all files" => "todos los archivos", "all files" => "todos los archivos",
"all filenames" => "todos los nombres de archivo", "all filenames" => "todos los nombres de archivo",
@@ -254,6 +266,7 @@ $text = array(
"Opening File" => "Abriendo archivo", "Opening File" => "Abriendo archivo",
"Enter relative file..." => "Entre una ruta relativa (iniciando con /) o una URL remota", "Enter relative file..." => "Entre una ruta relativa (iniciando con /) o una URL remota",
"Getting" => "Obteniendo", "Getting" => "Obteniendo",
"Saving" => "Guardando:",
"Please enter the..." => "Por favor ingrese el nuevo nombre para", "Please enter the..." => "Por favor ingrese el nuevo nombre para",
"Renaming to" => "Renombrando a", "Renaming to" => "Renombrando a",
"Moving to" => "Moviendo a", "Moving to" => "Moviendo a",
@@ -267,6 +280,7 @@ $text = array(
"replace all" => "reemplazar todo", "replace all" => "reemplazar todo",
"file" => "archivo", "file" => "archivo",
"Replacing text in" => "Reemplazando texto en", "Replacing text in" => "Reemplazando texto en",
"Sorry there was..." => "Lo siento, hubo un error con su solicitud.\\n\\nPor favor verifique su consola de desarrollo para mas informacion.",
"Cancelled tasks" => "Tareas canceladas", "Cancelled tasks" => "Tareas canceladas",
"Open previous files" => "Abrir archivos previos?", "Open previous files" => "Abrir archivos previos?",
"Please enter your..." => "Por favor entre su token de GitHub (para acceso personal). Ver ayuda cerca al Token de autenticaci&oacute;n de Github en la ayuda > Vea pantalla de configuraci&oacute;n para m&aacute;s informaci&oacute;n", "Please enter your..." => "Por favor entre su token de GitHub (para acceso personal). Ver ayuda cerca al Token de autenticaci&oacute;n de Github en la ayuda > Vea pantalla de configuraci&oacute;n para m&aacute;s informaci&oacute;n",
@@ -276,8 +290,7 @@ $text = array(
"Error cannot find..." => "Error: no puedo encontrar o accesar las rutas de archivos de error", "Error cannot find..." => "Error: no puedo encontrar o accesar las rutas de archivos de error",
"No new errors..." => "No fueron encontrados nuevos errores", "No new errors..." => "No fueron encontrados nuevos errores",
"You have made..." => "Usted ha realizado cambios. Esta seguro que quiere cerrar sin guardar?", "You have made..." => "Usted ha realizado cambios. Esta seguro que quiere cerrar sin guardar?",
"Close all tabs" => "Cerrar todas las fichas?", "Close all tabs" => "Cerrar todas las fichas?"
"results" => "resultados"
), ),
"login" => "login" =>
@@ -371,7 +384,13 @@ $text = array(
"codemirror dir" => "directorio codemirror", "codemirror dir" => "directorio codemirror",
"codemirror version" => "version codemirror", "codemirror version" => "version codemirror",
"file manager root" => "administrador de archivos raiz", "file manager root" => "administrador de archivos raiz",
"Free to use..." => "Libre para usarlo para cualquier prop&oacute;sito, comercial o no, solo dejeme saber cualquier uso o mejora. :)<br><br>No se da garantia de ningun tipo, su uso se encuentra bajo su responsabilidad.<br><br>Muchas personas y compa&ntilde;&iacute;as han ayudado a construir ICEcoder por lo que les damos las gracias. Por favor vea la lista completa en", "Get in contact..." => "Pongase en contacto...",
"backups" => "respaldos",
"keep version control..." => "mantener control de versiones de respaldo para",
"day" => "dia",
"days" => "dias",
"of backups stored..." => "de respaldos almacenados actualmente",
"You may use..." => "Libre para usarlo para cualquier prop&oacute;sito, comercial o no, solo dejeme saber cualquier uso o mejora. :)<br><br>No se da garantia de ningun tipo, su uso se encuentra bajo su responsabilidad.",
"functionality" => "funcionalidad", "functionality" => "funcionalidad",
"check for updates..." => "verificar por actualizaciones en la carga", "check for updates..." => "verificar por actualizaciones en la carga",
"auto open last..." => "auto cargar los ultimos archivos al ingresar", "auto open last..." => "auto cargar los ultimos archivos al ingresar",
@@ -430,6 +449,19 @@ $text = array(
"updater" => "updater" =>
array( array(
"Update appears to..." => "La actualizaci&oacute;n parece haber sido satisfactoria" "Update appears to..." => "La actualizaci&oacute;n parece haber sido satisfactoria"
),
"find-in-files" =>
array(
"Enter path to search in" => "Ingrese la ruta para buscar",
"Enter semicolon-separated masks of files to look at (e.g. *.php;*.html;*.js)" => "Ingrese la mascaras de archivo separadas por punto y coma para buscar (ej. *.php;*.html;*.js)",
"Type of text" => "Tipo de texto",
"Fixed text" => "Texto fijo",
"Regular expression" => "Expresion regular",
"Case sensitive" => "Sensible a mayuscula",
"Yes" => "Si",
"No" => "No",
"Search" => "Buscar",
) )
); );

View File

@@ -0,0 +1,14 @@
<?php
// Load common functions
include("headers.php");
include("settings.php");
$file = str_replace("|","/",xssClean($_GET['file'],'html'));
$loadedFile = toUTF8noBOM(file_get_contents("../backups/".$file,false,$context),true);
$encoding=ini_get("default_charset");
if($encoding=="")
$encoding="UTF-8";
echo '<textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile,ENT_COMPAT,$encoding).'</textarea>';
echo "<script>parent.document.getElementById('buttonsContainer').style.display = 'inline-block';parent.editor.setValue(document.getElementById('loadedFile').value)</script>";
?>

30
lib/backup-versions.css Normal file
View File

@@ -0,0 +1,30 @@
/* First, reset everything to a standard */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
border: 0;
margin: 0;
padding: 0;
outline: 0;
font-size: 12px;
vertical-align: top;
}
body {overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
a {color: #fff; text-decoration: none}
.backup-versions {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}
.button {padding: 5px 10px; font-size: 14px; background-color: rgba(0,198,255,0.7); margin-bottom: 20px; text-align: center; cursor: pointer}

118
lib/backup-versions.php Normal file
View File

@@ -0,0 +1,118 @@
<?php
// Load common functions
include("headers.php");
include("settings.php");
$text = $_SESSION['text'];
$t = $text['backup-versions'];
$file = str_replace("|","/",xssClean($_GET['file'],'html'));
$fileCountInfo = getVersionsCount(dirname($file),basename($file));
$versions = $fileCountInfo['count'];
?>
<!DOCTYPE html>
<html>
<head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> backup version control</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="backup-versions.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css?microtime=<?php echo microtime(true);?>">
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js?microtime=<?php echo microtime(true);?>"></script>
<style type="text/css">
.CodeMirror {position: absolute; width: 409px; height: 180px; font-size: <?php echo $ICEcoder["fontSize"];?>}
.CodeMirror-scroll {overflow: hidden}
/* Make sure this next one remains the 3rd item, updated with JS */
.cm-tab {border-left-width: <?php echo $ICEcoder["visibleTabs"] ? "1px" : "0";?>; margin-left: <?php echo $ICEcoder["visibleTabs"] ? "-1px" : "0";?>; border-left-style: solid; border-left-color: rgba(255,255,255,0.2)}
</style>
<link rel="stylesheet" href="editor.css?microtime=<?php echo microtime(true);?>">
<?php
$themeArray = array();
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
while (false !== ($cssFile = readdir($handle))) {
if ($cssFile !== "." && $cssFile != "..") {
array_push($themeArray,basename($cssFile,".css"));
}
}
sort($themeArray);
for ($i=0;$i<count($themeArray);$i++) {
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css?microtime='.microtime(true).'">'.PHP_EOL;
}
?>
</head>
<body class="backup-versions">
<h1 id="title"><?php echo $versions." ".($versions != 1 ? $t["backups"] : $t["backup"])." ".$t['available for'].":";?></h1>
<h2><?php echo $file;?></h2>
<br>
<div style="display: inline-block">
<?php
$dateCounts = $fileCountInfo['dateCounts'];
$displayVersions = $versions;
// Establish the base, host and date dir parts...
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
foreach ($dateCounts as $key => $value) {
echo "<b>".date("jS M Y",strtotime($key))." (".$value." ".($value != 1 ? $t["backups"] : $t["backup"]).")</b>";
echo '<br>';
for ($j=0; $j<$value; $j++) {
echo '<a href="backup-versions-preview-loader.php?file='.str_replace("/","|",$backupDirHost.'/'.$key.$file).' ('.$displayVersions.')&csrf='.$_SESSION['csrf'].'" target="previewLoader">Backup '.$displayVersions.'<br>';
$displayVersions--;
}
echo '<br>';
}
?>
</div>
<div style="display: inline-block; height: 300px; width: 400px; margin-left: 30px">
<textarea id="code" name="code">Click a backup to the left to preview it</textarea>
</div>
<div style="display: none; width: 180px; margin-left: 30px" id="buttonsContainer">
<div class="button" onclick="openNew()">Open in new tab</div>
<div class="button" onclick="openDiff()">Open in diff mode</div>
<!--
<div class="button" onclick="alert('Function not available yet - Coming in v5.4')">Restore as new version</div>
//-->
</div>
<div style="display: none">
<iframe name="previewLoader"></iframe>
</div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
readOnly: "nocursor",
indentUnit: top.ICEcoder.indentSize,
tabSize: top.ICEcoder.indentSize,
mode: "javascript",
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
});
editor.setSize("400px","330px");
var openNew = function() {
var cM;
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))
top.ICEcoder.newTab();
cM = top.ICEcoder.getcMInstance();
cM.setValue(editor.getValue());
}
var openDiff = function() {
var cMDiff;
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))
top.ICEcoder.setSplitPane('on');
cMDiff = top.ICEcoder.getcMdiffInstance();
top.ICEcoder.focus('diff');
cMDiff.setValue(editor.getValue());
}
</script>
</body>
</html>

View File

@@ -1,6 +1,6 @@
<?php <?php
$ICEcoderUserSettings = array( $ICEcoderUserSettings = array(
"versionNo" => "5.0", "versionNo" => "5.3",
"licenseEmail" => "", "licenseEmail" => "",
"licenseCode" => "", "licenseCode" => "",
"configCreateDate" => 0, "configCreateDate" => 0,
@@ -9,6 +9,8 @@ $ICEcoderUserSettings = array(
"openLastFiles" => true, "openLastFiles" => true,
"updateDiffOnSave" => true, "updateDiffOnSave" => true,
"languageUser" => "english.php", "languageUser" => "english.php",
"backupsKept" => true,
"backupsDays" => 14,
"findFilesExclude" => array(".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip"), "findFilesExclude" => array(".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip"),
"codeAssist" => true, "codeAssist" => true,
"visibleTabs" => false, "visibleTabs" => false,

View File

@@ -10,8 +10,14 @@ if (!file_exists($file) || strpos(str_replace("\\","/",$file),$docRoot) !== 0) {
} }
if (file_exists($file)) { if (file_exists($file)) {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header('Content-Description: File Transfer'); header('Content-Description: File Transfer');
header("Content-Type: application/octet-stream");
header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Disposition: attachment; filename='.basename($file));
// header("Content-Transfer-Encoding: binary");
header('Content-Length: '.filesize($file)); header('Content-Length: '.filesize($file));
ob_clean(); ob_clean();
flush(); flush();

View File

@@ -1,6 +1,6 @@
/* ICEcoder default theme by Matt Pass */ /* ICEcoder default theme by Matt Pass */
.cm-s-icecoder {color: #666; background: #141612} .cm-s-icecoder {color: #666; background: #1d1d1b}
.cm-s-icecoder span.cm-keyword {color: #eee; font-weight:bold} /* off-white 1 */ .cm-s-icecoder span.cm-keyword {color: #eee; font-weight:bold} /* off-white 1 */
.cm-s-icecoder span.cm-atom {color: #e1c76e} /* yellow */ .cm-s-icecoder span.cm-atom {color: #e1c76e} /* yellow */
@@ -8,7 +8,7 @@
.cm-s-icecoder span.cm-def {color: #b9ca4a} /* green */ .cm-s-icecoder span.cm-def {color: #b9ca4a} /* green */
.cm-s-icecoder span.cm-variable {color: #6cb5d9} /* blue */ .cm-s-icecoder span.cm-variable {color: #6cb5d9} /* blue */
.cm-s-icecoder span.cm-variable-2 {color: #bf255c} /* pink */ .cm-s-icecoder span.cm-variable-2 {color: #cc1e5c} /* pink */
.cm-s-icecoder span.cm-variable-3 {color: #f9602c} /* orange */ .cm-s-icecoder span.cm-variable-3 {color: #f9602c} /* orange */
.cm-s-icecoder span.cm-property {color: #eee} /* off-white 1 */ .cm-s-icecoder span.cm-property {color: #eee} /* off-white 1 */
@@ -19,7 +19,6 @@
.cm-s-icecoder span.cm-string-2 {color: #6cb5d9} /* blue */ .cm-s-icecoder span.cm-string-2 {color: #6cb5d9} /* blue */
.cm-s-icecoder span.cm-meta {color: #555} /* grey */ .cm-s-icecoder span.cm-meta {color: #555} /* grey */
.cm-s-icecoder span.cm-error {color: #d00} /* red */
.cm-s-icecoder span.cm-qualifier {color: #555} /* grey */ .cm-s-icecoder span.cm-qualifier {color: #555} /* grey */
.cm-s-icecoder span.cm-builtin {color: #214e7b} /* bright blue */ .cm-s-icecoder span.cm-builtin {color: #214e7b} /* bright blue */
@@ -32,9 +31,10 @@
.cm-s-icecoder span.cm-quote {color: #186718} /* dark green */ .cm-s-icecoder span.cm-quote {color: #186718} /* dark green */
.cm-s-icecoder span.cm-hr {color: #888} /* mid-grey */ .cm-s-icecoder span.cm-hr {color: #888} /* mid-grey */
.cm-s-icecoder span.cm-link {color: #e1c76e} /* yellow */ .cm-s-icecoder span.cm-link {color: #e1c76e} /* yellow */
.cm-s-icecoder span.cm-error {color: #d00} /* red */
.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important} .cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important}
.cm-s-icecoder .CodeMirror-selected {color: #fff !important; background: #037 !important} .cm-s-icecoder .CodeMirror-selected {color: #fff !important; background: #037 !important}
.cm-s-icecoder .CodeMirror-gutters {background: #141612; min-width: 41px; border-right: 0} .cm-s-icecoder .CodeMirror-gutters {background: #1d1d1b; min-width: 41px; border-right: 0}
.cm-s-icecoder .CodeMirror-linenumber {color: #555; cursor: default} .cm-s-icecoder .CodeMirror-linenumber {color: #555; cursor: default}
.cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important} .cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important}

View File

@@ -1,6 +1,7 @@
<?php <?php
include("headers.php"); include("headers.php");
include("settings.php"); include("settings.php");
include("ftp-control.php");
$t = $text['file-control']; $t = $text['file-control'];
// =============================== // ===============================
@@ -19,60 +20,84 @@ $errorMsg = "None";
$saveType = isset($_GET['saveType']) ? strClean($_GET['saveType']) : ""; $saveType = isset($_GET['saveType']) ? strClean($_GET['saveType']) : "";
// Establish the filename/new filename // Establish the filename/new filename
$file = str_replace("|","/",strClean( if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
isset($_POST['newFileName']) && $_POST['newFileName']!="" $file = $_POST['newFileName']; // New file
? $_POST['newFileName'] } elseif (isset($_REQUEST['file'])) {
: $_REQUEST['file'] $file = $_REQUEST['file']; // Existing file
)); } else {
$file = ""; // Error
// Establish the actual name as we may have HTML entities in filename $finalAction = "nothing";
$file = html_entity_decode($file); $doNext = "";
$error = true;
// Put the original $file var aside for use $errorStr = "true";
$fileOrig = $file; $errorMsg = $t['Sorry, bad filename...'];
// Trim any +'s or spaces from the end of file
$file = rtrim(rtrim($file,'+'),' ');
// Also remove [NEW] from $file, we can consider $_GET['action'] or $fileOrig to pick that up
$file = rtrim($file,'[NEW]');
// Make each path in $file a full path (; seperated list)
$allFiles = explode(";",$file);
for ($i=0; $i<count($allFiles); $i++) {
if (strpos($allFiles[$i],$docRoot)===false && $_GET['action']!="getRemoteFile") {
$allFiles[$i]=str_replace("|","/",$docRoot.$iceRoot.$allFiles[$i]);
}
}; };
$file = implode(";",$allFiles);
// Establish the $fileLoc and $fileName (used in single file cases, eg opening. Multiple file cases, eg deleting, is worked out in that loop) // If we have file(s) to work with...
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/")); if (!$error) {
$fileName = basename($file); // Replace pipes with slashes, after cleaning the chars
$file = str_replace("|","/",strClean($file));
// Check through all files to make sure they're valid/safe // Establish the actual name as we may have HTML entities in filename
$allFiles = explode(";",$file); $file = html_entity_decode($file);
for ($i=0; $i<count($allFiles); $i++) {
// Uncomment to alert and console.log the action and file, useful for debugging // Put the original $file var aside for use
// echo ";alert('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');console.log('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');"; $fileOrig = $file;
// Die if the file requested isn't something we expect // Trim any +'s or spaces from the end of file
if( $file = rtrim(rtrim($file,'+'),' ');
// A local folder that isn't the doc root or starts with the doc root
($_GET['action']!="getRemoteFile" && // Also remove [NEW] from $file, we can consider $_GET['action'] or $fileOrig to pick that up
rtrim($allFiles[$i],"/") !== rtrim($docRoot,"/") && $file = rtrim($file,'[NEW]');
strpos(realpath(rtrim(dirname($allFiles[$i]),"/")),realpath(rtrim($docRoot,"/"))) !== 0
) || // Make each path in $file a full path (; seperated list)
// Or a remote URL that doesn't start http $allFiles = explode(";",$file);
($_GET['action']=="getRemoteFile" && strpos($allFiles[$i],"http") !== 0) for ($i=0; $i<count($allFiles); $i++) {
) { if (strpos($allFiles[$i],$docRoot)===false && $_GET['action']!="getRemoteFile") {
$error = true; $allFiles[$i]=str_replace("|","/",$docRoot.$iceRoot.$allFiles[$i]);
$errorStr = "true"; }
$errorMsg = "Sorry! - problem with file requested";
}; };
$file = implode(";",$allFiles);
// Establish the $fileLoc and $fileName (used in single file cases, eg opening. Multiple file cases, eg deleting, is worked out in that loop)
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/"));
$fileName = basename($file);
// Check through all files to make sure they're valid/safe
$allFiles = explode(";",$file);
for ($i=0; $i<count($allFiles); $i++) {
// Uncomment to alert and console.log the action and file, useful for debugging
// echo ";alert('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');console.log('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');";
// Die if the file requested isn't something we expect
if(
// A local folder that isn't the doc root or starts with the doc root
($_GET['action']!="getRemoteFile" && !isset($ftpSite) &&
rtrim($allFiles[$i],"/") !== rtrim($docRoot,"/") &&
strpos(realpath(rtrim(dirname($allFiles[$i]),"/")),realpath(rtrim($docRoot,"/"))) !== 0
) ||
// Or a remote URL that doesn't start http
($_GET['action']=="getRemoteFile" && strpos($allFiles[$i],"http") !== 0)
) {
$error = true;
$errorStr = "true";
$errorMsg = "Sorry! - problem with file requested";
};
}
} }
$doNext = "";
// If we're in FTP mode, start a connection and leave open for FTP actions
if (isset($ftpSite)) {
ftpStart();
// Show user warning if no good connection
if (!$ftpConn || !$ftpLogin) {
$doNext .= 'top.ICEcoder.message("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");';
}
}
// ============ // ============
// SAVING FILES // SAVING FILES
// ============ // ============
@@ -87,48 +112,69 @@ if (!$error && $_GET['action']=="save") {
$finalAction = strpos($fileOrig,"[NEW]")>0 ? "save as" : "save"; $finalAction = strpos($fileOrig,"[NEW]")>0 ? "save as" : "save";
$fileURL = isset($file) ? $file : ""; $fileURL = isset($file) ? $file : "";
$fileMDTURLPart = isset($_GET["fileMDT"]) && $_GET["fileMDT"]!="undefined" ? "&fileMDT=".numClean($_GET['fileMDT']) : ""; $fileMDTURLPart = isset($_GET["fileMDT"]) && $_GET["fileMDT"]!="undefined" ? "&fileMDT=".numClean($_GET['fileMDT']) : "";
$doNext = ' $fileVersionURLPart = isset($_GET["fileVersion"]) && $_GET["fileVersion"]!="undefined" ? "&fileVersion=".numClean($_GET['fileVersion']) : "";
$doNext .= '
top.ICEcoder.serverMessage(); top.ICEcoder.serverMessage();
fileLoc = "'.$fileLoc.'"; fileLoc = "'.$fileLoc.'";
overwriteOK = false;
noConflictSave = false;
newFileName = top.ICEcoder.getInput("'.$t['Enter filename to...'].' "+(fileLoc!="" ? fileLoc : "/"),""); newFileName = top.ICEcoder.getInput("'.$t['Enter filename to...'].' "+(fileLoc!="" ? fileLoc : "/"),"");
if (newFileName) { if (newFileName) {
if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}; if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName};
newFileName = fileLoc + newFileName; newFileName = fileLoc + newFileName;
if (top.ICEcoder.filesFrame.contentWindow.document.getElementById(newFileName.replace(/\\\//g,"|"))) {
overwriteOK = top.ICEcoder.ask("'.$t['That file exists...'].'"); /* Check if file/dir exists */
} top.ICEcoder.lastFileDirCheckStatusObj = false;
top.ICEcoder.checkExists(newFileName);
var thisInt = setInterval(function() {
if (top.ICEcoder.lastFileDirCheckStatusObj != false) {
clearInterval(thisInt);
if (top.ICEcoder.lastFileDirCheckStatusObj.file && top.ICEcoder.lastFileDirCheckStatusObj.file.exists) {
overwriteOK = top.ICEcoder.ask("'.$t['That file exists...'].'");
} else {
noConflictSave = true;
};
/* Saving under conditions: Confirmation of overwrite or there is no filename conflict, it is a new file, in either case we can save */
if (overwriteOK || noConflictSave) {
newFileName = "'.(isset($ftpSite) ? "" : $docRoot).'" + newFileName;
saveURL = "lib/file-control-xhr.php?action=save'.$fileMDTURLPart.$fileVersionURLPart.'&csrf='.$_GET["csrf"].'";
var xhr = top.ICEcoder.xhrObj();
xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status==200) {
/* console.log(xhr.responseText); */
var statusObj = JSON.parse(xhr.responseText);
/* Set the actions end time and time taken in JSON object */
statusObj.action.timeEnd = new Date().getTime();
statusObj.action.timeTaken = statusObj.action.timeEnd - statusObj.action.timeStart;
/* console.log(statusObj); */
if (statusObj.status.error) {
top.ICEcoder.message(statusObj.status.errorMsg);
} else {
eval(statusObj.action.doNext);
}
}
};
/* console.log(\'Calling \'+saveURL+\' via XHR\'); */
xhr.open("POST",saveURL,true);
xhr.setRequestHeader(\'Content-type\', \'application/x-www-form-urlencoded\');
xhr.send(\'timeStart='.$_POST["timeStart"].'&file='.$fileURL.'&newFileName=\'+newFileName+\'&contents=\'+top.ICEcoder.saveAsContent);
top.ICEcoder.serverMessage("<b>'.$t['Saving'].'</b><br>" + "'.($finalAction == "Save" ? "newFileName" : "'".$fileName."'").'");
}
}
},10);
}; };
if ("undefined" == typeof newFileName || (newFileName && "undefined" == typeof overwriteOK) || ("undefined" != typeof overwriteOK && overwriteOK)) { /* UI dialog cancelling and saving contents for save as looparound */
newFileName = "'.$docRoot.'" + newFileName; if (!newFileName || newFileName && !overwriteOK) {
saveURL = "lib/file-control-xhr.php?action=save'.$fileMDTURLPart.'&csrf='.$_GET["csrf"].'"; top.ICEcoder.saveAsContent = top.document.getElementById(\'saveTemp1\').value;
var xhr = top.ICEcoder.xhrObj();
xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status==200) {
/* console.log(xhr.responseText); */
var statusObj = JSON.parse(xhr.responseText);
/* Set the actions end time and time taken in JSON object */
statusObj.action.timeEnd = new Date().getTime();
statusObj.action.timeTaken = statusObj.action.timeEnd - statusObj.action.timeStart;
/* console.log(statusObj); */
if (statusObj.status.error) {
top.ICEcoder.message(statusObj.status.errorMsg);
} else {
eval(statusObj.action.doNext);
}
}
};
/* console.log(\'Calling \'+saveURL+\' via XHR\'); */
xhr.open("POST",saveURL,true);
xhr.setRequestHeader(\'Content-type\', \'application/x-www-form-urlencoded\');
xhr.send(\'timeStart='.$_POST["timeStart"].'&file='.$fileURL.'&newFileName=\'+newFileName+\'&contents=\'+top.document.getElementById(\'saveTemp1\').value);
top.ICEcoder.serverMessage("<b>'.$t['Saving'].'</b><br>" + "'.($finalAction == "Save" ? "newFileName" : "'".$fileName."'").'");
} else {
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0); top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
}'; }';
@@ -143,44 +189,150 @@ if (!$error && $_GET['action']=="save") {
// FILE IS WRITEABLE // FILE IS WRITEABLE
// ================= // =================
if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) { if (!$demoMode && (isset($ftpSite) || (file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) {
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
$filemtime = !isset($ftpSite) && $serverType=="Linux" ? filemtime($file) : "1000000";
// ======================= // =======================
// MDT'S MATCH, WRITE FILE // MDT'S MATCH, WRITE FILE
// ======================= // =======================
if (!(isset($_GET['fileMDT']))||$filemtime==$_GET['fileMDT']) { if (!(isset($_GET['fileMDT']))||$filemtime==$_GET['fileMDT']) {
// Newly created files have the perms set too
$setPerms = (!file_exists($file)) ? true : false; // FTP Saving
// get old file contents, if file exists, and count stats on usage \n and \r there if (isset($ftpSite)) {
// in this case we can keep line endings, which file had before, without // Write our file contents
// making code version control systems going crazy about line endings change in whole file. $ftpFilepath = ltrim($fileLoc."/".$fileName,"/");
$oldContents = file_exists($file)?file_get_contents($file):''; // replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
$unixNewLines = preg_match_all('/[^\r][\n]/u', $oldContents); $contents = $_POST['contents'];
$windowsNewLines = preg_match_all('/[\r][\n]/u', $oldContents); $contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents);
$fh = fopen($file, 'w') or die($t['Sorry, cannot save']); $contents = str_replace("\r", $ICEcoder["lineEnding"], $contents);
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding $contents = str_replace("\n", $ICEcoder["lineEnding"], $contents);
$contents = $_POST['contents']; if (!ftpWriteFile($ftpConn, $ftpFilepath, $contents, $ftpMode)) {
$contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents); $doNext .= 'top.ICEcoder.message("Sorry, could not write '.$ftpFilepath.' at '.$ftpHost.'");';
$contents = str_replace("\r", $ICEcoder["lineEnding"], $contents); }
$contents = str_replace("\n", $ICEcoder["lineEnding"], $contents); $doNext .= 'top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.$filemtime.'";';
if (($unixNewLines > 0) || ($windowsNewLines > 0)){ $doNext .= '(function() {var x=top.ICEcoder.openFileVersions; var y=top.ICEcoder.selectedTab-1; x[y] = "undefined" != typeof x[y] ? x[y]+1 : 1})();top.ICEcoder.updateVersionsDisplay();';
if ($unixNewLines > $windowsNewLines){ // Local saving
$contents = str_replace($ICEcoder["lineEnding"], "\n", $contents); } else {
} elseif ($windowsNewLines > $unixNewLines){ // Newly created files have the perms set too
$contents = str_replace($ICEcoder["lineEnding"], "\r\n", $contents); $setPerms = (!file_exists($file)) ? true : false;
// get old file contents, if file exists, and count stats on usage \n and \r there
// in this case we can keep line endings, which file had before, without
// making code version control systems going crazy about line endings change in whole file.
$oldContents = file_exists($file)?file_get_contents($file):'';
$unixNewLines = preg_match_all('/[^\r][\n]/u', $oldContents);
$windowsNewLines = preg_match_all('/[\r][\n]/u', $oldContents);
$fh = fopen($file, 'w') or die($t['Sorry, cannot save']);
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
$contents = $_POST['contents'];
$contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents);
$contents = str_replace("\r", $ICEcoder["lineEnding"], $contents);
$contents = str_replace("\n", $ICEcoder["lineEnding"], $contents);
if (($unixNewLines > 0) || ($windowsNewLines > 0)){
if ($unixNewLines > $windowsNewLines){
$contents = str_replace($ICEcoder["lineEnding"], "\n", $contents);
} elseif ($windowsNewLines > $unixNewLines){
$contents = str_replace($ICEcoder["lineEnding"], "\r\n", $contents);
}
}
// Now write that content, close the file and clear the statcache
fwrite($fh, $contents);
fclose($fh);
if ($setPerms) {
chmod($file,octdec($ICEcoder['newFilePerms']));
}
clearstatcache();
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
$doNext .= 'top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.$filemtime.'";';
$doNext .= '(function() {var x=top.ICEcoder.openFileVersions; var y=top.ICEcoder.selectedTab-1; x[y] = "undefined" != typeof x[y] ? x[y]+1 : 1})();top.ICEcoder.updateVersionsDisplay();';
}
// Save a version controlled backup source of the file
if ($ICEcoder["backupsKept"]) {
$backupDirFormat = "Y-m-d";
// Establish the base, host and date dir parts...
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../backups/";
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
$backupDirDate = date($backupDirFormat);
// Establish an array of dirs from base to our file location
$subDirsArray = explode("/",ltrim($fileLoc,"/"));
array_unshift($subDirsArray,$backupDirHost,$backupDirDate);
// Make any dirs that don't exist if full path isn't there
if (!is_dir($backupDirBase.implode("/",$subDirsArray))) {
$pathIncr = "";
for ($i=0; $i<count($subDirsArray); $i++) {
$pathIncr .= $subDirsArray[$i]."/";
// If this subdir isn't there, make it
if (!is_dir($backupDirBase.$pathIncr)) {
mkdir($backupDirBase.$pathIncr);
}
}
}
// We should have our dir path now so set that
$backupDir = $backupDirBase.implode("/",$subDirsArray);
// Work out an available filename (we postfix a number in parens)
for ($i=1; $i<1000000000; $i++) {
if (!file_exists($backupDir.'/'.$fileName." (".$i.")")) {
$backupFileName = $fileName." (".$i.")";
$backupFileNum = $i;
$i=1000000000;
}
}
// Now save within that backup dir and clear the statcache
$fh = fopen($backupDir."/".$backupFileName, "w") or die($t['Sorry, cannot save...']);
fwrite($fh, $contents);
fclose($fh);
clearstatcache();
// Log the version count in an index file, which contains saved version counts
$backupIndex = $backupDirBase.$backupDirHost."/".$backupDirDate."/.versions-index";
// Have a version index already? Update contents
if (file_exists($backupIndex)) {
$versionsInfo = "";
$versionsInfoOrig = file_get_contents($backupIndex,false,$context);
$versionsInfoOrig = explode("\n",$versionsInfoOrig);
$replacedLine = false;
// For each line, either re-set number or simply include the line
for ($i=0; $i<count($versionsInfoOrig); $i++) {
if (strpos($versionsInfoOrig[$i],$fileLoc."/".$fileName." = ") === 0) {
$versionsInfo .= $fileLoc."/".$fileName." = ".$backupFileNum.PHP_EOL;
$replacedLine = true;
} else {
$versionsInfo .= $versionsInfoOrig[$i].PHP_EOL;
}
}
// Didn't find our line in the file? Add it to the end
if (!$replacedLine) {
$versionsInfo .= $fileLoc."/".$fileName." = ".$backupFileNum.PHP_EOL;
}
// No version file yet, set the first line
} else {
$versionsInfo = $fileLoc."/".$fileName." = ".$backupFileNum.PHP_EOL;
}
$versionsInfo = rtrim($versionsInfo,PHP_EOL);
$fh = fopen($backupIndex, 'w') or die($t['Sorry, cannot save...']);
fwrite($fh, $versionsInfo);
fclose($fh);
clearstatcache();
// Finally, clear any old backup dirs than user set X days (inclusive)
$backupDirsList = scandir($backupDirBase.$backupDirHost);
$backupDirsKeep = array();
for ($i=0; $i<=$ICEcoder["backupsDays"]; $i++) {
$backupDirsKeep[] = date($backupDirFormat, strtotime('-'.$i.' day',strtotime($backupDirDate)));
}
for ($i=0; $i<count($backupDirsList); $i++) {
if ($backupDirsList[$i] != "." && $backupDirsList[$i] != ".." && !in_array($backupDirsList[$i],$backupDirsKeep)) {
rrmdir($backupDirBase.$backupDirHost."/".$backupDirsList[$i]);
}
} }
} }
// Now write that content, close the file and clear the statcache
fwrite($fh, $contents);
fclose($fh);
if ($setPerms) {
chmod($file,octdec($ICEcoder['newFilePerms']));
}
clearstatcache();
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
$doNext = 'top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.$filemtime.'";';
// Reload file manager, rename tab & remove old file highlighting if it was a new file // Reload file manager, rename tab & remove old file highlighting if it was a new file
if (isset($_POST['newFileName']) && $_POST['newFileName']!="") { if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\',false,false,false,\'file\');'; $doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\',false,false,false,\'file\');';
@@ -203,6 +355,7 @@ if (!$error && $_GET['action']=="save") {
top.ICEcoder.previewWindowLoading = false; top.ICEcoder.previewWindowLoading = false;
try {top.ICEcoder.doPesticide();} catch(err) {}; try {top.ICEcoder.doPesticide();} catch(err) {};
try {top.ICEcoder.doStatsJS(\'save\');} catch(err) {}; try {top.ICEcoder.doStatsJS(\'save\');} catch(err) {};
try {top.ICEcoder.doResponsive();} catch(err) {};
clearInterval(top.ICEcoder.checkPreviewWindowLoadingInt); clearInterval(top.ICEcoder.checkPreviewWindowLoadingInt);
} else { } else {
top.ICEcoder.previewWindowLoading = top.ICEcoder.previewWindow.document.readyState == "loading" ? true : false; top.ICEcoder.previewWindowLoading = top.ICEcoder.previewWindow.document.readyState == "loading" ? true : false;
@@ -235,8 +388,10 @@ if (!$error && $_GET['action']=="save") {
// ====================================================== // ======================================================
} else { } else {
// Only applicable for local files
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true); $loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
$doNext = ' $fileCountInfo = getVersionsCount($fileLoc,$fileName);
$doNext .= '
var loadedFile = document.createElement("textarea"); var loadedFile = document.createElement("textarea");
loadedFile.value = "'.str_replace('"','\\\"',str_replace("\r","\\\\r",str_replace("\n","\\\\n",str_replace("</textarea>","<ICEcoder:/:textarea>",$loadedFile)))).'"; loadedFile.value = "'.str_replace('"','\\\"',str_replace("\r","\\\\r",str_replace("\n","\\\\n",str_replace("</textarea>","<ICEcoder:/:textarea>",$loadedFile)))).'";
var refreshFile = top.ICEcoder.ask("'.$t['Sorry, this file...'].'\\\n'.$file.'\\\n\\\n'.$t['Reload this file...'].'"); var refreshFile = top.ICEcoder.ask("'.$t['Sorry, this file...'].'\\\n'.$file.'\\\n\\\n'.$t['Reload this file...'].'");
@@ -248,6 +403,7 @@ if (!$error && $_GET['action']=="save") {
cM.setValue(loadedFile.value); cM.setValue(loadedFile.value);
top.ICEcoder.savedPoints[thisTab-1] = cM.changeGeneration(); top.ICEcoder.savedPoints[thisTab-1] = cM.changeGeneration();
top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "'.$filemtime.'"; top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "'.$filemtime.'";
top.ICEcoder.openFileVersions[top.ICEcoder.selectedTab-1] = "'.$fileCountInfo['count'].'";
cM.clearHistory(); cM.clearHistory();
/* Now for the new version in the diff pane */ /* Now for the new version in the diff pane */
top.ICEcoder.setSplitPane(\'on\'); top.ICEcoder.setSplitPane(\'on\');
@@ -263,7 +419,7 @@ if (!$error && $_GET['action']=="save") {
} else { } else {
$finalAction = "nothing"; $finalAction = "nothing";
$doNext = "top.ICEcoder.message('".$t['Sorry, cannot save']."\\\\n".$file."');"; $doNext .= "top.ICEcoder.message('".$t['Sorry, cannot save']."\\\\n".$file."');";
} }
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'; $doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
} }
@@ -274,15 +430,31 @@ if (!$error && $_GET['action']=="save") {
// ========== // ==========
if (!$error && $_GET['action']=="newFolder") { if (!$error && $_GET['action']=="newFolder") {
if (!$demoMode && is_writable($docRoot.$fileLoc)) { if (!$demoMode && ($ftpSite || is_writable($docRoot.$fileLoc))) {
mkdir($file, octdec($ICEcoder['newDirPerms'])); $updateFM = false;
// Reload file manager // FTP
$doNext = 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\',false,false,false,\'folder\');'; if (isset($ftpSite)) {
$ftpFilepath = ltrim($fileLoc."/".$fileName,"/");
if (!ftpMkDir($ftpConn, octdec($ICEcoder['newDirPerms']), $ftpFilepath)) {
$doNext .= 'top.ICEcoder.message("Sorry, could not create dir '.$ftpFilepath.' at '.$ftpHost.'");';
} else {
$updateFM = true;
}
// Local
} else {
mkdir($file, octdec($ICEcoder['newDirPerms']));
// Reload file manager
$updateFM = true;
}
// Update file manager on success
if ($updateFM) {
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\',false,false,false,\'folder\');';
}
$finalAction = "newFolder"; $finalAction = "newFolder";
// Run our custom processes // Run our custom processes
include_once("../processes/on-new-dir.php"); include_once("../processes/on-new-dir.php");
} else { } else {
$doNext = "top.ICEcoder.message('".$t['Sorry, cannot create...']."\\\\n".$fileLoc."');"; $doNext .= "top.ICEcoder.message('".$t['Sorry, cannot create...']."\\\\n".$fileLoc."');";
$finalAction = "nothing"; $finalAction = "nothing";
} }
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'; $doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
@@ -293,27 +465,46 @@ if (!$error && $_GET['action']=="newFolder") {
// ================ // ================
if (!$error && $_GET['action']=="move") { if (!$error && $_GET['action']=="move") {
$moved=false; if (isset($ftpSite)) {
$doNext = ""; $srcDir = ltrim(str_replace("|","/",strClean($_GET['oldFileName'])),"/");
$srcDir = $docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])); $tgtDir = ltrim($fileLoc."/".$fileName,"/");
$tgtDir = $docRoot.$fileLoc."/".$fileName; } else {
$srcDir = $docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName']));
$tgtDir = $docRoot.$fileLoc."/".$fileName;
}
if ($srcDir != $tgtDir && $fileLoc != "") { if ($srcDir != $tgtDir && $fileLoc != "") {
if (!$demoMode && is_writable($srcDir)) { if (!$demoMode && ($ftpSite || is_writable($srcDir))) {
if(rename($srcDir,$tgtDir)) { $updateFM = false;
// Reload file manager // FTP
$fileOrFolder = is_dir($docRoot.$fileLoc."/".$fileName) ? "folder" : "file"; if (isset($ftpSite)) {
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'move\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean(str_replace("|","/",$_GET['oldFileName']))).'\',false,\''.$fileOrFolder.'\');'; if (!ftpRename($ftpConn, $srcDir, $tgtDir)) {
$finalAction = "move"; $doNext .= 'top.ICEcoder.message("Sorry, could not rename '.$srcDir.' to '.$tgtDir.'");';
$moved=true; } else {
// Run our custom processes $ftpFileDirInfo = ftpGetFileInfo($ftpConn, ltrim($fileLoc,"/"), $fileName);
include_once("../processes/on-file-dir-move.php"); $fileOrFolder = $ftpFileDirInfo['type'] == "directory" ? "folder" : "file";
$updateFM = true;
}
// Local
} else {
if(rename($srcDir,$tgtDir)) {
// Is a dir or file (needed to create new item in file manager)
$fileOrFolder = is_dir($docRoot.$fileLoc."/".$fileName) ? "folder" : "file";
$updateFM = true;
}
} }
} // Update file manager on success
if (!$moved) { if ($updateFM) {
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'move\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean(str_replace("|","/",$_GET['oldFileName']))).'\',false,$fileOrFolder);';
}
$finalAction = "move";
// Run our custom processes
include_once("../processes/on-file-dir-move.php");
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot move']."\\\\n".str_replace("|","/",strClean($_GET['oldFileName']))."\\\\n\\\\n".$t['Maybe public write...']."');"; $doNext .= "top.ICEcoder.message('".$t['Sorry, cannot move']."\\\\n".str_replace("|","/",strClean($_GET['oldFileName']))."\\\\n\\\\n".$t['Maybe public write...']."');";
$finalAction = "nothing"; $finalAction = "nothing";
} }
} else { } else {
$doNext .= "";
$finalAction = "nothing"; $finalAction = "nothing";
} }
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'; $doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
@@ -324,19 +515,31 @@ if (!$error && $_GET['action']=="move") {
// ================== // ==================
if (!$error && $_GET['action']=="rename") { if (!$error && $_GET['action']=="rename") {
$renamed=false; if (!$demoMode && ($ftpSite || is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName']))))) {
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) { $updateFM = false;
if(rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName)) { // FTP
// Reload file manager if (isset($ftpSite)) {
$doNext = 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');'; $ftpFilepath = ltrim($fileLoc."/".$fileName,"/");
$finalAction = "rename"; if (!ftpRename($ftpConn, ltrim(strClean($_GET['oldFileName']),"/"), $ftpFilepath)) {
$renamed=true; $doNext .= 'top.ICEcoder.message("Sorry, could not rename '.ltrim(strClean($_GET['oldFileName']),"/").' to '.$ftpFilepath.'");';
// Run our custom processes } else {
include_once("../processes/on-file-dir-rename.php"); $updateFM = true;
}
// Local
} else {
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
$updateFM = true;
} }
} // Update file manager on success
if (!$renamed) { if ($updateFM) {
$doNext = "top.ICEcoder.message('".$t['Sorry, cannot rename']."\\\\n".strClean($_GET['oldFileName'])."\\\\n\\\\n".$t['Maybe public write...']."');"; $doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
}
$finalAction = "rename";
// Run our custom processes
include_once("../processes/on-file-dir-rename.php");
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot rename']."\\\\n".strClean($_GET['oldFileName'])."\\\\n\\\\n".$t['Maybe public write...']."');";
$finalAction = "nothing";
} }
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'; $doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
}; };
@@ -345,7 +548,7 @@ if (!$error && $_GET['action']=="rename") {
// PASTE FILE/FOLDER // PASTE FILE/FOLDER
// ================= // =================
if (!$error && $_GET['action']=="paste") { if (!isset($ftpSite) && !$error && $_GET['action']=="paste") {
$source = $file; $source = $file;
$dest = str_replace("//","/",$docRoot.$iceRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source)); $dest = str_replace("//","/",$docRoot.$iceRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source));
if (!$demoMode && is_writable(dirname($dest))) { if (!$demoMode && is_writable(dirname($dest))) {
@@ -387,12 +590,12 @@ if (!$error && $_GET['action']=="paste") {
} }
} }
// Reload file manager // Reload file manager
$doNext = 'top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.basename($dest).'\',false,false,false,\''.$fileOrFolder.'\');'; $doNext .= 'top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.basename($dest).'\',false,false,false,\''.$fileOrFolder.'\');';
$finalAction = "pasteFile"; $finalAction = "pasteFile";
// Run our custom processes // Run our custom processes
include_once("../processes/on-file-dir-paste.php"); include_once("../processes/on-file-dir-paste.php");
} else { } else {
$doNext = "top.ICEcoder.message('".$t['Sorry, cannot copy']." \\\\n".str_replace($docRoot,"",$source)."\\\\n ".$t['into']." \\\\n".str_replace($docRoot,"",$dest)."');"; $doNext .= "top.ICEcoder.message('".$t['Sorry, cannot copy']." \\\\n".str_replace($docRoot,"",$source)."\\\\n ".$t['into']." \\\\n".str_replace($docRoot,"",$dest)."');";
$finalAction = "nothing"; $finalAction = "nothing";
} }
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'; $doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
@@ -402,9 +605,8 @@ if (!$error && $_GET['action']=="paste") {
// UPLOAD FILE(S) // UPLOAD FILE(S)
// ============== // ==============
if (!$error && $_GET['action']=="upload") { if (!isset($ftpSite) && !$error && $_GET['action']=="upload") {
if (!$demoMode) { if (!$demoMode) {
$doNext = "";
class fileUploader { class fileUploader {
public function __construct($uploads) { public function __construct($uploads) {
global $docRoot,$iceRoot,$ICEcoder,$doNext; global $docRoot,$iceRoot,$ICEcoder,$doNext;
@@ -469,31 +671,54 @@ if (!$error && $_GET['action']=="upload") {
// ======================== // ========================
if (!$error && $_GET['action']=="delete") { if (!$error && $_GET['action']=="delete") {
$doNext = "";
$filesArray = explode(";",$file); // May contain more than one file here $filesArray = explode(";",$file); // May contain more than one file here
for ($i=0;$i<count($filesArray);$i++) { // FTP
$fullPath = str_replace($docRoot,"",$filesArray[$i]); if (isset($ftpSite)) {
$fullPath = str_replace($iceRoot,"",$fullPath); if (count($filesArray) == 1) {
$fullPath = $docRoot.$iceRoot.$fullPath; $ftpFileDirInfo = ftpGetFileInfo($ftpConn, ltrim($fileLoc,"/"), $fileName);
$itemType = $ftpFileDirInfo['type'] == "directory" ? "dir" : "file";
if (rtrim($fullPath,"/") == rtrim($docRoot,"/")) { $itemPath = ltrim($fileLoc."/".$fileName,"/");
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete...']."');"; if (!$demoMode && ftpDelete($ftpConn,$itemType,$itemPath)) {
} else if (!$demoMode && is_writable($fullPath)) { if ($fileLoc=="" || $fileLoc=="\\") {$fileLoc="/";};
is_dir($fullPath) // Reload file manager
? rrmdir($fullPath) $doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
: unlink($fullPath); $finalAction = "delete";
$fileName = basename($fullPath); // Run our custom processes
$fileLoc = dirname(str_replace($docRoot,"",$fullPath)); include_once("../processes/on-file-dir-delete.php");
if ($fileLoc=="" || $fileLoc=="\\") {$fileLoc="/";}; } else {
// Reload file manager $doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete']."\\\\n".$fileLoc."/".$fileName."');";
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');'; $finalAction = "nothing";
$finalAction = "delete"; }
// Run our custom processes
include_once("../processes/on-file-dir-delete.php");
} else { } else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete']."\\\\n".str_replace($docRoot,"",$fullPath)."');"; $doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete more...']."');";
$finalAction = "nothing"; $finalAction = "nothing";
} }
// Local
} else {
for ($i=0;$i<count($filesArray);$i++) {
$fullPath = str_replace($docRoot,"",$filesArray[$i]);
$fullPath = str_replace($iceRoot,"",$fullPath);
$fullPath = $docRoot.$iceRoot.$fullPath;
if (rtrim($fullPath,"/") == rtrim($docRoot,"/")) {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete...']."');";
} else if (!$demoMode && is_writable($fullPath)) {
is_dir($fullPath)
? rrmdir($fullPath)
: unlink($fullPath);
$fileName = basename($fullPath);
$fileLoc = dirname(str_replace($docRoot,"",$fullPath));
if ($fileLoc=="" || $fileLoc=="\\") {$fileLoc="/";};
// Reload file manager
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
$finalAction = "delete";
// Run our custom processes
include_once("../processes/on-file-dir-delete.php");
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete']."\\\\n".str_replace($docRoot,"",$fullPath)."');";
$finalAction = "nothing";
}
}
} }
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'; $doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
}; };
@@ -518,8 +743,7 @@ function rrmdir($dir) {
// REPLACE TEXT IN A FILE // REPLACE TEXT IN A FILE
// ====================== // ======================
if (!$error && $_GET['action']=="replaceText") { if (!isset($ftpSite) && !$error && $_GET['action']=="replaceText") {
$doNext = "";
if (!$demoMode && is_writable($file)) { if (!$demoMode && is_writable($file)) {
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true); $loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile); $newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
@@ -540,8 +764,8 @@ if (!$error && $_GET['action']=="replaceText") {
// GET CONTENTS OF REMOTE URL // GET CONTENTS OF REMOTE URL
// ========================== // ==========================
if (!$error && $_GET['action']=="getRemoteFile") { if (!isset($ftpSite) && !$error && $_GET['action']=="getRemoteFile") {
$doNext = ""; $lineNumber = max(isset($_REQUEST['lineNumber'])?intval($_REQUEST['lineNumber']):1, 1);
if ($remoteFile = toUTF8noBOM(file_get_contents($file,false,$context),true)) { if ($remoteFile = toUTF8noBOM(file_get_contents($file,false,$context),true)) {
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding // replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
$remoteFile = str_replace("\r\n", $ICEcoder["lineEnding"], $remoteFile); $remoteFile = str_replace("\r\n", $ICEcoder["lineEnding"], $remoteFile);
@@ -549,6 +773,7 @@ if (!$error && $_GET['action']=="getRemoteFile") {
$remoteFile = str_replace("\n", $ICEcoder["lineEnding"], $remoteFile); $remoteFile = str_replace("\n", $ICEcoder["lineEnding"], $remoteFile);
$doNext .= 'top.ICEcoder.newTab();'; $doNext .= 'top.ICEcoder.newTab();';
$doNext .= 'top.ICEcoder.getcMInstance().setValue(\''.str_replace("\r","",str_replace("\t","\\\\t",str_replace("\n","\\\\n",str_replace("'","\\\\'",str_replace("\\","\\\\",preg_quote($remoteFile)))))).'\');'; $doNext .= 'top.ICEcoder.getcMInstance().setValue(\''.str_replace("\r","",str_replace("\t","\\\\t",str_replace("\n","\\\\n",str_replace("'","\\\\'",str_replace("\\","\\\\",preg_quote($remoteFile)))))).'\');';
$doNext .= 'top.ICEcoder.goToLine('.$lineNumber.');';
$finalAction = "getRemoteFile"; $finalAction = "getRemoteFile";
// Run our custom processes // Run our custom processes
include_once("../processes/on-get-remote-file.php"); include_once("../processes/on-get-remote-file.php");
@@ -564,22 +789,46 @@ if (!$error && $_GET['action']=="getRemoteFile") {
// ======================= // =======================
if (!$error && $_GET['action']=="perms") { if (!$error && $_GET['action']=="perms") {
if (!$demoMode && is_writable($file)) { if (!$demoMode && ($ftpSite || is_writable($file))) {
chmod($file,octdec(numClean($_GET['perms']))); $updateFM = false;
// Reload file manager // FTP
$doNext = 'top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');'; if (isset($ftpSite)) {
$ftpFilepath = ltrim($fileLoc."/".$fileName,"/");
if (!ftpPerms($ftpConn, octdec(numClean($_GET['perms'])), $ftpFilepath)) {
$doNext .= 'top.ICEcoder.message("Sorry, could not set perms on '.$ftpFilepath.' at '.$ftpHost.'");';
} else {
$updateFM = true;
}
// Local
} else {
chmod($file,octdec(numClean($_GET['perms'])));
// Reload file manager
$updateFM = true;
}
// Update file manager on success
if ($updateFM) {
$doNext .= 'top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
}
$finalAction = "perms"; $finalAction = "perms";
// Run our custom processes // Run our custom processes
include_once("../processes/on-file-dir-perms.php"); include_once("../processes/on-file-dir-perms.php");
} else { } else {
$finalAction = "nothing"; $finalAction = "nothing";
$doNext = "top.ICEcoder.message('".$t['Sorry, cannot change...']." \\n".strClean($file)."');"; $doNext .= "top.ICEcoder.message('".$t['Sorry, cannot change...']." \\n".strClean($file)."');";
} }
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'; $doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
} };
// ====================
// CHECK FOR A FILE/DIR
// ====================
if (!isset($ftpSite) && !$error && $_GET['action']=="checkExists") {
// This action is called under seperate AJAX call and the responseText object stored in top.ICEcoder.lastFileDirCheckStatusObj
// Nothing really done here though, we do something with the responseText
$finalAction = "checkExists";
$doNext .= 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
};
// =================== // ===================
// JSON DATA TO RETURN // JSON DATA TO RETURN
@@ -589,20 +838,43 @@ if (!$error && $_GET['action']=="perms") {
if (!isset($filemtime)) { if (!isset($filemtime)) {
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000"; $filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
} }
// Set $timeStart, use 0 if not available
$timeStart = isset($_POST["timeStart"]) ? $_POST["timeStart"] : 0;
if (isset($ftpSite)) {
// Get info on dir/file now
$ftpFileDirInfo = ftpGetFileInfo($ftpConn, ltrim($fileLoc,"/"), $fileName);
// End the connection
ftpEnd();
// Then set info
$itemAbsPath = $ftpRoot.$fileLoc.'/'.$fileName;
$itemPath = dirname($ftpRoot.$fileLoc.'/'.$fileName);
$itemBytes = $ftpFileDirInfo['size'];
$itemType = (isset($ftpFileDirInfo['type']) ? ($ftpFileDirInfo['type'] == "directory" ? "dir" : "file") : "unknown");
$itemExists = (isset($ftpFileDirInfo['type']) ? "true" : "false");
} else {
$itemAbsPath = $file;
$itemPath = dirname($file);
$itemBytes = filesize($file);
$itemType = (file_exists($file) ? (is_dir($file) ? "dir" : "file") : "unknown");
$itemExists = (file_exists($file) ? "true" : "false");
}
echo '{ echo '{
"file": { "file": {
"absPath": "'.$file.'", "absPath": "'.$itemAbsPath.'",
"relPath": "'.$fileLoc.'/'.$fileName.'", "relPath": "'.$fileLoc.'/'.$fileName.'",
"name": "'.$fileName.'", "name": "'.$fileName.'",
"path": "'.dirname($file).'", "path": "'.$itemPath.'",
"bytes": "'.filesize($file).'", "bytes": "'.$itemBytes.'",
"modifiedDT": "'.$filemtime.'" "modifiedDT": "'.$filemtime.'",
"type": "'.$itemType.'",
"exists": '.$itemExists.'
}, },
"action": { "action": {
"initial" : "'.$_GET["action"].'", "initial" : "'.$_GET["action"].'",
"final" : "'.$finalAction.'", "final" : "'.$finalAction.'",
"timeStart": '.$_POST["timeStart"].', "timeStart": '.$timeStart.',
"timeEnd": 0, "timeEnd": 0,
"timeTaken": 0, "timeTaken": 0,
"csrf": "'.$_GET["csrf"].'", "csrf": "'.$_GET["csrf"].'",

View File

@@ -1,6 +1,7 @@
<?php <?php
include("headers.php"); include("headers.php");
include("settings.php"); include("settings.php");
include("ftp-control.php");
$t = $text['file-control']; $t = $text['file-control'];
?> ?>
<?php if ($_SESSION['githubDiff']) { ?> <?php if ($_SESSION['githubDiff']) { ?>
@@ -9,9 +10,6 @@ $t = $text['file-control'];
<?php ;}; ?> <?php ;}; ?>
<script> <script>
<?php <?php
// Get the save type if any
$saveType = isset($_GET['saveType']) ? strClean($_GET['saveType']) : "";
// Establish the filename/new filename // Establish the filename/new filename
$file = str_replace("|","/",strClean( $file = str_replace("|","/",strClean(
isset($_POST['newFileName']) && $_POST['newFileName']!="" isset($_POST['newFileName']) && $_POST['newFileName']!=""
@@ -54,7 +52,7 @@ for ($i=0; $i<count($allFiles); $i++) {
// Die if the file requested isn't something we expect // Die if the file requested isn't something we expect
if( if(
// A local folder that isn't the doc root or starts with the doc root // A local folder that isn't the doc root or starts with the doc root
($_GET['action']!="getRemoteFile" && ($_GET['action']!="getRemoteFile" && !isset($ftpSite) &&
rtrim($allFiles[$i],"/") !== rtrim($docRoot,"/") && rtrim($allFiles[$i],"/") !== rtrim($docRoot,"/") &&
strpos(realpath(rtrim(dirname($allFiles[$i]),"/")),realpath(rtrim($docRoot,"/"))) !== 0 strpos(realpath(rtrim(dirname($allFiles[$i]),"/")),realpath(rtrim($docRoot,"/"))) !== 0
) || ) ||
@@ -69,10 +67,10 @@ for ($i=0; $i<count($allFiles); $i++) {
if ($_GET['action']=="load") { if ($_GET['action']=="load") {
echo 'action="load";'; echo 'action="load";';
$lineNumber = max(isset($_REQUEST['lineNumber'])?intval($_REQUEST['lineNumber']):1, 1); $lineNumber = max(isset($_REQUEST['lineNumber'])?intval($_REQUEST['lineNumber']):1, 1);
if (file_exists($file)) { if (isset($ftpSite) || file_exists($file)) {
$finfo = "text"; $finfo = "text";
// Determine what to do based on mime type // Determine what to do based on mime type
if (function_exists('finfo_open')) { if (!isset($ftpSite) && function_exists('finfo_open')) {
$finfoMIME = finfo_open(FILEINFO_MIME); $finfoMIME = finfo_open(FILEINFO_MIME);
$finfo = finfo_file($finfoMIME, $file); $finfo = finfo_file($finfoMIME, $file);
finfo_close($finfoMIME); finfo_close($finfoMIME);
@@ -85,8 +83,26 @@ if ($_GET['action']=="load") {
if (strpos($finfo,"text")===0 || strpos($finfo, "application/xml")===0 || strpos($finfo,"empty")!==false) { if (strpos($finfo,"text")===0 || strpos($finfo, "application/xml")===0 || strpos($finfo,"empty")!==false) {
echo 'fileType="text";'; echo 'fileType="text";';
echo 'top.ICEcoder.shortURL = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";'; echo 'top.ICEcoder.shortURL = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
// Get file over FTP?
if (isset($ftpSite)) {
ftpStart();
// Show user warning if no good connection
if (!$ftpConn || !$ftpLogin) {
die('alert("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>');
exit;
}
// Get our file contents and close the FTP connection
$loadedFile = toUTF8noBOM(ftpGetContents($ftpConn, $ftpRoot.$fileLoc."/".$fileName, $ftpMode));
ftpEnd();
// Get local file
} else {
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true); $loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile).'</textarea><script>'; }
$encoding=ini_get("default_charset");
if($encoding=="")
$encoding="UTF-8";
echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile,ENT_COMPAT,$encoding).'</textarea><script>';
// Run our custom processes // Run our custom processes
include_once("../processes/on-file-load.php"); include_once("../processes/on-file-load.php");
} else if (strpos($finfo,"image")===0) { } else if (strpos($finfo,"image")===0) {
@@ -109,7 +125,7 @@ if (action=="load") {
console.log('<?php echo $t['There was a...']; ?>'); console.log('<?php echo $t['There was a...']; ?>');
window.location.reload(true); window.location.reload(true);
<?php <?php
if (file_exists($file)) { if (isset($ftpSite) || file_exists($file)) {
?> ?>
} else { } else {
top.ICEcoder.loadingFile = true; top.ICEcoder.loadingFile = true;
@@ -122,7 +138,7 @@ if (action=="load") {
top.ICEcoder.setLayout(); top.ICEcoder.setLayout();
top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance); top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance);
<?php if ($_SESSION['githubDiff']) { ?> <?php if (!isset($ftpSite) && $_SESSION['githubDiff']) { ?>
// If we're in GitHub diff mode and have a split pane display, get the content for the diff pane // If we're in GitHub diff mode and have a split pane display, get the content for the diff pane
if (top.ICEcoder.githubDiff && top.ICEcoder.splitPane) { if (top.ICEcoder.githubDiff && top.ICEcoder.splitPane) {
<?php <?php
@@ -169,11 +185,16 @@ if (action=="load") {
top.ICEcoder['cMActiveLinecM'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].addLineClass(0, "background", "cm-s-activeLine"); top.ICEcoder['cMActiveLinecM'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].addLineClass(0, "background", "cm-s-activeLine");
top.ICEcoder.nextcMInstance++; top.ICEcoder.nextcMInstance++;
top.ICEcoder.openFileMDTs.push('<?php echo $serverType=="Linux" ? filemtime($file) : "1000000"; ?>'); top.ICEcoder.openFileMDTs.push('<?php echo $serverType=="Linux" ? filemtime($file) : "1000000"; ?>');
top.ICEcoder.openFileVersions.push(<?php
$fileCountInfo = getVersionsCount($fileLoc,$fileName);
echo $fileCountInfo['count'];?>);
top.ICEcoder.updateVersionsDisplay();
for (var i=0; i<cM.lineCount(); i++) { for (var i=0; i<cM.lineCount(); i++) {
top.ICEcoder.content.contentWindow.CodeMirror.doFold(cM.getLine(i).indexOf("{")>-1?"brace":"xml",null,"+","-",true)(cM, i); top.ICEcoder.content.contentWindow.CodeMirror.doFold(cM.getLine(i).indexOf("{")>-1?"brace":"xml",null,"+","-",true)(cM, i);
} }
top.ICEcoder.loadingFile = false;
top.ICEcoder.goToLine(<?php echo $lineNumber; ?>); top.ICEcoder.goToLine(<?php echo $lineNumber; ?>);
top.ICEcoder.loadingFile = false;
<?php <?php
;}; ;};
?> ?>
@@ -185,7 +206,7 @@ if (action=="load") {
top.document.getElementById('blackMask').style.visibility = "visible"; top.document.getElementById('blackMask').style.visibility = "visible";
top.document.getElementById('mediaContainer').innerHTML = top.document.getElementById('mediaContainer').innerHTML =
"<canvas id=\"canvasPicker\" width=\"1\" height=\"1\" style=\"position: absolute; margin: 10px 0 0 10px; cursor: crosshair\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></canvas>" + "<canvas id=\"canvasPicker\" width=\"1\" height=\"1\" style=\"position: absolute; margin: 10px 0 0 10px; cursor: crosshair\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></canvas>" +
"<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url('images/checkerboard.png')\" onLoad=\"reducedImgMsg = (this.naturalWidth > 700 || this.naturalHeight > 500) ? ', <?php echo $t['displayed at']; ?> ' + this.width + ' x ' + this.height : ''; document.getElementById('imgInfo').innerHTML += ' (' + this.naturalWidth + ' x ' + this.naturalHeight + reducedImgMsg + ')'; top.ICEcoder.drawCanvasImage(this)\"><br>" + "<img src=\"<?php echo (isset($ftpSite) ? $ftpSite : "").$fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url('images/checkerboard.png')\" onLoad=\"reducedImgMsg = (this.naturalWidth > 700 || this.naturalHeight > 500) ? ', <?php echo $t['displayed at']; ?> ' + this.width + ' x ' + this.height : ''; document.getElementById('imgInfo').innerHTML += ' (' + this.naturalWidth + ' x ' + this.naturalHeight + reducedImgMsg + ')'; top.ICEcoder.initCanvasImage(this); top.ICEcoder.interactCanvasImage(this)\"><br>" +
"<div class=\"whiteGlow\" style=\"display: inline-block; margin-top: -10px; border: solid 10px #fff; color: #000; background-color: #fff\" id=\"imgInfo\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\">" + "<div class=\"whiteGlow\" style=\"display: inline-block; margin-top: -10px; border: solid 10px #fff; color: #000; background-color: #fff\" id=\"imgInfo\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\">" +
"<b><?php echo $fileLoc."/".$fileName;?></b>" + "<b><?php echo $fileLoc."/".$fileName;?></b>" +
"</div><br>" + "</div><br>" +
@@ -193,11 +214,11 @@ if (action=="load") {
"<input type=\"text\" id=\"rgbMouseXY\" style=\"border: 1px solid #888; margin-right: 10px; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" + "<input type=\"text\" id=\"rgbMouseXY\" style=\"border: 1px solid #888; margin-right: 10px; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
"<input type=\"text\" id=\"hex\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" + "<input type=\"text\" id=\"hex\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
"<input type=\"text\" id=\"rgb\" style=\"border: 1px solid #888; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>"; "<input type=\"text\" id=\"rgb\" style=\"border: 1px solid #888; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>";
top.document.getElementById('floatingContainer').style.background = "#fff url('<?php echo $fileLoc."/".$fileName;?>') no-repeat 0 0";
} }
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0); top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
} }
</script>
// Finally, switch mode in case we have saved, renamed file etc // Finally, switch mode in case we have saved, renamed file etc
top.ICEcoder.switchMode(); top.ICEcoder.switchMode();

View File

@@ -1,6 +1,6 @@
/* Additional file types */ /* Additional file types */
.fileManager LI.ext-c:before {background-position: -48px 0} .fileManager LI.ext-c:before {background-position: -48px 0}
.fileManager LI.ext-cpp:before {background-position: -64px 0} .fileManager LI.ext-cpp:before, .fileManager LI.ext-ino:before {background-position: -64px 0}
.fileManager LI.ext-cs:before {background-position: -80px 0} .fileManager LI.ext-cs:before {background-position: -80px 0}
.fileManager LI.ext-coffee:before {background-position: -96px 0} .fileManager LI.ext-coffee:before {background-position: -96px 0}
.fileManager LI.ext-css:before {background-position: -112px 0} .fileManager LI.ext-css:before {background-position: -112px 0}

115
lib/ftp-control.php Normal file
View File

@@ -0,0 +1,115 @@
<?php
// Start a FTP connection
function ftpStart() {
global $ftpConn, $ftpLogin, $ftpHost, $ftpUser, $ftpPass, $ftpPasv;
// Establish connection, login and maybe use pasv
$ftpConn = ftp_connect($ftpHost);
$ftpLogin = ftp_login($ftpConn, $ftpUser, $ftpPass);
if ($ftpPasv) {
ftp_pasv($ftpConn, true);
}
}
// End a FTP connection
function ftpEnd() {
global $ftpConn;
ftp_close($ftpConn);
}
// Get dir/file lists (simple and detailed) from FTP detailed rawlist response
function ftpGetList($ftpConn, $directory = '.') {
$simpleList = $detailedList = array();
// If we have a FTP rawlist to work with
if (is_array($rows = @ftp_rawlist($ftpConn, $directory))) {
foreach ($rows as $row) {
// Split row up by spaces and set keys on $item array
$chunks = preg_split("/\s+/", $row);
list($item['rights'], $item['number'], $item['user'], $item['group'], $item['size'], $item['month'], $item['day'], $item['time']) = $chunks;
// Also set if this is a dir or file
$item['type'] = $chunks[0]{0} === 'd' ? 'directory' : 'file';
// Splice the array and finally work out $simpleList and $detailedList
array_splice($chunks, 0, 8);
$detailedList[implode(" ", $chunks)] = $item;
$simpleList[] = implode(" ", $chunks);
}
// Return simple array list and detailed items list also
return array('simpleList' => $simpleList, 'detailedList' => $detailedList);
}
return false;
}
// Get detailed info on a file from returned info from ftpGetList
function ftpGetFileInfo($ftpConn, $directory = '.', $fileName) {
// Get both sets of arrays back and get our detailed list
$ftpListArrays = ftpGetList($ftpConn, $directory);
$detailedList = $ftpListArrays['detailedList'];
// Now get the file info for our file
$fileInfo = $detailedList[$fileName];
// Return the info
return $fileInfo;
}
// Get contents over FTP
function ftpGetContents($ftpConn, $filepath, $ftpMode) {
// Create temp handler, this type needed for extended char set
$tempHandle = fopen('php://temp', 'r+');
// Get file from FTP assuming that it exists
ftp_fget($ftpConn, $tempHandle, $filepath, $ftpMode, 0);
// Return our content
return stream_get_contents($tempHandle, -1, 0);
}
// Write file contents over FTP
function ftpWriteFile($ftpConn, $filepath, $contents, $ftpMode) {
// Create temp handler, this type needed for extended char set
$tempHandle = fopen('php://temp', 'r+');
// Write contents to handle and rewind head
fwrite($tempHandle, $contents);
rewind($tempHandle);
// Write our content and return true/false
return ftp_fput($ftpConn, $filepath, $tempHandle, $ftpMode, 0);
}
// Make a new dir over FTP
function ftpMkDir($ftpConn, $perms, $dir) {
// Create the new dir
if (!ftp_mkdir($ftpConn, $dir)) {
return false;
} else {
// Also then set perms (we must be able to do that if we created dir, so can always return true)
ftpPerms($ftpConn, $perms, $dir);
return true;
}
}
// Rename a dir/dile over FTP
function ftpRename($ftpConn, $oldPath, $newPath) {
// Return success status of rename
return ftp_rename($ftpConn, $oldPath, $newPath);
}
// Change dir/file perms over FTP
function ftpPerms($ftpConn, $perms, $filePath) {
// Return success status of perms change
return ftp_chmod($ftpConn, $perms, $filePath);
}
// Delete dir/file over FTP
function ftpDelete($ftpConn, $type, $path) {
if ($type == "file") {
// Delete our file and return true/false
return ftp_delete($ftpConn, $path);
} else {
// Delete our dir and return true/false
return ftp_rmdir($ftpConn, $path);
}
}
?>

View File

@@ -2,6 +2,7 @@
if (!isset($ICEcoder['root'])) { if (!isset($ICEcoder['root'])) {
include("headers.php"); include("headers.php");
include("settings.php"); include("settings.php");
include("ftp-control.php");
} }
if (!$_SESSION['loggedIn']) { if (!$_SESSION['loggedIn']) {
@@ -26,7 +27,7 @@ $t = $text['get-branch'];
<body> <body>
<?php <?php
// Need to get dir contents recursively? (Used by GitHub diff mode) // Need to get dir contents recursively? (Used by GitHub diff mode)
if ($_SESSION['githubDiff']) { if (!isset($ftpSite) && $_SESSION['githubDiff']) {
// Function to sort given values alphabetically // Function to sort given values alphabetically
function alphasort($a, $b) { function alphasort($a, $b) {
return strcmp($a->getPathname(), $b->getPathname()); return strcmp($a->getPathname(), $b->getPathname());
@@ -120,19 +121,44 @@ $location = str_replace("|","/",$_GET['location']);
if ($location=="/") {$location = "";}; if ($location=="/") {$location = "";};
$dirArray = $filesArray = $finalArray = array(); $dirArray = $filesArray = $finalArray = array();
$finalArray = scanDir($scanDir.$location);
// Get dir/file list over FTP
if (isset($ftpSite)) {
ftpStart();
// Show user warning if no good connection
if (!$ftpConn || !$ftpLogin) {
die('<script>top.ICEcoder.message("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");</script>');
exit;
}
// Get our simple and detailed lists and close the FTP connection
$ftpList = ftpGetList($ftpConn, $ftpRoot.$location);
$finalArray = $ftpList['simpleList'];
$ftpItems = $ftpList['detailedList'];
ftpEnd();
// or get local list
} else {
$finalArray = scanDir($scanDir.$location);
}
foreach($finalArray as $entry) { foreach($finalArray as $entry) {
$canAdd = true; $canAdd = true;
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) { for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
if($_SESSION['bannedFiles'][$i] != "" && strpos($entry,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;} if($_SESSION['bannedFiles'][$i] != "" && strpos($entry,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
} }
if ($docRoot.$iceRoot.$location."/".$entry == $docRoot.$ICEcoderDir) { // Only applicable for local dir, ignoring ICEcoder's dir
if (!isset($ftpSite) && $docRoot.$iceRoot.$location."/".$entry == $docRoot.$ICEcoderDir) {
$canAdd = false; $canAdd = false;
} }
if ($entry != "." && $entry != ".." && $canAdd) { if ($entry != "." && $entry != ".." && $canAdd) {
is_dir($docRoot.$iceRoot.$location."/".$entry) if (!isset($ftpSite)) {
? array_push($dirArray,$location."/".$entry) is_dir($docRoot.$iceRoot.$location."/".$entry)
: array_push($filesArray,$location."/".$entry); ? array_push($dirArray,$location."/".$entry)
: array_push($filesArray,$location."/".$entry);
} else {
$ftpItems[$entry]['type'] == "directory"
? array_push($dirArray,$location."/".$entry)
: array_push($filesArray,$location."/".$entry);
}
} }
} }
natcasesort($dirArray); natcasesort($dirArray);
@@ -141,7 +167,11 @@ natcasesort($filesArray);
$finalArray = array_merge($dirArray,$filesArray); $finalArray = array_merge($dirArray,$filesArray);
for ($i=0;$i<count($finalArray);$i++) { for ($i=0;$i<count($finalArray);$i++) {
$fileFolderName = str_replace("\\","/",$finalArray[$i]); $fileFolderName = str_replace("\\","/",$finalArray[$i]);
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file"; if (!isset($ftpSite)) {
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
} else {
$type = $ftpItems[basename($fileFolderName)]['type'] == "directory" ? "folder" : "file";
}
if ($type=="file") { if ($type=="file") {
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers) // Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION); $ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
@@ -161,7 +191,25 @@ for ($i=0;$i<count($finalArray);$i++) {
(($type == "folder")?" top.ICEcoder.openCloseDir(this,$loadParam);":""). (($type == "folder")?" top.ICEcoder.openCloseDir(this,$loadParam);":"").
" if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".xssClean(basename($fileFolderName),"html")."</span> "; " if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".xssClean(basename($fileFolderName),"html")."</span> ";
$thisPermVal = $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : ''; if (!isset($ftpSite)) {
$thisPermVal = $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : '';
} else {
// Work out perms value
$thisPermVal = 0;
$r = $ftpItems[basename($fileFolderName)]['rights'];
// Owner
$thisPermVal += substr($r,1,1) == "r" ? 400 : 0;
$thisPermVal += substr($r,2,1) == "w" ? 200 : 0;
$thisPermVal += substr($r,3,1) == "x" ? 100 : 0;
// Group
$thisPermVal += substr($r,4,1) == "r" ? 40 : 0;
$thisPermVal += substr($r,5,1) == "w" ? 20 : 0;
$thisPermVal += substr($r,6,1) == "x" ? 10 : 0;
// Public
$thisPermVal += substr($r,7,1) == "r" ? 4 : 0;
$thisPermVal += substr($r,8,1) == "w" ? 2 : 0;
$thisPermVal += substr($r,9,1) == "x" ? 1 : 0;
}
$permColors = $thisPermVal == 777 ? 'background: #800; color: #eee' : 'color: #888'; $permColors = $thisPermVal == 777 ? 'background: #800; color: #eee' : 'color: #888';
echo '<span style="'.$permColors.'; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">'; echo '<span style="'.$permColors.'; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">';
echo $thisPermVal; echo $thisPermVal;
@@ -170,7 +218,7 @@ for ($i=0;$i<count($finalArray);$i++) {
echo ' </div>'; echo ' </div>';
if ($_SESSION['githubDiff']) { if (!isset($ftpSite) && $_SESSION['githubDiff']) {
// Show the loading screen until we're done comparing files with GitHub // Show the loading screen until we're done comparing files with GitHub
echo "<script>setTimeout(function(){top.ICEcoder.showHide('show',top.get('loadingMask'));},4)</script>"; echo "<script>setTimeout(function(){top.ICEcoder.showHide('show',top.get('loadingMask'));},4)</script>";
$i=0; $i=0;
@@ -409,7 +457,7 @@ if ($_SESSION['githubDiff']) {
// If we're not in githubDiff mode, show files here // If we're not in githubDiff mode, show files here
if (folderContent.indexOf('<ul')>-1 || folderContent.indexOf('<li')>-1) { if (folderContent.indexOf('<ul')>-1 || folderContent.indexOf('<li')>-1) {
<?php if (!$_SESSION['githubDiff']) {echo 'showFiles();';};?> <?php if (isset($ftpSite) || !$_SESSION['githubDiff']) {echo 'showFiles();';};?>
} else { } else {
<?php <?php
$iceGithubLocalPaths = $ICEcoder["githubLocalPaths"]; $iceGithubLocalPaths = $ICEcoder["githubLocalPaths"];

View File

@@ -39,13 +39,11 @@ $t = $text['help'];
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> s</span> <span class="shortcut"><?php echo $t['Wrap with span'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> s</span> <span class="shortcut"><?php echo $t['Wrap with span'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> p</span> <span class="shortcut"><?php echo $t['Wrap unwrap p'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> p</span> <span class="shortcut"><?php echo $t['Wrap unwrap p'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> a</span> <span class="shortcut"><?php echo $t['Wrap unwrap a'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> a</span> <span class="shortcut"><?php echo $t['Wrap unwrap a'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> b</span> <span class="shortcut"><?php echo $t['Wrap unwrap b'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> i</span> <span class="shortcut"><?php echo $t['Wrap unwrap i'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> g</span> <span class="shortcut"><?php echo $t['Wrap unwrap strong'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> e</span> <span class="shortcut"><?php echo $t['Wrap unwrap em'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> 8</span> <span class="shortcut"><?php echo $t['Wrap unwrap li'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> 1, 2 <?php echo $t['or'];?> 3</span> <span class="shortcut"><?php echo $t['Wrap unwrap h1...'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> 1, 2 <?php echo $t['or'];?> 3</span> <span class="shortcut"><?php echo $t['Wrap unwrap h1...'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> Enter</span> <span class="shortcut"><?php echo $t['End line with...'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> Enter</span> <span class="shortcut"><?php echo $t['End line with...'];?></span><br><br>
<h2><?php echo $t['On Tabs'];?></h2>
<span class="key"><?php echo $t['Middle click'];?></span> <span class="shortcut"><?php echo $t['Close tab'];?></span><br>
</div> </div>
<div style="display: inline-block; width: 385px"> <div style="display: inline-block; width: 385px">
@@ -66,17 +64,16 @@ $t = $text['help'];
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> -</span> <span class="shortcut"><?php echo $t['Close current tab'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> -</span> <span class="shortcut"><?php echo $t['Close current tab'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> o</span> <span class="shortcut"><?php echo $t['Open file prompt'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> o</span> <span class="shortcut"><?php echo $t['Open file prompt'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> f</span> <span class="shortcut"><?php echo $t['Find'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> f</span> <span class="shortcut"><?php echo $t['Find'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> g</span> <span class="shortcut"><?php echo $t['Focus on Go...'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> g</span> <span class="shortcut"><?php echo $t['Previous'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> l</span> <span class="shortcut"><?php echo $t['Focus on Go...'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> s</span> <span class="shortcut"><?php echo $t['Save'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> s</span> <span class="shortcut"><?php echo $t['Save'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Shift <span class="plus">+</span> s</span> <span class="shortcut"><?php echo $t['Save as'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Shift <span class="plus">+</span> s</span> <span class="shortcut"><?php echo $t['Save as'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Enter</span> <span class="shortcut"><?php echo $t['View webpage'];?> <span class="info" title="Popups need to be enabled">[?]</span></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Enter</span> <span class="shortcut"><?php echo $t['View webpage'];?> <span class="info" title="Popups need to be enabled">[?]</span></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> `</span> <span class="shortcut"><?php echo $t['Contract expand file...'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> `</span> <span class="shortcut"><?php echo $t['Contract expand file...'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> .</span> <span class="shortcut"><?php echo $t['Fold unfold current...'];?></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> .</span> <span class="shortcut"><?php echo $t['Fold unfold current...'];?></span><br>
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> &larr; / &rarr;</span> <span class="shortcut">Focus on file manager / content<!--<?php echo $t['Refocus on document'];?>//--></span><br> <span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> &larr; / &rarr;</span> <span class="shortcut">Focus on file manager / content<!--<?php echo $t['Refocus on document'];?>//--></span><br>
<span class="key">Esc</span> <span class="shortcut"><?php echo $t['Cancel tasks'];?></span><br><br> <span class="key">Esc</span> <span class="shortcut"><?php echo $t['Cancel tasks'];?></span><br>
<h2><?php echo $t['On Tabs'];?></h2>
<span class="key"><?php echo $t['Middle click'];?></span> <span class="shortcut"><?php echo $t['Close tab'];?></span><br>
</div> </div>
</body> </body>

View File

@@ -22,7 +22,7 @@ body {overflow: hidden;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
background-color: #222; background-color: #1d1d1b;
} }
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px} h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
@@ -31,6 +31,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
.blackMask {position: fixed; display: table; width: 100%; height: 100%; top: 0; left: 0; visibility: hidden; background-color: rgba(0,0,0,0.8); text-align: center; z-index: 100} .blackMask {position: fixed; display: table; width: 100%; height: 100%; top: 0; left: 0; visibility: hidden; background-color: rgba(0,0,0,0.8); text-align: center; z-index: 100}
.blackMask .popupVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center} .blackMask .popupVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
.popupVCenter .popup {#position: relative; #top: -50%; text-align: center; color: #fff; font-size: 10px} .popupVCenter .popup {#position: relative; #top: -50%; text-align: center; color: #fff; font-size: 10px}
.floatingContainer {position: absolute; top: 0; left: 0; width: 55px; height: 55px; visibility: hidden; border: solid 1px #444; image-rendering: pixelated}
.floatingContainer:before {position: absolute; display: inline-block; width: 3px; height: 3px; left: 25px; top: 25px; content: ''; border: solid 1px #b00}
.whiteGlow {box-shadow: 0 0 8px 2px rgba(255,255,255,0.6)} .whiteGlow {box-shadow: 0 0 8px 2px rgba(255,255,255,0.6)}
.spinner {width: 50px; height: 50px; margin: 20px auto; background: #fff; .spinner {width: 50px; height: 50px; margin: 20px auto; background: #fff;
@@ -79,7 +81,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
.files .options .optionsList a:hover {color: #fff; cursor: pointer} .files .options .optionsList a:hover {color: #fff; cursor: pointer}
.files input:focus, .findReplace input:focus, .findReplace select:focus, .password:focus {outline: 0; box-shadow: 0 0 10px 1px rgba(0,198,255,0.7)} .files input:focus, .findReplace input:focus, .findReplace select:focus, .password:focus {outline: 0; box-shadow: 0 0 10px 1px rgba(0,198,255,0.7)}
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer} .files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
.files .button:hover {background-color: #222; color: #eee} .files .button:hover {background-color: #1d1d1b; color: #eee}
.files .frame {display: inline-block; width: 250px; margin-top: 24px} .files .frame {display: inline-block; width: 250px; margin-top: 24px}
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 4px 12px 1px 12px; opacity: 0; .files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 4px 12px 1px 12px; opacity: 0;
transition: opacity 0.2s; transition: opacity 0.2s;
@@ -107,7 +109,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
.tabsBar .newTab {position: absolute; display: inline-block; height: 15px; padding: 4px 7px 3px 7px; background: #ddd; cursor: pointer; z-index: 0; .tabsBar .newTab {position: absolute; display: inline-block; height: 15px; padding: 4px 7px 3px 7px; background: #ddd; cursor: pointer; z-index: 0;
transition: left 0.15s ease-in-out; transition: left 0.15s ease-in-out;
} }
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #141612} .editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #1d1d1b}
.findBar .findReplace {position: absolute; padding-top: 2px; z-index: 1} .findBar .findReplace {position: absolute; padding-top: 2px; z-index: 1}
.findReplace .selectWrapper {position: relative; display: inline-block} .findReplace .selectWrapper {position: relative; display: inline-block}
.findReplace .selectWrapper select {position: relative; padding: 1px; border: 0; background: url('../images/select-arrow.gif') no-repeat right #444; color: #fff; font-size: 10px; height: 16px; .findReplace .selectWrapper select {position: relative; padding: 1px; border: 0; background: url('../images/select-arrow.gif') no-repeat right #444; color: #fff; font-size: 10px; height: 16px;
@@ -133,8 +135,9 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
.findBar .bug {position: fixed; display: inline-block; width: 16px; height: 16px; right: 16px; top: 48px; background: url('../images/bug-reporting-icons.png') 0 0 no-repeat; cursor: pointer; background-position: 0 0} .findBar .bug {position: fixed; display: inline-block; width: 16px; height: 16px; right: 16px; top: 48px; background: url('../images/bug-reporting-icons.png') 0 0 no-repeat; cursor: pointer; background-position: 0 0}
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden} .editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 1} .footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.15); left: 0; z-index: 1}
.footer .nesting {position: absolute; display: inline-block; padding: 5px; margin-top: 10px; left: 260px; border-radius: 5px; background-color: #0b0; cursor: default} .footer .nesting {position: absolute; display: inline-block; padding: 5px; margin-top: 10px; left: 260px; border-radius: 5px; background-color: #0b0; cursor: default}
.footer .versionsDisplay {position: absolute; display: inline-block; padding: 5px; margin-top: 3px; left: 275px; color: #fff; font-weight: bold; cursor: pointer}
.footer .splitPaneControls {position: absolute; display: inline-block; width: 50px; text-align: center; padding: 6px} .footer .splitPaneControls {position: absolute; display: inline-block; width: 50px; text-align: center; padding: 6px}
.footer .splitPaneControls .off {display: inline-block; width: 18px; height: 18px; margin-right: 10px; background: url('../images/split-pane-controls.gif') no-repeat 0 0; cursor: pointer} .footer .splitPaneControls .off {display: inline-block; width: 18px; height: 18px; margin-right: 10px; background: url('../images/split-pane-controls.gif') no-repeat 0 0; cursor: pointer}
.footer .splitPaneControls .on {display: inline-block; width: 19px; height: 18px; background: url('../images/split-pane-controls.gif') no-repeat -18px 0; cursor: pointer} .footer .splitPaneControls .on {display: inline-block; width: 19px; height: 18px; background: url('../images/split-pane-controls.gif') no-repeat -18px 0; cursor: pointer}
@@ -151,12 +154,6 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
.screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center} .screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
.screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline} .screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline}
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb} .screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
.screenCenter .trialBarContainer {display: inline-block; width: 170px; height: 8px; color: #bbb; background: #0b0b0b; text-align: right; margin-bottom: 40px}
.screenCenter .trialBarRemaining {display: inline-block; width: 170px; height: 8px; background: rgba(0,198,255,0.7); box-shadow: 0 0 10px 1px rgba(0,198,255,0.7);
transition: width 0.7s ease-in-out;
}
.screenCenter .trialBarText {text-align: center}
.screenCenter .trialBarText a {color: #fff; text-decoration: none}
.screenCenter .text {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888} .screenCenter .text {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888}
.screenCenter .text input {margin-top: 1px} .screenCenter .text input {margin-top: 1px}
.screenCenter .text a {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888; text-decoration: none} .screenCenter .text a {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888; text-decoration: none}

View File

@@ -19,6 +19,7 @@ var ICEcoder = {
canSwitchTabs: true, // Stops switching of tabs when trying to close canSwitchTabs: true, // Stops switching of tabs when trying to close
openFiles: [], // Array of open file URLs openFiles: [], // Array of open file URLs
openFileMDTs: [], // Array of open file modification datetimes openFileMDTs: [], // Array of open file modification datetimes
openFileVersions: [], // Array of open file version counts
cMInstances: [], // List of CodeMirror instance no's cMInstances: [], // List of CodeMirror instance no's
nextcMInstance: 1, // Next available CodeMirror instance no nextcMInstance: 1, // Next available CodeMirror instance no
selectedFiles: [], // Array of selected files selectedFiles: [], // Array of selected files
@@ -29,7 +30,7 @@ var ICEcoder = {
draggingTab: false, // If we're dragging a tab draggingTab: false, // If we're dragging a tab
draggingWithKey: false, // The key that's down while dragging, false if no key draggingWithKey: false, // The key that's down while dragging, false if no key
tabLeftPos: [], // Array of left positions of tabs inside content area tabLeftPos: [], // Array of left positions of tabs inside content area
tabBGcurrent: '#141414', // BG of current tab tabBGcurrent: '#1d1d1b', // BG of current tab
tabBGselected: '#49d', // BG of selected tab tabBGselected: '#49d', // BG of selected tab
tabBGopen: '#c3c3c3', // BG of open tab tabBGopen: '#c3c3c3', // BG of open tab
tabBGnormal: 'transparent', // BG of normal tab tabBGnormal: 'transparent', // BG of normal tab
@@ -44,6 +45,7 @@ var ICEcoder = {
pluginIntervalRefs: [], // Array of plugin interval refs pluginIntervalRefs: [], // Array of plugin interval refs
overPopup: false, // Indicates if we're over a popup or not overPopup: false, // Indicates if we're over a popup or not
cmdKey: false, // Tracking apple Command key up/down state cmdKey: false, // Tracking apple Command key up/down state
endTagReplaceData: [], // Will contain data for automatic end tag replacement
fmReady: false, // Indicates if the file manager is ready for action fmReady: false, // Indicates if the file manager is ready for action
bugReportStatus: "off", // Values of: off, error, ok, bugs bugReportStatus: "off", // Values of: off, error, ok, bugs
bugReportPath: "", // Bug report file path bugReportPath: "", // Bug report file path
@@ -60,7 +62,7 @@ var ICEcoder = {
// Set our aliases // Set our aliases
initAliases: function() { initAliases: function() {
var aliasArray = ["header","files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame","editor","tabsBar","findBar","content","footer","nestValid","splitPaneControls","charDisplay","byteDisplay"]; var aliasArray = ["header","files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame","editor","tabsBar","findBar","content","footer","nestValid","versionsDisplay","splitPaneControls","charDisplay","byteDisplay"];
// Create our ID aliases // Create our ID aliases
for (var i=0;i<aliasArray.length;i++) { for (var i=0;i<aliasArray.length;i++) {
@@ -88,7 +90,8 @@ var ICEcoder = {
top.ICEcoder.showHide('hide',top.get('loadingMask')); top.ICEcoder.showHide('hide',top.get('loadingMask'));
top.ICEcoder.autoOpenInt = setInterval(function() { top.ICEcoder.autoOpenInt = setInterval(function() {
if (top.ICEcoder.fmReady) { if (top.ICEcoder.fmReady) {
if (top.ICEcoder.openLastFiles) {top.ICEcoder.autoOpenFiles()}; // Delay auto open process by 200ms to give trial bar time to begin animation
if (top.ICEcoder.openLastFiles) {setTimeout(function() {top.ICEcoder.autoOpenFiles()},200);};
clearInterval(top.ICEcoder.autoOpenInt); clearInterval(top.ICEcoder.autoOpenInt);
} }
}, 4); }, 4);
@@ -122,6 +125,7 @@ var ICEcoder = {
this.optionsFile.style.width = this.optionsEdit.style.width = this.optionsSource.style.width = this.optionsHelp.style.width = (this.filesW-60) + "px"; this.optionsFile.style.width = this.optionsEdit.style.width = this.optionsSource.style.width = this.optionsHelp.style.width = (this.filesW-60) + "px";
this.filesFrame.style.height = (winH-headerH-fileNavH) + "px"; this.filesFrame.style.height = (winH-headerH-fileNavH) + "px";
this.nestValid.style.left = (this.filesW+10) + "px"; this.nestValid.style.left = (this.filesW+10) + "px";
this.versionsDisplay.style.left = (this.filesW+25) + "px";
this.splitPaneControls.style.left = (parseInt((winW-this.filesW)/2,10)-25-4+this.filesW) + "px"; this.splitPaneControls.style.left = (parseInt((winW-this.filesW)/2,10)-25-4+this.filesW) + "px";
top.ICEcoder.setTabWidths(); top.ICEcoder.setTabWidths();
@@ -164,6 +168,9 @@ var ICEcoder = {
// Also clear marks (if going to a single pane) or redo the marks (if split pane) // Also clear marks (if going to a single pane) or redo the marks (if split pane)
if (top.ICEcoder.splitPane) { if (top.ICEcoder.splitPane) {
top.ICEcoder.updateDiffs(); top.ICEcoder.updateDiffs();
// Also set the scroll position to match
cM = top.ICEcoder.getcMInstance();
top.ICEcoder.cMonScroll(cM,'cM'+ICEcoder.cMInstances[ICEcoder.selectedTab-1]);
} else { } else {
cM = top.ICEcoder.getcMInstance(); cM = top.ICEcoder.getcMInstance();
cMdiff = top.ICEcoder.getcMdiffInstance(); cMdiff = top.ICEcoder.getcMdiffInstance();
@@ -320,9 +327,45 @@ var ICEcoder = {
},0); },0);
}, },
// On before change
cMonBeforeChange: function(thisCM,cMinstance,changeObj,cM) {
var sels, tokenString, range, canMaybeReplace, thisData;
// For each of the user selections
sels = thisCM.listSelections();
for (var i=0; i<sels.length; i++) {
// Get the token at the cursor start (anchor) position
tokenString = thisCM.getTokenAt(sels[i].anchor);
// If we're just inside a tag, move along 1 char pos and get token info at that position
if (tokenString.type == "tag bracket" && tokenString.string == "<") {
tokenString = thisCM.getTokenAt({line: sels[i].anchor.line, ch: sels[i].anchor.ch+1});
}
// If we're inside a tag now
if (tokenString.type == "tag") {
// Test for range info
range = cM.fold['xml'](thisCM, sels[i].anchor);
canMaybeReplace = true;
for (var j=0; j<top.ICEcoder.endTagReplaceData.length; j++) {
// If we have range info and we're start and end are on the same line
if ("undefined" != typeof range && top.ICEcoder.endTagReplaceData[j].split(";")[1] == range.to.line + ":" + range.to.ch) {
canMaybeReplace = false;
}
}
// If we can still replace and have range info and not undoing/redoing (as that replaces chunks itself)
if (canMaybeReplace && "undefined" != typeof range && changeObj.origin != "undo" && changeObj.origin != "redo") {
// Work out the data string to set and if not in array, push in ready to handle on change event
thisData = tokenString.string + ";" + range.to.line + ":" + range.to.ch;
if (top.ICEcoder.endTagReplaceData.indexOf(thisData) == -1) {
top.ICEcoder.endTagReplaceData.push(thisData);
}
}
}
}
},
// On change // On change
cMonChange: function(thisCM,cMinstance,changeObj) { cMonChange: function(thisCM,cMinstance,changeObj) {
var filepath, filename, fileExt; var rData, thisToken, repl1, repl2, tTS, filepath, filename, fileExt;
// If we're not loading the file, it's a change, so update tab // If we're not loading the file, it's a change, so update tab
if (!top.ICEcoder.loadingFile) { if (!top.ICEcoder.loadingFile) {
@@ -335,6 +378,35 @@ var ICEcoder = {
top.ICEcoder.setLayout(); top.ICEcoder.setLayout();
},0); },0);
// If we're replacing end tag strings, do that
if (top.ICEcoder.endTagReplaceData.length > 0) {
// For each one of them, grab our data to work with
for (var i=0; i<top.ICEcoder.endTagReplaceData.length; i++) {
rData = top.ICEcoder.endTagReplaceData[i].split(";");
// Don't do anything if it's the same line, as we can't rely on fold range data due to nested tags
if (rData[1].split(":")[0]*1 == changeObj.from.line) {
continue;
}
// Otherwise, work out the replace ranges
repl1 = {line: rData[1].split(":")[0]*1, ch: (rData[1].split(":")[1]*1)+2};
repl2 = {line: rData[1].split(":")[0]*1, ch: (rData[1].split(":")[1]*1)+2+rData[0].length};
// Establish the string to replace with
thisToken = thisCM.getTokenAt(thisCM.listSelections()[i].anchor);
tTS = thisToken.string;
if (tTS == "<" ) {
tTS = "";
}
// Replace our string over the range
// Disabled for now, as buggy
// thisCM.replaceRange(tTS, repl1, repl2);
}
}
// Reset the array ready for next time
top.ICEcoder.endTagReplaceData = [];
top.ICEcoder.getCaretPosition(); top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay(); top.ICEcoder.updateCharDisplay();
top.ICEcoder.updateByteDisplay(); top.ICEcoder.updateByteDisplay();
@@ -361,10 +433,11 @@ var ICEcoder = {
} }
// Update diffs if we have a split pane // Update diffs if we have a split pane
if (top.ICEcoder.splitPane) { if (top.ICEcoder.splitPane) {
top.ICEcoder.updateDiffs(); // Need 0ms tickover so we handle char change first
setTimeout(function(){top.ICEcoder.updateDiffs();},0);
} }
// Update HTML edited files live // Update HTML edited files live
if (filepath && top.ICEcoder.previewWindow.location) { if (filepath && top.ICEcoder.previewWindow.location && filepath != "/[NEW]") {
top.ICEcoder.updatePreviewWindow(thisCM,filepath,filename,fileExt); top.ICEcoder.updatePreviewWindow(thisCM,filepath,filename,fileExt);
} }
// Update the title tag to indicate any changes // Update the title tag to indicate any changes
@@ -375,15 +448,17 @@ var ICEcoder = {
cMonScroll: function(thisCM,cMinstance) { cMonScroll: function(thisCM,cMinstance) {
var cM, cMdiff, otherCM; var cM, cMdiff, otherCM;
// Get both main & diff instance and work out the instance we're not scrolling
cM = top.ICEcoder.getcMInstance();
cMdiff = top.ICEcoder.getcMdiffInstance();
otherCM = cMinstance.indexOf('diff') > -1 ? cM : cMdiff;
top.ICEcoder.mouseDown=false; top.ICEcoder.mouseDown=false;
// Scroll other pane x & y to match this one we're scrolling if (top.ICEcoder.splitPane) {
otherCM.scrollTo(thisCM.getScrollInfo().left, thisCM.getScrollInfo().top); // Get both main & diff instance and work out the instance we're not scrolling
cM = top.ICEcoder.getcMInstance();
cMdiff = top.ICEcoder.getcMdiffInstance();
otherCM = cMinstance.indexOf('diff') > -1 ? cM : cMdiff;
// Scroll other pane x & y to match this one we're scrolling, after a 0ms tickover to avoid judder
setTimeout(function(){otherCM.scrollTo(thisCM.getScrollInfo().left, thisCM.getScrollInfo().top);},0);
}
}, },
@@ -474,6 +549,12 @@ var ICEcoder = {
if (opcodes[i][0] == "replace") { if (opcodes[i][0] == "replace") {
// Line amount is diff between end of both panes at this point in our loop, plus 1 line and our overall document shift, multiplied by font size // Line amount is diff between end of both panes at this point in our loop, plus 1 line and our overall document shift, multiplied by font size
amt = ((opcodes[i][4] - opcodes[i][2] + 1 + top.ICEcoder.renderPaneShiftAmount) * cM.defaultTextHeight()); amt = ((opcodes[i][4] - opcodes[i][2] + 1 + top.ICEcoder.renderPaneShiftAmount) * cM.defaultTextHeight());
// Add on the extra heights for any wrapped lines
for (var j=opcodes[i][4]-1; j<=opcodes[i][2]-1; j++) {
if (cMdiff.getLineHandle(j).height > cM.defaultTextHeight()) {
amt += cMdiff.getLineHandle(j).height - cM.defaultTextHeight();
}
}
// If we have an height greater than the default text height, add a new style // If we have an height greater than the default text height, add a new style
if (amt > cM.defaultTextHeight()) { if (amt > cM.defaultTextHeight()) {
top.ICEcoder.renderLineStyle.push(["main", opcodes[i][2], "height", amt + "px"]); top.ICEcoder.renderLineStyle.push(["main", opcodes[i][2], "height", amt + "px"]);
@@ -505,6 +586,12 @@ var ICEcoder = {
if (opcodes[i][0] == "replace") { if (opcodes[i][0] == "replace") {
// Line amount is diff between end of both panes at this point in our loop, plus 1 line and our overall document shift, multiplied by font size // Line amount is diff between end of both panes at this point in our loop, plus 1 line and our overall document shift, multiplied by font size
amt = ((opcodes[i][2] - opcodes[i][4] + 1 - top.ICEcoder.renderPaneShiftAmount) * cM.defaultTextHeight()); amt = ((opcodes[i][2] - opcodes[i][4] + 1 - top.ICEcoder.renderPaneShiftAmount) * cM.defaultTextHeight());
// Add on the extra heights for any wrapped lines
for (var j=opcodes[i][4]-1; j<=opcodes[i][2]-1; j++) {
if (cM.getLineHandle(j).height > cM.defaultTextHeight()) {
amt += cM.getLineHandle(j).height - cM.defaultTextHeight();
}
}
// If we have an height greater than the default text height, add a new style // If we have an height greater than the default text height, add a new style
if (amt > cM.defaultTextHeight()) { if (amt > cM.defaultTextHeight()) {
top.ICEcoder.renderLineStyle.push(["diff", opcodes[i][4], "height", amt + "px"]); top.ICEcoder.renderLineStyle.push(["diff", opcodes[i][4], "height", amt + "px"]);
@@ -580,6 +667,8 @@ var ICEcoder = {
try {top.ICEcoder.doPesticide();} catch(err) {}; try {top.ICEcoder.doPesticide();} catch(err) {};
// Do the stats.js plugin if it exists // Do the stats.js plugin if it exists
try {top.ICEcoder.doStatsJS('update');} catch(err) {}; try {top.ICEcoder.doStatsJS('update');} catch(err) {};
// Do the responsive plugin if it exists
try {top.ICEcoder.doResponsive();} catch(err) {};
}, },
// Clean up our loaded code // Clean up our loaded code
@@ -750,7 +839,7 @@ var ICEcoder = {
thisCM.indentLine(endLine+2,'subtract'); thisCM.indentLine(endLine+2,'subtract');
}); });
} else { } else {
if ( ['p','a','b','i','strong','em','h1','h2','h3','li'].indexOf(tag)>-1 && if ( ['p','a','h1','h2','h3'].indexOf(tag)>-1 &&
thisCM.getSelection().substr(0,tag.length+1) == "<"+tagStart && thisCM.getSelection().substr(0,tag.length+1) == "<"+tagStart &&
thisCM.getSelection().substr(-(tag.length+3)) == "</"+tagEnd+">") { thisCM.getSelection().substr(-(tag.length+3)) == "</"+tagEnd+">") {
// Undo wrapper // Undo wrapper
@@ -997,6 +1086,20 @@ var ICEcoder = {
ICEcoder.thisFileFolderLink=link; ICEcoder.thisFileFolderLink=link;
}, },
// Detect and return dir/file/false for this DOM ref (false for not found)
isFileFolder: function(ref) {
var domElem;
domElem = top.get('filesFrame').contentWindow.document.getElementById(ref.replace(top.iceRoot,"").replace(/\/$/, "").replace(/\//g,"|"));
if (domElem) {
return domElem.parentNode.parentNode.className.indexOf("directory") > -1
? "folder"
: "file";
} else {
return false;
}
},
// Select file or folder on demand // Select file or folder on demand
selectFileFolder: function(evt,ctrlSim,shiftSim) { selectFileFolder: function(evt,ctrlSim,shiftSim) {
var tgtFile, shortURL, selecting, dirList, lastFileClicked, startFile, endFile, thisFileObj; var tgtFile, shortURL, selecting, dirList, lastFileClicked, startFile, endFile, thisFileObj;
@@ -1180,24 +1283,39 @@ var ICEcoder = {
} }
}, },
// Provide a path and line ref and we return the seperate pieces
returnFileAndLine: function(fileLink) {
var line = 1;
var re = /^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/;
var reMatch = re.exec(fileLink);
if (null !== reMatch) {
line = reMatch[4];
fileLink = reMatch[1];
} else if (fileLink.indexOf('://') > 0){
if (fileLink.lastIndexOf(':') !== fileLink.indexOf('://')) {
line = fileLink.split(':')[2];
fileLink = fileLink.substr(0,fileLink.lastIndexOf(":"));
}
} else if (fileLink.indexOf(':') > 0){
line = fileLink.split(':')[1];
fileLink = fileLink.split(':')[0];
}
if ((fileLink.indexOf('(') > 0) && (fileLink.indexOf(')') > 0)){
line = fileLink.split('(')[1].split(')')[0];
fileLink = fileLink.split('(')[0];
}
return [fileLink,line];
},
// Open a file // Open a file
openFile: function(fileLink) { openFile: function(fileLink) {
var shortURL, canOpenFile; var flSplit, line, shortURL, canOpenFile;
var line = 1;
if ("undefined" != typeof fileLink) { if ("undefined" != typeof fileLink) {
var re = /^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/; flSplit = top.ICEcoder.returnFileAndLine(fileLink);
var reMatch = re.exec(fileLink); fileLink = flSplit[0];
if (null !== reMatch) line = flSplit[1];
{
line = reMatch[4];
fileLink = reMatch[1];
} else if (fileLink.indexOf(':') > 0){
line = fileLink.split(':')[1];
fileLink = fileLink.split(':')[0];
} else if ((fileLink.indexOf('(') > 0) && (fileLink.indexOf(')') > 0)){
line = fileLink.split('(')[1].split(')')[0];
fileLink = fileLink.split('(')[0];
}
} }
if (fileLink) { if (fileLink) {
@@ -1259,7 +1377,15 @@ var ICEcoder = {
// Get remote file contents // Get remote file contents
getRemoteFile: function(remoteFile) { getRemoteFile: function(remoteFile) {
top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf,remoteFile); var flSplit, line;
if ("undefined" != typeof remoteFile) {
flSplit = top.ICEcoder.returnFileAndLine(remoteFile);
remoteFile = flSplit[0];
line = flSplit[1];
}
top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf+"&lineNumber="+line,remoteFile);
top.ICEcoder.serverMessage('<b>'+top.t['Getting']+'</b><br>'+remoteFile); top.ICEcoder.serverMessage('<b>'+top.t['Getting']+'</b><br>'+remoteFile);
}, },
@@ -1276,7 +1402,7 @@ var ICEcoder = {
: "|[NEW]"; : "|[NEW]";
} }
filePath = filePath.replace("||","|"); filePath = filePath.replace("||","|");
top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+saveType+"&csrf="+top.ICEcoder.csrf,filePath); top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&fileVersion="+ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+"&saveType="+saveType+"&csrf="+top.ICEcoder.csrf,filePath);
top.ICEcoder.serverMessage('<b>'+top.t['Saving']+'</b><br>'+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"")); top.ICEcoder.serverMessage('<b>'+top.t['Saving']+'</b><br>'+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""));
}, },
@@ -1459,6 +1585,67 @@ var ICEcoder = {
return false; return false;
}, },
// Check for existance of a file/dir
checkExists: function(path) {
var xhr, statusObj, timeStart;
path = path.replace(/\|/g,"/");
// Clear any prefixed iceRoot from path
if (path.indexOf(top.iceRoot) === 0) {
path = path.replace(top.iceRoot,"");
}
// Start a seperate XHR call. We run seperately rather than add into the serverQueue because we may need to run
// immediately, eg need to if a file/dir exists mid flow in 'Save As' function, so can't go into queue
xhr = top.ICEcoder.xhrObj();
xhr.onreadystatechange=function() {
if (xhr.readyState==4) {
// Parse the response as a JSON object
statusObj = JSON.parse(xhr.responseText);
// Set the action end time and time taken in JSON object
statusObj.action.timeEnd = new Date().getTime();
statusObj.action.timeTaken = statusObj.action.timeEnd - statusObj.action.timeStart;
// User wanted raw (or both) output of the response?
if (["raw","both"].indexOf(top.ICEcoder.fileDirResOutput) >= 0) {
console.log(xhr.responseText);
}
// User wanted object (or both) output of the response?
if (["object","both"].indexOf(top.ICEcoder.fileDirResOutput) >= 0) {
console.log(statusObj);
}
// Also store the statusObj
top.ICEcoder.lastFileDirCheckStatusObj = statusObj;
// OK reponse? If error, show that, otherwise do whatever we're required to do next
if (xhr.status==200) {
if (statusObj.status.error) {
top.ICEcoder.message(statusObj.status.errorMsg);
console.log("ICEcoder error info for your request...");
console.log(statusObj);
top.ICEcoder.serverMessage();
top.ICEcoder.serverQueue('del',0);
} else {
eval(statusObj.action.doNext);
}
// Some other response? Display a message about that
} else {
top.ICEcoder.message(top.t['Sorry there was...']);
console.log("ICEcoder error info for your request...");
console.log(statusObj);
top.ICEcoder.serverMessage();
top.ICEcoder.serverQueue('del',0);
}
}
};
xhr.open("POST","lib/file-control-xhr.php?action=checkExists&csrf="+top.ICEcoder.csrf,true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
timeStart = new Date().getTime();
xhr.send('timeStart='+timeStart+'&file='+path);
},
// Show menu on right clicking in file manager // Show menu on right clicking in file manager
showMenu: function(evt) { showMenu: function(evt) {
var menuType, menuHeight, winH, fmYPos; var menuType, menuHeight, winH, fmYPos;
@@ -1536,8 +1723,8 @@ var ICEcoder = {
' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'">'+file+'</span> <span style="'+permColors+'; font-size: 8px" id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'_perms">'+perms+'</span></a>'; ' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'">'+file+'</span> <span style="'+permColors+'; font-size: 8px" id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'_perms">'+perms+'</span></a>';
// If we don't have at least 3 DOM items in here, it's an empty folder // If we don't have a locNest or at least 3 DOM items in there, it's an empty folder
if(locNest.childNodes.length<3) { if(!locNest || locNest.childNodes.length<3) {
// We now need to begin a new UL list // We now need to begin a new UL list
newUL = document.createElement("ul"); newUL = document.createElement("ul");
locNest = targetElem.parentNode.parentNode; locNest = targetElem.parentNode.parentNode;
@@ -1597,11 +1784,13 @@ var ICEcoder = {
targetElem = top.get('filesFrame').contentWindow.document.getElementById(shortURL); targetElem = top.get('filesFrame').contentWindow.document.getElementById(shortURL);
// Set the name to be as per our new file/folder name // Set the name to be as per our new file/folder name
targetElem.innerHTML = file; targetElem.innerHTML = file;
// Finally, update the ID of the target & set a new title and perms ID // Update the ID of the target & set a new title and perms ID
targetElem.id = location.replace(/\//g,"|") + "|" + file; targetElem.id = location.replace(/\//g,"|") + "|" + file;
targetElem.parentNode.title = targetElem.id.replace(/\|/g,"/"); targetElem.parentNode.title = targetElem.id.replace(/\|/g,"/");
targetElemPerms = top.get('filesFrame').contentWindow.document.getElementById(shortURL+"_perms"); targetElemPerms = top.get('filesFrame').contentWindow.document.getElementById(shortURL+"_perms");
targetElemPerms.id = location.replace(/\//g,"|") + "|" + file + "_perms"; targetElemPerms.id = location.replace(/\//g,"|") + "|" + file + "_perms";
// Finally, rename also within any children
top.ICEcoder.renameInChildren(targetElem, oldName, location, file);
} }
// Moving files // Moving files
@@ -1635,6 +1824,32 @@ var ICEcoder = {
} }
}, },
// Rename node attributes within any renamed dirs recursively
renameInChildren: function(elem, oldName, location, file) {
var innerItems, targetElem, targetElemPerms;
// If our elem has a sibling and it's a UL, we renamed a dir
if(elem.parentNode.parentNode.nextSibling && elem.parentNode.parentNode.nextSibling.nodeName == "UL") {
innerItems = elem.parentNode.parentNode.nextSibling;
// For each one of the children in the UL, if it's a LI (may be a file or dir)
for (var i=0; i<innerItems.childNodes.length; i++) {
if (innerItems.childNodes[i].nodeName == "LI") {
// Get the span elem inside as our targetElem
targetElem = innerItems.childNodes[i].childNodes[0].childNodes[1];
// Update the ID of the target & set a new title
targetElem.id = targetElem.id.replace(oldName.replace(/\//g,"|"),location.replace(/\//g,"|")+"|"+file);
targetElem.parentNode.title = targetElem.id.replace(/\|/g,"/");
// Also update the perms ID
targetElemPerms = top.get('filesFrame').contentWindow.document.getElementById(targetElem.id).nextSibling.nextSibling;
targetElemPerms.id = targetElem.id + "_perms";
// Finally, test this node for ULs next to it also, incase it's a dir
top.ICEcoder.renameInChildren(targetElem, oldName, location, file);
}
}
}
},
// Refresh file manager // Refresh file manager
refreshFileManager: function() { refreshFileManager: function() {
top.ICEcoder.showHide('show',top.get('loadingMask')); top.ICEcoder.showHide('show',top.get('loadingMask'));
@@ -1697,14 +1912,19 @@ var ICEcoder = {
}, },
// Find & replace text according to user selections // Find & replace text according to user selections
findReplace: function(findString,resultsOnly,buttonClick,isCancel) { findReplace: function(findString,resultsOnly,buttonClick,isCancel,findPrevious) {
var find, replace, results, cM, cMdiff, thisCM, content, cursor, avgBlockH, addPadding, rBlocks, blockColor, replaceQS, targetQS, filesQS;
if (isCancel){ if (isCancel){
// Deselect by setting value to itself, then focus on editor // Deselect by setting value to itself, then focus on editor
top.get('find').value = top.get('find').value; top.get('find').value = top.get('find').value;
top.ICEcoder.focus(); top.ICEcoder.focus();
return; return;
} }
var find, replace, results, cM, cMdiff, thisCM, content, cursor, avgBlockH, addPadding, rBlocks, blockColor, replaceQS, targetQS, filesQS; // Set findPrevious to false if not passed in
if ("undefined" == typeof findPrevious) {
findPrevious = false;
}
// Determine our find & replace strings and results display // Determine our find & replace strings and results display
find = findString.toLowerCase(); find = findString.toLowerCase();
@@ -1755,22 +1975,59 @@ var ICEcoder = {
// We need to take action instead // We need to take action instead
} else { } else {
// Find our cursor position relative to results // Find our cursor position relative to results
ICEcoder.findResult = 0; // Go next
for (var i=0;i<ICEcoder.results.length;i++) { if (!findPrevious) {
if (ICEcoder.results[i]<thisCM.indexFromPos(thisCM.getCursor())) { ICEcoder.findResult = 0;
ICEcoder.findResult++; for (var i=0;i<ICEcoder.results.length;i++) {
if (ICEcoder.results[i]<thisCM.indexFromPos({"ch": thisCM.getCursor().ch+1, "line": thisCM.getCursor().line})) {
ICEcoder.findResult++;
}
}
// Go previous
} else {
if("undefined" == typeof ICEcoder.findResult) {
ICEcoder.findResult = ICEcoder.results.length+1;
} else {
ICEcoder.findResult = ICEcoder.results.length;
}
for (var i=ICEcoder.results.length-1;i>=0;i--) {
if (ICEcoder.results[i]>thisCM.indexFromPos({"ch": thisCM.getCursor().ch-1, "line": thisCM.getCursor().line})) {
ICEcoder.findResult--;
}
} }
} }
if (ICEcoder.findResult>ICEcoder.results.length-1) {ICEcoder.findResult=0};
// Loop round to start
if (!findPrevious && ICEcoder.findResult>ICEcoder.results.length-1) {
ICEcoder.findResult = 0
}
// Loop round to end
if (findPrevious && ICEcoder.findResult==1) {
ICEcoder.findResult = ICEcoder.results.length+1;
}
// Update results display // Update results display
results.innerHTML = "Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results"; results.innerHTML = "Highlighted result "+(ICEcoder.findResult+(!findPrevious ? 1 : -1))+" of "+ICEcoder.results.length+" results";
cursor = thisCM.getSearchCursor(find,thisCM.getCursor(),true); // Now actually perform the movement in the editor
cursor.findNext(); if (!findPrevious) {
if (!cursor.from()) { // Find next instance
cursor = thisCM.getSearchCursor(find,{line:0,ch:0},true); cursor = thisCM.getSearchCursor(find,{"ch": thisCM.getCursor().ch+1, "line": thisCM.getCursor().line},true);
cursor.findNext(); cursor.findNext();
// Find next from start of doc
if (!cursor.from()) {
cursor = thisCM.getSearchCursor(find,{line:0,ch:0},true);
cursor.findNext();
}
} else {
// Find previous instance
cursor = thisCM.getSearchCursor(find,{"ch": thisCM.getCursor().ch-1, "line": thisCM.getCursor().line},true);
cursor.findPrevious();
// Find previous from end of doc
if (!cursor.from()) {
cursor = thisCM.getSearchCursor(find,{line:1000000,ch:1000000},true);
cursor.findPrevious();
}
} }
// Finally, highlight our selection // Finally, highlight our selection
thisCM.setSelection(cursor.from(), cursor.to()); thisCM.setSelection(cursor.from(), cursor.to());
@@ -1864,6 +2121,16 @@ var ICEcoder = {
ICEcoder.charDisplay.innerHTML = ICEcoder.caretLocType + ", Line: " + (thisCM.getCursor().line+1) + ", Char: " + thisCM.getCursor().ch; ICEcoder.charDisplay.innerHTML = ICEcoder.caretLocType + ", Line: " + (thisCM.getCursor().line+1) + ", Char: " + thisCM.getCursor().ch;
}, },
// Update version display
updateVersionsDisplay: function() {
var versionsCount = top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1];
get('versionsDisplay').innerHTML = "undefined" != typeof versionsCount
? top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1] + " backup" +
(versionsCount != 1 ? "s" : "")
: "";
},
// Update the byte display // Update the byte display
updateByteDisplay: function() { updateByteDisplay: function() {
var cM, cMdiff, thisCM; var cM, cMdiff, thisCM;
@@ -2022,12 +2289,14 @@ var ICEcoder = {
} }
}, },
// Draw a canvas image based on actual img node image src // Init the canvas by drawing the image and setting the floating containers background size (5x zoom)
drawCanvasImage: function (imgThis) { initCanvasImage: function (imgThis) {
var canvas, img, x, y, imgData, R, G, B, rgb, hex, textColor; var canvas, img;
canvas = top.get('canvasPicker').getContext('2d'); canvas = top.get('canvasPicker').getContext('2d');
img = new Image(); img = new Image();
img.crossOrigin = "Anonymous";
img.src = imgThis.src; img.src = imgThis.src;
img.onload = function() { img.onload = function() {
top.get('canvasPicker').width = imgThis.width; top.get('canvasPicker').width = imgThis.width;
@@ -2035,6 +2304,15 @@ var ICEcoder = {
canvas.drawImage(img,0,0,imgThis.width,imgThis.height); canvas.drawImage(img,0,0,imgThis.width,imgThis.height);
} }
top.document.getElementById('floatingContainer').style.backgroundSize = (imgThis.naturalWidth*5)+"px "+(imgThis.naturalHeight*5)+"px";
},
// Interact with the canvas image
interactCanvasImage: function (imgThis) {
var canvas, x, y, imgData, R, G, B, rgb, hex, textColor, fcElem, fcBGX, fcBGY;
canvas = top.get('canvasPicker').getContext('2d');
// Show pointer colors on mouse move over canvas // Show pointer colors on mouse move over canvas
top.get('canvasPicker').onmousemove = function(event) { top.get('canvasPicker').onmousemove = function(event) {
// get mouse x & y // get mouse x & y
@@ -2054,6 +2332,25 @@ var ICEcoder = {
top.get('hexMouseXY').style.backgroundColor = top.get('rgbMouseXY').style.backgroundColor = '#' + hex; top.get('hexMouseXY').style.backgroundColor = top.get('rgbMouseXY').style.backgroundColor = '#' + hex;
textColor = R<128 || G<128 || B<128 && (R<200 && G<200 && B>50) ? '#fff' : '#000'; textColor = R<128 || G<128 || B<128 && (R<200 && G<200 && B>50) ? '#fff' : '#000';
top.get('hexMouseXY').style.color = top.get('rgbMouseXY').style.color = textColor; top.get('hexMouseXY').style.color = top.get('rgbMouseXY').style.color = textColor;
// Move the floating container to follow mouse pointer
fcElem = get('floatingContainer');
fcElem.style.left = top.ICEcoder.mouseX+20 + "px";
fcElem.style.top = top.ICEcoder.mouseY + "px";
// Move the background image for the container to match also
// 5 x zoom, account for scaling down of large images and shift 25px of the hover div size
// (55px is the 11x11 grid of pixels), minus 5px for centre row/col
fcBGX = -((x*5)*(imgThis.naturalWidth/imgThis.width))+25;
fcBGY = -((y*5)*(imgThis.naturalHeight/imgThis.height))+25;
fcElem.style.backgroundPosition = fcBGX+"px "+fcBGY+"px";
};
// Show image preview box on mouse over
top.get('canvasPicker').onmouseover = function(event) {
get('floatingContainer').style.visibility = "visible";
};
// Hide image preview box on mouse out
top.get('canvasPicker').onmouseout = function(event) {
get('floatingContainer').style.visibility = "hidden";
}; };
// Set pointer colors on clicking canvas // Set pointer colors on clicking canvas
top.get('canvasPicker').onclick = function() { top.get('canvasPicker').onclick = function() {
@@ -2204,22 +2501,42 @@ var ICEcoder = {
if (item && (item.indexOf('saveFiles=')==-1 && item.indexOf('action=load')==-1)) { if (item && (item.indexOf('saveFiles=')==-1 && item.indexOf('action=load')==-1)) {
xhr = top.ICEcoder.xhrObj(); xhr = top.ICEcoder.xhrObj();
xhr.onreadystatechange=function() { xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status==200) { if (xhr.readyState==4) {
// console.log(xhr.responseText); // Parse the response as a JSON object
statusObj = JSON.parse(xhr.responseText); statusObj = JSON.parse(xhr.responseText);
// Set the action end time and time taken in JSON object // Set the action end time and time taken in JSON object
statusObj.action.timeEnd = new Date().getTime(); statusObj.action.timeEnd = new Date().getTime();
statusObj.action.timeTaken = statusObj.action.timeEnd - statusObj.action.timeStart; statusObj.action.timeTaken = statusObj.action.timeEnd - statusObj.action.timeStart;
// console.log(statusObj);
if (statusObj.status.error) { // User wanted raw (or both) output of the response?
top.ICEcoder.message(statusObj.status.errorMsg); if (["raw","both"].indexOf(top.ICEcoder.fileDirResOutput) >= 0) {
} else { console.log(xhr.responseText);
eval(statusObj.action.doNext); }
// User wanted object (or both) output of the response?
if (["object","both"].indexOf(top.ICEcoder.fileDirResOutput) >= 0) {
console.log(statusObj);
} }
// OK reponse? If error, show that, otherwise do whatever we're required to do next
if (xhr.status==200) {
if (statusObj.status.error) {
top.ICEcoder.message(statusObj.status.errorMsg);
console.log("ICEcoder error info for your request...");
console.log(statusObj);
top.ICEcoder.serverMessage();
top.ICEcoder.serverQueue('del',0);
} else {
eval(statusObj.action.doNext);
}
// Some other response? Display a message about that
} else {
top.ICEcoder.message(top.t['Sorry there was...']);
console.log("ICEcoder error info for your request...");
console.log(statusObj);
top.ICEcoder.serverMessage();
top.ICEcoder.serverQueue('del',0);
}
} }
}; };
xhr.open("POST",ICEcoder.serverQueueItems[0],true); xhr.open("POST",ICEcoder.serverQueueItems[0],true);
@@ -2231,7 +2548,13 @@ var ICEcoder = {
xhr.send('timeStart='+timeStart+'&file='+file); xhr.send('timeStart='+timeStart+'&file='+file);
} }
} else { } else {
setTimeout(function() {top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href=ICEcoder.serverQueueItems[0]},1);
setTimeout(function() {
if ("undefined" != typeof ICEcoder.serverQueueItems[0]) {
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href=ICEcoder.serverQueueItems[0];
}
},1);
} }
} }
}, },
@@ -2256,6 +2579,40 @@ var ICEcoder = {
if (previousFiles=="") {previousFiles="CLEAR"}; if (previousFiles=="") {previousFiles="CLEAR"};
// Then send through to the settings page to update setting // Then send through to the settings page to update setting
top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+previousFiles+"&csrf="+top.ICEcoder.csrf); top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+previousFiles+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.updateLast10List(previousFiles);
},
// Update the list of 10 previous files in browser
updateLast10List: function(previousFiles) {
var newFile, last10Files, last10FilesList;
// Split our previous files string into an array
previousFiles = previousFiles.split(',');
// For each one of those, if it's not 'CLEAR' we can maybe rotate the list
for (var i=0; i<previousFiles.length; i++) {
if (previousFiles[i] != "CLEAR") {
// Set the new file LI item to maybe insert at top of the list, including trailing new line to split on in future
newFile = "<li class=\"pft-file ext-"+previousFiles[i].substring(previousFiles[i].lastIndexOf(".")+1)+"\" style=\"margin-left: -21px\"><a style=\"cursor:pointer\" onclick=\"top.ICEcoder.openFile('"+previousFiles[i].replace(/\|/g,"/")+"')\">"+previousFiles[i].replace(/\|/g,"/")+"</a></li>\n";
// Get DOM elem for last 10 files
last10Files = top.ICEcoder.content.contentWindow.document.getElementById('last10Files');
// If the innerHTML of that doesn't contain our new item, we can insert it
if(last10Files.innerHTML.indexOf(newFile) == -1) {
// Get the last 10 files list, pop the last one off and add newFile at start
last10FilesList = last10Files.innerHTML.split("\n");
if (
last10FilesList.length >= 10 || // No more than 10
last10FilesList[0] == '<div style="display: inline-block; margin-left: -39px; margin-top: -4px">[none]</div><br><br>' || // Clear out placeholder
last10FilesList[last10FilesList.length-1] == "" // No empty array items
) {
last10FilesList.pop();
}
// Update the list
last10Files.innerHTML = newFile + (last10FilesList.join("\n"));
}
}
}
}, },
// Opens the last files we had open // Opens the last files we had open
@@ -2279,7 +2636,13 @@ var ICEcoder = {
// Show the help screen // Show the help screen
helpScreen: function() { helpScreen: function() {
top.get('mediaContainer').innerHTML = '<iframe src="lib/help.php" class="whiteGlow" style="width: 840px; height: 515px"></iframe>'; top.get('mediaContainer').innerHTML = '<iframe src="lib/help.php" class="whiteGlow" style="width: 840px; height: 465px"></iframe>';
top.ICEcoder.showHide('show',top.get('blackMask'));
},
// Show the backup versions screen
versionsScreen: function(file,versions) {
top.get('mediaContainer').innerHTML = '<iframe src="lib/backup-versions.php?file='+file+'&csrf='+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 840px; height: 465px"></iframe>';
top.ICEcoder.showHide('show',top.get('blackMask')); top.ICEcoder.showHide('show',top.get('blackMask'));
}, },
@@ -2352,7 +2715,7 @@ var ICEcoder = {
// Update the settings used when we make a change to them // Update the settings used when we make a change to them
useNewSettings: function(themeURL,codeAssist,lockedNav,tagWrapperCommand,autoComplete,visibleTabs,fontSize,lineWrapping,indentWithTabs,indentAuto,indentSize,pluginPanelAligned,bugFilePaths,bugFileCheckTimer,bugFileMaxLines,githubAuthTokenSet,updateDiffOnSave,refreshFM) { useNewSettings: function(themeURL,codeAssist,lockedNav,tagWrapperCommand,autoComplete,visibleTabs,fontSize,lineWrapping,indentWithTabs,indentAuto,indentSize,pluginPanelAligned,bugFilePaths,bugFileCheckTimer,bugFileMaxLines,githubAuthTokenSet,updateDiffOnSave,refreshFM) {
var styleNode, strCSS, cMCSS, activeLineBG; var styleNode, thisCSS, strCSS, activeLineBG;
// cut out ?microtime= at the end // cut out ?microtime= at the end
var cleanThemeUrl = themeURL.slice(0, themeURL.lastIndexOf("?")); var cleanThemeUrl = themeURL.slice(0, themeURL.lastIndexOf("?"));
@@ -2391,13 +2754,23 @@ var ICEcoder = {
top.ICEcoder.hideFileMenu(); top.ICEcoder.hideFileMenu();
}; };
// Update font size at top level
thisCSS = top.document.styleSheets[0];
strCSS = thisCSS.rules ? 'rules' : 'cssRules';
thisCSS[strCSS][0].style['fontSize'] = fontSize;
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[4]; // Update font size in file manager
strCSS = cMCSS.rules ? 'rules' : 'cssRules'; thisCSS = ICEcoder.filesFrame.contentWindow.document.styleSheets[3];
cMCSS[strCSS][0].style['fontSize'] = fontSize; strCSS = thisCSS.rules ? 'rules' : 'cssRules';
cMCSS[strCSS][4].style['border-left-width'] = visibleTabs ? '1px' : '0'; thisCSS[strCSS][0].style['fontSize'] = fontSize;
cMCSS[strCSS][4].style['margin-left'] = visibleTabs ? '-1px' : '0';
cMCSS[strCSS][2].style.cssText = "background-color: " + activeLineBG + " !important"; // Update styles in editor
thisCSS = ICEcoder.content.contentWindow.document.styleSheets[4];
strCSS = thisCSS.rules ? 'rules' : 'cssRules';
thisCSS[strCSS][0].style['fontSize'] = fontSize;
thisCSS[strCSS][4].style['border-left-width'] = visibleTabs ? '1px' : '0';
thisCSS[strCSS][4].style['margin-left'] = visibleTabs ? '-1px' : '0';
thisCSS[strCSS][2].style.cssText = "background-color: " + activeLineBG + " !important";
top.ICEcoder.lineWrapping = lineWrapping; top.ICEcoder.lineWrapping = lineWrapping;
top.ICEcoder.indentWithTabs = indentWithTabs; top.ICEcoder.indentWithTabs = indentWithTabs;
@@ -2510,7 +2883,7 @@ var ICEcoder = {
thisCM = top.ICEcoder.editorFocusInstance.indexOf('diff') > -1 ? cMdiff : cM; thisCM = top.ICEcoder.editorFocusInstance.indexOf('diff') > -1 ? cMdiff : cM;
top.ICEcoder.previewWindowLoading = true; top.ICEcoder.previewWindowLoading = true;
top.ICEcoder.previewWindow = window.open(filepath,"previewWindow"); top.ICEcoder.previewWindow = window.open(filepath,"previewWindow",500,500);
if (["md"].indexOf(fileExt) > -1) { if (["md"].indexOf(fileExt) > -1) {
top.ICEcoder.previewWindow.onload = function() { top.ICEcoder.previewWindow.onload = function() {
top.ICEcoder.previewWindowLoading = false; top.ICEcoder.previewWindowLoading = false;
@@ -2523,6 +2896,8 @@ var ICEcoder = {
try {top.ICEcoder.doPesticide();} catch(err) {}; try {top.ICEcoder.doPesticide();} catch(err) {};
// Do the stats.js plugin if it exists // Do the stats.js plugin if it exists
try {top.ICEcoder.doStatsJS('open');} catch(err) {}; try {top.ICEcoder.doStatsJS('open');} catch(err) {};
// Do the responsive plugin if it exists
try {top.ICEcoder.doResponsive();} catch(err) {};
} }
} }
} }
@@ -2761,6 +3136,9 @@ var ICEcoder = {
top.ICEcoder.findMode = false; top.ICEcoder.findMode = false;
ICEcoder.findReplace(top.get('find').value,true,false); ICEcoder.findReplace(top.get('find').value,true,false);
// Update our versions display
top.ICEcoder.updateVersionsDisplay();
// Finally, update the cursor display // Finally, update the cursor display
top.ICEcoder.getCaretPosition(); top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay(); top.ICEcoder.updateCharDisplay();
@@ -2901,6 +3279,7 @@ var ICEcoder = {
top.get('tab'+i).title = top.get('tab'+(i+1)).title; top.get('tab'+i).title = top.get('tab'+(i+1)).title;
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i]; ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i]; ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
ICEcoder.openFileVersions[i-1] = ICEcoder.openFileVersions[i];
} }
// hide the instance we're closing by setting the hide class and removing from the array // hide the instance we're closing by setting the hide class and removing from the array
ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].getWrapperElement().style.display = "none"; ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].getWrapperElement().style.display = "none";
@@ -2912,6 +3291,7 @@ var ICEcoder = {
top.get('tab'+ICEcoder.openFiles.length).title = ""; top.get('tab'+ICEcoder.openFiles.length).title = "";
ICEcoder.openFiles.pop(); ICEcoder.openFiles.pop();
ICEcoder.openFileMDTs.pop(); ICEcoder.openFileMDTs.pop();
ICEcoder.openFileVersions.pop();
// If we're closing the selected tab, determin the new selectedTab number, reduced by 1 if we have some tabs, 0 for a reset state // If we're closing the selected tab, determin the new selectedTab number, reduced by 1 if we have some tabs, 0 for a reset state
if (ICEcoder.selectedTab==closeTabNum) { if (ICEcoder.selectedTab==closeTabNum) {
ICEcoder.openFiles.length>0 ? ICEcoder.selectedTab-=1 : ICEcoder.selectedTab = 0; ICEcoder.openFiles.length>0 ? ICEcoder.selectedTab-=1 : ICEcoder.selectedTab = 0;
@@ -2937,6 +3317,9 @@ var ICEcoder = {
top.ICEcoder.setPreviousFiles(); top.ICEcoder.setPreviousFiles();
} }
// Update the versions display
top.ICEcoder.updateVersionsDisplay();
// Update the title tag to indicate any changes // Update the title tag to indicate any changes
top.ICEcoder.indicateChanges(); top.ICEcoder.indicateChanges();
} }
@@ -3074,11 +3457,11 @@ var ICEcoder = {
// Sort tabs into new order // Sort tabs into new order
sortTabs: function(newOrder) { sortTabs: function(newOrder) {
var a, b, savedPoints = [], openFiles = [], openFileMDTs = [], cMInstances = [], selectedTabWillBe; var a, b, savedPoints = [], openFiles = [], openFileMDTs = [], openFileVersions = [], cMInstances = [], selectedTabWillBe;
// Setup an array of our actual arrays and the blank ones // Setup an array of our actual arrays and the blank ones
a = [ICEcoder.savedPoints, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances]; a = [ICEcoder.savedPoints, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.openFileVersions, ICEcoder.cMInstances];
b = [savedPoints, openFiles, openFileMDTs, cMInstances]; b = [savedPoints, openFiles, openFileMDTs, openFileVersions, cMInstances];
// Push the new order values into array b then set into array a // Push the new order values into array b then set into array a
for (var i=0;i<a.length;i++) { for (var i=0;i<a.length;i++) {
for (var j=0;j<a[i].length;j++) { for (var j=0;j<a[i].length;j++) {
@@ -3105,7 +3488,8 @@ var ICEcoder = {
ICEcoder.savedPoints = a[0]; ICEcoder.savedPoints = a[0];
ICEcoder.openFiles = a[1]; ICEcoder.openFiles = a[1];
ICEcoder.openFileMDTs = a[2]; ICEcoder.openFileMDTs = a[2];
ICEcoder.cMInstances = a[3]; ICEcoder.openFileVersions = a[3];
ICEcoder.cMInstances = a[4];
top.ICEcoder.setTabWidths(); top.ICEcoder.setTabWidths();
top.ICEcoder.switchTab(selectedTabWillBe); top.ICEcoder.switchTab(selectedTabWillBe);
}, },
@@ -3182,14 +3566,9 @@ var ICEcoder = {
else if (key==83) {top.ICEcoder.tagWrapper('span'); return false;} else if (key==83) {top.ICEcoder.tagWrapper('span'); return false;}
else if (key==80) {top.ICEcoder.tagWrapper('p'); return false;} else if (key==80) {top.ICEcoder.tagWrapper('p'); return false;}
else if (key==65) {top.ICEcoder.tagWrapper('a'); return false;} else if (key==65) {top.ICEcoder.tagWrapper('a'); return false;}
else if (key==66) {top.ICEcoder.tagWrapper('b'); return false;}
else if (key==73) {top.ICEcoder.tagWrapper('i'); return false;}
else if (key==71) {top.ICEcoder.tagWrapper('strong'); return false;}
else if (key==69) {top.ICEcoder.tagWrapper('em'); return false;}
else if (key==49) {top.ICEcoder.tagWrapper('h1'); return false;} else if (key==49) {top.ICEcoder.tagWrapper('h1'); return false;}
else if (key==50) {top.ICEcoder.tagWrapper('h2'); return false;} else if (key==50) {top.ICEcoder.tagWrapper('h2'); return false;}
else if (key==51) {top.ICEcoder.tagWrapper('h3'); return false;} else if (key==51) {top.ICEcoder.tagWrapper('h3'); return false;}
else if (key==56) {top.ICEcoder.tagWrapper('li'); return false;}
else if (key==13) {top.ICEcoder.addLineBreakAtEnd(); return false;} else if (key==13) {top.ICEcoder.addLineBreakAtEnd(); return false;}
else if (key==37) {top.ICEcoder.filesFrame.contentWindow.focus();return false;} else if (key==37) {top.ICEcoder.filesFrame.contentWindow.focus();return false;}
else {return key;} else {return key;}
@@ -3211,8 +3590,10 @@ var ICEcoder = {
top.ICEcoder.insertLineBefore(); top.ICEcoder.insertLineBefore();
return false; return false;
// CTRL/Cmd+F (Find) // CTRL/Cmd+F (Find next)
} else if(key==70 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { // and
// CTRL/Cmd+G (Find previous)
} else if((key==70||key==71) && (evt.ctrlKey||top.ICEcoder.cmdKey)) {
var find = top.get('find'); var find = top.get('find');
cM = ICEcoder.getcMInstance(); cM = ICEcoder.getcMInstance();
cMdiff = ICEcoder.getcMdiffInstance(); cMdiff = ICEcoder.getcMdiffInstance();
@@ -3229,10 +3610,18 @@ var ICEcoder = {
// that find has focus and refuses to give it focus second time. // that find has focus and refuses to give it focus second time.
top.get('goToLineNo').focus(); top.get('goToLineNo').focus();
find.focus(); find.focus();
// Trigger the find/replace operation
if(key==70) {
// Find next
top.get('findReplaceSubmit').click();
} else {
// Find previous
ICEcoder.findReplace(top.document.getElementById('find').value,false,true,false,'findPrevious');
}
return false; return false;
// CTRL/Cmd+G (Go to line) // CTRL/Cmd+L (Go to line)
} else if(key==71 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { } else if(key==76 && (evt.ctrlKey||top.ICEcoder.cmdKey)) {
var goToLineInput = top.get('goToLineNo'); var goToLineInput = top.get('goToLineNo');
goToLineInput.select(); goToLineInput.select();
// this is trick for Chrome - after you have used Ctrl-F once, when // this is trick for Chrome - after you have used Ctrl-F once, when
@@ -3268,14 +3657,14 @@ var ICEcoder = {
return false; return false;
// CTRL/Cmd+numeric plus (New tab) // CTRL/Cmd+numeric plus (New tab)
} else if(key==107 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { } else if((key==107 || key==187) && (evt.ctrlKey||top.ICEcoder.cmdKey)) {
area=="content" area=="content"
? top.ICEcoder.duplicateLines() ? top.ICEcoder.duplicateLines()
: top.ICEcoder.newTab(); : top.ICEcoder.newTab();
return false; return false;
// CTRL/Cmd+numeric minus (Close tab) // CTRL/Cmd+numeric minus (Close tab)
} else if(key==109 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { } else if((key==109 || key==189) && (evt.ctrlKey||top.ICEcoder.cmdKey)) {
area=="content" area=="content"
? top.ICEcoder.removeLines() ? top.ICEcoder.removeLines()
: top.ICEcoder.closeTab(top.ICEcoder.selectedTab); : top.ICEcoder.closeTab(top.ICEcoder.selectedTab);

314
lib/ice-coder.min.js vendored
View File

@@ -1,156 +1,170 @@
var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,savedPoints:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,scrollbarVisible:!1,mouseDown:!1,draggingFilesW:!1,draggingTab:!1,draggingWithKey:!1,tabLeftPos:[],tabBGcurrent:"#141414",tabBGselected:"#49d",tabBGopen:"#c3c3c3",tabBGnormal:"transparent",tabFGcurrent:"#fff",tabFGselected:"#fff",tabFGopenFile:"#000",tabFGnormalFile:"#eee", var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,savedPoints:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],openFileVersions:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,scrollbarVisible:!1,mouseDown:!1,draggingFilesW:!1,draggingTab:!1,draggingWithKey:!1,tabLeftPos:[],tabBGcurrent:"#1d1d1b",tabBGselected:"#49d",tabBGopen:"#c3c3c3",tabBGnormal:"transparent",tabFGcurrent:"#fff",tabFGselected:"#fff",tabFGopenFile:"#000",
tabFGnormalTab:"#888",serverQueueItems:[],previewWindow:!1,previewWindowLoading:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,fmReady:!1,bugReportStatus:"off",bugReportPath:"",bugFilesSizesSeen:[],bugFilesSizesActual:[],githubDiff:!1,githubAuthTokenSet:!1,splitPane:!1,renderLineStyle:[],renderPaneShiftAmount:0,debounce:"",editorFocusInstance:"",ready:!1,initAliases:function(){for(var a="header files fileOptions optionsFile optionsEdit optionsSource optionsHelp filesFrame editor tabsBar findBar content footer nestValid splitPaneControls charDisplay byteDisplay".split(" "), tabFGnormalFile:"#eee",tabFGnormalTab:"#888",serverQueueItems:[],previewWindow:!1,previewWindowLoading:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,endTagReplaceData:[],fmReady:!1,bugReportStatus:"off",bugReportPath:"",bugFilesSizesSeen:[],bugFilesSizesActual:[],githubDiff:!1,githubAuthTokenSet:!1,splitPane:!1,renderLineStyle:[],renderPaneShiftAmount:0,debounce:"",editorFocusInstance:"",ready:!1,initAliases:function(){for(var a="header files fileOptions optionsFile optionsEdit optionsSource optionsHelp filesFrame editor tabsBar findBar content footer nestValid versionsDisplay splitPaneControls charDisplay byteDisplay".split(" "),
b=0;b<a.length;b++)ICEcoder[a[b]]=top.get(a[b])},init:function(){top.ICEcoder.lockedNav||(top.ICEcoder.filesW=ICEcoder.minFilesW);ICEcoder.setLayout();top.ICEcoder.overFileFolder("folder","|");top.ICEcoder.selectFileFolder("init");top.ICEcoder.filesFrame.contentWindow.focus();top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.autoOpenInt=setInterval(function(){top.ICEcoder.fmReady&&(top.ICEcoder.openLastFiles&&top.ICEcoder.autoOpenFiles(),clearInterval(top.ICEcoder.autoOpenInt))},4); b=0;b<a.length;b++)ICEcoder[a[b]]=top.get(a[b])},init:function(){top.ICEcoder.lockedNav||(top.ICEcoder.filesW=ICEcoder.minFilesW);ICEcoder.setLayout();top.ICEcoder.overFileFolder("folder","|");top.ICEcoder.selectFileFolder("init");top.ICEcoder.filesFrame.contentWindow.focus();top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.autoOpenInt=setInterval(function(){top.ICEcoder.fmReady&&(top.ICEcoder.openLastFiles&&setTimeout(function(){top.ICEcoder.autoOpenFiles()},200),clearInterval(top.ICEcoder.autoOpenInt))},
setInterval(ICEcoder.updateNestingIndicator,30);top.ICEcoder.startBugChecking();top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth;c=window.innerHeight;this.header.style.width=this.tabsBar.style.width=this.findBar.style.width=b+"px";this.files.style.width=this.editor.style.left=this.filesW+"px";this.optionsFile.style.width=this.optionsEdit.style.width=this.optionsSource.style.width=this.optionsHelp.style.width=this.filesW-60+"px";this.filesFrame.style.height=c-25-35+"px";this.nestValid.style.left= 4);setInterval(ICEcoder.updateNestingIndicator,30);top.ICEcoder.startBugChecking();top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth;c=window.innerHeight;this.header.style.width=this.tabsBar.style.width=this.findBar.style.width=b+"px";this.files.style.width=this.editor.style.left=this.filesW+"px";this.optionsFile.style.width=this.optionsEdit.style.width=this.optionsSource.style.width=this.optionsHelp.style.width=this.filesW-60+"px";this.filesFrame.style.height=c-25-35+"px";
this.filesW+10+"px";this.splitPaneControls.style.left=parseInt((b-this.filesW)/2,10)-25-4+this.filesW+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-25-21-28-26+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.splitPane?(top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].setSize("50%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ this.nestValid.style.left=this.filesW+10+"px";this.versionsDisplay.style.left=this.filesW+25+"px";this.splitPaneControls.style.left=parseInt((b-this.filesW)/2,10)-25-4+this.filesW+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-25-21-28-26+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.splitPane?(top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].setSize("50%",
ICEcoder.cMInstances[a]].setSize("50%",top.ICEcoder.content.style.height)):(top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize("100%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].setSize("0",top.ICEcoder.content.style.height));top.ICEcoder.splitPane?top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?parseInt(parseInt(ICEcoder.content.style.width,10)/2, top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize("50%",top.ICEcoder.content.style.height)):(top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize("100%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].setSize("0",top.ICEcoder.content.style.height));top.ICEcoder.splitPane?top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?
10)+17+"px":parseInt(parseInt(ICEcoder.content.style.width,10)/2,10)+"px":top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?"17px":"0"},4))},setSplitPane:function(a){var b;top.ICEcoder.splitPane="on"==a?!0:!1;top.get("splitPaneControlsOff").style.opacity=top.ICEcoder.splitPane?.5:1;top.get("splitPaneControlsOn").style.opacity=top.ICEcoder.splitPane?1:.5;top.ICEcoder.setLayout();if(top.ICEcoder.splitPane)top.ICEcoder.updateDiffs();else{b= parseInt(parseInt(ICEcoder.content.style.width,10)/2,10)+17+"px":parseInt(parseInt(ICEcoder.content.style.width,10)/2,10)+"px":top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?"17px":"0"},4))},setSplitPane:function(a){var b;top.ICEcoder.splitPane="on"==a?!0:!1;top.get("splitPaneControlsOff").style.opacity=top.ICEcoder.splitPane?.5:1;top.get("splitPaneControlsOn").style.opacity=top.ICEcoder.splitPane?1:.5;top.ICEcoder.setLayout();if(top.ICEcoder.splitPane)top.ICEcoder.updateDiffs(),
top.ICEcoder.getcMInstance();a=top.ICEcoder.getcMdiffInstance();cMmarks=b.getAllMarks();for(b=0;b<cMmarks.length;b++)cMmarks[b].clear();cMdiffMarks=a.getAllMarks();for(b=0;b<cMdiffMarks.length;b++)cMdiffMarks[b].clear()}},changeFilesW:function(a){ICEcoder.lockedNav&&ICEcoder.filesW!=ICEcoder.minFilesW||("undefined"!=typeof ICEcoder.changeFilesInt&&clearInterval(ICEcoder.changeFilesInt),ICEcoder.changeFilesInt=setInterval(function(){ICEcoder.changeFilesWStep(a)},10))},changeFilesWStep:function(a){"expand"== b=top.ICEcoder.getcMInstance(),top.ICEcoder.cMonScroll(b,"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]);else{b=top.ICEcoder.getcMInstance();a=top.ICEcoder.getcMdiffInstance();cMmarks=b.getAllMarks();for(b=0;b<cMmarks.length;b++)cMmarks[b].clear();cMdiffMarks=a.getAllMarks();for(b=0;b<cMdiffMarks.length;b++)cMdiffMarks[b].clear()}},changeFilesW:function(a){ICEcoder.lockedNav&&ICEcoder.filesW!=ICEcoder.minFilesW||("undefined"!=typeof ICEcoder.changeFilesInt&&clearInterval(ICEcoder.changeFilesInt),
a?ICEcoder.filesW<ICEcoder.maxFilesW-1?ICEcoder.filesW+=Math.ceil((ICEcoder.maxFilesW-ICEcoder.filesW)/2):ICEcoder.filesW=ICEcoder.maxFilesW:ICEcoder.filesW>ICEcoder.minFilesW+1?ICEcoder.filesW-=Math.ceil((ICEcoder.filesW-ICEcoder.minFilesW)/2):ICEcoder.filesW=ICEcoder.minFilesW;("expand"==a&&ICEcoder.filesW==ICEcoder.maxFilesW||"contract"==a&&ICEcoder.filesW==ICEcoder.minFilesW)&&clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){top.ICEcoder.ready&&"w-resize"== ICEcoder.changeFilesInt=setInterval(function(){ICEcoder.changeFilesWStep(a)},10))},changeFilesWStep:function(a){"expand"==a?ICEcoder.filesW<ICEcoder.maxFilesW-1?ICEcoder.filesW+=Math.ceil((ICEcoder.maxFilesW-ICEcoder.filesW)/2):ICEcoder.filesW=ICEcoder.maxFilesW:ICEcoder.filesW>ICEcoder.minFilesW+1?ICEcoder.filesW-=Math.ceil((ICEcoder.filesW-ICEcoder.minFilesW)/2):ICEcoder.filesW=ICEcoder.minFilesW;("expand"==a&&ICEcoder.filesW==ICEcoder.maxFilesW||"contract"==a&&ICEcoder.filesW==ICEcoder.minFilesW)&&
top.document.body.style.cursor?top.ICEcoder.mouseDown&&(top.ICEcoder.filesW=top.ICEcoder.maxFilesW=250<=top.ICEcoder.mouseX&&400>=top.ICEcoder.mouseX?top.ICEcoder.mouseX:250>top.ICEcoder.mouseX?250:400,top.ICEcoder.files.style.width=top.ICEcoder.filesFrame.style.width=top.ICEcoder.filesW+"px",top.ICEcoder.setLayout(),top.ICEcoder.draggingFilesW=!0):top.ICEcoder.draggingFilesW=!1},lockUnlockNav:function(){var a;a=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmLock");ICEcoder.lockedNav= clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){top.ICEcoder.ready&&"w-resize"==top.document.body.style.cursor?top.ICEcoder.mouseDown&&(top.ICEcoder.filesW=top.ICEcoder.maxFilesW=250<=top.ICEcoder.mouseX&&400>=top.ICEcoder.mouseX?top.ICEcoder.mouseX:250>top.ICEcoder.mouseX?250:400,top.ICEcoder.files.style.width=top.ICEcoder.filesFrame.style.width=top.ICEcoder.filesW+"px",top.ICEcoder.setLayout(),top.ICEcoder.draggingFilesW=!0):top.ICEcoder.draggingFilesW=!1},
!ICEcoder.lockedNav;a.style.backgroundPosition=ICEcoder.lockedNav?"0 0":"-16px 0"},showHidePlugins:function(a){get("plugins").style.width="show"==a?"55px":"3px";get("plugins").style.background="show"==a?"#333":"transparent";"show"==a&&ICEcoder.changeFilesW("expand")},cMonFocus:function(a,b){top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.editorFocusInstance=b;top.ICEcoder.getCaretPosition()},cMonBlur:function(a,b){},cMonKeyUp:function(a, lockUnlockNav:function(){var a;a=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmLock");ICEcoder.lockedNav=!ICEcoder.lockedNav;a.style.backgroundPosition=ICEcoder.lockedNav?"0 0":"-16px 0"},showHidePlugins:function(a){get("plugins").style.width="show"==a?"55px":"3px";get("plugins").style.background="show"==a?"#333":"transparent";"show"==a&&ICEcoder.changeFilesW("expand")},cMonFocus:function(a,b){top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();
b){"undefined"!=typeof top.doFind&&clearInterval(top.doFind);top.doFind=setTimeout(function(){top.ICEcoder.findReplace(top.get("find").value,!0,!1)},500);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()},cMonCursorActivity:function(a,b){var c;top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();a.removeLineClass(top.ICEcoder["cMActiveLine"+b],"background");a.getCursor("start").line==a.getCursor().line&&(top.ICEcoder["cMActiveLine"+ top.ICEcoder.editorFocusInstance=b;top.ICEcoder.getCaretPosition()},cMonBlur:function(a,b){},cMonKeyUp:function(a,b){"undefined"!=typeof top.doFind&&clearInterval(top.doFind);top.doFind=setTimeout(function(){top.ICEcoder.findReplace(top.get("find").value,!0,!1)},500);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()},cMonCursorActivity:function(a,b){var c;top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();
b]=a.addLineClass(a.getCursor().line,"background","cm-s-activeLine"));"CSS"==top.ICEcoder.caretLocType&&top.ICEcoder.cssColorPreview();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.prevLineDiff:top.ICEcoder.prevLine;c!=a.getCursor().line&&a.getLine(c)&&0<a.getLine(c).length&&0==a.getLine(c).replace(/\s/g,"").length&&a.replaceRange("",{line:c,ch:0},{line:c,ch:1E6});setTimeout(function(){for(var c,e=0;e<top.ICEcoder.renderLineStyle.length;e++){c=!1;if("diff"!=top.ICEcoder.renderLineStyle[e][0]&& a.removeLineClass(top.ICEcoder["cMActiveLine"+b],"background");a.getCursor("start").line==a.getCursor().line&&(top.ICEcoder["cMActiveLine"+b]=a.addLineClass(a.getCursor().line,"background","cm-s-activeLine"));"CSS"==top.ICEcoder.caretLocType&&top.ICEcoder.cssColorPreview();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.prevLineDiff:top.ICEcoder.prevLine;c!=a.getCursor().line&&a.getLine(c)&&0<a.getLine(c).length&&0==a.getLine(c).replace(/\s/g,"").length&&a.replaceRange("",{line:c,
-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[e][0]&&-1<b.indexOf("diff"))c=!0;c&&a.getCursor().line+1==top.ICEcoder.renderLineStyle[e][1]?a.setOption("cursorHeight",a.defaultTextHeight()/a.lineInfo(a.getCursor().line).handle.height):a.setOption("cursorHeight",1)}},0)},cMonChange:function(a,b,c){var d,e;top.ICEcoder.loadingFile||top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight; ch:0},{line:c,ch:1E6});setTimeout(function(){for(var c,e=0;e<top.ICEcoder.renderLineStyle.length;e++){c=!1;if("diff"!=top.ICEcoder.renderLineStyle[e][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[e][0]&&-1<b.indexOf("diff"))c=!0;c&&a.getCursor().line+1==top.ICEcoder.renderLineStyle[e][1]?a.setOption("cursorHeight",a.defaultTextHeight()/a.lineInfo(a.getCursor().line).handle.height):a.setOption("cursorHeight",1)}},0)},cMonBeforeChange:function(a,b,c,d){var e,f,g;b=a.listSelections();
top.ICEcoder.setLayout()},0);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.updateNestingIndicator();top.ICEcoder.findMode&&(top.ICEcoder.results.splice(top.ICEcoder.findResult,1),top.get("results").innerHTML=top.ICEcoder.results.length+" "+top.t.results,top.ICEcoder.findMode=!1);if(b=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]){d=b.substr(b.lastIndexOf("/")+1);e=d.substr(d.lastIndexOf(".")+1);for(var f=c.from.line;f<c.from.line+ for(var h=0;h<b.length;h++)if(e=a.getTokenAt(b[h].anchor),"tag bracket"==e.type&&"<"==e.string&&(e=a.getTokenAt({line:b[h].anchor.line,ch:b[h].anchor.ch+1})),"tag"==e.type){f=d.fold.xml(a,b[h].anchor);g=!0;for(var k=0;k<top.ICEcoder.endTagReplaceData.length;k++)"undefined"!=typeof f&&top.ICEcoder.endTagReplaceData[k].split(";")[1]==f.to.line+":"+f.to.ch&&(g=!1);g&&"undefined"!=typeof f&&"undo"!=c.origin&&"redo"!=c.origin&&(e=e.string+";"+f.to.line+":"+f.to.ch,-1==top.ICEcoder.endTagReplaceData.indexOf(e)&&
c.text.length;f++)top.ICEcoder.content.contentWindow.CodeMirror.doFold(-1<a.getLine(f).indexOf("{")?"brace":"xml",null,"+","-",!0)(a,f);if("}"==c.text[0]||c.removed&&"}"==c.removed[0])for(cursor=a.getSearchCursor("{",a.getCursor(),!1),cursor.findPrevious(),f=cursor.from().line;f<a.getCursor().line;f++)top.ICEcoder.content.contentWindow.CodeMirror.doFold(-1<a.getLine(f).indexOf("{")?"brace":"xml",null,"+","-",!0)(a,f)}top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();b&&top.ICEcoder.previewWindow.location&& top.ICEcoder.endTagReplaceData.push(e))}},cMonChange:function(a,b,c){var d,e,f;top.ICEcoder.loadingFile||top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if(0<top.ICEcoder.endTagReplaceData.length)for(b=0;b<top.ICEcoder.endTagReplaceData.length;b++)d=top.ICEcoder.endTagReplaceData[b].split(";"),1*d[1].split(":")[0]!=c.from.line&&(d[1].split(":"),d[1].split(":"),
top.ICEcoder.updatePreviewWindow(a,b,d,e);top.ICEcoder.indicateChanges()},cMonScroll:function(a,b){var c,d;c=top.ICEcoder.getcMInstance();d=top.ICEcoder.getcMdiffInstance();c=-1<b.indexOf("diff")?c:d;top.ICEcoder.mouseDown=!1;c.scrollTo(a.getScrollInfo().left,a.getScrollInfo().top)},cMonInputRead:function(a,b){"keypress"==top.ICEcoder.autoComplete&&top.ICEcoder.codeAssist&&(a.state.completionActive||top.ICEcoder.autocomplete())},cMonRenderLine:function(a,b,c,d){for(var e,f=0;f<top.ICEcoder.renderLineStyle.length;f++){e= d[1].split(":"),d[1].split(":"),d=a.getTokenAt(a.listSelections()[b].anchor),d=d.string,"<"==d&&(d=""));top.ICEcoder.endTagReplaceData=[];top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.updateNestingIndicator();top.ICEcoder.findMode&&(top.ICEcoder.results.splice(top.ICEcoder.findResult,1),top.get("results").innerHTML=top.ICEcoder.results.length+" "+top.t.results,top.ICEcoder.findMode=!1);if(d=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
!1;if("diff"!=top.ICEcoder.renderLineStyle[f][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[f][0]&&-1<b.indexOf("diff"))e=!0;e&&a.lineInfo(c).line+1==top.ICEcoder.renderLineStyle[f][1]&&(d.style[top.ICEcoder.renderLineStyle[f][2]]=top.ICEcoder.renderLineStyle[f][3])}},updateDiffs:function(){var a,b,c,d,e;top.ICEcoder.renderLineStyle=[];top.ICEcoder.renderPaneShiftAmount=0;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();c=a?difflib.stringAsLines(a.getValue()):""; 1]){e=d.substr(d.lastIndexOf("/")+1);f=e.substr(e.lastIndexOf(".")+1);for(b=c.from.line;b<c.from.line+c.text.length;b++)top.ICEcoder.content.contentWindow.CodeMirror.doFold(-1<a.getLine(b).indexOf("{")?"brace":"xml",null,"+","-",!0)(a,b);if("}"==c.text[0]||c.removed&&"}"==c.removed[0])for(cursor=a.getSearchCursor("{",a.getCursor(),!1),cursor.findPrevious(),b=cursor.from().line;b<a.getCursor().line;b++)top.ICEcoder.content.contentWindow.CodeMirror.doFold(-1<a.getLine(b).indexOf("{")?"brace":"xml",
d=b?difflib.stringAsLines(b.getValue()):"";c=(new difflib.SequenceMatcher(c,d)).get_opcodes();if(a){e=a.getAllMarks();for(d=0;d<e.length;d++)e[d].clear();e=b.getAllMarks();for(d=0;d<e.length;d++)e[d].clear()}if(a&&""!=b.getValue())for(d=0;d<c.length;d++)if("equal"!==c[d][0]){if("replace"==c[d][0]){e=(c[d][4]-c[d][2]+1+top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();e>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",e+"px"]);for(var f=0;f<c[d][2]-c[d][1];f++)e= null,"+","-",!0)(a,b)}top.ICEcoder.splitPane&&setTimeout(function(){top.ICEcoder.updateDiffs()},0);d&&top.ICEcoder.previewWindow.location&&"/[NEW]"!=d&&top.ICEcoder.updatePreviewWindow(a,d,e,f);top.ICEcoder.indicateChanges()},cMonScroll:function(a,b){var c,d,e;top.ICEcoder.mouseDown=!1;top.ICEcoder.splitPane&&(c=top.ICEcoder.getcMInstance(),d=top.ICEcoder.getcMdiffInstance(),e=-1<b.indexOf("diff")?c:d,setTimeout(function(){e.scrollTo(a.getScrollInfo().left,a.getScrollInfo().top)},0))},cMonInputRead:function(a,
top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+f),b.getLine(c[d][3]+f)),a.markText({line:c[d][1]+f,ch:0},{line:c[d][3]+f+top.ICEcoder.renderPaneShiftAmount,ch:e[0]},{className:"diffGreyLighter"}),a.markText({line:c[d][1]+f,ch:e[0]},{line:c[d][3]+f+top.ICEcoder.renderPaneShiftAmount,ch:e[0]+e[1]},{className:"diffGrey"}),a.markText({line:c[d][1]+f,ch:e[0]+e[1]},{line:c[d][3]+f+top.ICEcoder.renderPaneShiftAmount,ch:1E6},{className:"diffGreyLighter"})}else a.markText({line:c[d][1],ch:0},{line:c[d][2]- b){"keypress"==top.ICEcoder.autoComplete&&top.ICEcoder.codeAssist&&(a.state.completionActive||top.ICEcoder.autocomplete())},cMonRenderLine:function(a,b,c,d){for(var e,f=0;f<top.ICEcoder.renderLineStyle.length;f++){e=!1;if("diff"!=top.ICEcoder.renderLineStyle[f][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[f][0]&&-1<b.indexOf("diff"))e=!0;e&&a.lineInfo(c).line+1==top.ICEcoder.renderLineStyle[f][1]&&(d.style[top.ICEcoder.renderLineStyle[f][2]]=top.ICEcoder.renderLineStyle[f][3])}},
1,ch:1E6},{className:"diffGreen"});"replace"!=c[d][0]&&c[d][1]==c[d][2]&&(top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",(c[d][4]-c[d][3]+1)*a.defaultTextHeight()+"px"]),a.markText({line:c[d][2]-1,ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffNone"}));if("replace"==c[d][0])for(e=(c[d][2]-c[d][4]+1-top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight(),e>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",e+"px"]),f=0;f<c[d][4]-c[d][3];f++)e=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+ updateDiffs:function(){var a,b,c,d,e,f;top.ICEcoder.renderLineStyle=[];top.ICEcoder.renderPaneShiftAmount=0;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();c=a?difflib.stringAsLines(a.getValue()):"";d=b?difflib.stringAsLines(b.getValue()):"";c=(new difflib.SequenceMatcher(c,d)).get_opcodes();if(a){e=a.getAllMarks();for(d=0;d<e.length;d++)e[d].clear();e=b.getAllMarks();for(d=0;d<e.length;d++)e[d].clear()}if(a&&""!=b.getValue())for(d=0;d<c.length;d++)if("equal"!==c[d][0]){if("replace"==
f),b.getLine(c[d][3]+f)),b.markText({line:c[d][1]+f-top.ICEcoder.renderPaneShiftAmount,ch:0},{line:c[d][3]+f,ch:e[0]},{className:"diffGreyLighter"}),b.markText({line:c[d][1]+f-top.ICEcoder.renderPaneShiftAmount,ch:e[0]},{line:c[d][3]+f,ch:e[0]+e[2]},{className:"diffGrey"}),b.markText({line:c[d][1]+f-top.ICEcoder.renderPaneShiftAmount,ch:e[0]+e[2]},{line:c[d][3]+f,ch:1E6},{className:"diffGreyLighter"});else b.markText({line:c[d][3],ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffRed"});"replace"!=c[d][0]&& c[d][0]){f=(c[d][4]-c[d][2]+1+top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)b.getLineHandle(e).height>a.defaultTextHeight()&&(f+=b.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",f+"px"]);for(e=0;e<c[d][2]-c[d][1];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),a.markText({line:c[d][1]+e,ch:0},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,
ch:f[0]},{className:"diffGreyLighter"}),a.markText({line:c[d][1]+e,ch:f[0]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]+f[1]},{className:"diffGrey"}),a.markText({line:c[d][1]+e,ch:f[0]+f[1]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:1E6},{className:"diffGreyLighter"})}else a.markText({line:c[d][1],ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffGreen"});"replace"!=c[d][0]&&c[d][1]==c[d][2]&&(top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",(c[d][4]-c[d][3]+1)*a.defaultTextHeight()+
"px"]),a.markText({line:c[d][2]-1,ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffNone"}));if("replace"==c[d][0]){f=(c[d][2]-c[d][4]+1-top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)a.getLineHandle(e).height>a.defaultTextHeight()&&(f+=a.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",f+"px"]);for(e=0;e<c[d][4]-c[d][3];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),
b.getLine(c[d][3]+e)),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:0},{line:c[d][3]+e,ch:f[0]},{className:"diffGreyLighter"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{line:c[d][3]+e,ch:f[0]+f[2]},{className:"diffGrey"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:f[0]+f[2]},{line:c[d][3]+e,ch:1E6},{className:"diffGreyLighter"})}else b.markText({line:c[d][3],ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffRed"});"replace"!=c[d][0]&&
c[d][3]==c[d][4]&&(top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",(c[d][2]-c[d][1]+1)*a.defaultTextHeight()+"px"]),b.markText({line:c[d][4]-1,ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffNone"}));top.ICEcoder.renderPaneShiftAmount=c[d][2]-c[d][4]}},findStringDiffs:function(a,b){"undefined"==typeof a&&(a="");"undefined"==typeof b&&(b="");for(var c=0,d=a.length,e=b.length;a[c]&&a[c]==b[c];c++);for(;d>c&e>c&a[d-1]==b[e-1];d--)e--;return[c,d-c,e-c]},updatePreviewWindow:function(a,b,c,d){top.ICEcoder.previewWindow.location.pathname== c[d][3]==c[d][4]&&(top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",(c[d][2]-c[d][1]+1)*a.defaultTextHeight()+"px"]),b.markText({line:c[d][4]-1,ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffNone"}));top.ICEcoder.renderPaneShiftAmount=c[d][2]-c[d][4]}},findStringDiffs:function(a,b){"undefined"==typeof a&&(a="");"undefined"==typeof b&&(b="");for(var c=0,d=a.length,e=b.length;a[c]&&a[c]==b[c];c++);for(;d>c&e>c&a[d-1]==b[e-1];d--)e--;return[c,d-c,e-c]},updatePreviewWindow:function(a,b,c,d){top.ICEcoder.previewWindow.location.pathname==
b?-1<["htm","html","txt"].indexOf(d)?top.ICEcoder.previewWindow.document.documentElement.innerHTML=a.getValue():-1<["md"].indexOf(d)&&(top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())):-1<["css"].indexOf(d)&&-1<top.ICEcoder.previewWindow.document.documentElement.innerHTML.indexOf(c)&&(a=a.getValue(),c=document.createElement("style"),c.type="text/css",c.id="ICEcoder"+b.replace(/\//g,"_"),c.styleSheet?c.styleSheet.cssText=a:c.appendChild(document.createTextNode(a)),top.ICEcoder.previewWindow.document.getElementById(c.id)&& b?-1<["htm","html","txt"].indexOf(d)?top.ICEcoder.previewWindow.document.documentElement.innerHTML=a.getValue():-1<["md"].indexOf(d)&&(top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())):-1<["css"].indexOf(d)&&-1<top.ICEcoder.previewWindow.document.documentElement.innerHTML.indexOf(c)&&(a=a.getValue(),c=document.createElement("style"),c.type="text/css",c.id="ICEcoder"+b.replace(/\//g,"_"),c.styleSheet?c.styleSheet.cssText=a:c.appendChild(document.createTextNode(a)),top.ICEcoder.previewWindow.document.getElementById(c.id)&&
top.ICEcoder.previewWindow.document.documentElement.removeChild(top.ICEcoder.previewWindow.document.getElementById(c.id)),top.ICEcoder.previewWindow.document.documentElement.appendChild(c));try{top.ICEcoder.doPesticide()}catch(e){}try{top.ICEcoder.doStatsJS("update")}catch(f){}},contentCleanUp:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getValue();b=b.replace(/<ICEcoder:\/:textarea>/g,"</textarea>");a.setValue(b); top.ICEcoder.previewWindow.document.documentElement.removeChild(top.ICEcoder.previewWindow.document.getElementById(c.id)),top.ICEcoder.previewWindow.document.documentElement.appendChild(c));try{top.ICEcoder.doPesticide()}catch(e){}try{top.ICEcoder.doStatsJS("update")}catch(e){}try{top.ICEcoder.doResponsive()}catch(e){}},contentCleanUp:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getValue();b=b.replace(/<ICEcoder:\/:textarea>/g,
a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration()},undo:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a).undo()},redo:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a).redo()},indent:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")? "</textarea>");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration()},undo:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a).undo()},redo:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a).redo()},indent:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();
c:b;"more"==a?top.ICEcoder.content.contentWindow.CodeMirror.commands.indentMore(b):top.ICEcoder.content.contentWindow.CodeMirror.commands.indentLess(b)},moveLines:function(a){var b,c,d,e,f,g,k;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;e=d.getCursor("start");f=d.getCursor("end");"up"==a&&0<e.line&&(g=e.line-1);"down"==a&&f.line<d.lineCount()-1&&(g=f.line+1);isNaN(g)||(k=d.getLine(g),d.operation(function(){if("up"==a)for(var b= b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;"more"==a?top.ICEcoder.content.contentWindow.CodeMirror.commands.indentMore(b):top.ICEcoder.content.contentWindow.CodeMirror.commands.indentLess(b)},moveLines:function(a){var b,c,d,e,f,g,h;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;e=d.getCursor("start");f=d.getCursor("end");"up"==a&&0<e.line&&(g=e.line-1);"down"==a&&f.line<d.lineCount()-1&&(g=f.line+1);isNaN(g)||
e.line;b<=f.line;b++)d.replaceRange(d.getLine(b),{line:b-1,ch:0},{line:b-1,ch:1E6});else for(b=f.line;b>=e.line;b--)d.replaceRange(d.getLine(b),{line:b+1,ch:0},{line:b+1,ch:1E6});d.replaceRange(k,{line:"up"==a?f.line:e.line,ch:0},{line:"up"==a?f.line:e.line,ch:1E6});d.setSelection({line:e.line+("up"==a?-1:1),ch:e.ch},{line:f.line+("up"==a?-1:1),ch:f.ch})}))},highlightLine:function(a){var b,c;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")? (h=d.getLine(g),d.operation(function(){if("up"==a)for(var b=e.line;b<=f.line;b++)d.replaceRange(d.getLine(b),{line:b-1,ch:0},{line:b-1,ch:1E6});else for(b=f.line;b>=e.line;b--)d.replaceRange(d.getLine(b),{line:b+1,ch:0},{line:b+1,ch:1E6});d.replaceRange(h,{line:"up"==a?f.line:e.line,ch:0},{line:"up"==a?f.line:e.line,ch:1E6});d.setSelection({line:e.line+("up"==a?-1:1),ch:e.ch},{line:f.line+("up"==a?-1:1),ch:f.ch})}))},highlightLine:function(a){var b,c;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();
c:b;b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},focus:function(a){var b,c;/iPhone|iPad|iPod/i.test(navigator.userAgent)||(b=top.ICEcoder.getcMInstance(),c=top.ICEcoder.getcMdiffInstance(),(a=a?c:b)&&a.focus())},goToLine:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b).setCursor(a?a-1:top.get("goToLineNo").value-1);top.ICEcoder.focus();setTimeout(function(){top.ICEcoder.focus()},0);return!1}, b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},focus:function(a){var b,c;/iPhone|iPad|iPod/i.test(navigator.userAgent)||(b=top.ICEcoder.getcMInstance(),c=top.ICEcoder.getcMdiffInstance(),(a=a?c:b)&&a.focus())},goToLine:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b).setCursor(a?a-1:top.get("goToLineNo").value-1);top.ICEcoder.focus();
lineCommentToggle:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);ICEcoder.lineCommentToggleSub(a,b,c,d,d.length)},tagWrapper:function(a){var b,c,d,e,f;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;b=a;"div"==a?(e=d.getCursor("start").line,f=d.getCursor().line,d.operation(function(){d.replaceSelection("<div>\n"+ setTimeout(function(){top.ICEcoder.focus()},0);return!1},lineCommentToggle:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);ICEcoder.lineCommentToggleSub(a,b,c,d,d.length)},tagWrapper:function(a){var b,c,d,e,f;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;b=a;"div"==a?(e=d.getCursor("start").line,
d.getSelection()+"\n</div>","around");for(var a=e+1;a<=f+1;a++)d.indentLine(a);d.indentLine(f+2,"prev");d.indentLine(f+2,"subtract")})):-1<"p a b i strong em h1 h2 h3 li".split(" ").indexOf(a)&&d.getSelection().substr(0,a.length+1)=="<"+b&&d.getSelection().substr(-(a.length+3))=="</"+a+">"?d.replaceSelection(d.getSelection().substr(d.getSelection().indexOf(">")+1,d.getSelection().length-d.getSelection().indexOf(">")-1-a.length-3),"around"):("a"==a&&(b='a href=""'),d.replaceSelection("<"+b+">"+d.getSelection()+ f=d.getCursor().line,d.operation(function(){d.replaceSelection("<div>\n"+d.getSelection()+"\n</div>","around");for(var a=e+1;a<=f+1;a++)d.indentLine(a);d.indentLine(f+2,"prev");d.indentLine(f+2,"subtract")})):-1<["p","a","h1","h2","h3"].indexOf(a)&&d.getSelection().substr(0,a.length+1)=="<"+b&&d.getSelection().substr(-(a.length+3))=="</"+a+">"?d.replaceSelection(d.getSelection().substr(d.getSelection().indexOf(">")+1,d.getSelection().length-d.getSelection().indexOf(">")-1-a.length-3),"around"):("a"==
"</"+a+">","around"),"a"==a&&d.setCursor({line:d.getCursor("start").line,ch:d.getCursor("start").ch+9}))},addLineBreakAtEnd:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=b.getCursor().line);b.replaceRange(b.getLine(a)+"<br>",{line:a,ch:0},{line:a,ch:1E6})},insertLineBefore:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")? a&&(b='a href=""'),d.replaceSelection("<"+b+">"+d.getSelection()+"</"+a+">","around"),"a"==a&&d.setCursor({line:d.getCursor("start").line,ch:d.getCursor("start").ch+9}))},addLineBreakAtEnd:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=b.getCursor().line);b.replaceRange(b.getLine(a)+"<br>",{line:a,ch:0},{line:a,ch:1E6})},insertLineBefore:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();
c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange("\n"+d.getLine(a),{line:a,ch:0},{line:a,ch:1E6});d.setCursor({line:d.getCursor().line-1,ch:0});d.execCommand("indentAuto")})},insertLineAfter:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange(d.getLine(a)+"\n",{line:a,ch:0},{line:a,ch:1E6});d.execCommand("indentAuto")})},duplicateLines:function(a){var b, d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange("\n"+d.getLine(a),{line:a,ch:0},{line:a,ch:1E6});d.setCursor({line:d.getCursor().line-1,ch:0});d.execCommand("indentAuto")})},insertLineAfter:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange(d.getLine(a)+"\n",{line:a,ch:0},{line:a,
c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"end"),b.setSelection(c,d)):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.replaceRange(b.getLine(a)+"\n"+b.getLine(a),{line:a,ch:0},{line:a,ch:1E6}),b.setCursor(a+1,c))},removeLines:function(a){var b, ch:1E6});d.execCommand("indentAuto")})},duplicateLines:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"end"),b.setSelection(c,d)):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.replaceRange(b.getLine(a)+"\n"+b.getLine(a),{line:a,
c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;!a&&b.somethingSelected()?b.replaceSelection("","end"):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.execCommand("deleteLine"),b.setCursor(a-1,c))},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos); ch:0},{line:a,ch:1E6}),b.setCursor(a+1,c))},removeLines:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;!a&&b.somethingSelected()?b.replaceSelection("","end"):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.execCommand("deleteLine"),b.setCursor(a-1,c))},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getTokenAt(a.getCursor()).string;
else for(top.ICEcoder.origCurorPos=a.getCursor(),a=["var "+b,"function "+b,b+"=function",b+"= function",b+" =function",b+" = function",b+"=new function",b+"= new function",b+" =new function",b+" = new function","window['"+b+"']",'window["'+b+'"]',"this['"+b+"']",'this["'+b+'"]',b+":",b+" :","def "+b,"class "+b],b=0;b<a.length&&!top.ICEcoder.findReplace(a[b],!1,!1);b++);},autocomplete:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")? if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);else for(top.ICEcoder.origCurorPos=a.getCursor(),a=["var "+b,"function "+b,b+"=function",b+"= function",b+" =function",b+" = function",b+"=new function",b+"= new function",b+" =new function",b+" = new function","window['"+b+"']",'window["'+b+'"]',"this['"+b+"']",'this["'+b+'"]',b+":",b+" :","def "+b,"class "+b],b=0;b<a.length&&!top.ICEcoder.findReplace(a[b],!1,!1);b++);},autocomplete:function(){var a,b;a=ICEcoder.getcMInstance();
b:a;top.ICEcoder.content.contentWindow.CodeMirror.commands.autocomplete(a)},pasteURL:function(a){var b,c;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;"CTRL"==top.ICEcoder.draggingWithKey&&(a=window.location.protocol+"//"+window.location.hostname+a);b.replaceSelection(a,"around")},searchForSelected:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")? b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;top.ICEcoder.content.contentWindow.CodeMirror.commands.autocomplete(a)},pasteURL:function(a){var b,c;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;"CTRL"==top.ICEcoder.draggingWithKey&&(a=window.location.protocol+"//"+window.location.hostname+a);b.replaceSelection(a,"around")},searchForSelected:function(){var a,b;a=top.ICEcoder.getcMInstance();
b:a;top.ICEcoder.caretLocType&&(""!=a.getSelection()?(b=top.ICEcoder.caretLocType.toLowerCase()+" ","Content"==top.ICEcoder.caretLocType&&(b=""),window.open("http://www.google.com/#output=search&q="+b+a.getSelection())):top.ICEcoder.message(top.t["No text selected..."]))},fmAction:function(a,b){var c,d,e,f;c=top.get("filesFrame").contentWindow.document.getElementById(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1]+"_perms").parentNode;d=c.parentNode;e=-1<c.onmouseover.toString().indexOf("'folder'")? b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;top.ICEcoder.caretLocType&&(""!=a.getSelection()?(b=top.ICEcoder.caretLocType.toLowerCase()+" ","Content"==top.ICEcoder.caretLocType&&(b=""),window.open("http://www.google.com/#output=search&q="+b+a.getSelection())):top.ICEcoder.message(top.t["No text selected..."]))},fmAction:function(a,b){var c,d,e,f;c=top.get("filesFrame").contentWindow.document.getElementById(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
"folder":"file";f=!1;"up"==b&&(d.previousSibling&&d.previousSibling.previousSibling?(f=d.previousSibling.previousSibling,"UL"==f.tagName&&(f=f.childNodes[f.childNodes.length-1])):d.parentNode.previousSibling&&(f=d.parentNode.previousSibling),f&&(f=f.childNodes[0]));"down"==b&&(d.nextSibling&&d.nextSibling.childNodes[0]?f=d.nextSibling.childNodes[0]:d.nextSibling&&d.nextSibling.nextSibling?f=d.nextSibling.nextSibling:d.parentNode.nextSibling&&(f=d.parentNode.nextSibling.nextSibling),f&&(f=f.childNodes[0])); 1]+"_perms").parentNode;d=c.parentNode;e=-1<c.onmouseover.toString().indexOf("'folder'")?"folder":"file";f=!1;"up"==b&&(d.previousSibling&&d.previousSibling.previousSibling?(f=d.previousSibling.previousSibling,"UL"==f.tagName&&(f=f.childNodes[f.childNodes.length-1])):d.parentNode.previousSibling&&(f=d.parentNode.previousSibling),f&&(f=f.childNodes[0]));"down"==b&&(d.nextSibling&&d.nextSibling.childNodes[0]?f=d.nextSibling.childNodes[0]:d.nextSibling&&d.nextSibling.nextSibling?f=d.nextSibling.nextSibling:
"left"==b&&"folder"==e&&d.parentNode.previousSibling&&top.ICEcoder.openCloseDir(c,!1);if("right"==b||"enter"==b)"folder"==e?top.ICEcoder.openCloseDir(c,!0):top.ICEcoder.openFile(c.childNodes[1].id.replace(/\|/g,"/"));f&&f.childNodes[1]&&(top.ICEcoder.overFileFolder(e,f.childNodes[1].id),top.ICEcoder.selectFileFolder(a))},openCloseDir:function(a,b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.openCloseDir(this,!b)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"== d.parentNode.nextSibling&&(f=d.parentNode.nextSibling.nextSibling),f&&(f=f.childNodes[0]));"left"==b&&"folder"==e&&d.parentNode.previousSibling&&top.ICEcoder.openCloseDir(c,!1);if("right"==b||"enter"==b)"folder"==e?top.ICEcoder.openCloseDir(c,!0):top.ICEcoder.openFile(c.childNodes[1].id.replace(/\|/g,"/"));f&&f.childNodes[1]&&(top.ICEcoder.overFileFolder(e,f.childNodes[1].id),top.ICEcoder.selectFileFolder(a))},openCloseDir:function(a,b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.cmdKey||
c.tagName&&((d="none"==c.style.display)?b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");b?top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/get-branch.php?location="+a.childNodes[1].id+"&csrf="+top.ICEcoder.csrf:"UL"==c.tagName&&c.parentNode.removeChild(c);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=a;ICEcoder.thisFileFolderLink=b},selectFileFolder:function(a,b,c){var d,e,f;if(""==top.ICEcoder.thisFileFolderLink)b|| top.ICEcoder.openCloseDir(this,!b)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"==c.tagName&&((d="none"==c.style.display)?b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");b?top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/get-branch.php?location="+a.childNodes[1].id+"&csrf="+top.ICEcoder.csrf:"UL"==c.tagName&&c.parentNode.removeChild(c);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=
a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.deselectAllFiles();else if(top.ICEcoder.thisFileFolderLink)if(e=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),d=top.ICEcoder.filesFrame.contentWindow.document.getElementById(e),b||a.ctrlKey||top.ICEcoder.cmdKey)-1<top.ICEcoder.selectedFiles.indexOf(e)?(ICEcoder.selectDeselectFile("deselect",d),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(e),1)):(ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e));else if(c|| a;ICEcoder.thisFileFolderLink=b},isFileFolder:function(a){return(a=top.get("filesFrame").contentWindow.document.getElementById(a.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,"|")))?-1<a.parentNode.parentNode.className.indexOf("directory")?"folder":"file":!1},selectFileFolder:function(a,b,c){var d,e,f;if(""==top.ICEcoder.thisFileFolderLink)b||a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.deselectAllFiles();else if(top.ICEcoder.thisFileFolderLink)if(e=top.ICEcoder.thisFileFolderLink.replace(/\//g,
a.shiftKey){var g=function(a,b,c,d){return("00000000000000000000"+a).substr(-20)};a=!1;b=d.parentNode.parentNode.parentNode;f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1];c=e.replace(/\d+/g,g)<f.replace(/\d+/g,g)?e:f;f=e.replace(/\d+/g,g)>f.replace(/\d+/g,g)?e:f;if(0<top.ICEcoder.selectedFiles.length&&c.substr(0,c.lastIndexOf("|"))==f.substr(0,f.lastIndexOf("|")))for(e=0;1E6>e&&("LI"!=b.childNodes[e].nodeName&&e++,d=b.childNodes[e].childNodes[0].childNodes[1],d.id==c&&(a=!0),1== "|"),d=top.ICEcoder.filesFrame.contentWindow.document.getElementById(e),b||a.ctrlKey||top.ICEcoder.cmdKey)-1<top.ICEcoder.selectedFiles.indexOf(e)?(ICEcoder.selectDeselectFile("deselect",d),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(e),1)):(ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e));else if(c||a.shiftKey){var g=function(a,b,c,d){return("00000000000000000000"+a).substr(-20)};a=!1;b=d.parentNode.parentNode.parentNode;f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
a&&-1==top.ICEcoder.selectedFiles.indexOf(d.id)&&(ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(d.id)),d.id!=f);e+=2);else ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e);top.ICEcoder.githubDiff&&(top.get("githubNavSelectedCount").innerHTML="Selected: "+top.ICEcoder.selectedFiles.length,top.get("githubNavCommit").style.color=0<top.ICEcoder.selectedFiles.length? 1];c=e.replace(/\d+/g,g)<f.replace(/\d+/g,g)?e:f;f=e.replace(/\d+/g,g)>f.replace(/\d+/g,g)?e:f;if(0<top.ICEcoder.selectedFiles.length&&c.substr(0,c.lastIndexOf("|"))==f.substr(0,f.lastIndexOf("|")))for(e=0;1E6>e&&("LI"!=b.childNodes[e].nodeName&&e++,d=b.childNodes[e].childNodes[0].childNodes[1],d.id==c&&(a=!0),1==a&&-1==top.ICEcoder.selectedFiles.indexOf(d.id)&&(ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(d.id)),d.id!=f);e+=2);else ICEcoder.selectDeselectFile("select",
"#fff":"#333",top.get("githubNavCommit").style.background=0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555",top.get("githubNavSelectedCount").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.background=0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555");document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected files"]:top.t["all files"]; d),top.ICEcoder.selectedFiles.push(e)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e);top.ICEcoder.githubDiff&&(top.get("githubNavSelectedCount").innerHTML="Selected: "+top.ICEcoder.selectedFiles.length,top.get("githubNavCommit").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavCommit").style.background=0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555",top.get("githubNavSelectedCount").style.color=0<
document.findAndReplace.target[3].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected filenames"]:top.t["all filenames"];top.ICEcoder.hideFileMenu()},deselectAllFiles:function(){for(var a,b=0;b<top.ICEcoder.selectedFiles.length;b++)a=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selectedFiles[b]),ICEcoder.selectDeselectFile("deselect",a);top.ICEcoder.selectedFiles.length=0},selectDeselectFile:function(a,b){var c;b&&(c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g, top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.background=0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555");document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected files"]:top.t["all files"];document.findAndReplace.target[3].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected filenames"]:top.t["all filenames"];top.ICEcoder.hideFileMenu()},
"/"))?!0:!1,top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]==b.id.replace(/\|/g,"/")?b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:top.ICEcoder.tabBGcurrent:b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},boxSelect:function(a,b){var c,d;c=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmDragBox"); deselectAllFiles:function(){for(var a,b=0;b<top.ICEcoder.selectedFiles.length;b++)a=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selectedFiles[b]),ICEcoder.selectDeselectFile("deselect",a);top.ICEcoder.selectedFiles.length=0},selectDeselectFile:function(a,b){var c;b&&(c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g,"/"))?!0:!1,top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]==b.id.replace(/\|/g,"/")?b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:
"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast="");top.ICEcoder.mouseDown&&"drag"==b&&(top.ICEcoder.fmDraggedBox=!0,d=0<top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX,c.style.left=(d?top.ICEcoder.fmDragBoxStartX:top.ICEcoder.mouseX)+"px",c.style.width=Math.abs(top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX)+"px",d=0<top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY,c.style.top= top.ICEcoder.tabBGcurrent:b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},boxSelect:function(a,b){var c,d;c=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmDragBox");"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast=
(d?top.ICEcoder.fmDragBoxStartY-70:top.ICEcoder.mouseY-70)+"px",c.style.height=Math.abs(top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY)+"px",""!=top.ICEcoder.thisFileFolderLink&&(""==top.ICEcoder.fmDragSelectFirst?(top.ICEcoder.fmDragSelectFirst=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0<top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectFirst),top.ICEcoder.selectFileFolder(a)):(top.ICEcoder.fmDragSelectLast=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0< "");top.ICEcoder.mouseDown&&"drag"==b&&(top.ICEcoder.fmDraggedBox=!0,d=0<top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX,c.style.left=(d?top.ICEcoder.fmDragBoxStartX:top.ICEcoder.mouseX)+"px",c.style.width=Math.abs(top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX)+"px",d=0<top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY,c.style.top=(d?top.ICEcoder.fmDragBoxStartY-70:top.ICEcoder.mouseY-70)+"px",c.style.height=Math.abs(top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY)+"px",""!=top.ICEcoder.thisFileFolderLink&&
top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectLast),top.ICEcoder.selectFileFolder(a,!1,"shiftSim"))));"up"==b&&(c.style.width=0,c.style.height=0)},newFile:function(){top.ICEcoder.newTab("alsoSave")},newFolder:function(){var a,b;a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter new folder name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+ (""==top.ICEcoder.fmDragSelectFirst?(top.ICEcoder.fmDragSelectFirst=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0<top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectFirst),top.ICEcoder.selectFileFolder(a)):(top.ICEcoder.fmDragSelectLast=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0<top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectLast),top.ICEcoder.selectFileFolder(a,!1,"shiftSim"))));"up"==b&&
top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>"+top.t["Creating Folder"]+"</b><br>"+b)},openFile:function(a){var b,c=1;"undefined"!=typeof a&&(b=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a),null!==b?(c=b[4],a=b[1]):0<a.indexOf(":")?(c=a.split(":")[1],a=a.split(":")[0]):0<a.indexOf("(")&&0<a.indexOf(")")&&(c=a.split("(")[1].split(")")[0],a=a.split("(")[0]));a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType="file");"/[NEW]"!=top.ICEcoder.thisFileFolderLink&& (c.style.width=0,c.style.height=0)},newFile:function(){top.ICEcoder.newTab("alsoSave")},newFolder:function(){var a,b;a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter new folder name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>"+top.t["Creating Folder"]+"</b><br>"+b)},returnFileAndLine:function(a){var b=
!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?(top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1),1<c&&top.ICEcoder.goToLine(c)):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),b=!0,100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message(top.t["Sorry you can..."]),b=!1),b&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g, 1,c=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a);null!==c?(b=c[4],a=c[1]):0<a.indexOf("://")?a.lastIndexOf(":")!==a.indexOf("://")&&(b=a.split(":")[2],a=a.substr(0,a.lastIndexOf(":"))):0<a.indexOf(":")&&(b=a.split(":")[1],a=a.split(":")[0]);0<a.indexOf("(")&&0<a.indexOf(")")&&(b=a.split("(")[1].split(")")[0],a=a.split("(")[0]);return[a,b]},openFile:function(a){var b,c;"undefined"!=typeof a&&(b=top.ICEcoder.returnFileAndLine(a),a=b[0],b=b[1]);a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType=
"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink+"&csrf="+top.ICEcoder.csrf+"&lineNumber="+c),top.ICEcoder.serverMessage("<b>"+top.t["Opening File"]+"</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b<a.length;b++)top.ICEcoder.thisFileFolderLink=a[b].replace("|","/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},openPrompt:function(){var a; "file");"/[NEW]"!=top.ICEcoder.thisFileFolderLink&&!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?(top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1),1<b&&top.ICEcoder.goToLine(b)):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),c=!0,100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message(top.t["Sorry you can..."]),c=!1),c&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=
if(a=top.ICEcoder.getInput(top.t["Enter relative file..."],""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):top.ICEcoder.openFile(a)},getRemoteFile:function(a){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf,a);top.ICEcoder.serverMessage("<b>"+top.t.Getting+"</b><br>"+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0<top.ICEcoder.selectedFiles.length&& top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink+"&csrf="+top.ICEcoder.csrf+"&lineNumber="+b),top.ICEcoder.serverMessage("<b>"+top.t["Opening File"]+"</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b<a.length;b++)top.ICEcoder.thisFileFolderLink=a[b].replace("|","/"),top.ICEcoder.thisFileFolderType=
(c=top.ICEcoder.selectedFiles[0],b=-1==c.lastIndexOf(".")||c.lastIndexOf(".")<c.lastIndexOf("|")?c+b:"|[NEW]");b=b.replace("||","|");top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+a+"&csrf="+top.ICEcoder.csrf,b);top.ICEcoder.serverMessage("<b>"+top.t.Saving+"</b><br>"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length- "file",top.ICEcoder.openFile()},openPrompt:function(){var a;if(a=top.ICEcoder.getInput(top.t["Enter relative file..."],""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):top.ICEcoder.openFile(a)},getRemoteFile:function(a){var b;"undefined"!=typeof a&&(b=top.ICEcoder.returnFileAndLine(a),a=b[0],b=b[1]);top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf+"&lineNumber="+b,a);top.ICEcoder.serverMessage("<b>"+top.t.Getting+"</b><br>"+a)},saveFile:function(a){var b,
1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1<d&&(top.ICEcoder.openFiles[d]=b,closeTabLink='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>', c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0<top.ICEcoder.selectedFiles.length&&(c=top.ICEcoder.selectedFiles[0],b=-1==c.lastIndexOf(".")||c.lastIndexOf(".")<c.lastIndexOf("|")?c+b:"|[NEW]");b=b.replace("||","|");top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&fileVersion="+ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+"&saveType="+a+"&csrf="+
c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage("<b>"+top.t["Renaming to"]+"</b><br>"+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1<d&&(top.ICEcoder.openFiles[d]= top.ICEcoder.csrf,b);top.ICEcoder.serverMessage("<b>"+top.t.Saving+"</b><br>"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1<d&&
b,closeTabLink='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title= (top.ICEcoder.openFiles[d]=b,closeTabLink='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),
b),top.ICEcoder.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>"+top.t["Moving to"]+"</b><br>"+b)),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a=a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0<a.length&&top.ICEcoder.ask("Delete:\n\n"+b+"?")&&(top.ICEcoder.serverQueue("add", top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage("<b>"+top.t["Renaming to"]+"</b><br>"+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1<d&&(top.ICEcoder.openFiles[d]=b,closeTabLink='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>',
"lib/file-control-xhr.php?action=delete&&csrf="+top.ICEcoder.csrf,a.join(";")),top.ICEcoder.serverMessage("<b>"+top.t["Deleting File"]+"</b><br>"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d<a.length;d++)top.ICEcoder.copiedFiles[d]=a[d];b||(top.get("fmMenuPasteOption").style.display="block");c||top.ICEcoder.hideFileMenu()},pasteFiles:function(a){if(top.ICEcoder.copiedFiles)for(var b=0;b<top.ICEcoder.copiedFiles.length;b++)"|"!=top.ICEcoder.copiedFiles[b]?(top.ICEcoder.serverQueue("add", c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>"+top.t["Moving to"]+"</b><br>"+b)),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;
"lib/file-control-xhr.php?action=paste&location="+a+"&csrf="+top.ICEcoder.csrf,top.ICEcoder.copiedFiles[b]),top.ICEcoder.serverMessage("<b>"+top.t["Pasting File"]+"</b><br>"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])},duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide"); a=a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0<a.length&&top.ICEcoder.ask("Delete:\n\n"+b+"?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=delete&&csrf="+top.ICEcoder.csrf,a.join(";")),top.ICEcoder.serverMessage("<b>"+top.t["Deleting File"]+"</b><br>"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d<a.length;d++)top.ICEcoder.copiedFiles[d]=a[d];b||(top.get("fmMenuPasteOption").style.display="block");c||top.ICEcoder.hideFileMenu()},
a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt= pasteFiles:function(a){if(top.ICEcoder.copiedFiles)for(var b=0;b<top.ICEcoder.copiedFiles.length;b++)"|"!=top.ICEcoder.copiedFiles[b]?(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=paste&location="+a+"&csrf="+top.ICEcoder.csrf,top.ICEcoder.copiedFiles[b]),top.ICEcoder.serverMessage("<b>"+top.t["Pasting File"]+"</b><br>"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])},
setTimeout(function(){for(var a=0;a<c.length;a++)top.ICEcoder.showHide("hide",top.get(c[a])),top.get(c[a]+"Nav").style.color=""},150);else for(var d=0;d<c.length;d++)top.ICEcoder.showHide("hide",top.get(c[d])),top.get(c[d]+"Nav").style.color="";get("fileOptions").style.opacity=0;"show"==a&&("undefined"!=typeof fileNavInt&&clearTimeout(fileNavInt),top.ICEcoder.showHide(a,top.get(b)),top.get(b+"Nav").style.color="#fff",get("fileOptions").style.opacity=1)},isPathFolder:function(a){a=top.ICEcoder.filesFrame.contentDocument.getElementsByClassName("pft-directory"); duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),
for(var b=top.ICEcoder.selectedFiles[0],c,d=0;d<a.length;d++)if(c=a[d],"underfined"!=typeof c&&(c=c.childNodes[0],"undefined"!=typeof c&&(c=c.childNodes[1],"undefined"!=typeof c&&b===c.getAttribute("id"))))return!0;return!1},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&& event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;a<c.length;a++)top.ICEcoder.showHide("hide",top.get(c[a])),top.get(c[a]+"Nav").style.color=""},150);else for(var d=0;d<c.length;d++)top.ICEcoder.showHide("hide",top.get(c[d])),top.get(c[d]+"Nav").style.color="";get("fileOptions").style.opacity=0;"show"==a&&("undefined"!=typeof fileNavInt&&clearTimeout(fileNavInt),top.ICEcoder.showHide(a,
""!=top.ICEcoder.thisFileFolderLink&&(b=this.isPathFolder(top.ICEcoder.selectedFiles[0])?"folder":"file",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?"block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display= top.get(b)),top.get(b+"Nav").style.color="#fff",get("fileOptions").style.opacity=1)},isPathFolder:function(a){a=top.ICEcoder.filesFrame.contentDocument.getElementsByClassName("pft-directory");for(var b=top.ICEcoder.selectedFiles[0],c,d=0;d<a.length;d++)if(c=a[d],"underfined"!=typeof c&&(c=c.childNodes[0],"undefined"!=typeof c&&(c=c.childNodes[1],"undefined"!=typeof c&&b===c.getAttribute("id"))))return!0;return!1},checkExists:function(a){var b,c,d;a=a.replace(/\|/g,"/");0===a.indexOf(top.iceRoot)&&
"inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity= (a=a.replace(top.iceRoot,""));b=top.ICEcoder.xhrObj();b.onreadystatechange=function(){4==b.readyState&&(c=JSON.parse(b.responseText),c.action.timeEnd=(new Date).getTime(),c.action.timeTaken=c.action.timeEnd-c.action.timeStart,0<=["raw","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(b.responseText),0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(c),top.ICEcoder.lastFileDirCheckStatusObj=c,200==b.status?c.status.error?(top.ICEcoder.message(c.status.errorMsg),console.log("ICEcoder error info for your request..."),
"0"},updateFileManagerList:function(a,b,c,d,e,f,g){var k,h,l,p,n,m,t;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling; console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)):eval(c.action.doNext):(top.ICEcoder.message(top.t["Sorry there was..."]),console.log("ICEcoder error info for your request..."),console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))};b.open("POST","lib/file-control-xhr.php?action=checkExists&csrf="+top.ICEcoder.csrf,!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");d=(new Date).getTime();b.send("timeStart="+d+"&file="+
p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" "+("folder"==g?"ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\"": a)},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=this.isPathFolder(top.ICEcoder.selectedFiles[0])?"folder":"file",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?
"")+' onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {'+("folder"==g?"top.ICEcoder.openCloseDir(this,"+("folder"==g?"true":"false")+");":"")+' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+n+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+ "block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display="inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-
d+"</span></a>";if(3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m,l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m), 10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){var h,k,l,p,n,m,q;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,
l.nextSibling.appendChild(p);else for(h=0;h<l.childNodes.length;h++)if(l.childNodes[h].className&&(m=0<l.childNodes[h].className.indexOf("directory")?"folder":"file",t=l.childNodes[h].getElementsByTagName("span")[0].innerHTML,m==g&&t>c||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className=k;m.draggable=!1;m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus(): "|")+"|"+c)){h="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");k=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=k.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+
top.ICEcoder.getcMdiffInstance().focus())};m.ondragend=function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;h==l.childNodes.length-1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[h]),l.insertBefore(p,l.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g, g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" "+("folder"==g?"ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\"":"")+' onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {'+("folder"==g?"top.ICEcoder.openCloseDir(this,"+("folder"==g?"true":"false")+");":"")+' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+
"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",e.substr(0,e.lastIndexOf("/")),c));"chmod"==a&&(f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(f.replace(/\//g,"|")+"_perms"),h.style.background= b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+n+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(!l||3>l.childNodes.length)m=document.createElement("ul"),l=k.parentNode.parentNode,l.parentNode.insertBefore(m,l.nextSibling),m=document.createElement("li"),m.className=h,m.draggable=!1,m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?
777==d?"#800":"none",h.style.color=777==d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0); top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m),l.nextSibling.appendChild(p);else for(k=0;k<l.childNodes.length;k++)if(l.childNodes[k].className&&(m=0<l.childNodes[k].className.indexOf("directory")?"folder":"file",q=l.childNodes[k].getElementsByTagName("span")[0].innerHTML,m==g&&q>c||"folder"==g&&"file"==m||k==l.childNodes.length-1)){m=document.createElement("li");m.className=
top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b||93==b)top.ICEcoder.cmdKey=!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+ h;m.draggable=!1;m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragend=function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;k==l.childNodes.length-1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[k]),l.insertBefore(p,l.childNodes[k+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&setTimeout(function(){c="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1},findReplaceOptions:function(){top.get("rText").style.display= 1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),k=top.get("filesFrame").contentWindow.document.getElementById(f),k.innerHTML=c,k.id=b.replace(/\//g,"|")+"|"+c,k.parentNode.title=k.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms",top.ICEcoder.renameInChildren(k,e,b,c));"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",e.substr(0,
top.get("replace").style.display=top.get("rTarget").style.display=document.findAndReplace.connector.value==top.t.and?"inline-block":"none"},findReplace:function(a,b,c,d){if(d)top.get("find").value=top.get("find").value,top.ICEcoder.focus();else{var e,f,g;a=a.toLowerCase();e=top.get("replace").value;f=top.get("results");d=ICEcoder.getcMInstance();g=ICEcoder.getcMdiffInstance();if((d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?g:d)&&0<a.length&&document.findAndReplace.target.value==top.t["this document"]){d.getValue().toLowerCase(); e.lastIndexOf("/")),c));"chmod"==a&&(f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),k=top.get("filesFrame").contentWindow.document.getElementById(f.replace(/\//g,"|")+"_perms"),k.style.background=777==d?"#800":"none",k.style.color=777==d?"#eee":"#888",k.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),k=(b+"|"+c).replace("||","|"),k=top.get("filesFrame").contentWindow.document.getElementById(k).parentNode.parentNode,
document.findAndReplace.connector.value==top.t.and&&c&&(document.findAndReplace.replaceAction.value==top.t.replace&&d.getSelection().toLowerCase()==a?d.replaceSelection(e,"around"):document.findAndReplace.replaceAction.value==top.t["replace all"]&&(c=new RegExp(a,"gi"),d.setValue(d.getValue().replace(c,e))));c=d.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];ICEcoder.resultsLines=[];for(e=0;e<c.length;e++)c.substr(e,a.length)==a&&-1==ICEcoder.results.indexOf(e)&& top.ICEcoder.openCloseDir(k.childNodes[0],!1),k.parentNode.removeChild(k))},renameInChildren:function(a,b,c,d){var e,f;if(a.parentNode.parentNode.nextSibling&&"UL"==a.parentNode.parentNode.nextSibling.nodeName){a=a.parentNode.parentNode.nextSibling;for(var g=0;g<a.childNodes.length;g++)"LI"==a.childNodes[g].nodeName&&(e=a.childNodes[g].childNodes[0].childNodes[1],e.id=e.id.replace(b.replace(/\//g,"|"),c.replace(/\//g,"|")+"|"+d),e.parentNode.title=e.id.replace(/\|/g,"/"),f=top.get("filesFrame").contentWindow.document.getElementById(e.id).nextSibling.nextSibling,
(ICEcoder.results.push(e),-1==ICEcoder.resultsLines.indexOf(d.posFromIndex(e).line+1)&&ICEcoder.resultsLines.push(d.posFromIndex(e).line+1));ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)f.innerHTML=ICEcoder.results.length+" results";else{for(e=ICEcoder.findResult=0;e<ICEcoder.results.length;e++)ICEcoder.results[e]<d.indexFromPos(d.getCursor())&&ICEcoder.findResult++;ICEcoder.findResult>ICEcoder.results.length-1&&(ICEcoder.findResult=0);f.innerHTML="Highlighted result "+(ICEcoder.findResult+ f.id=e.id+"_perms",top.ICEcoder.renameInChildren(e,b,c,d))}},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b||93==b)top.ICEcoder.cmdKey=
1)+" of "+ICEcoder.results.length+" results";b=d.getSearchCursor(a,d.getCursor(),!0);b.findNext();b.from()||(b=d.getSearchCursor(a,{line:0,ch:0},!0),b.findNext());d.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/d.lineCount():d.defaultTextHeight();b=top.ICEcoder.scrollBarVisible?0:d.heightAtLine(0);f="";for(e=1;e<=d.lineCount();e++)c=-1<ICEcoder.resultsLines.indexOf(e)?d.getCursor().line+1== !0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&setTimeout(function(){c="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),
e?"#b00":"#888":"transparent",f+='<div style="position: absolute; display: block; width: 5px; height:'+a+"px; background: "+c+"; top: "+parseInt(a*(e-1)+b,10)+'px"></div>';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=f;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}f.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display= top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1},findReplaceOptions:function(){top.get("rText").style.display=top.get("replace").style.display=top.get("rTarget").style.display=document.findAndReplace.connector.value==top.t.and?"inline-block":"none"},findReplace:function(a,b,c,d,e){var f,g,h;if(d)top.get("find").value=top.get("find").value,top.ICEcoder.focus();else{"undefined"==typeof e&&(e=!1);a=a.toLowerCase();f=top.get("replace").value;
"none";return!1}""!=a&&c?(f=b=d="",document.findAndReplace.connector.value==top.t.and&&(d="&replace="+e),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(f="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"&#39;"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")), g=top.get("results");d=ICEcoder.getcMInstance();h=ICEcoder.getcMdiffInstance();if((d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?h:d)&&0<a.length&&document.findAndReplace.target.value==top.t["this document"]){d.getValue().toLowerCase();document.findAndReplace.connector.value==top.t.and&&c&&(document.findAndReplace.replaceAction.value==top.t.replace&&d.getSelection().toLowerCase()==a?d.replaceSelection(f,"around"):document.findAndReplace.replaceAction.value==top.t["replace all"]&&(c=new RegExp(a,
top.get("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+d+b+f+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'):(f.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none")}},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+ "gi"),d.setValue(d.getValue().replace(c,f))));c=d.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];ICEcoder.resultsLines=[];for(f=0;f<c.length;f++)c.substr(f,a.length)==a&&-1==ICEcoder.results.indexOf(f)&&(ICEcoder.results.push(f),-1==ICEcoder.resultsLines.indexOf(d.posFromIndex(f).line+1)&&ICEcoder.resultsLines.push(d.posFromIndex(f).line+1));ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)g.innerHTML=ICEcoder.results.length+" results";
b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|"));top.ICEcoder.serverMessage("<b>"+top.t["Replacing text in"]+"</b><br>"+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;c=a.getCursor().ch;for(var e=d=0;e<b;e++)d+=a.getLine(e).length+1;ICEcoder.caretPos=d+c-1},updateCharDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance(); else{if(e)for(ICEcoder.findResult="undefined"==typeof ICEcoder.findResult?ICEcoder.results.length+1:ICEcoder.results.length,f=ICEcoder.results.length-1;0<=f;f--)ICEcoder.results[f]>d.indexFromPos({ch:d.getCursor().ch-1,line:d.getCursor().line})&&ICEcoder.findResult--;else for(f=ICEcoder.findResult=0;f<ICEcoder.results.length;f++)ICEcoder.results[f]<d.indexFromPos({ch:d.getCursor().ch+1,line:d.getCursor().line})&&ICEcoder.findResult++;!e&&ICEcoder.findResult>ICEcoder.results.length-1&&(ICEcoder.findResult=
a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=ICEcoder.caretLocType+", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateByteDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.byteDisplay.innerHTML=a.getValue().length.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")+" bytes"},showDisplay:function(a){top.ICEcoder.byteDisplay.style.display= 0);e&&1==ICEcoder.findResult&&(ICEcoder.findResult=ICEcoder.results.length+1);g.innerHTML="Highlighted result "+(ICEcoder.findResult+(e?-1:1))+" of "+ICEcoder.results.length+" results";e?(b=d.getSearchCursor(a,{ch:d.getCursor().ch-1,line:d.getCursor().line},!0),b.findPrevious(),b.from()||(b=d.getSearchCursor(a,{line:1E6,ch:1E6},!0),b.findPrevious())):(b=d.getSearchCursor(a,{ch:d.getCursor().ch+1,line:d.getCursor().line},!0),b.findNext(),b.from()||(b=d.getSearchCursor(a,{line:0,ch:0},!0),b.findNext()));
"byte"==a?"inline-block":"none";top.ICEcoder.charDisplay.style.display="char"==a?"inline-block":"none"},showHide:function(a,b){b.style.visibility="show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow[isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1]]},getcMdiffInstance:function(a){return top.ICEcoder.content.contentWindow[(isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length? d.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/d.lineCount():d.defaultTextHeight();b=top.ICEcoder.scrollBarVisible?0:d.heightAtLine(0);e="";for(f=1;f<=d.lineCount();f++)g=-1<ICEcoder.resultsLines.indexOf(f)?d.getCursor().line+1==f?"#b00":"#888":"transparent",e+='<div style="position: absolute; display: block; width: 5px; height:'+a+"px; background: "+g+"; top: "+parseInt(a*(f-1)+b,10)+'px"></div>';
"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1])+"diff"]},getMouseXY:function(a,b){top.ICEcoder.mouseX=a.pageX?a.pageX:a.clientX+document.body.scrollLeft;top.ICEcoder.mouseY=a.pageY?a.pageY:a.clientY+document.body.scrollTop;top.ICEcoder.area=b;"top"!=b&&(top.ICEcoder.mouseY+=70);"editor"==b&&(top.ICEcoder.mouseX+=top.ICEcoder.filesW);top.ICEcoder.dragCursorTest();62<top.ICEcoder.mouseY&&top.ICEcoder.setTabWidths()},dragCursorTest:function(){var a,b;a=top.ICEcoder.mouseX- top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=e;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}g.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=a&&c?(e=b=d="",document.findAndReplace.connector.value==top.t.and&&(d="&replace="+f),0<=
top.ICEcoder.diffStartX;!1!==top.ICEcoder.draggingTab&&top.ICEcoder.diffStartX&&(-10>=a||10<=a)&&top.ICEcoder.mouseX>parseInt(top.ICEcoder.files.style.width,10)&&(top.ICEcoder.tabDragMouseX=top.ICEcoder.mouseX-parseInt(top.ICEcoder.files.style.width,10)-top.ICEcoder.tabDragMouseXStart,top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX<top.ICEcoder.filesW+ document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(e="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"&#39;"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+d+b+e+"&csrf="+top.ICEcoder.csrf+
7||top.ICEcoder.draggingFilesW)?"w-resize":"auto",top.ICEcoder.content.contentWindow.document&&top.ICEcoder.filesFrame.contentWindow)){top.document.body.style.cursor=a;if(b=top.ICEcoder.content.contentWindow.document.body)b.style.cursor=a;if(b=top.ICEcoder.filesFrame.contentWindow.document.body)b.style.cursor=a}},serverMessage:function(a){var b;b=top.get("serverMessage");a?(b.innerHTML=top.ICEcoder.xssClean(a).replace(/\&lt;b\&gt;/g,"<b>").replace(/\&lt;\/b\&gt;/g,"</b>").replace(/\&lt;br\&gt;/g, '" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'):(g.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none")}},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|"));top.ICEcoder.serverMessage("<b>"+top.t["Replacing text in"]+
"<br>"),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();if(a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a){b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&& "</b><br>"+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;c=a.getCursor().ch;for(var e=d=0;e<b;e++)d+=a.getLine(e).length+1;ICEcoder.caretPos=d+c-1},updateCharDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=ICEcoder.caretLocType+
", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateVersionsDisplay:function(){var a=top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1];get("versionsDisplay").innerHTML="undefined"!=typeof a?top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+" backup"+(1!=a?"s":""):""},updateByteDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.byteDisplay.innerHTML=a.getValue().length.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
",")+" bytes"},showDisplay:function(a){top.ICEcoder.byteDisplay.style.display="byte"==a?"inline-block":"none";top.ICEcoder.charDisplay.style.display="char"==a?"inline-block":"none"},showHide:function(a,b){b.style.visibility="show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow[isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1]]},getcMdiffInstance:function(a){return top.ICEcoder.content.contentWindow[(isNaN(a)?
"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1])+"diff"]},getMouseXY:function(a,b){top.ICEcoder.mouseX=a.pageX?a.pageX:a.clientX+document.body.scrollLeft;top.ICEcoder.mouseY=a.pageY?a.pageY:a.clientY+document.body.scrollTop;top.ICEcoder.area=b;"top"!=b&&(top.ICEcoder.mouseY+=70);"editor"==b&&(top.ICEcoder.mouseX+=top.ICEcoder.filesW);top.ICEcoder.dragCursorTest();62<top.ICEcoder.mouseY&&top.ICEcoder.setTabWidths()},
dragCursorTest:function(){var a,b;a=top.ICEcoder.mouseX-top.ICEcoder.diffStartX;!1!==top.ICEcoder.draggingTab&&top.ICEcoder.diffStartX&&(-10>=a||10<=a)&&top.ICEcoder.mouseX>parseInt(top.ICEcoder.files.style.width,10)&&(top.ICEcoder.tabDragMouseX=top.ICEcoder.mouseX-parseInt(top.ICEcoder.files.style.width,10)-top.ICEcoder.tabDragMouseXStart,top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-
7&&top.ICEcoder.mouseX<top.ICEcoder.filesW+7||top.ICEcoder.draggingFilesW)?"w-resize":"auto",top.ICEcoder.content.contentWindow.document&&top.ICEcoder.filesFrame.contentWindow)){top.document.body.style.cursor=a;if(b=top.ICEcoder.content.contentWindow.document.body)b.style.cursor=a;if(b=top.ICEcoder.filesFrame.contentWindow.document.body)b.style.cursor=a}},serverMessage:function(a){var b;b=top.get("serverMessage");a?(b.innerHTML=top.ICEcoder.xssClean(a).replace(/\&lt;b\&gt;/g,"<b>").replace(/\&lt;\/b\&gt;/g,
"</b>").replace(/\&lt;br\&gt;/g,"<br>"),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();if(a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a){b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&&
b.parentNode.removeChild(b);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}}, b.parentNode.removeChild(b);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}},
showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'color\').value)" value="insert &gt;" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'colorRGB\').value)" value="insert &gt;" class="insertColorValue">'; showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'color\').value)" value="insert &gt;" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'colorRGB\').value)" value="insert &gt;" class="insertColorValue">';
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,e,f,g,k,h,l,p,n;b=top.get("canvasPicker").getContext("2d");c=new Image;c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.get("canvasPicker").onmousemove=function(a){d=a.pageX-this.offsetLeft;e=a.pageY-this.offsetTop;f=b.getImageData(d,e,1,1).data;g=f[0];k=f[1];h=f[2];l=g+","+k+","+h;p=top.ICEcoder.rgbToHex(g, farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},initCanvasImage:function(a){var b,c;b=top.get("canvasPicker").getContext("2d");c=new Image;c.crossOrigin="Anonymous";c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.document.getElementById("floatingContainer").style.backgroundSize=5*a.naturalWidth+"px "+5*a.naturalHeight+"px"},interactCanvasImage:function(a){var b,c,d,e,f,
k,h);top.get("rgbMouseXY").value=l;top.get("hexMouseXY").value="#"+p;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+p;n=128>g||128>k||128>h&&200>g&&200>k&&50<h?"#fff":"#000";top.get("hexMouseXY").style.color=top.get("rgbMouseXY").style.color=n};top.get("canvasPicker").onclick=function(){top.get("rgb").value=top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor= g,h,k,l,p,n,m,q;b=top.get("canvasPicker").getContext("2d");top.get("canvasPicker").onmousemove=function(u){c=u.pageX-this.offsetLeft;d=u.pageY-this.offsetTop;e=b.getImageData(c,d,1,1).data;f=e[0];g=e[1];h=e[2];k=f+","+g+","+h;l=top.ICEcoder.rgbToHex(f,g,h);top.get("rgbMouseXY").value=k;top.get("hexMouseXY").value="#"+l;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+l;p=128>f||128>g||128>h&&200>f&&200>g&&50<h?"#fff":"#000";top.get("hexMouseXY").style.color=
top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=n}},rgbToHex:function(a,b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789abcdef".charAt((a-a%16)/16)+"0123456789abcdef".charAt(a%16)},insertColorValue:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;c=b.getTokenAt(b.getCursor()); top.get("rgbMouseXY").style.color=p;n=get("floatingContainer");n.style.left=top.ICEcoder.mouseX+20+"px";n.style.top=top.ICEcoder.mouseY+"px";m=-(a.naturalWidth/a.width*c*5)+25;q=-(a.naturalHeight/a.height*d*5)+25;n.style.backgroundPosition=m+"px "+q+"px"};top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"};top.get("canvasPicker").onclick=function(){top.get("rgb").value=
b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,ch:1E6})},fMIconVis:function(a,b){var c;if(c=top.get(a))c.style.opacity=b},isOpen:function(a){a=a.replace(/\|/g,"/").replace(top.docRoot+top.iceRoot,"");a=top.ICEcoder.openFiles.indexOf(a);return-1!=a?a:!1},startPluginIntervals:function(a,b,c,d){-1<b.indexOf("?")&&(b=b+"&csrf="+top.ICEcoder.csrf);top.ICEcoder["plugTimer"+a]=-1<["_parent","_top","_self",""].indexOf(c)?top.ICEcoder["plugTimer"+a]=setInterval("window.location='"+ top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=p}},rgbToHex:function(a,b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789abcdef".charAt((a-a%16)/16)+"0123456789abcdef".charAt(a%16)},insertColorValue:function(a){var b,
b+"'",6E4*d):0==c.indexOf("fileControl")?top.ICEcoder["plugTimer"+a]=setInterval(function(){top.ICEcoder.serverQueue("add",b);top.ICEcoder.serverMessage(c.split(":")[1])},6E4*d):top.ICEcoder["plugTimer"+a]=setInterval("window.open('"+b+"','"+c+"')",6E4*d);top.ICEcoder.pluginIntervalRefs.push(a)},codeAssistToggle:function(){var a,b;top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.get("codeAssistDisplay").style.backgroundPosition=top.ICEcoder.codeAssist?"0 0":"-16px 0";top.ICEcoder.cssColorPreview(); c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;c=b.getTokenAt(b.getCursor());b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,ch:1E6})},fMIconVis:function(a,b){var c;if(c=top.get(a))c.style.opacity=b},isOpen:function(a){a=a.replace(/\|/g,"/").replace(top.docRoot+top.iceRoot,"");a=top.ICEcoder.openFiles.indexOf(a);return-1!=a?a:!1},startPluginIntervals:function(a,b,c,d){-1<b.indexOf("?")&&(b=b+"&csrf="+
top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?"diff":!1);for(i=0;i<top.ICEcoder.cMInstances.length;i++)if(a=top.ICEcoder.openFiles[i],a=a.split("."),a=a[a.length-1],"js"==a||"json"==a)a=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]],b=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]+"diff"],top.ICEcoder.codeAssist?(a.setOption("lint",!0),b.setOption("lint",!0)):(a.clearGutter("CodeMirror-lint-markers"),a.setOption("lint",!1),b.clearGutter("CodeMirror-lint-markers"), top.ICEcoder.csrf);top.ICEcoder["plugTimer"+a]=-1<["_parent","_top","_self",""].indexOf(c)?top.ICEcoder["plugTimer"+a]=setInterval("window.location='"+b+"'",6E4*d):0==c.indexOf("fileControl")?top.ICEcoder["plugTimer"+a]=setInterval(function(){top.ICEcoder.serverQueue("add",b);top.ICEcoder.serverMessage(c.split(":")[1])},6E4*d):top.ICEcoder["plugTimer"+a]=setInterval("window.open('"+b+"','"+c+"')",6E4*d);top.ICEcoder.pluginIntervalRefs.push(a)},codeAssistToggle:function(){var a,b;top.ICEcoder.codeAssist=
b.setOption("lint",!1))},serverQueue:function(a,b,c){var d,e,f,g,k;d=ICEcoder.getcMInstance();for(f=e=0;f<ICEcoder.serverQueueItems.length;f++)0<ICEcoder.serverQueueItems[f].indexOf("action=save")&&e++;e++;if("add"==a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(f=document.createElement("textarea"),f.setAttribute("id","saveTemp"+e),document.body.appendChild(f),top.get("saveTemp"+e).value=d.getValue());else if("del"==a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){d= !top.ICEcoder.codeAssist;top.get("codeAssistDisplay").style.backgroundPosition=top.ICEcoder.codeAssist?"0 0":"-16px 0";top.ICEcoder.cssColorPreview();top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?"diff":!1);for(i=0;i<top.ICEcoder.cMInstances.length;i++)if(a=top.ICEcoder.openFiles[i],a=a.split("."),a=a[a.length-1],"js"==a||"json"==a)a=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]],b=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]+"diff"],
e-1;for(f=1;f<d;f++)top.get("saveTemp"+f).value=top.get("saveTemp"+(f+1)).value;d=top.get("saveTemp"+d);d.parentNode.removeChild(d)}ICEcoder.serverQueueItems.splice(0,1)}if("del"==a&&1<=ICEcoder.serverQueueItems.length||1==ICEcoder.serverQueueItems.length)b&&-1==b.indexOf("saveFiles=")&&-1==b.indexOf("action=load")?(g=top.ICEcoder.xhrObj(),g.onreadystatechange=function(){4==g.readyState&&200==g.status&&(k=JSON.parse(g.responseText),k.action.timeEnd=(new Date).getTime(),k.action.timeTaken=k.action.timeEnd- top.ICEcoder.codeAssist?(a.setOption("lint",!0),b.setOption("lint",!0)):(a.clearGutter("CodeMirror-lint-markers"),a.setOption("lint",!1),b.clearGutter("CodeMirror-lint-markers"),b.setOption("lint",!1))},serverQueue:function(a,b,c){var d,e,f,g,h;d=ICEcoder.getcMInstance();for(f=e=0;f<ICEcoder.serverQueueItems.length;f++)0<ICEcoder.serverQueueItems[f].indexOf("action=save")&&e++;e++;if("add"==a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(f=document.createElement("textarea"),f.setAttribute("id",
k.action.timeStart,k.status.error?top.ICEcoder.message(k.status.errorMsg):eval(k.action.doNext))},g.open("POST",ICEcoder.serverQueueItems[0],!0),g.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a=(new Date).getTime(),0<b.indexOf("action=save")?g.send("timeStart="+a+"&file="+c+"&contents="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):g.send("timeStart="+a+"&file="+c)):setTimeout(function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href= "saveTemp"+e),document.body.appendChild(f),top.get("saveTemp"+e).value=d.getValue());else if("del"==a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){d=e-1;for(f=1;f<d;f++)top.get("saveTemp"+f).value=top.get("saveTemp"+(f+1)).value;d=top.get("saveTemp"+d);d.parentNode.removeChild(d)}ICEcoder.serverQueueItems.splice(0,1)}if("del"==a&&1<=ICEcoder.serverQueueItems.length||1==ICEcoder.serverQueueItems.length)b&&-1==b.indexOf("saveFiles=")&&-1==b.indexOf("action=load")?
ICEcoder.serverQueueItems[0]},1)},cancelAllActions:function(){window.stop();0<ICEcoder.serverQueueItems.length&&ICEcoder.serverQueueItems.splice(1,ICEcoder.serverQueueItems.length);top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.serverMessage('<b style="color: #d00">'+top.t["Cancelled tasks"]+"</b>");setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g, (g=top.ICEcoder.xhrObj(),g.onreadystatechange=function(){4==g.readyState&&(h=JSON.parse(g.responseText),h.action.timeEnd=(new Date).getTime(),h.action.timeTaken=h.action.timeEnd-h.action.timeStart,0<=["raw","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(g.responseText),0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(h),200==g.status?h.status.error?(top.ICEcoder.message(h.status.errorMsg),console.log("ICEcoder error info for your request..."),console.log(h),top.ICEcoder.serverMessage(),
"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a+"&csrf="+top.ICEcoder.csrf)},autoOpenFiles:function(){if(0<top.ICEcoder.previousFiles.length&&top.ICEcoder.ask(top.t["Open previous files"]+"\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a<top.ICEcoder.previousFiles.length;a++)top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[a].replace("|", top.ICEcoder.serverQueue("del",0)):eval(h.action.doNext):(top.ICEcoder.message(top.t["Sorry there was..."]),console.log("ICEcoder error info for your request..."),console.log(h),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))},g.open("POST",ICEcoder.serverQueueItems[0],!0),g.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a=(new Date).getTime(),0<b.indexOf("action=save")?g.send("timeStart="+a+"&file="+c+"&contents="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):
"/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},settingsScreen:function(a){a||(top.get("mediaContainer").innerHTML='<iframe src="lib/settings-screen.php" class="whiteGlow" style="width: 970px; height: 610px"></iframe>');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/help.php" class="whiteGlow" style="width: 840px; height: 515px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))}, g.send("timeStart="+a+"&file="+c)):setTimeout(function(){"undefined"!=typeof ICEcoder.serverQueueItems[0]&&(top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href=ICEcoder.serverQueueItems[0])},1)},cancelAllActions:function(){window.stop();0<ICEcoder.serverQueueItems.length&&ICEcoder.serverQueueItems.splice(1,ICEcoder.serverQueueItems.length);top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.serverMessage('<b style="color: #d00">'+top.t["Cancelled tasks"]+"</b>");setTimeout(function(){top.ICEcoder.serverMessage()},
showManual:function(a,b){var c;c=b?"#"+b:"";top.get("mediaContainer").innerHTML='<iframe src="https://icecoder.net/manual?version='+a+c+'" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show", 2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a+"&csrf="+top.ICEcoder.csrf);top.ICEcoder.updateLast10List(a)},updateLast10List:function(a){var b,c,d;a=a.split(",");for(var e=0;e<a.length;e++)"CLEAR"!=a[e]&&(b='<li class="pft-file ext-'+a[e].substring(a[e].lastIndexOf(".")+1)+'" style="margin-left: -21px"><a style="cursor:pointer" onclick="top.ICEcoder.openFile(\''+
top.get("blackMask"))},pluginsManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/plugins-manager.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},githubAction:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/github.php?action='+a+"&selectedFiles="+top.ICEcoder.selectedFiles.join(";")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 340px; height: 340px"></iframe>';top.ICEcoder.showHide("show", a[e].replace(/\|/g,"/")+"')\">"+a[e].replace(/\|/g,"/")+"</a></li>\n",c=top.ICEcoder.content.contentWindow.document.getElementById("last10Files"),-1==c.innerHTML.indexOf(b)&&(d=c.innerHTML.split("\n"),(10<=d.length||'<div style="display: inline-block; margin-left: -39px; margin-top: -4px">[none]</div><br><br>'==d[0]||""==d[d.length-1])&&d.pop(),c.innerHTML=b+d.join("\n")))},autoOpenFiles:function(){if(0<top.ICEcoder.previousFiles.length&&top.ICEcoder.ask(top.t["Open previous files"]+"\n\n"+top.ICEcoder.previousFiles.length+
top.get("blackMask"))},githubTokenAsk:function(a){if(githubAuthToken=top.ICEcoder.getInput(top.t["Please enter your..."],""))top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/github.php?action=auth&token="+githubAuthToken+"&goNext="+a+"&csrf="+top.ICEcoder.csrf,githubAuthToken=""},showHideGithubNav:function(a){top.get("githubNav").style.display="show"==a?"block":"none";top.get("fileNav").style.display="show"==a?"none":"block"},githubManager:function(){top.ICEcoder.githubAuthTokenSet? " files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a<top.ICEcoder.previousFiles.length;a++)top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[a].replace("|","/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},settingsScreen:function(a){a||(top.get("mediaContainer").innerHTML='<iframe src="lib/settings-screen.php" class="whiteGlow" style="width: 970px; height: 610px"></iframe>');top.ICEcoder.showHide(a?
(top.get("mediaContainer").innerHTML='<iframe src="lib/github-manager.php" class="whiteGlow" style="width: 660px; height: 450px"></iframe>',top.ICEcoder.showHide("show",top.get("blackMask"))):top.ICEcoder.githubTokenAsk("showManager")},githubDiffToggle:function(){var a;if(!top.ICEcoder.githubAuthTokenSet)top.ICEcoder.githubTokenAsk("loadFiles");else if(top.ICEcoder.githubDiff||top.ICEcoder.ask(top.t["This will compare..."]))top.ICEcoder.githubDiff=!top.ICEcoder.githubDiff,a=top.ICEcoder.githubDiff? "hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/help.php" class="whiteGlow" style="width: 840px; height: 465px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},versionsScreen:function(a,b){top.get("mediaContainer").innerHTML='<iframe src="lib/backup-versions.php?file='+a+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 840px; height: 465px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},showManual:function(a,
"true":"false",top.ICEcoder.filesFrame.src="files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf},useNewSettings:function(a,b,c,d,e,f,g,k,h,l,p,n,m,t,u,v,w,x){var q,r=a.slice(0,a.lastIndexOf("?")),r=r.slice(r.lastIndexOf("/")+1,r.lastIndexOf("."));top.ICEcoder.theme!==r&&(top.ICEcoder.theme=r,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),q=document.createElement("link"),q.setAttribute("rel","stylesheet"),q.setAttribute("type","text/css"),q.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(q), b){var c;c=b?"#"+b:"";top.get("mediaContainer").innerHTML='<iframe src="https://icecoder.net/manual?version='+a+c+'" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},
q=-1<"3024-day base16-light eclipse elegant mdn-like neat neo paraiso-light solarized the-matrix xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":-1<"3024-night blackboard colorforth liquibyte night tomorrow-night-bright tomorrow-night-eighties vibrant-ink".split(" ").indexOf(top.ICEcoder.theme)?"#888":"#000",top.ICEcoder.switchTab(top.ICEcoder.selectedTab));b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&(top.ICEcoder.lockUnlockNav(), pluginsManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/plugins-manager.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},githubAction:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/github.php?action='+a+"&selectedFiles="+top.ICEcoder.selectedFiles.join(";")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 340px; height: 340px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},
ICEcoder.changeFilesW(c?"expand":"contract"),top.ICEcoder.hideFileMenu());b=ICEcoder.content.contentWindow.document.styleSheets[4];a=b.rules?"rules":"cssRules";b[a][0].style.fontSize=g;b[a][4].style["border-left-width"]=f?"1px":"0";b[a][4].style["margin-left"]=f?"-1px":"0";b[a][2].style.cssText="background-color: "+q+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.indentWithTabs=h;top.ICEcoder.indentSize=p;top.ICEcoder.indentAuto=l;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+ githubTokenAsk:function(a){if(githubAuthToken=top.ICEcoder.getInput(top.t["Please enter your..."],""))top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/github.php?action=auth&token="+githubAuthToken+"&goNext="+a+"&csrf="+top.ICEcoder.csrf,githubAuthToken=""},showHideGithubNav:function(a){top.get("githubNav").style.display="show"==a?"block":"none";top.get("fileNav").style.display="show"==a?"none":"block"},githubManager:function(){top.ICEcoder.githubAuthTokenSet?(top.get("mediaContainer").innerHTML=
ICEcoder.cMInstances[f]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("tabSize",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].refresh(),ICEcoder.content.contentWindow["cM"+ '<iframe src="lib/github-manager.php" class="whiteGlow" style="width: 660px; height: 450px"></iframe>',top.ICEcoder.showHide("show",top.get("blackMask"))):top.ICEcoder.githubTokenAsk("showManager")},githubDiffToggle:function(){var a;if(!top.ICEcoder.githubAuthTokenSet)top.ICEcoder.githubTokenAsk("loadFiles");else if(top.ICEcoder.githubDiff||top.ICEcoder.ask(top.t["This will compare..."]))top.ICEcoder.githubDiff=!top.ICEcoder.githubDiff,a=top.ICEcoder.githubDiff?"true":"false",top.ICEcoder.filesFrame.src=
ICEcoder.cMInstances[f]+"diff"].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("tabSize",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].refresh(); "files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf},useNewSettings:function(a,b,c,d,e,f,g,h,k,l,p,n,m,q,u,v,w,x){var r,t=a.slice(0,a.lastIndexOf("?")),t=t.slice(t.lastIndexOf("/")+1,t.lastIndexOf("."));top.ICEcoder.theme!==t&&(top.ICEcoder.theme=t,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),r=document.createElement("link"),r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(r),
d!=top.ICEcoder.tagWrapperCommand&&(top.ICEcoder.tagWrapperCommand=d);e!=top.ICEcoder.autoComplete&&(top.ICEcoder.autoComplete=e);top.get("plugins").style.left="left"==n?"0":"auto";top.get("plugins").style.right="right"==n?"0":"auto";top.ICEcoder.bugFilePaths=m;top.ICEcoder.bugFileCheckTimer=t;top.ICEcoder.bugFileMaxLines=u;""!=top.ICEcoder.bugFilePaths[0]?top.ICEcoder.startBugChecking():"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt);top.ICEcoder.splitPane&& r=-1<"3024-day base16-light eclipse elegant mdn-like neat neo paraiso-light solarized the-matrix xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":-1<"3024-night blackboard colorforth liquibyte night tomorrow-night-bright tomorrow-night-eighties vibrant-ink".split(" ").indexOf(top.ICEcoder.theme)?"#888":"#000",top.ICEcoder.switchTab(top.ICEcoder.selectedTab));b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&(top.ICEcoder.lockUnlockNav(),
top.ICEcoder.updateDiffs();top.ICEcoder.githubAuthTokenSet=v;top.ICEcoder.updateDiffOnSave=w;x&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.get("find").value,!0,!1);top.get("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen? ICEcoder.changeFilesW(c?"expand":"contract"),top.ICEcoder.hideFileMenu());a=top.document.styleSheets[0];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.filesFrame.contentWindow.document.styleSheets[3];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.content.contentWindow.document.styleSheets[4];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a[b][4].style["border-left-width"]=f?"1px":"0";a[b][4].style["margin-left"]=f?"-1px":"0";a[b][2].style.cssText="background-color: "+
document.mozCancelFullScreen():document.body.mozRequestFullScreen():"undefined"!=typeof document.webkitCancelFullScreen&&(document.webkitIsFullScreen?document.webkitCancelFullScreen():document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))},zipIt:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="plugins/zip-it/index.php?zip="+a+"&csrf="+top.ICEcoder.csrf},downloadFile:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href= r+" !important";top.ICEcoder.lineWrapping=h;top.ICEcoder.indentWithTabs=k;top.ICEcoder.indentSize=p;top.ICEcoder.indentAuto=l;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentUnit",top.ICEcoder.indentSize),
"lib/download.php?file="+a+"&csrf="+top.ICEcoder.csrf},chmod:function(a,b){a=a.replace(top.iceRoot,"");top.ICEcoder.showHide("hide",top.get("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=perms&perms="+b+"&csrf="+top.ICEcoder.csrf,a);top.ICEcoder.serverMessage("<b>chMod "+b+" on </b><br>"+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;d=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];a=d.substr(d.lastIndexOf("/")+ ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("tabSize",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].refresh(),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("indentUnit",
1);e=a.substr(a.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;top.ICEcoder.previewWindowLoading=!0;top.ICEcoder.previewWindow=window.open(d,"previewWindow");-1<["md"].indexOf(e)?top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindowLoading=!1;top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(c.getValue())}:top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindowLoading= top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("tabSize",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].refresh();d!=top.ICEcoder.tagWrapperCommand&&(top.ICEcoder.tagWrapperCommand=d);e!=top.ICEcoder.autoComplete&&(top.ICEcoder.autoComplete=e);top.get("plugins").style.left="left"==n?"0":"auto";top.get("plugins").style.right="right"==n?"0":"auto";top.ICEcoder.bugFilePaths=m;top.ICEcoder.bugFileCheckTimer=
!1;try{top.ICEcoder.doPesticide()}catch(a){}try{top.ICEcoder.doStatsJS("open")}catch(b){}}}},logout:function(){window.location=window.location+"?logout&csrf="+top.ICEcoder.csrf},message:function(a){alert(a)},ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b;b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},update:function(){confirm(top.t["Please note for..."])?(top.ICEcoder.showHide("show", q;top.ICEcoder.bugFileMaxLines=u;""!=top.ICEcoder.bugFilePaths[0]?top.ICEcoder.startBugChecking():"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt);top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();top.ICEcoder.githubAuthTokenSet=v;top.ICEcoder.updateDiffOnSave=w;x&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.get("find").value,!0,!1);top.get("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=
top.get("loadingMask")),window.location="lib/updater.php"):window.open("https://icecoder.net")},updated:function(){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='<h1 style="color: #fff; cursor: default">Thanks for updating to v'+top.ICEcoder.versionNo+'!</h1><h2 style="color: #888; cursor: default">Click anywhere to continue using ICEcoder...</h2>'},xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(d){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(f){}return null}, typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen?document.mozCancelFullScreen():document.body.mozRequestFullScreen():"undefined"!=typeof document.webkitCancelFullScreen&&(document.webkitIsFullScreen?document.webkitCancelFullScreen():document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))},zipIt:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href=
openBugReport:function(){var a;"off"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["You can start..."]);"error"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["Error cannot find..."]);"ok"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["No new errors..."]);"bugs"==top.ICEcoder.bugReportStatus&&(a=top.ICEcoder.openFiles.indexOf(top.ICEcoder.bugReportPath.replace(/\|/g,"/")),-1<a&&top.ICEcoder.closeTab(a+1,"dontSetPV","dontAsk"),top.ICEcoder.openFile(top.ICEcoder.bugReportPath), "plugins/zip-it/index.php?zip="+a+"&csrf="+top.ICEcoder.csrf},downloadFile:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/download.php?file="+a+"&csrf="+top.ICEcoder.csrf},chmod:function(a,b){a=a.replace(top.iceRoot,"");top.ICEcoder.showHide("hide",top.get("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=perms&perms="+b+"&csrf="+top.ICEcoder.csrf,a);top.ICEcoder.serverMessage("<b>chMod "+b+" on </b><br>"+
top.ICEcoder.bugFilesSizesSeen=top.ICEcoder.bugFilesSizesActual)},startBugChecking:function(){var a;0!==top.ICEcoder.bugFileCheckTimer?("undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt),top.ICEcoder.bugFilesSizesSeen=[],top.ICEcoder.bugFileCheckInt=setInterval(function(){a="lib/bug-files-check.php?";a+="files="+(""!==top.ICEcoder.bugFilePaths[0]?top.ICEcoder.bugFilePaths.join():"null").replace(/\//g,"|");a+="&filesSizesSeen=";if(top.ICEcoder.bugFilesSizesSeen.length!= a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;d=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];a=d.substr(d.lastIndexOf("/")+1);e=a.substr(a.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;top.ICEcoder.previewWindowLoading=!0;top.ICEcoder.previewWindow=window.open(d,"previewWindow",500,500);-1<["md"].indexOf(e)?top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindowLoading=
top.ICEcoder.bugFilePaths.length)for(var b=0;b<top.ICEcoder.bugFilePaths.length;b++)top.ICEcoder.bugFilesSizesSeen[b]="null";a+=top.ICEcoder.bugFilesSizesSeen.join();a+="&maxLines="+top.ICEcoder.bugFileMaxLines;a+="&csrf="+top.ICEcoder.csrf;var c=top.ICEcoder.xhrObj();c.onreadystatechange=function(){if(4==c.readyState&&200==c.status){var a=JSON.parse(c.responseText);top.get("bugIcon").style.backgroundPosition="off"==a.result?"0 0":"ok"==a.result?"-32px 0":"bugs"==a.result?"-48px 0":"-16px 0";top.ICEcoder.bugReportStatus= !1;top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(c.getValue())}:top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindowLoading=!1;try{top.ICEcoder.doPesticide()}catch(a){}try{top.ICEcoder.doStatsJS("open")}catch(a){}try{top.ICEcoder.doResponsive()}catch(a){}}}},logout:function(){window.location=window.location+"?logout&csrf="+top.ICEcoder.csrf},message:function(a){alert(a)},ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b;
a.result;"null"==top.ICEcoder.bugFilesSizesSeen[0]&&(top.ICEcoder.bugFilesSizesSeen=a.filesSizesSeen);top.ICEcoder.bugFilesSizesActual=a.filesSizesSeen;top.ICEcoder.bugReportPath=a.bugReportPath}};c.open("GET",a,!0);c.send()},parseInt(1E3*top.ICEcoder.bugFileCheckTimer,10)),top.ICEcoder.bugReportStatus="ok"):"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt)},xssClean:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g, b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},update:function(){confirm(top.t["Please note for..."])?(top.ICEcoder.showHide("show",top.get("loadingMask")),window.location="lib/updater.php"):window.open("https://icecoder.net")},updated:function(){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='<h1 style="color: #fff; cursor: default">Thanks for updating to v'+top.ICEcoder.versionNo+'!</h1><h2 style="color: #888; cursor: default">Click anywhere to continue using ICEcoder...</h2>'},
"&quot;").replace(/'/g,"&#039;")},printCode:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=top.ICEcoder.filesFrame.contentWindow.frames.fileControl;b.window.document.body.innerHTML='<!DOCTYPE html><head><title>ICEcoder code output</title></head><body><pre style="white-space: pre-wrap">'+top.ICEcoder.xssClean(a.getValue())+"</pre></body></html>";b.focus();b.print();a.focus()},indicateChanges:function(){var a; xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}return null},openBugReport:function(){var a;"off"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["You can start..."]);"error"==top.ICEcoder.bugReportStatus&&
if(!top.ICEcoder.loadingFile){a="ICEcoder v "+top.ICEcoder.versionNo;for(var b=1;b<=top.ICEcoder.savedPoints.length;b++)if(top.ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()){a+=" \u2744";break}top.document.title=a}},switchTab:function(a,b){var c,d;ICEcoder.selectedTab=a;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();if(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c){ICEcoder.switchMode();for(var e=0;e<ICEcoder.cMInstances.length;e++)ICEcoder.content.contentWindow["cM"+ top.ICEcoder.message(top.t["Error cannot find..."]);"ok"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["No new errors..."]);"bugs"==top.ICEcoder.bugReportStatus&&(a=top.ICEcoder.openFiles.indexOf(top.ICEcoder.bugReportPath.replace(/\|/g,"/")),-1<a&&top.ICEcoder.closeTab(a+1,"dontSetPV","dontAsk"),top.ICEcoder.openFile(top.ICEcoder.bugReportPath),top.ICEcoder.bugFilesSizesSeen=top.ICEcoder.bugFilesSizesActual)},startBugChecking:function(){var a;0!==top.ICEcoder.bugFileCheckTimer?("undefined"!=
ICEcoder.cMInstances[e]].getWrapperElement().style.display="none",ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[e]+"diff"].getWrapperElement().style.display="none";c.setOption("theme",top.ICEcoder.theme);d.setOption("theme",top.ICEcoder.theme+" diff");c.getWrapperElement().style.display="block";d.getWrapperElement().style.display="block";top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();b||setTimeout(function(){top.ICEcoder.focus()},4);c.refresh();d.refresh();ICEcoder.redoTabHighlight(ICEcoder.selectedTab); typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt),top.ICEcoder.bugFilesSizesSeen=[],top.ICEcoder.bugFileCheckInt=setInterval(function(){a="lib/bug-files-check.php?";a+="files="+(""!==top.ICEcoder.bugFilePaths[0]?top.ICEcoder.bugFilePaths.join():"null").replace(/\//g,"|");a+="&filesSizesSeen=";if(top.ICEcoder.bugFilesSizesSeen.length!=top.ICEcoder.bugFilePaths.length)for(var b=0;b<top.ICEcoder.bugFilePaths.length;b++)top.ICEcoder.bugFilesSizesSeen[b]="null";a+=top.ICEcoder.bugFilesSizesSeen.join();
top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.get("find").value,!0,!1);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()}},newTab:function(a){var b;ICEcoder.cMInstances.push(ICEcoder.nextcMInstance);ICEcoder.selectedTab=ICEcoder.cMInstances.length;ICEcoder.showHide("show",ICEcoder.content);ICEcoder.content.contentWindow.createNewCMInstance(ICEcoder.nextcMInstance);ICEcoder.setLayout();ICEcoder.thisFileFolderType="file";ICEcoder.thisFileFolderLink= a+="&maxLines="+top.ICEcoder.bugFileMaxLines;a+="&csrf="+top.ICEcoder.csrf;var c=top.ICEcoder.xhrObj();c.onreadystatechange=function(){if(4==c.readyState&&200==c.status){var a=JSON.parse(c.responseText);top.get("bugIcon").style.backgroundPosition="off"==a.result?"0 0":"ok"==a.result?"-32px 0":"bugs"==a.result?"-48px 0":"-16px 0";top.ICEcoder.bugReportStatus=a.result;"null"==top.ICEcoder.bugFilesSizesSeen[0]&&(top.ICEcoder.bugFilesSizesSeen=a.filesSizesSeen);top.ICEcoder.bugFilesSizesActual=a.filesSizesSeen;
"/[NEW]";ICEcoder.openFile();b=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);b.removeLineClass(ICEcoder["cMActiveLinecM"+ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]],"background");ICEcoder["cMActiveLinecM"+ICEcoder.selectedTab]=b.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++;a&&top.ICEcoder.saveFile()},createNewTab:function(a){var b;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+top.ICEcoder.openFiles.length).style.display= top.ICEcoder.bugReportPath=a.bugReportPath}};c.open("GET",a,!0);c.send()},parseInt(1E3*top.ICEcoder.bugFileCheckTimer,10)),top.ICEcoder.bugReportStatus="ok"):"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt)},xssClean:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},printCode:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
"inline-block";b=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("tab"+top.ICEcoder.openFiles.length).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+b.slice(b.lastIndexOf("/")).replace(/\//, b:a;b=top.ICEcoder.filesFrame.contentWindow.frames.fileControl;b.window.document.body.innerHTML='<!DOCTYPE html><head><title>ICEcoder code output</title></head><body><pre style="white-space: pre-wrap">'+top.ICEcoder.xssClean(a.getValue())+"</pre></body></html>";b.focus();b.print();a.focus()},indicateChanges:function(){var a;if(!top.ICEcoder.loadingFile){a="ICEcoder v "+top.ICEcoder.versionNo;for(var b=1;b<=top.ICEcoder.savedPoints.length;b++)if(top.ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()){a+=
"");top.get("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");top.ICEcoder.setTabWidths();top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);top.ICEcoder.selectedTab=top.ICEcoder.openFiles.length;top.ICEcoder.savedPoints.push(0);a||top.ICEcoder.setPreviousFiles()},nextTab:function(){top.ICEcoder.switchTab(top.ICEcoder.selectedTab+1<=top.ICEcoder.openFiles.length?top.ICEcoder.selectedTab+1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<= " \u2744";break}top.document.title=a}},switchTab:function(a,b){var c,d;ICEcoder.selectedTab=a;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();if(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c){ICEcoder.switchMode();for(var e=0;e<ICEcoder.cMInstances.length;e++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[e]].getWrapperElement().style.display="none",ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[e]+"diff"].getWrapperElement().style.display="none";c.setOption("theme",
top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.get("tab"+a).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+ top.ICEcoder.theme);d.setOption("theme",top.ICEcoder.theme+" diff");c.getWrapperElement().style.display="block";d.getWrapperElement().style.display="block";top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();b||setTimeout(function(){top.ICEcoder.focus()},4);c.refresh();d.refresh();ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.get("find").value,!0,!1);top.ICEcoder.updateVersionsDisplay();top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();
top.ICEcoder.updateByteDisplay()}},newTab:function(a){var b;ICEcoder.cMInstances.push(ICEcoder.nextcMInstance);ICEcoder.selectedTab=ICEcoder.cMInstances.length;ICEcoder.showHide("show",ICEcoder.content);ICEcoder.content.contentWindow.createNewCMInstance(ICEcoder.nextcMInstance);ICEcoder.setLayout();ICEcoder.thisFileFolderType="file";ICEcoder.thisFileFolderLink="/[NEW]";ICEcoder.openFile();b=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);b.removeLineClass(ICEcoder["cMActiveLinecM"+
ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]],"background");ICEcoder["cMActiveLinecM"+ICEcoder.selectedTab]=b.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++;a&&top.ICEcoder.saveFile()},createNewTab:function(a){var b;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+top.ICEcoder.openFiles.length).style.display="inline-block";b=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("tab"+top.ICEcoder.openFiles.length).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
b.slice(b.lastIndexOf("/")).replace(/\//,"");top.get("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");top.ICEcoder.setTabWidths();top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);top.ICEcoder.selectedTab=top.ICEcoder.openFiles.length;top.ICEcoder.savedPoints.push(0);a||top.ICEcoder.setPreviousFiles()},nextTab:function(){top.ICEcoder.switchTab(top.ICEcoder.selectedTab+1<=top.ICEcoder.openFiles.length?top.ICEcoder.selectedTab+
1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<=top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.get("tab"+a).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
c.slice(c.lastIndexOf("/")).replace(/\//,"");top.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.savedPoints.length;d++)top.get("tab"+d).childNodes[0]&&(top.get("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=ICEcoder.savedPoints[d-1]!=top.ICEcoder.getcMInstance(d).changeGeneration()?"#b00":"transparent"),b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab,"undefined"!=typeof top.ICEcoder.openFiles[d- c.slice(c.lastIndexOf("/")).replace(/\//,"");top.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.savedPoints.length;d++)top.get("tab"+d).childNodes[0]&&(top.get("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=ICEcoder.savedPoints[d-1]!=top.ICEcoder.getcMInstance(d).changeGeneration()?"#b00":"transparent"),b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab,"undefined"!=typeof top.ICEcoder.openFiles[d-
1]&&"/[NEW]"!=top.ICEcoder.openFiles[d-1]&&(c=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[d-1].replace(/\//g,"|")))&&(c.style.backgroundColor=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile),top.get("tab"+d).style.color=b,top.get("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen},closeTab:function(a,b,c){var d;a||(a=top.ICEcoder.selectedTab);ICEcoder.getcMInstance(); 1]&&"/[NEW]"!=top.ICEcoder.openFiles[d-1]&&(c=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[d-1].replace(/\//g,"|")))&&(c.style.backgroundColor=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile),top.get("tab"+d).style.color=b,top.get("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen},closeTab:function(a,b,c){var d;a||(a=top.ICEcoder.selectedTab);ICEcoder.getcMInstance();
ICEcoder.getcMdiffInstance();d=!0;c||ICEcoder.savedPoints[a-1]==top.ICEcoder.getcMInstance(a).changeGeneration()||(d=top.ICEcoder.ask(top.t["You have made..."]));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;d<ICEcoder.openFiles.length;d++)top.get("tab"+d).innerHTML=top.get("tab"+(d+1)).innerHTML,top.get("tab"+d).title=top.get("tab"+(d+1)).title,ICEcoder.openFiles[d-1]=ICEcoder.openFiles[d],ICEcoder.openFileMDTs[d-1]=ICEcoder.openFileMDTs[d];ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a- ICEcoder.getcMdiffInstance();d=!0;c||ICEcoder.savedPoints[a-1]==top.ICEcoder.getcMInstance(a).changeGeneration()||(d=top.ICEcoder.ask(top.t["You have made..."]));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;d<ICEcoder.openFiles.length;d++)top.get("tab"+d).innerHTML=top.get("tab"+(d+1)).innerHTML,top.get("tab"+d).title=top.get("tab"+(d+1)).title,ICEcoder.openFiles[d-1]=ICEcoder.openFiles[d],ICEcoder.openFileMDTs[d-1]=ICEcoder.openFileMDTs[d],ICEcoder.openFileVersions[d-1]=ICEcoder.openFileVersions[d];
1]].getWrapperElement().style.display="none";ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a-1]+"diff"].getWrapperElement().style.display="none";top.ICEcoder.cMInstances.splice(a-1,1);top.get("tab"+ICEcoder.openFiles.length).style.display="none";top.get("tab"+ICEcoder.openFiles.length).innerHTML="";top.get("tab"+ICEcoder.openFiles.length).title="";ICEcoder.openFiles.pop();ICEcoder.openFileMDTs.pop();ICEcoder.selectedTab==a&&(0<ICEcoder.openFiles.length?--ICEcoder.selectedTab:ICEcoder.selectedTab= ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a-1]].getWrapperElement().style.display="none";ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a-1]+"diff"].getWrapperElement().style.display="none";top.ICEcoder.cMInstances.splice(a-1,1);top.get("tab"+ICEcoder.openFiles.length).style.display="none";top.get("tab"+ICEcoder.openFiles.length).innerHTML="";top.get("tab"+ICEcoder.openFiles.length).title="";ICEcoder.openFiles.pop();ICEcoder.openFileMDTs.pop();ICEcoder.openFileVersions.pop();
0);0<ICEcoder.openFiles.length&&0==ICEcoder.selectedTab&&(ICEcoder.selectedTab=1);0==ICEcoder.openFiles.length?top.ICEcoder.fMIconVis("fMView",.3):(ICEcoder.switchMode(),ICEcoder.switchTab(ICEcoder.selectedTab));top.ICEcoder.savedPoints.splice(a-1,1);top.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.selectDeselectFile("deselect",top.ICEcoder.filesFrame.contentWindow.document.getElementById(c.replace(/\//g,"|")));b||top.ICEcoder.setPreviousFiles();top.ICEcoder.indicateChanges()}top.ICEcoder.canSwitchTabs= ICEcoder.selectedTab==a&&(0<ICEcoder.openFiles.length?--ICEcoder.selectedTab:ICEcoder.selectedTab=0);0<ICEcoder.openFiles.length&&0==ICEcoder.selectedTab&&(ICEcoder.selectedTab=1);0==ICEcoder.openFiles.length?top.ICEcoder.fMIconVis("fMView",.3):(ICEcoder.switchMode(),ICEcoder.switchTab(ICEcoder.selectedTab));top.ICEcoder.savedPoints.splice(a-1,1);top.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.selectDeselectFile("deselect",top.ICEcoder.filesFrame.contentWindow.document.getElementById(c.replace(/\//g,
!1;top.ICEcoder.setTabWidths("posOnlyNewTab");setTimeout(function(){top.ICEcoder.canSwitchTabs=!0},100)},closeAllTabs:function(){if(0<top.ICEcoder.cMInstances.length&&ICEcoder.ask(top.t["Close all tabs"]))for(var a=top.ICEcoder.cMInstances.length;0<a;a--)top.ICEcoder.closeTab(a,1<a?!0:!1);top.ICEcoder.indicateChanges()},setTabWidths:function(a){var b,c,d,e,f;if(top.ICEcoder.ready){b=parseInt(top.ICEcoder.content.style.width,10)-53-22-10;c=b/top.ICEcoder.openFiles.length-18;d=-18;e=53;f=0;top.ICEcoder.tabLeftPos= "|")));b||top.ICEcoder.setPreviousFiles();top.ICEcoder.updateVersionsDisplay();top.ICEcoder.indicateChanges()}top.ICEcoder.canSwitchTabs=!1;top.ICEcoder.setTabWidths("posOnlyNewTab");setTimeout(function(){top.ICEcoder.canSwitchTabs=!0},100)},closeAllTabs:function(){if(0<top.ICEcoder.cMInstances.length&&ICEcoder.ask(top.t["Close all tabs"]))for(var a=top.ICEcoder.cMInstances.length;0<a;a--)top.ICEcoder.closeTab(a,1<a?!0:!1);top.ICEcoder.indicateChanges()},setTabWidths:function(a){var b,c,d,e,f;if(top.ICEcoder.ready){b=
[];for(var g=0;g<top.ICEcoder.openFiles.length;g++)a&&(g=top.ICEcoder.openFiles.length),d=168*top.ICEcoder.openFiles.length>b?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX= parseInt(top.ICEcoder.content.style.width,10)-53-22-10;c=b/top.ICEcoder.openFiles.length-18;d=-18;e=53;f=0;top.ICEcoder.tabLeftPos=[];for(var g=0;g<top.ICEcoder.openFiles.length;g++)a&&(g=top.ICEcoder.openFiles.length),d=168*top.ICEcoder.openFiles.length>b?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+
top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX-(parseInt(top.ICEcoder.files.style.width,10)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left, f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX-(parseInt(top.ICEcoder.files.style.width,10)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+
10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:53;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.get("tab"+c).style.opacity=c==top.ICEcoder.draggingTab?1:.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-top.ICEcoder.tabLeftPos[c-1]:b,c!=top.ICEcoder.draggingTab&&(c<top.ICEcoder.draggingTab?top.get("tab"+c).style.left=a<=top.ICEcoder.tabLeftPos[c-1]? 18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:53;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.get("tab"+c).style.opacity=c==top.ICEcoder.draggingTab?1:.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-top.ICEcoder.tabLeftPos[c-
top.ICEcoder.tabLeftPos[c-1]+b:top.ICEcoder.tabLeftPos[c-1]:top.get("tab"+c).style.left=a>=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>=top.ICEcoder.tabLeftPos[c-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>c?c+1:c),top.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo? 1]:b,c!=top.ICEcoder.draggingTab&&(c<top.ICEcoder.draggingTab?top.get("tab"+c).style.left=a<=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]+b:top.ICEcoder.tabLeftPos[c-1]:top.get("tab"+c).style.left=a>=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>=top.ICEcoder.tabLeftPos[c-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?
top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("tab"+c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.savedPoints,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances]; 1:top.ICEcoder.dragTabNo>c?c+1:c),top.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("tab"+c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=
c=[[],[],[],[]];for(var e=0;e<b.length;e++){for(var f=0;f<b[e].length;f++)c[e].push(b[e][a[f]-1]);b[e]=c[e]}for(e=0;e<a.length;e++)top.get("tab"+a[e]).id="tab"+(e+1)+".temp",top.ICEcoder.selectedTab==a[e]&&(d=e+1);for(e=0;e<a.length;e++)top.get("tab"+(e+1)+".temp").id="tab"+(e+1);top.get("tab"+d)&&(top.get("tab"+d).className="tab tabSlide");ICEcoder.savedPoints=b[0];ICEcoder.openFiles=b[1];ICEcoder.openFileMDTs=b[2];ICEcoder.cMInstances=b[3];top.ICEcoder.setTabWidths();top.ICEcoder.switchTab(d)}, !1},sortTabs:function(a){var b,c,d;b=[ICEcoder.savedPoints,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.openFileVersions,ICEcoder.cMInstances];c=[[],[],[],[],[]];for(var e=0;e<b.length;e++){for(var f=0;f<b[e].length;f++)c[e].push(b[e][a[f]-1]);b[e]=c[e]}for(e=0;e<a.length;e++)top.get("tab"+a[e]).id="tab"+(e+1)+".temp",top.ICEcoder.selectedTab==a[e]&&(d=e+1);for(e=0;e<a.length;e++)top.get("tab"+(e+1)+".temp").id="tab"+(e+1);top.get("tab"+d)&&(top.get("tab"+d).className="tab tabSlide");ICEcoder.savedPoints=
alphaTabs:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;a=[];b=[];c=[];for(var f=0;f<top.ICEcoder.openFiles.length;f++)a.push(top.ICEcoder.openFiles[f].slice(top.ICEcoder.openFiles[f].lastIndexOf("/")+1)),b.push(top.ICEcoder.openFiles[f]),top.get("tab"+(f+1)).className="tab tabSlide";for(;0<a.length;){d=a[0];nextValueFull=b[0];for(f=e=0;f<a.length;f++)a[f]<d&&(d=a[f],nextValueFull=top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(b[f])],e=f);c.push(top.ICEcoder.openFiles.indexOf(nextValueFull)+ b[0];ICEcoder.openFiles=b[1];ICEcoder.openFileMDTs=b[2];ICEcoder.openFileVersions=b[3];ICEcoder.cMInstances=b[4];top.ICEcoder.setTabWidths();top.ICEcoder.switchTab(d)},alphaTabs:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;a=[];b=[];c=[];for(var f=0;f<top.ICEcoder.openFiles.length;f++)a.push(top.ICEcoder.openFiles[f].slice(top.ICEcoder.openFiles[f].lastIndexOf("/")+1)),b.push(top.ICEcoder.openFiles[f]),top.get("tab"+(f+1)).className="tab tabSlide";for(;0<a.length;){d=a[0];nextValueFull=
1);a.splice(e,1);b.splice(e,1)}top.ICEcoder.sortTabs(c)}},interceptKeys:function(a,b){var c,d,e;c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(224==c||91==c||93==c)top.ICEcoder.cmdKey=!0;if(46==c&&"files"==a)return top.ICEcoder.deleteFiles(),!1;if(b.altKey)return d=b.ctrlKey||top.ICEcoder.cmdKey?!0:!1,"ctrl+alt"==top.ICEcoder.tagWrapperCommand&&d||"alt-left"==top.ICEcoder.tagWrapperCommand&&!d?"content"==a?68==c?(top.ICEcoder.tagWrapper("div"),!1):83==c?(top.ICEcoder.tagWrapper("span"),!1):80== b[0];for(f=e=0;f<a.length;f++)a[f]<d&&(d=a[f],nextValueFull=top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(b[f])],e=f);c.push(top.ICEcoder.openFiles.indexOf(nextValueFull)+1);a.splice(e,1);b.splice(e,1)}top.ICEcoder.sortTabs(c)}},interceptKeys:function(a,b){var c,d,e;c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(224==c||91==c||93==c)top.ICEcoder.cmdKey=!0;if(46==c&&"files"==a)return top.ICEcoder.deleteFiles(),!1;if(b.altKey){var f=b.ctrlKey||top.ICEcoder.cmdKey?!0:!1;return"ctrl+alt"==
c?(top.ICEcoder.tagWrapper("p"),!1):65==c?(top.ICEcoder.tagWrapper("a"),!1):66==c?(top.ICEcoder.tagWrapper("b"),!1):73==c?(top.ICEcoder.tagWrapper("i"),!1):71==c?(top.ICEcoder.tagWrapper("strong"),!1):69==c?(top.ICEcoder.tagWrapper("em"),!1):49==c?(top.ICEcoder.tagWrapper("h1"),!1):50==c?(top.ICEcoder.tagWrapper("h2"),!1):51==c?(top.ICEcoder.tagWrapper("h3"),!1):56==c?(top.ICEcoder.tagWrapper("li"),!1):13==c?(top.ICEcoder.addLineBreakAtEnd(),!1):37==c?(top.ICEcoder.filesFrame.contentWindow.focus(), top.ICEcoder.tagWrapperCommand&&f||"alt-left"==top.ICEcoder.tagWrapperCommand&&!f?"content"==a?68==c?(top.ICEcoder.tagWrapper("div"),!1):83==c?(top.ICEcoder.tagWrapper("span"),!1):80==c?(top.ICEcoder.tagWrapper("p"),!1):65==c?(top.ICEcoder.tagWrapper("a"),!1):49==c?(top.ICEcoder.tagWrapper("h1"),!1):50==c?(top.ICEcoder.tagWrapper("h2"),!1):51==c?(top.ICEcoder.tagWrapper("h3"),!1):13==c?(top.ICEcoder.addLineBreakAtEnd(),!1):37==c?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):c:37==c?(top.ICEcoder.filesFrame.contentWindow.focus(),
!1):c:37==c?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):39==c?(top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?!0:!1),!1):c:13==c?(top.ICEcoder.insertLineAfter(),!1):c;if(13==c&&b.shiftKey)return top.ICEcoder.insertLineBefore(),!1;if(70==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return c=top.get("find"),d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,d=d.getSelections(),0<d.length&&0<d[0].length&&(c.value= !1):39==c?(top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?!0:!1),!1):c:13==c?(top.ICEcoder.insertLineAfter(),!1):c}if(13==c&&b.shiftKey)return top.ICEcoder.insertLineBefore(),!1;if(70!=c&&71!=c||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(76==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return c=top.get("goToLineNo"),c.select(),top.get("find").focus(),c.focus(),!1;if(73==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.searchForSelected(),!1;if(39==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&
d[0]),c.select(),top.get("goToLineNo").focus(),c.focus(),!1;if(71==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return c=top.get("goToLineNo"),c.select(),top.get("find").focus(),c.focus(),!1;if(73==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.searchForSelected(),!1;if(39==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a)return top.ICEcoder.nextTab(),!1;if(37==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a)return top.ICEcoder.previousTab(),!1;if(38==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&& "content"!=a)return top.ICEcoder.nextTab(),!1;if(37==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a)return top.ICEcoder.previousTab(),!1;if(38==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.moveLines("up"),!1;if(40==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.moveLines("down"),!1;if(107!=c&&187!=c||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(109!=c&&189!=c||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(83==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return b.shiftKey?
"content"==a)return top.ICEcoder.moveLines("up"),!1;if(40==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.moveLines("down"),!1;if(107==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return"content"==a?top.ICEcoder.duplicateLines():top.ICEcoder.newTab(),!1;if(109==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return"content"==a?top.ICEcoder.removeLines():top.ICEcoder.closeTab(top.ICEcoder.selectedTab),!1;if(83==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return b.shiftKey?top.ICEcoder.saveFile("saveAs"): top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1;if(13==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])return top.ICEcoder.resetKeys(b),window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1;if(13==c&&"files"==a)return b.ctrlKey||top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,"enter")),!1;if(38!=c&&40!=c&&37!=
top.ICEcoder.saveFile(),!1;if(13==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])return top.ICEcoder.resetKeys(b),window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1;if(13==c&&"files"==a)return b.ctrlKey||top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,"enter")),!1;if(38!=c&&40!=c&&37!=c&&39!=c||"files"!=a)return 79== c&&39!=c||"files"!=a)return 79==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.openPrompt(),!1):32==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.addSnippet(),!1):74==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):223==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(top.ICEcoder.lockedNav?"expand":"contract"),!1):190==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),
c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.openPrompt(),!1):32==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.addSnippet(),!1):74==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):223==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(top.ICEcoder.lockedNav?"expand":"contract"),!1):190==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")? d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,c=d.getCursor().line,top.contentFrame.CodeMirror.doFold(-1<d.getLine(c).indexOf("{")?"brace":"xml",null,"+","-",!1)(d,c),!1):27==c&&"content"==a?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,1<d.getSelections().length?d.execCommand("singleSelection"):top.ICEcoder.lineCommentToggle(),!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c;b.ctrlKey||top.ICEcoder.cmdKey||
e:d,c=d.getCursor().line,top.contentFrame.CodeMirror.doFold(-1<d.getLine(c).indexOf("{")?"brace":"xml",null,"+","-",!1)(d,c),!1):27==c&&"content"==a?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,1<d.getSelections().length?d.execCommand("singleSelection"):top.ICEcoder.lineCommentToggle(),!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c;b.ctrlKey||top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder", (0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,38==c?"up":40==c?"down":37==c?"left":"right"));return!1}"content"==a?top.ICEcoder.removeLines():top.ICEcoder.closeTab(top.ICEcoder.selectedTab);return!1}"content"==a?top.ICEcoder.duplicateLines():top.ICEcoder.newTab();return!1}f=top.get("find");d=ICEcoder.getcMInstance();e=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
"|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,38==c?"up":40==c?"down":37==c?"left":"right"));return!1},resetKeys:function(a){top.ICEcoder.cmdKey=!1},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;c=a.getLine(b).length-a.getLine(b).replace(/^\s\s*/,"").length;a=a.getLine(b).slice(c);"function"==a.slice(0,8)?top.ICEcoder.doSnippet("function","function VAR() {\nINDENT\tCURSOR\nINDENT}"): e:d;d=d.getSelections();0<d.length&&0<d[0].length&&(f.value=d[0]);f.select();top.get("goToLineNo").focus();f.focus();70==c?top.get("findReplaceSubmit").click():ICEcoder.findReplace(top.document.getElementById("find").value,!1,!0,!1,"findPrevious");return!1},resetKeys:function(a){top.ICEcoder.cmdKey=!1},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;c=a.getLine(b).length-a.getLine(b).replace(/^\s\s*/,
"if"==a.slice(0,2)?top.ICEcoder.doSnippet("if","if (CURSOR) {\nINDENT\t\nINDENT}"):"for"==a.slice(0,3)&&top.ICEcoder.doSnippet("for","for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}")},doSnippet:function(a,b){var c,d,e,f,g,k;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c;d=c.getCursor().line;if(-1<c.getLine(d).indexOf(a)){e=c.getLine(d);f=e.indexOf(a);e=e.slice(e.indexOf(a)+a.length+1);b=b.replace(/VAR/g,e);e=c.getLine(d).slice(0, "").length;a=a.getLine(b).slice(c);"function"==a.slice(0,8)?top.ICEcoder.doSnippet("function","function VAR() {\nINDENT\tCURSOR\nINDENT}"):"if"==a.slice(0,2)?top.ICEcoder.doSnippet("if","if (CURSOR) {\nINDENT\t\nINDENT}"):"for"==a.slice(0,3)&&top.ICEcoder.doSnippet("for","for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}")},doSnippet:function(a,b){var c,d,e,f,g,h;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c;d=c.getCursor().line;
f);f=c.getLine(d).length-c.getLine(d).replace(/^\s\s*/,"").length;f=c.getLine(d).slice(0,f);b=b.replace(/INDENT/g,f);e+=b;f=e.indexOf("CURSOR");g=0;k=d;for(i=0;i<e.length;i++)e.indexOf("\n",g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,k+=1);c.replaceRange(e.replace("CURSOR",""),{line:d,ch:0},{line:d,ch:1E6});c.setCursor(k,f);top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?!0:!1)}}}; if(-1<c.getLine(d).indexOf(a)){e=c.getLine(d);f=e.indexOf(a);e=e.slice(e.indexOf(a)+a.length+1);b=b.replace(/VAR/g,e);e=c.getLine(d).slice(0,f);f=c.getLine(d).length-c.getLine(d).replace(/^\s\s*/,"").length;f=c.getLine(d).slice(0,f);b=b.replace(/INDENT/g,f);e+=b;f=e.indexOf("CURSOR");g=0;h=d;for(i=0;i<e.length;i++)e.indexOf("\n",g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,h+=1);c.replaceRange(e.replace("CURSOR",""),{line:d,ch:0},{line:d,ch:1E6});c.setCursor(h,f);top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
!0:!1)}}};

View File

@@ -18,20 +18,14 @@ echo $ICEcoder["password"] == "" && !$ICEcoder["multiUser"] ? "Setup" : "Login";
<link rel="icon" type="image/png" href="../favicon.png"> <link rel="icon" type="image/png" href="../favicon.png">
</head> </head>
<body style="background-color: #141414" onLoad="<?php if (!isset($_GET["get"])) {$inputFocus = $ICEcoder["multiUser"] ? "username" : "password"; echo "document.settingsUpdate.".$inputFocus.".focus(); ";}; ?>setTimeout(function(){document.getElementById('screenContainer').style.opacity=1},50);if (document.getElementById('trialBarRemaining')) {setTimeout(function(){document.getElementById('trialBarRemaining').style.width = '<?php echo $tRemainingPerc*170;?>px';},150)}"> <body style="background-color: #181817" onLoad="<?php if (!isset($_GET["get"])) {$inputFocus = $ICEcoder["multiUser"] ? "username" : "password"; echo "document.settingsUpdate.".$inputFocus.".focus(); ";}; ?>setTimeout(function(){document.getElementById('screenContainer').style.opacity=1},50)">
<div class="screenContainer" id="screenContainer" style="background-color: #141414; opacity: 0; transition: opacity 0.1s ease-out"> <div class="screenContainer" id="screenContainer" style="background-color: #181817; opacity: 0; transition: opacity 0.1s ease-out">
<div class="screenVCenter"> <div class="screenVCenter">
<div class="screenCenter"> <div class="screenCenter">
<img src="../images/ice-coder.png" alt="ICEcoder"> <img src="../images/ice-coder.png" alt="ICEcoder">
<div class="version" style="margin-bottom: 22px">v <?php echo $ICEcoder["versionNo"];?></div> <div class="version" style="margin-bottom: 22px">v <?php echo $ICEcoder["versionNo"];?></div>
<?php if (generateHash(strClean($ICEcoder['licenseEmail']),$ICEcoder['licenseCode'])!=$ICEcoder['licenseCode'] && !isset($_GET['get']) && !isset($_POST['code'])) {?>
<div class="trialBarContainer"><div class="trialBarRemaining" id="trialBarRemaining"></div><br>
<div class="trialBarText"><?php echo $tDaysRemaining;?> days left - <a href="login.php?get=code&csrf=<?php echo $_SESSION["csrf"];?>">Unlock now</a></div>
</div>
<?php ;}; ?>
<form name="settingsUpdate" action="login.php" method="POST"> <form name="settingsUpdate" action="login.php" method="POST">
<?php <?php
if (isset($_GET["get"]) && $_GET["get"]=="code") { if (isset($_GET["get"]) && $_GET["get"]=="code") {

View File

@@ -132,7 +132,7 @@ function xssClean($data,$type) {
function toUTF8noBOM($string,$message) { function toUTF8noBOM($string,$message) {
// Attempt to detect encoding // Attempt to detect encoding
if (function_exists('mb_detect_encoding')) { if (function_exists('mb_detect_encoding')) {
$encType = mb_detect_encoding($string); $strictUTF8 = mb_detect_encoding($string, 'UTF-8', true);
// Get rid of any UTF-8 BOM // Get rid of any UTF-8 BOM
$string = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$string); $string = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$string);
// Test for any bad characters // Test for any bad characters
@@ -140,7 +140,7 @@ function toUTF8noBOM($string,$message) {
$teststringBroken = utf8_decode($teststring); $teststringBroken = utf8_decode($teststring);
$teststringConverted = iconv("UTF-8", "UTF-8//IGNORE", $teststringBroken); $teststringConverted = iconv("UTF-8", "UTF-8//IGNORE", $teststringBroken);
// If we have a matching length, UTF8 encode it // If we have a matching length, UTF8 encode it
if ($encType != "ASCII" && $encType != "UTF-8" && strlen($teststringConverted) == strlen($teststringBroken)) { if (!$strictUTF8 && strlen($teststringConverted) == strlen($teststringBroken)) {
$string = utf8_encode($string); $string = utf8_encode($string);
if ($message) { if ($message) {
echo "top.ICEcoder.message('".$t['Your document does...'].".');"; echo "top.ICEcoder.message('".$t['Your document does...'].".');";
@@ -179,4 +179,45 @@ if (!function_exists('array_replace_recursive')) {
return $base; return $base;
} }
} }
// Get number of versions total for a file
function getVersionsCount($fileLoc,$fileName) {
$count = 0;
$dateCounts = array();
// Establish the base, host and date dirs within...
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../backups/";
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
$backupDateDirs = scandir($backupDirBase.$backupDirHost,1);
// Get rid of . and .. from date dirs array
for ($i=0; $i<count($backupDateDirs); $i++) {
if ($backupDateDirs[$i] == "." || $backupDateDirs[$i] == "..") {
array_splice($backupDateDirs,$i,1);
$i--;
}
}
// Check the backup index in each dir and add up the counts from matching lines
for ($i=0; $i<count($backupDateDirs); $i++) {
$backupIndex = $backupDirBase.$backupDirHost."/".$backupDateDirs[$i]."/.versions-index";
// Have a .versions-index file? Get contents
if (file_exists($backupIndex)) {
$versionsInfo = file_get_contents($backupIndex,false,$context);
$versionsInfo = explode("\n",$versionsInfo);
// For each line, check if it's our file and if so, add the count to our $count value and $dateCount array
for ($j=0; $j<count($versionsInfo); $j++) {
$fileRef = $fileLoc."/".$fileName." = ";
if (strpos($versionsInfo[$j],$fileRef) === 0) {
// We have a match, so split on the " = " and we can grab number as 2nd part
$lineInfo = explode(" = ",$versionsInfo[$j]);
$count += intval($lineInfo[1]);
$dateCounts[$backupDateDirs[$i]] = intval($lineInfo[1]);
}
}
}
}
return array(
"count" => $count,
"dateCounts" => $dateCounts
);
}
?> ?>

View File

@@ -33,8 +33,10 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
.settings .infoPane a:hover {text-decoration: underline} .settings .infoPane a:hover {text-decoration: underline}
.settings .logo {position: relative; margin-top: 2px; width: 100px} .settings .logo {position: relative; margin-top: 2px; width: 100px}
.settings .version {position: relative; display: block; margin-top: 5px; margin-bottom: 10px; font-size: 10px; color: #bbb} .settings .version {position: relative; display: block; margin-top: 5px; margin-bottom: 10px; font-size: 10px; color: #bbb}
.settings .settingsColumn1 {width: 220px; height: 560px; padding: 20px; float: left} .settings .tabContainer {background: #fff; height: 38px; padding-top: 20px}
.settings .settingsColumn2 {width: 420px; height: 560px; padding: 20px 20px 20px 0; float: left} .settings .tabContainer .tab {padding: 12px; background: #444; margin-right: 1px; float: left; cursor: pointer}
.settings .tabContainer .tabActive {background: #1c1c19}
.settings .section {width: 640px; height: 450px; padding: 20px; margin-top: 10px; float: left}
.settings input, .settings textarea {border: 1px solid #555; background-color: #444; color: #fff} .settings input, .settings textarea {border: 1px solid #555; background-color: #444; color: #fff}
.settings input:focus, .settings textarea:focus { .settings input:focus, .settings textarea:focus {
outline: none; outline: none;
@@ -42,5 +44,6 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
-moz-box-shadow: 0 0 10px 1px rgba(0,198,255,0.7); -moz-box-shadow: 0 0 10px 1px rgba(0,198,255,0.7);
box-shadow: 0 0 10px 1px rgba(0,198,255,0.7); box-shadow: 0 0 10px 1px rgba(0,198,255,0.7);
} }
.settings input[type="text"]:disabled {opacity: 0.5}
.settings .info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help} .settings .info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}
.settings .update {position: absolute; bottom: 0; right: 20px; padding: 5px 10px; font-size: 18px; background-color: rgba(0,198,255,0.7); opacity: 0.1; cursor: pointer} .settings .update {position: absolute; bottom: 0; right: 20px; padding: 5px 10px; font-size: 18px; background-color: rgba(0,198,255,0.7); opacity: 0.1; cursor: pointer}

View File

@@ -84,112 +84,115 @@ for ($i=0;$i<count($themeArray);$i++) {
</div> </div>
<form name="settings" action="settings.php" method="POST"> <form name="settings" action="settings.php" method="POST">
<div class="settingsColumn1">
<h2><?php echo $t['functionality'];?></h2>
<input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> <?php echo $t['check for updates...'];?><br>
<input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> <?php echo $t['auto open last...'];?><br>
<input type="checkbox" onclick="showButton()" name="updateDiffOnSave" value="true"<?php if($ICEcoder["updateDiffOnSave"]) {echo ' checked';};?>> update diff pane on save<br>
language <span class="info" title="Reload required after changing">[?]</span><br>
<select onchange="showButton()" name="languageUser">
<?php
$langFiles = array("chinese-simplified.php","chinese-traditional.php","dutch.php","english.php","french.php","german.php","italian.php","norwegian.php","persian.php","portuguese-brazilian.php","spanish.php");
$langText = array("中国(简体)","中國(繁體)","Nederlands","English","Français","Deutsch","Italiano","Norsk","فارسی","Portugues(br)","Espa&ntilde;ol");
for ($i=0; $i<count($langFiles); $i++) {
echo '<option value="'.$langFiles[$i].'"'.($ICEcoder["languageUser"]==$langFiles[$i] ? ' selected' : '').'>'.$langText[$i].'</option>'.PHP_EOL;
}
?>
</select><br>
<br>
<?php echo $t['when finding in...'];?>:<br>
<input type="text" onkeydown="showButton()" name="findFilesExclude" value="<?php echo implode(", ",$ICEcoder["findFilesExclude"]); ?>"><br>
<br>
<h2><?php echo $t['assisting'];?></h2> <div class="tabContainer">
<input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> <?php echo $t['code assist'];?><br> <div id="generalTab" class="tab tabActive" onclick="switchTab('general')">General</div>
<input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> <?php echo $t['visible tabs'];?><br> <div id="styleTab" class="tab" onclick="switchTab('style')">Style</div>
<input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> <?php echo $t['locked nav'];?><br><br> <div id="accountsTab" class="tab" onclick="switchTab('accounts')">Accounts</div>
<?php echo $t['tag wrapper command'];?><br> <div id="securityTab" class="tab" onclick="switchTab('security')">Security</div>
<select onchange="showButton()" name="tagWrapperCommand">
<option value="ctrl+alt"<?php if($ICEcoder["tagWrapperCommand"]=='ctrl+alt') {echo " selected";};?>>ctrl/cmd + alt</option>
<option value="alt-left"<?php if($ICEcoder["tagWrapperCommand"]=='alt-left') {echo " selected";};?>>alt left</option>
</select><br>
<br>
<?php echo $t['auto-complete on'];?><br>
<select onchange="showButton()" name="autoComplete">
<option value="ctrl+space"<?php if($ICEcoder["autoComplete"]=='ctrl+space') {echo " selected";};?>>ctrl/cmd + space</option>
<option value="keypress"<?php if($ICEcoder["autoComplete"]=='keypress') {echo " selected";};?>>keypress</option>
</select><br>
<br>
<h2><?php echo $t['security'];?></h2>
<?php echo $t['new password'];?> <span class="info" title="<?php echo $t['8 chars min'];?>">[?]</span><br>
<input type="password" name="password" onkeydown="showButton()"><br>
<?php echo $t['confirm password'];?><br>
<input type="password" name="passwordConfirm" onkeydown="showButton()"><br>
<br>
<?php echo $t['banned files/folders'];?><br>
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedFiles" value="<?php echo implode(", ",$ICEcoder["bannedFiles"]); ?>"><br>
<?php echo $t['banned paths'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br>
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedPaths" value="<?php echo implode(", ",$ICEcoder["bannedPaths"]); ?>"><br>
<input type="hidden" name="changedFileSettings" value="false">
<?php echo $t['ip addresses'];?> <span class="info" title="<?php echo $t['Comma delimited'];?>">[?]</span><br>
<input type="text" onkeydown="showButton()" name="allowedIPs" value="<?php echo implode(", ",$ICEcoder["allowedIPs"]); ?>"><br>
</div> </div>
<div class="settingsColumn2"> <div id="generalSection" class="section" style="display: block">
<h2><?php echo $t['style'];?></h2>
<?php echo $t['theme'];?><br>
<select onchange="selectTheme();showButton()" id="select" name="theme" style="width: 95px">
<option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option>
<?php
for ($i=0;$i<count($themeArray);$i++) {
$optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : '';
echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL;
}
?>
</select>
<span style="position: absolute; margin: -15px 0 0 15px"> <div style="display: inline-block; margin-right: 40px">
<?php echo $t['indent type'];?><br>
<select onchange="showButton()" name="indentWithTabs">
<option value="true"<?php if($ICEcoder["indentWithTabs"]) {echo " selected";};?>>tabs</option>
<option value="false"<?php if(!$ICEcoder["indentWithTabs"]) {echo " selected";};?>>spaces</option>
</select>
</span>
<span style="position: absolute; margin: -15px 0 0 100px"> <h2>language</h2><br>
<?php echo $t['indent size'];?><br> <select onchange="showButton()" name="languageUser">
<input type="text" name="indentSize" id="indentSize" style="width: 30px" onkeydown="showButton()" onkeyup="changeIndentSize()" value="<?php echo $ICEcoder["indentSize"];?>"> <?php
</span> $langFiles = array("chinese-simplified.php","chinese-traditional.php","dutch.php","english.php","french.php","german.php","italian.php","norwegian.php","persian.php","portuguese-brazilian.php","spanish.php");
$langText = array("中国(简体)","中國(繁體)","Nederlands","English","Français","Deutsch","Italiano","Norsk","فارسی","Portugues(br)","Espa&ntilde;ol");
for ($i=0; $i<count($langFiles); $i++) {
echo '<option value="'.$langFiles[$i].'"'.($ICEcoder["languageUser"]==$langFiles[$i] ? ' selected' : '').'>'.$langText[$i].'</option>'.PHP_EOL;
}
?>
</select> <span class="info" style="display: inline-block; padding-top: 2px" title="Reload required after changing">[?]</span>
<br><br>
<span style="position: absolute; margin: -15px 0 15px 175px"> <h2><?php echo $t['functionality'];?></h2><br>
<?php echo $t['auto indent'];?><br> <input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> <?php echo $t['check for updates...'];?><br>
<select onchange="showButton()" name="indentAuto"> <input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> <?php echo $t['auto open last...'];?><br>
<option value="true"<?php if($ICEcoder["indentAuto"]) {echo " selected";};?>>yes</option> <input type="checkbox" onclick="showButton()" name="updateDiffOnSave" value="true"<?php if($ICEcoder["updateDiffOnSave"]) {echo ' checked';};?>> update diff pane on save
<option value="false"<?php if(!$ICEcoder["indentAuto"]) {echo " selected";};?>>no</option> <br><br>
</select>
</span>
<br>
<span style="position: absolute; margin: 5px 0 0 0">
<?php echo $t['line wrapping'];?><br>
<select onchange="showButton()" name="lineWrapping">
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["lineWrapping"]) {echo " selected";};?>>no</option>
</select>
</span>
<span style="position: absolute; margin: 5px 0 0 95px"> <h2><?php echo $t['assisting'];?></h2><br>
<?php echo $t['font size'];?><br> <input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> <?php echo $t['code assist'];?><br>
<input type="text" name="fontSize" id="fontSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeFontSize()" value="<?php echo $ICEcoder["fontSize"];?>"> <br>
</span> <?php echo $t['tag wrapper command'];?><br>
<select onchange="showButton()" name="tagWrapperCommand">
<option value="ctrl+alt"<?php if($ICEcoder["tagWrapperCommand"]=='ctrl+alt') {echo " selected";};?>>ctrl/cmd + alt</option>
<option value="alt-left"<?php if($ICEcoder["tagWrapperCommand"]=='alt-left') {echo " selected";};?>>alt left</option>
</select>
<br><br>
<br><br><br><br> <?php echo $t['auto-complete on'];?><br>
<select onchange="showButton()" name="autoComplete">
<option value="ctrl+space"<?php if($ICEcoder["autoComplete"]=='ctrl+space') {echo " selected";};?>>ctrl/cmd + space</option>
<option value="keypress"<?php if($ICEcoder["autoComplete"]=='keypress') {echo " selected";};?>>keypress</option>
</select>
<br><br>
<textarea id="code" name="code"> </div>
<div style="display: inline-block">
<h2>find &amp; replace</h2><br>
<?php echo $t['when finding in...'];?>:<br>
<input type="text" onkeydown="showButton()" name="findFilesExclude" style="width: 300px" value="<?php echo implode(", ",$ICEcoder["findFilesExclude"]); ?>">
<br><br>
<h2><?php echo $t['bug reporting'];?></h2><br>
<?php echo $t['check in files'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br>
<input type="text" name="bugFilePaths" style="width: 300px" onkeydown="showButton()" value="<?php echo implode(", ",$ICEcoder["bugFilePaths"]);?>"><br>
<span style="display: inline-block; padding: 6px 5px 0 0">...<?php echo $t['every'];?></span>
<input type="text" name="bugFileCheckTimer" style="width: 50px; margin-top: 3px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileCheckTimer"];?>">
<span style="display: inline-block; padding: 6px 5px 0 5px"><?php echo $t['secs getting last'];?></span>
<input type="text" name="bugFileMaxLines" style="width: 50px; margin-top: 3px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileMaxLines"];?>">
<span style="display: inline-block; padding: 6px 5px 0 5px"><?php echo $t['lines'];?></span>
<br><br>
<h2><?php echo $t['file manager'];?></h2><br>
<?php echo $t['root'];?> <span class="info" title="<?php echo $t['Slash prefixed'];?>">[?]</span><br>
<input type="text" name="root" style="width: 300px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
<br><br>
<h2><?php echo $t['backups'];?></h2><br>
<input type="checkbox" onclick="showButton();changeBackupsDaysStatus();" name="backupsKept" value="true"<?php if($ICEcoder["backupsKept"]) {echo ' checked';};?>> <?php echo $t['keep version control...'];?> <input type="text" name="backupsDays" id="backupsDays" style="width: 50px; margin: 3px 5px 0 5px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["backupsDays"];?>" <?php
if(!$ICEcoder["backupsKept"]){
echo ' disabled=""';
}?>> <?php echo $t['days'];?><br>
<div style="padding: 5px 5px 5px 5px; color: #888">
<?php
// Display number of days backups available
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../backups/";
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
$backupDirsList = scandir($backupDirBase.$backupDirHost);
// Remove . and .. from array
for ($i=0; $i<count($backupDirsList); $i++) {
if ($backupDirsList[$i] == "." || $backupDirsList[$i] == "..") {
array_splice($backupDirsList,$i,1);
$i--;
}
}
// Display text re the number of days backups have taken place
$backupNumDays = $backupDirsList[0] != "" && count($backupDirsList) > 0 ? count($backupDirsList) : 0;
echo $backupNumDays." ".($backupNumDays != 1 ? $t['days'] : $t['day'])." ".$t['of backups stored...'];
?>
</div><br>
<br><br>
</div>
</div>
<div id="styleSection" class="section" style="display: none">
<div style="display: inline-block; width: 400px; margin-right: 40px">
<div style="height: 220px">
<h2>preview</h2><br>
<textarea id="code" name="code">
function findSequence(goal) { function findSequence(goal) {
function find(start,history) { function find(start,history) {
if (start==goal) if (start==goal)
return history; return history;
else if (start>goal) else if (start>goal)
return null; return null;
else else
@@ -198,38 +201,84 @@ function findSequence(goal) {
} }
return find(1,"1"); return find(1,"1");
}</textarea> }</textarea>
<br> </div>
<br><br>
<span style="position: absolute; top: 325px"> <h2><?php echo $t['layout'];?></h2><br>
<input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> <?php echo $t['locked nav'];?><br><br>
<div style="position: relative; display: inline-block; margin-right: 20px">
<h2><?php echo $t['layout'];?></h2>
<?php echo $t['plugin panel aligned'];?><br> <?php echo $t['plugin panel aligned'];?><br>
<select onchange="showButton()" name="pluginPanelAligned"> <select onchange="showButton()" name="pluginPanelAligned">
<option value="left"<?php if($ICEcoder["pluginPanelAligned"] == "left") {echo " selected";};?>>left</option> <option value="left"<?php if($ICEcoder["pluginPanelAligned"] == "left") {echo " selected";};?>>left</option>
<option value="right"<?php if($ICEcoder["pluginPanelAligned"] == "right") {echo " selected";};?>>right</option> <option value="right"<?php if($ICEcoder["pluginPanelAligned"] == "right") {echo " selected";};?>>right</option>
</select> </select>
<br><br>
</div> </div>
<div style="position: relative; display: inline-block"> <div style="display: inline-block">
<h2><?php echo $t['file manager'];?></h2> <h2><?php echo $t['style'];?></h2><br>
<?php echo $t['root'];?> <span class="info" title="<?php echo $t['Slash prefixed'];?>">[?]</span><br> <?php echo $t['theme'];?><br>
<input type="text" name="root" style="width: 200px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>"> <select onchange="selectTheme();showButton()" id="select" name="theme" style="width: 95px">
<option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option>
<?php
for ($i=0;$i<count($themeArray);$i++) {
$optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : '';
echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL;
}
?>
</select>
<br><br>
<?php echo $t['font size'];?><br>
<input type="text" name="fontSize" id="fontSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeFontSize()" value="<?php echo $ICEcoder["fontSize"];?>">
<br><br>
<?php echo $t['indent size'];?><br>
<input type="text" name="indentSize" id="indentSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeIndentSize()" value="<?php echo $ICEcoder["indentSize"];?>">
<br><br>
<input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> <?php echo $t['visible tabs'];?>
<br><br>
<?php echo $t['line wrapping'];?><br>
<select onchange="showButton()" name="lineWrapping">
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["lineWrapping"]) {echo " selected";};?>>no</option>
</select>
<br><br>
<h2><?php echo $t['functionality'];?></h2><br>
<?php echo $t['indent type'];?><br>
<select onchange="showButton()" name="indentWithTabs">
<option value="true"<?php if($ICEcoder["indentWithTabs"]) {echo " selected";};?>>tabs</option>
<option value="false"<?php if(!$ICEcoder["indentWithTabs"]) {echo " selected";};?>>spaces</option>
</select>
<br><br>
<?php echo $t['auto indent'];?><br>
<select onchange="showButton()" name="indentAuto">
<option value="true"<?php if($ICEcoder["indentAuto"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["indentAuto"]) {echo " selected";};?>>no</option>
</select>
<br><br>
</div> </div>
</div>
<div id="accountsSection" class="section" style="display: none">
<h2>password</h2><br>
<?php echo $t['new password'];?> <span class="info" title="<?php echo $t['8 chars min'];?>">[?]</span><br>
<input type="password" name="password" style="width: 320px" onkeydown="showButton()">
<br><br> <br><br>
<h2><?php echo $t['bug reporting'];?></h2> <?php echo $t['confirm password'];?><br>
<?php echo $t['check in files'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br> <input type="password" name="passwordConfirm" style="width: 320px" onkeydown="showButton()">
<input type="text" name="bugFilePaths" style="width: 120px" onkeydown="showButton()" value="<?php echo implode(", ",$ICEcoder["bugFilePaths"]);?>">
<span style="display: inline-block; padding: 4px 5px 0 5px"><?php echo $t['every'];?></span>
<input type="text" name="bugFileCheckTimer" style="width: 50px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileCheckTimer"];?>">
<span style="display: inline-block; padding: 4px 5px 0 5px"><?php echo $t['secs getting last'];?></span>
<input type="text" name="bugFileMaxLines" style="width: 50px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileMaxLines"];?>">
<span style="display: inline-block; padding: 4px 5px 0 5px"><?php echo $t['lines'];?></span>
<br><br> <br><br>
<div> <h2><?php echo $t['multi-user'];?> <span class="info" title="<?php echo $t['Make sure you...'];?>">[?]</span></h2><br>
<h2><?php echo $t['multi-user'];?> <span class="info" title="<?php echo $t['Make sure you...'];?>">[?]</span></h2>
<input type="checkbox" name="multiUser" value="true" onclick="showButton();changeEnableRegistrationStatus();"<?php if($ICEcoder["multiUser"]){echo ' checked';} ?>>Multi-User <input type="checkbox" name="multiUser" value="true" onclick="showButton();changeEnableRegistrationStatus();"<?php if($ICEcoder["multiUser"]){echo ' checked';} ?>>Multi-User
<?php <?php
echo '<input type="checkbox" name="enableRegistration" value="true"'; echo '<input type="checkbox" name="enableRegistration" value="true"';
@@ -239,15 +288,28 @@ function findSequence(goal) {
} }
echo ' onclick="showButton()" id="enableRegistration"> '.$t['Registration'].' </input>'; echo ' onclick="showButton()" id="enableRegistration"> '.$t['Registration'].' </input>';
?> ?>
</div> <br><br>
<br>
<div> <h2>github</h2><br>
<h2>github</h2>
<?php echo $t['auth token'];?> <span class="info" title="<?php echo $t['Required to get...'];?>">[?]</span> &nbsp; <a href="https://help.github.com/articles/creating-an-access-token-for-command-line-use" target="_blank" class="info">Personal Access Token</a> &nbsp; <a href="(http://developer.github.com/v3/oauth" target="_blank" class="info">Client/Secret Pair Token</a><br> <?php echo $t['auth token'];?> <span class="info" title="<?php echo $t['Required to get...'];?>">[?]</span> &nbsp; <a href="https://help.github.com/articles/creating-an-access-token-for-command-line-use" target="_blank" class="info">Personal Access Token</a> &nbsp; <a href="(http://developer.github.com/v3/oauth" target="_blank" class="info">Client/Secret Pair Token</a><br>
<input type="text" name="githubAuthToken" style="width: 320px" onkeydown="showButton()" value="<?php echo $ICEcoder["githubAuthToken"];?>" autocomplete="off"> <input type="text" name="githubAuthToken" style="width: 320px" onkeydown="showButton()" value="<?php echo $ICEcoder["githubAuthToken"];?>" autocomplete="off">
</div> </div>
</span>
<div id="securitySection" class="section" style="display: none">
<h2><?php echo $t['security'];?></h2><br>
<?php echo $t['banned files/folders'];?><br>
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedFiles" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["bannedFiles"]); ?>">
<br><br>
<?php echo $t['banned paths'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br>
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedPaths" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["bannedPaths"]); ?>">
<br><br>
<input type="hidden" name="changedFileSettings" value="false">
<?php echo $t['ip addresses'];?> <span class="info" title="<?php echo $t['Comma delimited'];?>">[?]</span><br>
<input type="text" onkeydown="showButton()" name="allowedIPs" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["allowedIPs"]); ?>">
<br><br>
</div>
<script> <script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), { var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
@@ -270,17 +332,22 @@ function changeIndentSize() {
var indentSize = document.getElementById("indentSize").value; var indentSize = document.getElementById("indentSize").value;
editor.setOption("indentUnit", indentSize); editor.setOption("indentUnit", indentSize);
editor.setOption("tabSize", indentSize); editor.setOption("tabSize", indentSize);
editor.refresh();
} }
function changeFontSize() { function changeFontSize() {
cMCSS = document.styleSheets[2]; cMCSS = document.styleSheets[2];
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules'; cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
cMCSS[strCSS][0].style['fontSize'] = document.getElementById("fontSize").value; cMCSS[strCSS][0].style['fontSize'] = document.getElementById("fontSize").value;
editor.refresh();
} }
var changeEnableRegistrationStatus = function(){ var changeEnableRegistrationStatus = function(){
document.getElementById('enableRegistration').disabled=!document.getElementById('enableRegistration').disabled; document.getElementById('enableRegistration').disabled=!document.getElementById('enableRegistration').disabled;
} }
var changeBackupsDaysStatus = function(){
document.getElementById('backupsDays').disabled=!document.getElementById('backupsDays').disabled;
}
var showButton = function() { var showButton = function() {
document.getElementById('updateButton').style.opacity = 1; document.getElementById('updateButton').style.opacity = 1;
} }
@@ -303,12 +370,18 @@ var validatePasswords = function() {
} }
} }
} }
tabNames = ['general','style','accounts','security'];
var switchTab = function(tab) {
for (var i=0; i<tabNames.length; i++) {
document.getElementById(tabNames[i]+'Tab').className = tabNames[i] == tab ? "tab tabActive" : "tab";
document.getElementById(tabNames[i]+'Section').style.display = tabNames[i] == tab ? "block" : "none";
}
editor.refresh();
}
</script> </script>
<div class="update" id="updateButton" onClick="<?php echo $ICEcoder['demoMode'] ? "top.ICEcoder.message('Sorry, can\'t commit settings in demo mode')" : "validatePasswords()"; ?>">update</div> <div class="update" id="updateButton" onClick="<?php echo $ICEcoder['demoMode'] ? "top.ICEcoder.message('Sorry, can\'t commit settings in demo mode')" : "validatePasswords()"; ?>">update</div>
</div>
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>"> <input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form> </form>

View File

@@ -0,0 +1,20 @@
<?php
$newConfigSettingsFile = '<?php
// ICEcoder system settings
$ICEcoderSettings = array(
"versionNo" => "5.3",
"codeMirrorDir" => "CodeMirror",
"docRoot" => $_SERVER[\'DOCUMENT_ROOT\'], // Set absolute path of another location if needed
"demoMode" => false,
"devMode" => false,
"fileDirResOutput" => "none", // Can be none, raw, object, both (all but \'none\' output to console)
"loginRequired" => true,
"multiUser" => false,
"languageBase" => "english.php",
"lineEnding" => "\n",
"newDirPerms" => 755,
"newFilePerms" => 644,
"enableRegistration" => true
);
?>';
?>

View File

@@ -19,6 +19,8 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$ICEcoder["openLastFiles"] = isset($_POST['openLastFiles']) && $_POST['openLastFiles'] ? "true" : "false"; $ICEcoder["openLastFiles"] = isset($_POST['openLastFiles']) && $_POST['openLastFiles'] ? "true" : "false";
$ICEcoder["updateDiffOnSave"] = isset($_POST['updateDiffOnSave']) && $_POST['updateDiffOnSave'] ? "true" : "false"; $ICEcoder["updateDiffOnSave"] = isset($_POST['updateDiffOnSave']) && $_POST['updateDiffOnSave'] ? "true" : "false";
$ICEcoder["languageUser"] = strClean($_POST['languageUser']); $ICEcoder["languageUser"] = strClean($_POST['languageUser']);
$ICEcoder["backupsKept"] = isset($_POST['backupsKept']) && $_POST['backupsKept'] ? "true" : "false";
$ICEcoder["backupsDays"] = intval($_POST['backupsDays']);
$ICEcoder["findFilesExclude"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['findFilesExclude']))).'")'; $ICEcoder["findFilesExclude"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['findFilesExclude']))).'")';
$ICEcoder["codeAssist"] = isset($_POST['codeAssist']) && $_POST['codeAssist'] ? "true" : "false"; $ICEcoder["codeAssist"] = isset($_POST['codeAssist']) && $_POST['codeAssist'] ? "true" : "false";
$ICEcoder["visibleTabs"] = isset($_POST['visibleTabs']) && $_POST['visibleTabs'] ? "true" : "false"; $ICEcoder["visibleTabs"] = isset($_POST['visibleTabs']) && $_POST['visibleTabs'] ? "true" : "false";
@@ -41,7 +43,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$ICEcoder["bugFileMaxLines"] = intval($_POST['bugFileMaxLines']); $ICEcoder["bugFileMaxLines"] = intval($_POST['bugFileMaxLines']);
$ICEcoder["githubAuthToken"] = strClean($_POST['githubAuthToken']); $ICEcoder["githubAuthToken"] = strClean($_POST['githubAuthToken']);
$settingsArray = array("root","checkUpdates","openLastFiles","updateDiffOnSave","languageUser","findFilesExclude","codeAssist","visibleTabs","lockedNav","tagWrapperCommand","autoComplete","password","bannedFiles","bannedPaths","allowedIPs","theme","fontSize","lineWrapping","indentWithTabs","indentAuto","indentSize","pluginPanelAligned","bugFilePaths","bugFileCheckTimer","bugFileMaxLines","githubAuthToken"); $settingsArray = array("root","checkUpdates","openLastFiles","updateDiffOnSave","languageUser","backupsKept","backupsDays","findFilesExclude","codeAssist","visibleTabs","lockedNav","tagWrapperCommand","autoComplete","password","bannedFiles","bannedPaths","allowedIPs","theme","fontSize","lineWrapping","indentWithTabs","indentAuto","indentSize","pluginPanelAligned","bugFilePaths","bugFileCheckTimer","bugFileMaxLines","githubAuthToken");
$settingsNew = ""; $settingsNew = "";
for ($i=0;$i<count($settingsArray);$i++) { for ($i=0;$i<count($settingsArray);$i++) {
$settingsNew .= '"'.$settingsArray[$i].'" => '; $settingsNew .= '"'.$settingsArray[$i].'" => ';

View File

@@ -1,4 +1,15 @@
<?php <?php
$ftpSiteConn = false;
if ($ftpSiteConn == 1) {
$ftpSite = ""; // FTP site domain, eg http://yourdomain.com
$ftpHost = ""; // FTP host, eg ftp.yourdomain.com
$ftpUser = ""; // FTP username
$ftpPass = ""; // FTP password
$ftpPasv = false; // FTP account requires PASV mode?
$ftpMode = FTP_ASCII; // FTP transfer mode, FTP_ASCII or FTP_BINARY
$ftpRoot = ""; // FTP root dir to use as base, eg /htdocs
}
// Establish settings and users template filenames // Establish settings and users template filenames
$configSettings = 'config___settings.php'; $configSettings = 'config___settings.php';
$configUsersTemplate = 'config___users-template.php'; $configUsersTemplate = 'config___users-template.php';
@@ -6,23 +17,8 @@ $configUsersTemplate = 'config___users-template.php';
// Create a new config file if it doesn't exist yet. // Create a new config file if it doesn't exist yet.
// The reason we create it, is so it has PHP write permissions, meaning we can update it later // The reason we create it, is so it has PHP write permissions, meaning we can update it later
if (!file_exists(dirname(__FILE__)."/".$configSettings)) { if (!file_exists(dirname(__FILE__)."/".$configSettings)) {
$newConfigSettingsFile = '<?php // Include our params to make use of (as $newConfigSettingsFile)
// ICEcoder system settings include(dirname(__FILE__)."/settings-system-params.php");
$ICEcoderSettings = array(
"versionNo" => "5.0",
"codeMirrorDir" => "CodeMirror",
"docRoot" => $_SERVER[\'DOCUMENT_ROOT\'],
"demoMode" => false,
"devMode" => false,
"loginRequired" => true,
"multiUser" => false,
"languageBase" => "english.php",
"lineEnding" => "\n",
"newDirPerms" => 755,
"newFilePerms" => 644,
"enableRegistration" => true
);
?>';
if ($fConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) { if ($fConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) {
fwrite($fConfigSettings, $newConfigSettingsFile); fwrite($fConfigSettings, $newConfigSettingsFile);
fclose($fConfigSettings); fclose($fConfigSettings);
@@ -114,15 +110,17 @@ $demoMode = $ICEcoder['demoMode'];
// Check if trial period has ended // Check if trial period has ended
$tPeriod = 1296000-1; $tPeriod = 1296000-1;
if (generateHash(strClean($ICEcoder['licenseEmail']),$ICEcoder['licenseCode'])!=$ICEcoder['licenseCode'] && $ICEcoder['configCreateDate'] > 0 && $ICEcoder['configCreateDate']+$tPeriod < time() && !isset($_GET['get']) && !isset($_POST['code'])) {
if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && generateHash(strClean($ICEcoder['licenseEmail']),$ICEcoder['licenseCode'])!=$ICEcoder['licenseCode'] && $ICEcoder['configCreateDate'] > 0 && $ICEcoder['configCreateDate']+$tPeriod < time() && !isset($_GET['get']) && !isset($_POST['code'])) {
if (file_exists('lib/login.php')) { if (file_exists('lib/login.php')) {
header('Location: lib/login.php?get=code&csrf='.$_SESSION["csrf"]); // Go to get code screen in top level window
echo "<script>window.location='lib/login.php?get=code&csrf=".$_SESSION["csrf"]."';</script>"; echo "<script>window.location='lib/login.php?get=code&csrf=".$_SESSION["csrf"]."';</script>";
} else { } else {
header('Location: login.php?get=code&csrf='.$_SESSION["csrf"]); // Go to get code screen in top level window
echo "<script>window.location='login.php?get=code&csrf=".$_SESSION["csrf"]."';</script>"; echo "<script>window.location='login.php?get=code&csrf=".$_SESSION["csrf"]."';</script>";
} }
die('Redirecting to donate screen...'); die('Redirecting to donate screen...');
exit;
} }
$tRemaining = ($ICEcoder['configCreateDate']+$tPeriod)-time(); $tRemaining = ($ICEcoder['configCreateDate']+$tPeriod)-time();
if ($tRemaining > $tPeriod || $ICEcoder['configCreateDate'] == 0) {$tRemaining = $tPeriod;}; if ($tRemaining > $tPeriod || $ICEcoder['configCreateDate'] == 0) {$tRemaining = $tPeriod;};

View File

@@ -8,7 +8,7 @@ $t = $text['updater'];
<title>Updating ICEcoder...</title> <title>Updating ICEcoder...</title>
</head> </head>
<body style="background: #141414; color: #fff; font-size: 10px; font-family: arial, helvetica, swiss, verdana"> <body style="background: #181817; color: #fff; font-size: 10px; font-family: arial, helvetica, swiss, verdana">
<?php <?php
define('PATH', '../tmp/oldVersion/'); define('PATH', '../tmp/oldVersion/');
$updateDone = false; $updateDone = false;
@@ -178,8 +178,8 @@ function transposeSettings($oldFile,$newFile,$saveFile) {
// And override with old setting if not blank, not in excluded array and we have a match // And override with old setting if not blank, not in excluded array and we have a match
if ($thisKey != "" && $thisKey != "versionNo" && $thisKey != "codeMirrorDir" && strpos($oldSettingsArray[$j],'"'.$thisKey.'"') > -1) { if ($thisKey != "" && $thisKey != "versionNo" && $thisKey != "codeMirrorDir" && strpos($oldSettingsArray[$j],'"'.$thisKey.'"') > -1) {
$contentLine = $oldSettingsArray[$j].PHP_EOL; $contentLine = $oldSettingsArray[$j].PHP_EOL;
// If the old setting we're copying over isn't replacing the last line and doesn't end in a comma (after an rtrim to remove line endings), add one // If the old setting we're copying over isn't replacing the last line and doesn't end in a comma (after an rtrim to remove line endings), and doesn't contain a comment, add one
if ($i != count($newSettingsArray)-1 && substr(rtrim($contentLine),-1) != ",") { if ($i != count($newSettingsArray)-1 && substr(rtrim($contentLine),-1) != "," && strpos($contentLine,"//") == -1) {
$contentLine = str_replace(PHP_EOL,",".PHP_EOL,$contentLine); $contentLine = str_replace(PHP_EOL,",".PHP_EOL,$contentLine);
} }
} }
@@ -193,10 +193,23 @@ function transposeSettings($oldFile,$newFile,$saveFile) {
} }
function copyOverSettings($icvInfo) { function copyOverSettings($icvInfo) {
global $updateDone; global $updateDone, $configSettings;
// System settings // System settings
echo 'Transposing system settings...<br>'; echo 'Transposing system settings...<br>';
// Create a new config file if it doesn't exist yet.
// The reason we create it, is so it has PHP write permissions, meaning we can update it later
if (!file_exists(dirname(__FILE__)."/".$configSettings)) {
echo 'Creating new settings file...<br>';
// Include our params to make use of (as $newConfigSettingsFile)
include(dirname(__FILE__)."/settings-system-params.php");
if ($fConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) {
fwrite($fConfigSettings, $newConfigSettingsFile);
fclose($fConfigSettings);
} else {
die("Cannot update config file lib/".$configSettings.". Please check write permissions on lib/ and try again");
}
}
transposeSettings(PATH."lib/config___settings.php","config___settings.php","config___settings.php"); transposeSettings(PATH."lib/config___settings.php","config___settings.php","config___settings.php");
// Users template settings // Users template settings
@@ -220,10 +233,10 @@ startUpdate();
if ($updateDone) { if ($updateDone) {
echo 'Updated successfully!<br><br>'; echo 'Updated successfully!<br><br>';
echo 'Restarting ICEcoder...'; echo 'Restarting ICEcoder...';
echo '<script>alert("'.$t['Update appears to...'].'");window.location = "../?display=updated&csrf='.$_SESSION["csrf"].";</script>'; echo '<script>alert("'.$t['Update appears to...'].'");window.location = "../?display=updated&csrf='.$_SESSION["csrf"].'";</script>';
} else { } else {
echo 'Something appears to have gone wrong :-/<br><br>'; echo 'Something appears to have gone wrong :-/<br><br>';
echo 'Please report bugs at <a href="https://github.com/mattpass/ICEcoder" style="color: #fff">https://github.com/mattpass/ICEcoder</a><br><br>'; echo 'Please report bugs at <a href=\"https://github.com/mattpass/ICEcoder\" style=\"color: #fff\">https://github.com/mattpass/ICEcoder</a><br><br>';
echo 'You can recover the old version from ICEcoder\'s tmp dir'; echo 'You can recover the old version from ICEcoder\'s tmp dir';
} }
?> ?>

View File

@@ -46,6 +46,7 @@ top.ICEcoder.switchMode = function(mode) {
: fileExt == "jl" ? "text/x-julia" : fileExt == "jl" ? "text/x-julia"
: fileExt == "c" ? "text/x-csrc" : fileExt == "c" ? "text/x-csrc"
: fileExt == "cpp" ? "text/x-c++src" : fileExt == "cpp" ? "text/x-c++src"
: fileExt == "ino" ? "text/x-c++src"
: fileExt == "cs" ? "text/x-csharp" : fileExt == "cs" ? "text/x-csharp"
: fileExt == "go" ? "text/x-go" : fileExt == "go" ? "text/x-go"
: fileExt == "lua" ? "text/x-lua" : fileExt == "lua" ? "text/x-lua"
@@ -158,7 +159,7 @@ top.ICEcoder.updateNestingIndicator = function() {
fileExt = fileName.split("."); fileExt = fileName.split(".");
fileExt = fileExt[fileExt.length-1]; fileExt = fileExt[fileExt.length-1];
} }
if (thisCM && fileName && ["js","coffee","css","less","sql","erl","yaml","java","jl","c","cpp","cs","go","lua","pl","rs","scss"].indexOf(fileExt)==-1) { if (thisCM && fileName && ["js","coffee","css","less","sql","erl","yaml","java","jl","c","cpp","ino","cs","go","lua","pl","rs","scss"].indexOf(fileExt)==-1) {
testToken = thisCM.getTokenAt({line:thisCM.lineCount(),ch:thisCM.lineInfo(thisCM.lineCount()-1).text.length}); testToken = thisCM.getTokenAt({line:thisCM.lineCount(),ch:thisCM.lineInfo(thisCM.lineCount()-1).text.length});
nestOK = testToken.type && testToken.type.indexOf("error") == -1 ? true : false; nestOK = testToken.type && testToken.type.indexOf("error") == -1 ? true : false;
} }
@@ -203,6 +204,7 @@ top.ICEcoder.caretLocationType = function() {
: fileExt == "jl" ? "Julia" : fileExt == "jl" ? "Julia"
: fileExt == "c" ? "C" : fileExt == "c" ? "C"
: fileExt == "cpp" ? "C++" : fileExt == "cpp" ? "C++"
: fileExt == "ino" ? "C++"
: fileExt == "cs" ? "C#" : fileExt == "cs" ? "C#"
: fileExt == "go" ? "Go" : fileExt == "go" ? "Go"
: fileExt == "lua" ? "Lua" : fileExt == "lua" ? "Lua"

View File

@@ -1,6 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html>
<head> <head>
<title>ICEcoder requirements tests</title> <title>ICEcoder requirements tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=0.5, user-scalable=yes">
<link rel="icon" type="image/png" href="favicon.png">
</head> </head>
<body style="font-family: Arial"> <body style="font-family: Arial">