Compare commits

...

81 Commits
v5.4 ... v5.6

Author SHA1 Message Date
Matt Pass
3bfbc918f0 Version 5.6 2016-07-29 09:34:21 +01:00
Matt Pass
2c7a338dfb Merge pull request #645 from JpaKaagman/master
Updated the dutch language file
2016-07-24 20:46:48 +01:00
Matt Pass
db518cf2c6 ftpManager is a taller modal now 2016-07-22 10:41:29 +01:00
Matt Pass
8e790bec60 Clear any FTP session selection we may have 2016-07-22 10:40:04 +01:00
Matt Pass
f3edf9e2ae No longer hardcoded and now selection driven 2016-07-22 10:38:08 +01:00
Matt Pass
95a3d09672 ftpManager() now a working option 2016-07-22 10:34:47 +01:00
Matt Pass
1a654ec172 English language pieces added for FTP 2016-07-22 10:34:23 +01:00
Matt Pass
78117d52d0 repPosEnd is now ftpSites as it's next array item 2016-07-22 10:33:57 +01:00
Matt Pass
157d9a40fa New FTP sites manager modal added 2016-07-22 10:33:11 +01:00
Matt Pass
b5e78fb04c ftpSites now part of config settings 2016-07-22 10:32:48 +01:00
Julian Kaagman
a2dea59b24 Update dutch language file 2016-07-17 11:24:10 +02:00
Julian Kaagman
cc300f7edd Merge remote-tracking branch 'mattpass/master' 2016-07-17 09:56:38 +02:00
Matt Pass
1f0acdfe5f go-localhost-root.php added, resets and refreshes 2016-07-11 09:42:39 +01:00
Matt Pass
76c03cffff Remove dev logging, goLocalhostRoot and ftpManager added 2016-07-11 09:40:03 +01:00
Matt Pass
ae1188f81d Selecting localhosts goes there, rejig/hide others 2016-07-11 09:39:03 +01:00
Matt Pass
313002e4a0 Need to globalise text and set the array chunk 2016-07-11 08:46:15 +01:00
Matt Pass
63364001ea Update logout counter if available 2016-07-11 08:37:17 +01:00
Matt Pass
1af9d60dd3 60 now in own span 2016-07-11 08:35:01 +01:00
Matt Pass
76fce1c2b8 Split lang pieces up so 60 is updateable 2016-07-11 08:34:41 +01:00
Matt Pass
67e28106f9 Use premade var rather than spec in another way 2016-05-05 16:01:53 +01:00
Matt Pass
191990ffdb Change param and remove all other BOMs 2016-05-05 15:55:55 +01:00
Matt Pass
af318dd703 Don't set $origContent 2016-05-05 15:55:05 +01:00
Matt Pass
f83929584f Revert "No need to set $origContent"
This reverts commit c967325b7d.
2016-05-05 15:54:17 +01:00
Matt Pass
c967325b7d No need to set $origContent 2016-05-05 15:53:29 +01:00
Matt Pass
11fe0ad17a Update to match main JS file 2016-05-05 15:37:06 +01:00
Matt Pass
8da4352ee4 Don't send char count size anymore 2016-05-05 15:36:22 +01:00
Matt Pass
8a1fec4e18 Tweak to comment 2016-05-05 15:35:53 +01:00
Matt Pass
d686faf8a7 Replace only first BOM, include ending if needed 2016-05-05 15:35:43 +01:00
Matt Pass
e8ef9e5195 Don't log info anymore 2016-05-05 15:32:04 +01:00
Matt Pass
6735caae36 UTF8 BOM should be replaced with a PHP_EOL 2016-04-26 09:15:55 +01:00
Matt Pass
eabae9bed4 Supress saving error log info and showing message
Temp measure till we know UTF8 BOM issue is fixed
2016-04-26 09:15:38 +01:00
Matt Pass
5d23115c95 +1 not +2 2016-04-25 09:50:25 +01:00
Matt Pass
55692d3c49 Error handling improvements
Replace \r in content, only do extra JS if could FTP write OK
Get original content and check charCount and if finding different sizes,
log into to file
2016-04-25 09:50:09 +01:00
Matt Pass
3391b60836 Pass charCount along with save request as a check 2016-04-25 09:48:02 +01:00
Matt Pass
2727bcb3e8 Replace * when analysing bannedFiles list 2016-04-24 11:14:18 +01:00
Matt Pass
f6d19d2650 Don't move backups dir when updating 2016-04-24 10:56:22 +01:00
Matt Pass
22bca280f5 5 x new settings added, lineNumbers updates preview 2016-04-23 15:19:03 +01:00
Matt Pass
20614885de Pass in and update 5 x vars & CM options 2016-04-23 15:17:03 +01:00
Matt Pass
6831cea155 5 x new settings available to JS 2016-04-23 15:15:25 +01:00
Matt Pass
9a4e93fc43 5 new settings added, updating in config file & JS 2016-04-23 15:15:10 +01:00
Matt Pass
d44bc40c85 5 x new settings added 2016-04-23 15:14:19 +01:00
Matt Pass
f8c1fbfbec lineNumbers controlled from JS var 2016-04-23 15:13:55 +01:00
Matt Pass
94fe55cc14 5 x setting text pieces added 2016-04-23 15:13:26 +01:00
Matt Pass
e2f63a1d3b 5 x settings controlled from JS vars 2016-04-23 15:13:07 +01:00
Matt Pass
f8565d87b7 Version 5.5 2016-04-21 09:38:10 +01:00
Matt Pass
5a9cd5e85c Change true to false if checkbox is set 2016-04-14 09:28:05 +01:00
Matt Pass
09d34da6c3 disable further reg checkbox added & style tweaks 2016-04-14 09:26:17 +01:00
Matt Pass
d31db1de4e disable further registrations text piece added 2016-04-14 09:23:52 +01:00
Matt Pass
f388545412 Check if file/dir requested is on banned list first 2016-04-14 08:28:47 +01:00
Matt Pass
f5705393ee Check if requested file is on banned list first 2016-04-14 08:25:42 +01:00
Matt Pass
1e7b735b7f Add note re comma delimited 2016-04-14 08:24:31 +01:00
Matt Pass
6c12f36805 Italian language needs some apos unescaping 2016-04-13 22:17:19 +01:00
Matt Pass
838612932c Create duplicate IP based config file also 2016-04-08 10:22:10 +01:00
Matt Pass
b9f08b160b Margin to left & slightly slimmer, plus help cursor 2016-04-06 23:06:44 +01:00
Matt Pass
fcf72f0d12 Missed the dot 2016-04-06 22:56:09 +01:00
Matt Pass
d1a2f6ab8f activeline-background added back in 2016-04-06 22:54:03 +01:00
Matt Pass
38693781a0 Change of background and matchingbracket, drop activeline-background 2016-04-06 22:50:51 +01:00
Matt Pass
1fdb6c0086 Redo style for matchingbracket 2016-04-06 22:49:57 +01:00
Matt Pass
1fce9834db matchBrackets now included and enabled 2016-04-06 22:49:32 +01:00
Matt Pass
095d626883 Auto logout and interaction timers
openSecs to store a total number of secs ICEcoder has been open for, a 1
sec interval to check for auto-logout and session ping events. Function
added to show warning 60 secs before a logout, useNewSettings function
updates auto-logout period on settings change. Also function added to
reset the auto logout timer if it's showing. logout function now accepts
a type and maybe passes that through plus interceptKeys will reset timer
also
2016-04-06 21:48:40 +01:00
Matt Pass
4b12f4f365 Reset timer added to mouse events 2016-04-06 21:36:11 +01:00
Matt Pass
5d3ffae30c Mouse events added to reset and pingActive iframe 2016-04-06 21:34:09 +01:00
Matt Pass
9b6a701ffc reset timer on mouse events & auto-logout added 2016-04-06 21:31:13 +01:00
Matt Pass
d909d5ce1c Add file to keep session alive 2016-04-06 21:23:37 +01:00
Matt Pass
3d866fa2f2 Auto logout warning content added 2016-04-05 19:27:47 +01:00
Matt Pass
6ed0861f5b autoLogoutMins param added with 0 as default
0 being disabled setting
2016-04-05 19:25:43 +01:00
Matt Pass
4154b2bf3b Text pieces added re auto-logout 2016-04-05 19:08:27 +01:00
Matt Pass
59a18645c6 autoLogoutMins now updated in file 2016-04-05 17:13:38 +01:00
Matt Pass
aa92f86aa9 Setting added for auto-logout mins 2016-04-05 17:13:08 +01:00
Matt Pass
444e7ef6b4 Dropped support for Rust
CodeMirror doesn't seem to work with this mode after minification and so
has been dropped.
2016-04-02 14:23:41 +01:00
Matt Pass
d9393bf059 Only set mode if it's different to what is set
Avoids recoloring code
2016-04-02 13:18:29 +01:00
Matt Pass
904dee8f80 Check & clear server queue & return if we have this
If we have the exact same item URL, there is a save jamming situation,
so clear the server message and item from the queue then return
2016-04-02 12:55:19 +01:00
Matt Pass
cca5836698 No longer LZ compressing data before sending 2016-04-02 11:48:00 +01:00
Matt Pass
a406abd610 No longer using PHP LZ Compressor
Was too problematic one some characters so dropping use of this idea.
Too little benefit and many issues arising.
2016-04-02 11:46:15 +01:00
Matt Pass
5cde633847 Not using JS LZ Compressor anymore 2016-04-02 11:42:58 +01:00
Matt Pass
de5460b43f Removed PHP and JS versions of LZ Compressor
Becoming too problematic to use and for such little benefit so dropping
2016-04-02 11:42:36 +01:00
Matt Pass
a66661b194 Old style syntax re arrays also 2016-03-29 21:35:12 +01:00
Matt Pass
587132d81b LZCompress now including UTF16 2016-03-28 22:26:40 +01:00
JpaKaagman
ed7bde9d14 Merge remote-tracking branch 'mattpass/master' 2016-03-19 10:29:36 +01:00
JpaKaagman
a10eb21d70 Merge remote-tracking branch 'mattpass/master' 2016-03-15 06:22:58 +01:00
JpaKaagman
df78d5bb61 Merge remote-tracking branch 'mattpass/master' 2016-02-11 20:43:15 +01:00
43 changed files with 926 additions and 839 deletions

View File

@@ -1,6 +1,6 @@
/* The lint marker gutter */
.CodeMirror-lint-markers {
width: 16px;
width: 12px; margin-left: 2px;
}
.CodeMirror-lint-tooltip {
@@ -43,7 +43,7 @@
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
background-position: center center;
background-repeat: no-repeat;
cursor: pointer;
cursor: help;
display: inline-block;
height: 16px;
width: 16px;

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
ICEcoder default theme by Matt Pass, used in code editor available at https://icecoder.net
*/
.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-atom { color: #e1c76e; } /* yellow */
@@ -37,7 +37,7 @@ ICEcoder default theme by Matt Pass, used in code editor available at https://ic
.cm-s-icecoder .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-icecoder div.CodeMirror-selected { color: #fff; background: #037; }
.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-matchingbracket { border: 1px solid grey; color: black !important; }
.cm-s-icecoder .CodeMirror-matchingbracket { color: #fff !important; background: #555 !important; }
.cm-s-icecoder .CodeMirror-activeline-background { background: #000; }

View File

@@ -1,91 +0,0 @@
<?php
namespace LZCompressor;
class LZContext
{
/**
* @var array
*/
public $dictionary = [];
/**
* @var array
*/
public $dictionaryToCreate = [];
/**
* @var string
*/
public $c = '';
/**
* @var string
*/
public $wc = '';
/**
* @var string
*/
public $w = '';
/**
* @var int
*/
public $enlargeIn = 2;
/**
* @var int
*/
public $dictSize = 3;
/**
* @var int
*/
public $numBits = 2;
/**
* @var LZData
*/
public $data;
function __construct()
{
$this->data = new LZData;
}
// Helper
/**
* @param string $val
* @return bool
*/
public function dictionaryContains($val) {
return array_key_exists($val, $this->dictionary);
}
/**
* @param $val
*/
public function addToDictionary($val) {
$this->dictionary[$val] = $this->dictSize++;
}
/**
* @param string $val
* @return bool
*/
public function dictionaryToCreateContains($val) {
return array_key_exists($val, $this->dictionaryToCreate);
}
/**
* decrements enlargeIn and extends numbits in case enlargeIn drops to 0
*/
public function enlargeIn() {
$this->enlargeIn--;
if($this->enlargeIn==0) {
$this->enlargeIn = pow(2, $this->numBits);
$this->numBits++;
}
}
}

View File

@@ -1,29 +0,0 @@
<?php
namespace LZCompressor;
class LZData
{
/**
* @var
*/
public $str = '';
/**
* @var
*/
public $val;
/**
* @var int
*/
public $position = 0;
/**
* @var int
*/
public $index = 1;
public function append($str) {
$this->str .= $str;
}
}

View File

@@ -1,33 +0,0 @@
<?php
/**
* Created by PhpStorm.
* User: sics
* Date: 28.02.2016
* Time: 12:53
*/
namespace LZCompressor;
class LZReverseDictionary
{
public $entries = [0, 1 ,2];
public function size() {
return count($this->entries);
}
public function hasEntry($index) {
return array_key_exists($index, $this->entries);
}
public function getEntry($index) {
return $this->entries[$index];
}
public function addEntry($char) {
$this->entries[] = $char;
}
}

View File

@@ -1,286 +0,0 @@
<?php
namespace LZCompressor;
class LZString
{
public static function compressToBase64($input)
{
$res = self::_compress($input, 6, function($a) {
return LZUtil::$keyStrBase64{$a};
});
switch (strlen($res) % 4) { // To produce valid Base64
default: // When could this happen ?
case 0 : return $res;
case 1 : return $res ."===";
case 2 : return $res ."==";
case 3 : return $res ."=";
}
}
public static function decompressFromBase64($input)
{
return self::_decompress($input, 32, function($feed, $index) {
return LZUtil::getBaseValue(LZUtil::$keyStrBase64, LZUtil::utf8_charAt($feed, $index));
});
}
/**
* @param string $uncompressed
* @return string
*/
public static function compress($uncompressed)
{
return self::_compress($uncompressed, 16, function($a) {
return LZUtil::fromCharCode($a);
});
}
/**
* @param string $compressed
* @return string
*/
public static function decompress($compressed)
{
return self::_decompress($compressed, 32768, function($feed, $index) {
return LZUtil::charCodeAt($feed, $index);
});
}
/**
* @param string $uncompressed
* @param integer $bitsPerChar
* @param callable $getCharFromInt
* @return string
*/
private static function _compress($uncompressed, $bitsPerChar, $getCharFromInt) {
if(!is_string($uncompressed) || strlen($uncompressed) === 0) {
return '';
}
$context = new LZContext();
$length = LZUtil::utf8_strlen($uncompressed);
for($ii=0; $ii<$length; $ii++) {
$context->c = LZUtil::utf8_charAt($uncompressed, $ii);
if(!$context->dictionaryContains($context->c)) {
$context->addToDictionary($context->c);
$context->dictionaryToCreate[$context->c] = true;
}
$context->wc = $context->w . $context->c;
if($context->dictionaryContains($context->wc)) {
$context->w = $context->wc;
} else {
self::produceW($context, $bitsPerChar, $getCharFromInt);
}
}
if($context->w !== '') {
self::produceW($context, $bitsPerChar, $getCharFromInt);
}
$value = 2;
for($i=0; $i<$context->numBits; $i++) {
self::writeBit($value&1, $context->data, $bitsPerChar, $getCharFromInt);
$value = $value >> 1;
}
while (true) {
$context->data->val = $context->data->val << 1;
if ($context->data->position == ($bitsPerChar-1)) {
$context->data->append($getCharFromInt($context->data->val));
break;
}
$context->data->position++;
}
return $context->data->str;
}
/**
* @param LZContext $context
* @param integer $bitsPerChar
* @param callable $getCharFromInt
*
* @return LZContext
*/
private static function produceW(LZContext $context, $bitsPerChar, $getCharFromInt)
{
if($context->dictionaryToCreateContains($context->w)) {
if(LZUtil::charCodeAt($context->w)<256) {
for ($i=0; $i<$context->numBits; $i++) {
self::writeBit(null, $context->data, $bitsPerChar, $getCharFromInt);
}
$value = LZUtil::charCodeAt($context->w);
for ($i=0; $i<8; $i++) {
self::writeBit($value&1, $context->data, $bitsPerChar, $getCharFromInt);
$value = $value >> 1;
}
} else {
$value = 1;
for ($i=0; $i<$context->numBits; $i++) {
self::writeBit($value, $context->data, $bitsPerChar, $getCharFromInt);
$value = 0;
}
$value = LZUtil::charCodeAt($context->w);
for ($i=0; $i<16; $i++) {
self::writeBit($value&1, $context->data, $bitsPerChar, $getCharFromInt);
$value = $value >> 1;
}
}
$context->enlargeIn();
unset($context->dictionaryToCreate[$context->w]);
} else {
$value = $context->dictionary[$context->w];
for ($i=0; $i<$context->numBits; $i++) {
self::writeBit($value&1, $context->data, $bitsPerChar, $getCharFromInt);
$value = $value >> 1;
}
}
$context->enlargeIn();
$context->addToDictionary($context->wc);
$context->w = $context->c.'';
}
/**
* @param string $value
* @param LZData $data
* @param integer $bitsPerChar
* @param callable $getCharFromInt
*/
private static function writeBit($value, LZData $data, $bitsPerChar, $getCharFromInt)
{
if(null !== $value) {
$data->val = ($data->val << 1) | $value;
} else {
$data->val = ($data->val << 1);
}
if ($data->position == ($bitsPerChar-1)) {
$data->position = 0;
$data->append($getCharFromInt($data->val));
$data->val = 0;
} else {
$data->position++;
}
}
/**
* @param LZData $data
* @param integer $resetValue
* @param callable $getNextValue
* @param integer $exponent
* @param string $feed
* @return integer
*/
private static function readBits(LZData $data, $resetValue, $getNextValue, $feed, $exponent)
{
$bits = 0;
$maxPower = pow(2, $exponent);
$power=1;
while($power != $maxPower) {
$resb = $data->val & $data->position;
$data->position >>= 1;
if ($data->position == 0) {
$data->position = $resetValue;
$data->val = $getNextValue($feed, $data->index++);
}
$bits |= (($resb>0 ? 1 : 0) * $power);
$power <<= 1;
}
return $bits;
}
/**
* @param string $compressed
* @param integer $resetValue
* @param callable $getNextValue
* @return string
*/
private static function _decompress($compressed, $resetValue, $getNextValue)
{
if(!is_string($compressed) || strlen($compressed) === 0) {
return '';
}
$length = LZUtil::utf8_strlen($compressed);
$entry = null;
$enlargeIn = 4;
$numBits = 3;
$result = '';
$dictionary = new LZReverseDictionary();
$data = new LZData();
$data->str = $compressed;
$data->val = $getNextValue($compressed, 0);
$data->position = $resetValue;
$data->index = 1;
$next = self::readBits($data, $resetValue, $getNextValue, $compressed, 2);
if($next < 0 || $next > 1) {
return '';
}
$exponent = ($next == 0) ? 8 : 16;
$bits = self::readBits($data, $resetValue, $getNextValue, $compressed, $exponent);
$c = LZUtil::fromCharCode($bits);
$dictionary->addEntry($c);
$w = $c;
$result .= $c;
while(true) {
if($data->index > $length) {
return '';
}
$bits = self::readBits($data, $resetValue, $getNextValue, $compressed, $numBits);
$c = $bits;
switch($c) {
case 0:
$bits = self::readBits($data, $resetValue, $getNextValue, $compressed, 8);
$c = $dictionary->size();
$dictionary->addEntry(LZUtil::fromCharCode($bits));
$enlargeIn--;
break;
case 1:
$bits = self::readBits($data, $resetValue, $getNextValue, $compressed, 16);
$c = $dictionary->size();
$dictionary->addEntry(LZUtil::fromCharCode($bits));
$enlargeIn--;
break;
case 2:
return $result;
break;
}
if($enlargeIn == 0) {
$enlargeIn = pow(2, $numBits);
$numBits++;
}
if($dictionary->hasEntry($c)) {
$entry = $dictionary->getEntry($c);
}
else {
if ($c == $dictionary->size()) {
$entry = $w . $w{0};
} else {
return null;
}
}
$result .= $entry;
$dictionary->addEntry($w . $entry{0});
$w = $entry;
$enlargeIn--;
if($enlargeIn == 0) {
$enlargeIn = pow(2, $numBits);
$numBits++;
}
}
}
}

View File

@@ -1,112 +0,0 @@
<?php
/**
* Created by PhpStorm.
* User: sics
* Date: 27.02.2016
* Time: 15:54
*/
namespace LZCompressor;
class LZUtil
{
/**
* @var string
*/
public static $keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
public static $keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
private static $baseReverseDic = [];
/**
* @param string $alphabet
* @param integer $character
* @return string
*/
public static function getBaseValue($alphabet, $character)
{
if(!array_key_exists($alphabet, self::$baseReverseDic)) {
self::$baseReverseDic[$alphabet] = [];
for($i=0; $i<strlen($alphabet); $i++) {
self::$baseReverseDic[$alphabet][$alphabet{$i}] = $i;
}
}
return self::$baseReverseDic[$alphabet][$character];
}
/**
* @return string
*/
public static function fromCharCode()
{
return array_reduce(func_get_args(), function ($a, $b) {
$a .= self::utf8_chr($b);
return $a;
});
}
/**
* Phps chr() equivalent for UTF-8 encoding
*
* @param int|string $u
* @return string
*/
public static function utf8_chr($u)
{
return mb_convert_encoding('&#' . intval($u) . ';', 'UTF-8', 'HTML-ENTITIES');
}
/**
* @param string $str
* @param int $num
*
* @return bool|integer
*/
public static function charCodeAt($str, $num=0)
{
return self::utf8_ord(self::utf8_charAt($str, $num));
}
/**
* @param string $ch
*
* @return bool|integer
*/
public static function utf8_ord($ch)
{
// must remain php's strlen
$len = strlen($ch);
if ($len <= 0) {
return -1;
}
$h = ord($ch{0});
if ($h <= 0x7F) return $h;
if ($h < 0xC2) return -3;
if ($h <= 0xDF && $len > 1) return ($h & 0x1F) << 6 | (ord($ch{1}) & 0x3F);
if ($h <= 0xEF && $len > 2) return ($h & 0x0F) << 12 | (ord($ch{1}) & 0x3F) << 6 | (ord($ch{2}) & 0x3F);
if ($h <= 0xF4 && $len > 3)
return ($h & 0x0F) << 18 | (ord($ch{1}) & 0x3F) << 12 | (ord($ch{2}) & 0x3F) << 6 | (ord($ch{3}) & 0x3F);
return -2;
}
/**
* @param string $str
* @param integer $num
*
* @return string
*/
public static function utf8_charAt($str, $num)
{
return mb_substr($str, $num, 1, 'UTF-8');
}
/**
* @param string $str
* @return integer
*/
public static function utf8_strlen($str) {
return mb_strlen($str, 'UTF-8');
}
}

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.
<img src="https://icecoder.net/images/icecoder-v5-4-browser-code-editor.png" alt="ICEcoder web IDE">
<img src="https://icecoder.net/images/icecoder-v5-6-browser-code-editor.png" alt="ICEcoder web IDE">
###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).

View File

@@ -5,7 +5,7 @@ $t = $text['editor'];
?>
<!DOCTYPE html>
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.mouseDownInCM=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}" onDrop="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor')}">
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true; top.ICEcoder.resetAutoLogoutTimer()" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.mouseDownInCM=false; top.ICEcoder.resetAutoLogoutTimer(); if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor'); top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.canResizeFilesW()}" onDrop="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor')}">
<head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@@ -16,8 +16,8 @@ $t = $text['editor'];
<!--
codemirror-compressed.js
incls: codemirror
modes: clike, coffeescript, css, erlang, go, htmlmixed, javascript, julia, lua, markdown, perl, php, python, ruby, rust, sass, sql, xml, yaml
addon: brace-fold, closebrackets, closetag, css-hint, html-hint, javascript-hint, javascript-lint, lint, match-highlighter, searchcursor, show-hint, sql-hint, trailingspace, xml-fold, xml-hint
modes: clike, coffeescript, css, erlang, go, htmlmixed, javascript, julia, lua, markdown, perl, php, python, ruby, sass, sql, xml, yaml
addon: brace-fold, closebrackets, closetag, css-hint, html-hint, javascript-hint, javascript-lint, lint, match-highlighter, matchbrackets, searchcursor, show-hint, sql-hint, trailingspace, xml-fold, xml-hint
//-->
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js?microtime=<?php echo microtime(true);?>"></script>
<?php
@@ -228,7 +228,7 @@ function createNewCMInstance(num) {
// Define our CodeMirror options
var cMOptions = {
mode: "application/x-httpd-php",
lineNumbers: true,
lineNumbers: top.ICEcoder.lineNumbers,
gutters: ["CodeMirror-foldgutter","CodeMirror-lint-markers","CodeMirror-linenumbers"],
foldGutter: {gutter: "CodeMirror-foldgutter"},
foldOptions: {minFoldSize: 1},
@@ -236,11 +236,12 @@ function createNewCMInstance(num) {
indentWithTabs: top.ICEcoder.indentWithTabs,
indentUnit: top.ICEcoder.indentSize,
tabSize: top.ICEcoder.indentSize,
matchBrackets: top.ICEcoder.matchBrackets,
electricChars: false,
autoCloseTags: true,
autoCloseBrackets: true,
autoCloseTags: top.ICEcoder.autoCloseTags,
autoCloseBrackets: top.ICEcoder.autoCloseBrackets,
highlightSelectionMatches: true,
showTrailingSpace: true,
showTrailingSpace: top.ICEcoder.showTrailingSpace,
lint: false,
keyMap: "ICEcoder"
};

View File

@@ -8,7 +8,7 @@ $isGitHubRepoDir = in_array($ICEcoder["root"],$ICEcoder['githubLocalPaths']);
?>
<!DOCTYPE html>
<html onMouseDown="top.ICEcoder.mouseDown=true; top.ICEcoder.boxSelect(event,'down')" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.mouseDownInCM=false; top.ICEcoder.boxSelect(event,'up'); if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW(); top.ICEcoder.boxSelect(event,'drag')}" onDrop="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files')}" onContextMenu="top.ICEcoder.selectFileFolder(event); return top.ICEcoder.showMenu(event)" onClick="if (!top.ICEcoder.fmDraggedBox) {top.ICEcoder.selectFileFolder(event)} else {top.ICEcoder.fmDraggedBox = false}" onDragStart="top.ICEcoder.selectFileFolder(event);" onDragOver="event.preventDefault();event.stopPropagation()">
<html onMouseDown="top.ICEcoder.mouseDown=true; top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.boxSelect(event,'down')" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.mouseDownInCM=false; top.ICEcoder.boxSelect(event,'up'); if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files'); top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.canResizeFilesW(); top.ICEcoder.boxSelect(event,'drag')}" onDrop="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files')}" onContextMenu="top.ICEcoder.selectFileFolder(event); return top.ICEcoder.showMenu(event)" onClick="if (!top.ICEcoder.fmDraggedBox) {top.ICEcoder.selectFileFolder(event)} else {top.ICEcoder.fmDraggedBox = false}" onDragStart="top.ICEcoder.selectFileFolder(event);" onDragOver="event.preventDefault();event.stopPropagation()">
<head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
<meta name="robots" content="noindex, nofollow">
@@ -56,6 +56,8 @@ $permColors = $thisPermVal == 777 ? 'background: #800; color: #eee' : 'color: #8
<iframe name="processControl" style="display: none"></iframe>
<iframe name="pingActive" style="display: none"></iframe>
<div class="fmDragBox" id="fmDragBox"></div>
</body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -37,7 +37,7 @@ if ($ICEcoder["checkUpdates"]) {
$isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;
?>
<!DOCTYPE html>
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.mouseDownInCM=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() && !top.ICEcoder.getcMInstance().hasFocus() && !top.ICEcoder.getcMdiffInstance().hasFocus()) {event.wheelDelta > 0 ? top.ICEcoder.nextTab() : top.ICEcoder.previousTab();}">
<html onMouseDown="top.ICEcoder.mouseDown=true; top.ICEcoder.resetAutoLogoutTimer();" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.mouseDownInCM=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top'); top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.canResizeFilesW()}" onMouseWheel="top.ICEcoder.resetAutoLogoutTimer(); if (top.ICEcoder.getcMInstance() && !top.ICEcoder.getcMInstance().hasFocus() && !top.ICEcoder.getcMdiffInstance().hasFocus()) {event.wheelDelta > 0 ? top.ICEcoder.nextTab() : top.ICEcoder.previousTab();}">
<head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
<!--Updated via settings so must remain 1st stylesheet//-->
@@ -53,12 +53,14 @@ $isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;
iceRoot = "<?php echo $ICEcoder['root']; ?>";
window.onbeforeunload = function() {
for(var i=1;i<=ICEcoder.savedPoints.length;i++) {
if (ICEcoder.savedPoints[i-1]!=top.ICEcoder.getcMInstance(i).changeGeneration()) {
return "<?php echo $t['You have some...'];?>.";
if(top.ICEcoder.autoLogoutTimer < top.ICEcoder.autoLogoutMins*60) {
for(var i=1;i<=ICEcoder.savedPoints.length;i++) {
if (ICEcoder.savedPoints[i-1]!=top.ICEcoder.getcMInstance(i).changeGeneration()) {
return "<?php echo $t['You have some...'];?>.";
}
}
return "<?php echo $t['Are you sure...'];?>";
}
return "<?php echo $t['Are you sure...'];?>";
}
t = {
@@ -80,7 +82,6 @@ $t = $text['index'];
<script src="lib/mmd.js?microtime=<?php echo microtime(true);?>"></script>
<script src="farbtastic/farbtastic.js?microtime=<?php echo microtime(true);?>"></script>
<script src="lib/difflib.js?microtime=<?php echo microtime(true);?>"></script>
<script src="lib/lz-string.min.js?microtime=<?php echo microtime(true);?>"></script>
<link rel="stylesheet" href="farbtastic/farbtastic.css?microtime=<?php echo microtime(true);?>" type="text/css">
</head>
@@ -93,6 +94,7 @@ $t = $text['index'];
}
echo "];";
echo "top.ICEcoder.theme = '".($ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"])."';".
"top.ICEcoder.autoLogoutMins = ".$ICEcoder["autoLogoutMins"].";".
"top.ICEcoder.fontSize = '".$ICEcoder["fontSize"]."';".
"top.ICEcoder.openLastFiles = ".($ICEcoder["openLastFiles"] ? 'true' : 'false').";".
"top.ICEcoder.updateDiffOnSave = ".($ICEcoder["updateDiffOnSave"] ? 'true' : 'false').";".
@@ -100,6 +102,11 @@ $t = $text['index'];
"top.ICEcoder.codeAssist = ".($ICEcoder["codeAssist"] ? 'true' : 'false').";".
"top.ICEcoder.lockedNav = ".($ICEcoder["lockedNav"] ? 'true' : 'false').";".
"top.ICEcoder.lineWrapping = ".($ICEcoder["lineWrapping"] ? 'true' : 'false').";".
"top.ICEcoder.lineNumbers = ".($ICEcoder["lineNumbers"] ? 'true' : 'false').";".
"top.ICEcoder.showTrailingSpace = ".($ICEcoder["showTrailingSpace"] ? 'true' : 'false').";".
"top.ICEcoder.matchBrackets = ".($ICEcoder["matchBrackets"] ? 'true' : 'false').";".
"top.ICEcoder.autoCloseTags = ".($ICEcoder["autoCloseTags"] ? 'true' : 'false').";".
"top.ICEcoder.autoCloseBrackets = ".($ICEcoder["autoCloseBrackets"] ? 'true' : 'false').";".
"top.ICEcoder.indentWithTabs = ".($ICEcoder["indentWithTabs"] ? 'true' : 'false').";".
"top.ICEcoder.indentAuto = ".($ICEcoder["indentAuto"] ? 'true' : 'false').";".
"top.ICEcoder.indentSize = ".$ICEcoder["indentSize"].";".
@@ -234,14 +241,16 @@ $t = $text['index'];
</div>
<div id="optionsSource" class="optionsList" onmouseover="top.ICEcoder.showHideFileNav('show',this.id)" onmouseout="top.ICEcoder.showHideFileNav('hide',this.id);top.ICEcoder.canShowFMNav=false">
<ul>
<li><a nohref onclick="ICEcoder.refreshFileManager()">Localhost</a></li>
<li><a nohref onclick="ICEcoder.goLocalhostRoot()">Localhost</a></li>
<li><a nohref onclick="ICEcoder.ftpManager()">FTP</a></li>
<li><a nohref onclick="ICEcoder.githubManager()">GitHub</a></li>
<!--
<li><a nohref onclick="ICEcoder.message('SVN integration coming soon')">SVN</a></li>
<li><a nohref onclick="ICEcoder.message('Bitbucket integration coming soon\n\nCan you help with this? Get involved at icecoder.net')">Bitbucket</a></li>
<li><a nohref onclick="ICEcoder.message('Amazon AWS integration coming soon\n\nCan you help with this? Get involved at icecoder.net')">Amazon AWS</a></li>
<li><a nohref onclick="ICEcoder.message('Dropbox integration coming soon\n\nCan you help with this? Get involved at icecoder.net')">Dropbox</a></li>
<li><a nohref onclick="ICEcoder.message('FTP integration coming soon\n\nCan you help with this? Get involved at icecoder.net')">FTP</a></li>
<li><a nohref onclick="ICEcoder.message('SSH integration coming soon\n\nCan you help with this? Get involved at icecoder.net')">SSH</a></li>
//-->
</ul>
</div>
<div id="optionsHelp" class="optionsList" onmouseover="top.ICEcoder.showHideFileNav('show',this.id)" onmouseout="top.ICEcoder.showHideFileNav('hide',this.id);top.ICEcoder.canShowFMNav=false">

View File

@@ -12,7 +12,6 @@ $text = array(
"editor" =>
array(
"Click icons for..." => "<strong>Klik op de icoontjes<br>voor hulp &amp;<br>gebruiks info</strong>",
"server" => "server",
"Server name, OS..." => "Server naam, besturingssysteem & IP:",
"Root" => "Root:",
@@ -22,6 +21,8 @@ $text = array(
"your device" => "Uw apparaat",
"Browser" => "Browser:",
"Your IP" => "Uw IP:",
"trial remaining" => "Resterende demo tijd",
"days left" => "dagen",
"files" => "bestanden",
"Last 10 files..." => "Laatste 10 geopende bestanden:",
"none" => "[none]",
@@ -30,9 +31,7 @@ $text = array(
"dev mode" => "Ontwikkelaars modus",
"Status" => "Status",
"Using" => "Gebruikt",
"You can switch..." => "U kunt de ontwikkelaars modus aan/uit zetten
in lib/config__settings.php",
"results" => "resultaten"
"You can switch..." => "U kunt de ontwikkelaars modus aan/uit zetten in lib/config__settings.php",
),
@@ -40,6 +39,7 @@ in lib/config__settings.php",
array(
"Lock" => "Vergrendelen",
"Refresh" => "Vernieuwen",
"Plugins" => "Plugins",
"ROOT" => "[ROOT]"
),
@@ -51,9 +51,10 @@ in lib/config__settings.php",
"Your version is" => "Uw versie is",
"Update now" => "Nu updaten",
"You have some..." => "Er zijn wijzigingen die niet opgeslagen zijn",
"Are you sure you want to close?" => "Weet u zeker dat u wilt sluiten ?",
"Are you sure..." => "Weet u zeker dat u wilt sluiten ?",
"working" => "bezig",
"Color picker" => "Kleuren kiezer",
"Plugins Manager" => "Plugin beheer",
"New File" => "Nieuw bestand",
"New Folder" => "Nieuwe map",
"Upload File(s)" => "Upload bestand(en)",
@@ -68,7 +69,7 @@ in lib/config__settings.php",
"Properties" => "Eigenschappen",
"File" => "Bestand",
"Edit" => "Bewerken",
"Remote" => "Extern",
"Source" => "Bron",
"Help" => "Help",
"Save" => "Opslaan",
"Save As" => "Opslaan als",
@@ -92,24 +93,33 @@ in lib/config__settings.php",
"website" => "website",
"Close all tabs" => "Sluit alle tabbladen",
"Alphabetize tabs" => "Sorteer tabbladen",
// "Find" => "Zoek",
// "in" => "in",
// "and" => "en",
// "replace" => "vervangen",
// "replace all" => "alles vervangen",
// "this document" => "dit document",
// "open documents" => "open documenten",
// "all files" => "alle bestanden",
// "all filenames" => "alle bestandsnamen",
"Find" => "Zoek",
"in" => "in",
"and" => "en",
"replace" => "vervangen",
"replace all" => "alles vervangen",
"this document" => "dit document",
"open documents" => "open documenten",
"all files" => "alle bestanden",
"all filenames" => "alle bestandsnamen",
"Turn on/off..." => "Schakel codehulp aan/uit",
"Code Assist" => "Codehulp",
"Go to Line" => "Ga naar regel",
"View" => "Beeld",
"Bug reporting not active" => "Bug rapportage niet actief"
"Bug reporting not active" => "Bug rapportage niet actief",
"Single pane" => "Enkel pane",
"Diff pane also" => "Ook diff pane"
),
// /LIB
"auto-logout-warning" =>
array(
"Auto Logout Warning" => "Auto logout waarschuwing",
"You will be..." => "U wordt uitgelogd na",
"seconds due to..." => "seconden ivm inactiviteit, voor veiligheids doeleinden. Gebruik de muis of druk op een toets om door te gaan.<br><br>U kunt deze functie aanpassen of uitschakelen in Bewerken > Opties."
),
"backup-versions" =>
array(
"backup" => "backup",
@@ -124,33 +134,34 @@ in lib/config__settings.php",
"file-control" =>
array(
"Sorry, bad filename..." => "Sorry, ongeldige bestandsnaam opgegeven. Bekijk de dev tools console voor meer informatie.",
"Sorry, bad filename..." => "Er is een ongeldige bestandsnaam opgegeven. Bekijk de dev tools console voor meer informatie.",
"Sorry" => "Sorry",
"does not seem..." => "bestaat niet op de server",
"Sorry, could not..." => "Sorry, kan geen gegevens ophalen van",
"Sorry, cannot create..." => "Sorry, kan geen map aanmaken op",
"Sorry, cannot copy" => "Sorry, kan niet het volgende niet kopi&euml;ren",
"Sorry, could not..." => "Het is niet mogelijk om de gegevens op te halen van",
"Sorry, cannot create..." => "Er kan geen map worden aangemaakt op",
"Sorry, cannot copy" => "Kan niet worden gekopie&euml;rd",
"into" => "naar",
"Uploaded file(s) OK" => "Ge&uuml;ploade bestand(en)",
"Sorry, cannot upload" => "Sorry, kan niet uploaden",
"Sorry, cannot upload..." => "Sorry, kan niet uploaden in de demo modus",
"Sorry, cannot rename" => "Sorry, kan niet hernoemen",
"Sorry, cannot upload" => "Kan niet uploaden",
"Sorry, cannot upload..." => "Kan niet uploaden in de demo modus",
"Sorry, cannot rename" => "Kan niet hernoemen",
"Maybe public write..." => "Misschien zijn er publieke schrijfrechten nodig voor deze, of de bovenliggende map?",
"Sorry, cannot move" => "Sorry, kan niet worden verplaatst",
"Sorry, cannot save" => "Sorry, kan niet opslaan",
"Sorry, cannot replace..." => "Sorry, Kan geen tekst vervangen in",
"Sorry, cannot change..." => "Sorry, kan de rechten niet wijzigen voor",
"Sorry, cannot delete..." => "Sorry, kan de root level niet verwijderen",
"Sorry, cannot delete" => "Sorry, kan niet verwijderd worden",
"Sorry, this file..." => "Sorry, het bestand is gewijzigd, maar kan niet worden opgeslagen",
"Sorry, cannot move" => "Kan niet worden verplaatst",
"Sorry, cannot save" => "Kan niet opslaan",
"Sorry, cannot replace..." => "Kan geen tekst vervangen in",
"Sorry, cannot change..." => "Kan de rechten niet wijzigen voor",
"Sorry, cannot delete more..." => "U kunt niet meer dan een bestand tegelijkertijd verwijderen in FTP modus",
"Sorry, cannot delete..." => "Kan de root level niet verwijderen",
"Sorry, cannot delete" => "Kan niet verwijderd worden",
"Sorry, this file..." => "Het bestand is gewijzigd, maar kan niet worden opgeslagen",
"Reload this file..." => "Vernieuw dit bestand en kopieer de huidige versie naar een nieuw bestand?",
"There was a..." => "Er was een technisch probleem, mogelijk was er iets niet gereed. ICEcodeer heeft bestandsbeheer opnieuw geladen.",
"displayed at" => "weergegeven op",
"Enter filename to..." => "Voer een bestandsnaam in om het op te slaan op",
"That file exists..." => "Dit bestand bestaat al, overschrijven?",
"Saving" => "Opslaan"
),
),
"get-branch" =>
array(
"There are no..." => "Er zijn geen verschillen aangetroffen tussen de lokale en de Github repo. Wilt u terug schakelen naar de normale modus?",
@@ -167,7 +178,9 @@ in lib/config__settings.php",
"github paths" => "Github paden",
"Choose existing path" => "Kies een bestaand pad",
"Local path" => "Lokaal pad",
"Slash prefixed" => "Slash prefix",
"Remote GitHub path" => "Extern Github pad",
"Absolute URL beginning..." => "Absolute link, beginnend met https://github.com",
"Choose" => "Kies",
"Set local and..." => "Maak het lokale en externe pad leeg, om te verwijderen",
"Update" => "Update",
@@ -218,6 +231,8 @@ in lib/config__settings.php",
"Jump to definition" => "Spring naar definitie / spring terug",
"Comment uncomment" => "Commentaar (ongedaan) maken",
"Insert tab indent" => "Invoegen tab / verspringen geselecteerd",
"Insert more" => "Inspringen verruimen",
"Insert less" => "Inspringen verkleinen",
"Wrap with div" => "Omhullen met &lt;div&gt;",
"Wrap with span" => "Omhullen met &lt;span&gt;",
"Wrap unwrap p" => "Omhullen / onthullen met &lt;p&gt;",
@@ -242,6 +257,7 @@ in lib/config__settings.php",
"Close current tab" => "Sluit huidige tab",
"Open file prompt" => "Open bestands prompt",
"Find" => "Zoek",
"Previous" => "Vorige",
"Focus on Go..." => "Focus op ga naar regel invoer",
"Save" => "Opslaan",
"Save as" => "Opslaan als...",
@@ -254,12 +270,18 @@ in lib/config__settings.php",
"ice-coder" =>
array(
"results" => "resultaten",
"No text selected..." => "Geen tekst geselecteerd om te zoeken",
"all files" => "alle bestanden",
"all filenames" => "alle bestandsnamen",
"selected files" => "geselecteerde bestanden",
"selected filenames" => "geselecteerde bestandsnamaen",
"Creating Folder" => "Aanmaken map",
"Sorry you can..." => "Sorry, je kan maximaal 100 bestanden open hebben staan!",
"Opening File" => "Openen bestand",
"Enter relative file..." => "Geef relatieve bestands pad (voorafgaand door een slash) of een externe URL",
"Getting" => "Ophalen",
"Saving" => "Opslaan:",
"Please enter the..." => "Voer de nieuwe naam in voor",
"Renaming to" => "Hernoemen naar",
"Moving to" => "Verplaatsen naar",
@@ -267,7 +289,13 @@ in lib/config__settings.php",
"Pasting File" => "Bestand plakken",
"Sorry cannot paste..." => "Sorry, kan niet de gehele root plakken",
"Nothing to paste..." => "Er is niets om te plakken, kopieer eerst een bestand of map!",
"and" => "en",
"this document" => "dit bestand",
"replace" => "vervang",
"replace all" => "vervang alle",
"file" => "bestand",
"Replacing text in" => "Wijzig de tekst in",
"Sorry there was..." => "Helaas er is een fout opgetreden met uw aanvraag.\\n\\nKijk in de dev tools console voor meer informatie.",
"Cancelled tasks" => "Geannuleerde taken",
"Open previous files" => "Open voorgaande bestand(en)?",
"Please enter your..." => "Voer alstublieft uw GitHub token (personal access token of client/secret pair token). Zie ook de tooltip bij Github Auth Token binnen Bewerken > Opties voor meer informatie.",
@@ -286,16 +314,17 @@ in lib/config__settings.php",
"login" => "login",
"To disable registration..." => "Om de registratie modus uit te zetten, open het menu opties of open lib/config___settings.php en wijzig enableRegistration naar false",
"Registration mode enabled" => "Registratie modus aan",
"disable further registrations" => "uitschakelen van verdere registraties",
"auto-check for updates" => "automatisch controleren op updates",
"To put into..." => "Om de multi-user modus te gebruiken, open het menu opties of open lib/config___settings.php en verander multiUser naar true",
"multi-user" => "multi-user"
),
),
"multiple-results" =>
array(
"rename all" => "hernoem alles",
"replace all" => "vervang alles",
"document" => "document",
"document" => "bestand",
"Found" => "Gevonden",
"times" => "keer",
"replace" => "vervang",
@@ -368,14 +397,20 @@ in lib/config__settings.php",
"version" => "versie",
"website" => "website",
"git" => "git",
"codemirror dir" => "codemirror dir",
"codemirror dir" => "codemirror map",
"codemirror version" => "codemirror versie",
"file manager root" => "bestandsbeheer root",
"Free to use..." => "Vrij voor eigen gebruik, commercieel of persoonlijk. :)<br><br>Wij zijn niet aansprakelijk en bieden geen garantie, gebruik op eigen risico.<br><br>Een hoop fantastische mensen, en bedrijven hebben meegeholpen aan de ontwikkeling van ICEcoder waarvoor bedankt. Zie wie er allemaal heeft bijgedragen op",
"backups" => "backups",
"keep version control..." => "gebruik versiebeheer backups voor",
"day" => "dag",
"days" => "dagen",
"of backups stored..." => "of backups stored currently",
"Get in contact..." => "Kom in contact via...",
"You may use..." => "Vrij voor eigen gebruik, commercieel of persoonlijk. Laat het ons weten als je toffe aanpassingen maakt :)<br><br>Wij zijn niet aansprakelijk en bieden geen garantie, gebruik op eigen risico.",
"functionality" => "functionaliteit",
"check for updates..." => "check voor updates bij laden",
"auto open last..." => "automatisch openen laatst geopende bestanden na inloggen",
"when finding in..." => "when finding in files, exclude",
"when finding in..." => "Uitgesloten bestand typen",
"assisting" => "assisteren",
"code assist" => "codehulp",
"visible tabs" => "zichtbare tabs",
@@ -389,19 +424,27 @@ in lib/config__settings.php",
"banned files/folders" => "uitgesloten bestanden/mappen",
"banned paths" => "uitgesloten paden",
"ip addresses" => "ip adressen",
"auto-logout after" => "auto-logout na",
"mins of inactivity..." => "minuten in actief, tenzij er niet opgeslagen bestanden geopend zijn",
"Slash prefixed comma..." => "Slash prefixed, komma gescheiden",
"Comma delimited" => "komma gescheiden",
"style" => "style",
"theme" => "thema",
"line wrapping" => "regel omslag",
"line numbers" => "regel nummers",
"indent type" => "inspring type",
"indent size" => "inspring size",
"match brackets" => "match brackets",
"show trailing space" => "show trailing space",
"font size" => "lettergrootte",
"auto indent" => "auto indent",
"auto indent" => "automatisch inspringen",
"auto close tags" => "automatisch tags sluiten",
"auto close brackets" => "automatsich brackets sluiten",
"layout" => "lay-out",
"plugin panel aligned" => "plug-in paneel positie",
"file manager" => "bestandsbeheer",
"root" => "root",
"Set 0 to..." => "Set 0 to disable",
"Slash prefixed" => "Slash prefixed",
"bug reporting" => "bug rapportage",
"check in files" => "check in bestanden",
@@ -440,10 +483,10 @@ in lib/config__settings.php",
"Type of text" => "Type tekst",
"Fixed text" => "Fixed tekst",
"Regular expression" => "Reguliere expressie",
"Case sensitive" => "Case sensitive",
"Case sensitive" => "Hoofdletter gevoelig",
"Yes" => "Ja",
"No" => "Nee",
"Search" => "Zoek",
)
);
?>
?>

View File

@@ -112,6 +112,13 @@ $text = array(
// /LIB
"auto-logout-warning" =>
array(
"Auto Logout Warning" => "Auto logout warning",
"You will be..." => "You will be logged out after",
"seconds due to..." => "seconds due to inactivity, for security purposes. Use the mouse or hit a key to continue.<br><br>You can adjust or disable this from the Edit > Settings section."
),
"backup-versions" =>
array(
"backup" => "backup",
@@ -154,6 +161,37 @@ $text = array(
"Saving" => "Saving"
),
"ftp-manager" =>
array(
"Saving FTP sites" => "Saving FTP sites",
"Cannot update config..." => "Cannot update config file. Please set public write permissions on",
"and try again" => "and try again",
"ftp manager" => "ftp manager",
"Choose existing site" => "Choose existing site",
"Are you sure..." => "Are you sure you wish to remove this site?",
"Add new site" => "Add new site",
"Edit site" => "Edit site",
"Site name" => "Site name",
"Host" => "Host",
"Username" => "Username",
"Password" => "Password",
"PASV and mode" => "PASV and mode",
"Root" => "Root",
"eg My Site" => "eg My Site",
"eg ftp.yourdomain.com" => "eg ftp.yourdomain.com",
"eg user123" => "eg user123",
"eg pass123" => "eg pass123",
"Use PASV mode..." => "Use PASV mode if your FTP site requires it and choose the data transfer type - ASCII or binary",
"eg /htdocs" => "eg /htdocs",
"PASV connection off" => "PASV connection off",
"PASV connection on" => "PASV connection on",
"ASCII transfer" => "ASCII transfer",
"Binary transfer" => "Binary transfer",
"Add" => "Add",
"Choose" => "Choose",
"Update" => "Update"
),
"get-branch" =>
array(
"There are no..." => "There are no differences between the local and GitHub repo. Switch back to regular mode?",
@@ -306,6 +344,7 @@ $text = array(
"login" => "login",
"To disable registration..." => "To disable registration mode, open the settings menu or open lib/config___settings.php and change enableRegistration to false then reload this page",
"Registration mode enabled" => "Registration mode enabled",
"disable further registrations" => "disable further registrations",
"auto-check for updates" => "auto-check for updates",
"To put into..." => "To put into multi-user mode, open the settings menu or open lib/config___settings.php and change multiUser to true then reload this page",
"multi-user" => "multi-user"
@@ -415,19 +454,27 @@ $text = array(
"banned files/folders" => "banned files/folders",
"banned paths" => "banned paths",
"ip addresses" => "ip addresses",
"auto-logout after" => "auto-logout after",
"mins of inactivity..." => "mins of inactivity if no unsaved files",
"Slash prefixed comma..." => "Slash prefixed, comma delimited",
"Comma delimited" => "Comma delimited",
"style" => "style",
"theme" => "theme",
"line wrapping" => "line wrapping",
"line numbers" => "line numbers",
"indent type" => "indent type",
"indent size" => "indent size",
"match brackets" => "match brackets",
"show trailing space" => "show trailing space",
"font size" => "font size",
"auto indent" => "auto indent",
"auto close tags" => "auto close tags",
"auto close brackets" => "auto close brackets",
"layout" => "layout",
"plugin panel aligned" => "plugin panel aligned",
"file manager" => "file manager",
"root" => "root",
"Set 0 to..." => "Set 0 to disable",
"Slash prefixed" => "Slash prefixed",
"bug reporting" => "bug reporting",
"check in files" => "check in files",

View File

@@ -1,4 +1,4 @@
<?php
<?php
// Italian language translation
// by: @pietrondo (GitHub)
// @pietrobravo (Twitter)
@@ -138,7 +138,7 @@ $text = array(
"Sorry, cannot delete" => "Siamo spiacenti, non è possibile cancellare",
"Sorry, this file..." => "Siamo spiacenti, questo file è stato cambiato, non è possibile salvarlo",
"Reload this file..." => "Ricarica questo file e copia la tua versione in un pannello differente",
"There was a..." => "C'è stato un problema tecnico, probabilmente qualcosa che non era ancora pronto. Così ICEcoder ha ricaricato di nuovo il file.",
"There was a..." => "C\'è stato un problema tecnico, probabilmente qualcosa che non era ancora pronto. Così ICEcoder ha ricaricato di nuovo il file.",
"displayed at" => "visualizzato in",
"Enter filename to..." => "Inserisci il nome del file da salvare in",
"That file exists..." => "Questo file esiste già, sovrascrivere??",
@@ -148,7 +148,7 @@ $text = array(
"get-branch" =>
array(
"There are no..." => "Non ci sono differenze tra il repo locale e GitHub. Tornare alla modalità normale??",
"Sorry, there was..." => "Spiacente, c'è stato un errore, il codice:",
"Sorry, there was..." => "Spiacente, c\'è stato un errore, il codice:",
"Your local folder..." => "La cartella locale è vuota, ti piacerebbe clonare"
),
@@ -182,15 +182,15 @@ $text = array(
"headers" =>
array(
"Bad CSRF token..." => "Bad CSRF token. Per favore riporta l'errore a https://github.com/mattpass/ICEcoder così che possa essere fixato."
"Bad CSRF token..." => "Bad CSRF token. Per favore riporta l\'errore a https://github.com/mattpass/ICEcoder così che possa essere fixato."
),
"help" =>
array(
"shortcuts" => "shortcuts",
"Within document" => "all'interno del documento",
"Within document" => "all\'interno del documento",
"On Tabs" => "Sulle Tabs",
"Within file manager" => "All'interno del file manager",
"Within file manager" => "All\'interno del file manager",
"Anywhere" => "Dappertutto",
"Space" => "Spazio",
"Click" => "Click",
@@ -258,7 +258,7 @@ $text = array(
"Creating Folder" => "Sto creando una cartla",
"Sorry you can..." => "Spiacente, puoi avere solo 100 file aperti a volta!",
"Opening File" => "Apertura file",
"Enter relative file..." => "Digita il percorso relativo (con / di prefisso) o l'url remoto",
"Enter relative file..." => "Digita il percorso relativo (con / di prefisso) o l\'url remoto",
"Getting" => "Getting",
"Please enter the..." => "Per favore digita un nuovo nome per",
"Renaming to" => "Rinominando a ",
@@ -277,7 +277,7 @@ $text = array(
"Open previous files" => "Aprire i file precedenti?",
"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",
"This will compare..." => "Questo confronterà e mostrarà la diff tra il dir locale e il repository. Ok?",
"Please note for..." => "Si prega di notare: affinche l'aggiornamento funzioni correttamente, è necessario disporre dei permessi di scrittura e cancellazione su tutti le cartelle e file di ICEcoder e. Se è necessario ripristinare questa versione di ICEcoder per qualsiasi motivo, lo troverete nella directory / tmp dir. Fare clic su OK per procedere con l'aggiornamento automatico o annullare a visitare il sito ICEcoder in modo da poter utilizzare la zip e aggiornare manualmente.",
"Please note for..." => "Si prega di notare: affinche l\'aggiornamento funzioni correttamente, è necessario disporre dei permessi di scrittura e cancellazione su tutti le cartelle e file di ICEcoder e. Se è necessario ripristinare questa versione di ICEcoder per qualsiasi motivo, lo troverete nella directory / tmp dir. Fare clic su OK per procedere con l\'aggiornamento automatico o annullare a visitare il sito ICEcoder in modo da poter utilizzare la zip e aggiornare manualmente.",
"You can start..." => "Puoi ripoertare il bug in Help > Settings",
"Error cannot find..." => "Error: cannot find/access the error file paths",
"No new errors..." => "Nessun nuovo errore trovato",
@@ -379,7 +379,7 @@ $text = array(
"file manager root" => "root di file manager ",
"Free to use..." => "Libero di usarlo per i propri scopi, commerciali e non, facendomelo solo sapere per eventuali nuovi e interessanti utilizzi o personalizzazioni. :) <br> Nessuna garanzia o responsabilità, tutte le responsabilità di utilizzo è vostra. <br> Un sacco di aziende e persone fantastiche hanno contribuito a costruire ICEcoder e ce ne sarebbero troppi da ringraziare. Si prega di consultare la lista completa a",
"functionality" => "funzionalità",
"check for updates..." => "controlla aggiornamenti all'avvio",
"check for updates..." => "controlla aggiornamenti all\'avvio",
"auto open last..." => "Apri automaticamente ultimi file al login",
"when finding in..." => "quando trovi nei file, escludi",
"assisting" => "assisting",
@@ -430,14 +430,14 @@ token di accesso personale (https://help.github.com/articles/creating-an-access-
"settings-update" =>
array(
"Cannot update config..." => "Non posso aggiornare il file config. Per favore permetti l'accesso pubblico di scrittura",
"Cannot update config..." => "Non posso aggiornare il file config. Per favore permetti l\'accesso pubblico di scrittura",
"and try again" => "e prova ancora",
"and press refresh" => "e premi aggiorna"
),
"updater" =>
array(
"Update appears to..." => "L'aggiornamento sembra andato bene"
"Update appears to..." => "L\'aggiornamento sembra andato bene"
),
"find-in-files" =>
array(

View File

@@ -0,0 +1,28 @@
/* 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;
text-align: center;
}
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
.auto-logout-warning {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}

View File

@@ -0,0 +1,24 @@
<?php
include("headers.php");
include("settings.php");
$t = $text['auto-logout-warning'];
?>
<!DOCTYPE html>
<html>
<head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> auto-logout</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="auto-logout-warning.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="auto-logout-warning">
<h1 id="title"><?php echo $t['Auto Logout Warning'];?></h1>
<?php echo $t['You will be...'];?> <span id="timeRemaning">60</span> <?php echo $t['seconds due to...'];?>
</body>
</html>

View File

@@ -94,7 +94,7 @@ var highlightVersion = function(elem) {
}
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
lineNumbers: top.ICEcoder.lineNumbers,
readOnly: "nocursor",
indentUnit: top.ICEcoder.indentSize,
tabSize: top.ICEcoder.indentSize,

View File

@@ -1,6 +1,6 @@
<?php
$ICEcoderUserSettings = array(
"versionNo" => "5.4",
"versionNo" => "5.6",
"licenseEmail" => "",
"licenseCode" => "",
"configCreateDate" => 0,
@@ -21,9 +21,15 @@ $ICEcoderUserSettings = array(
"bannedFiles" => array(),
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
"allowedIPs" => array("*"),
"autoLogoutMins" => 0,
"theme" => "default",
"fontSize" => "13px",
"lineWrapping" => true,
"lineNumbers" => true,
"showTrailingSpace" => true,
"matchBrackets" => true,
"autoCloseTags" => true,
"autoCloseBrackets" => true,
"indentWithTabs" => true,
"indentAuto" => true,
"indentSize" => 4,
@@ -33,6 +39,7 @@ $ICEcoderUserSettings = array(
"bugFileMaxLines" => 0,
"githubAuthToken" => "",
"plugins" => array(),
"ftpSites" => array(),
"githubLocalPaths" => array(),
"githubRemotePaths" => array(),
"previousFiles" => "",

View File

@@ -37,4 +37,4 @@
.cm-s-icecoder .CodeMirror-selected {color: #fff !important; background: #037 !important}
.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-matchingbracket {border: 1px solid grey; color: black !important}
.cm-s-icecoder .CodeMirror-matchingbracket {color: #fff !important; background: #555 !important}

View File

@@ -4,14 +4,6 @@ include("settings.php");
include("ftp-control.php");
$t = $text['file-control'];
// Load the LZ String PHP libs and define using LZString
include(dirname(__FILE__)."/../LZCompressor/LZContext.php");
include(dirname(__FILE__)."/../LZCompressor/LZData.php");
include(dirname(__FILE__)."/../LZCompressor/LZReverseDictionary.php");
include(dirname(__FILE__)."/../LZCompressor/LZString.php");
include(dirname(__FILE__)."/../LZCompressor/LZUtil.php");
use LZCompressor\LZString as LZString;
// ===============================
// SET OUR ERROR INFO TO A DEFAULT
// ===============================
@@ -41,14 +33,6 @@ if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
$errorMsg = $t['Sorry, bad filename...'];
};
// If we have changes or whole content, we need to LZ decompress them
if (isset($_POST['changes'])) {
$_POST['changes'] = LZString::decompressFromBase64($_POST['changes']);
}
if (isset($_POST['contents'])) {
$_POST['contents'] = LZString::decompressFromBase64($_POST['contents']);
}
// If we have file(s) to work with...
if (!$error) {
// Replace pipes with slashes, after cleaning the chars
@@ -88,6 +72,8 @@ if (!$error) {
// Die if the file requested isn't something we expect
if(
// On the banned file/dir list
(str_replace("*","",$_SESSION['bannedFiles'][$i]) != "" && strpos($allFiles[$i],str_replace("*","",$_SESSION['bannedFiles'][$i]))!==false) ||
// 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,"/") &&
@@ -95,7 +81,7 @@ if (!$error) {
) ||
// 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";
@@ -244,7 +230,7 @@ if (!$error && $_GET['action']=="save") {
/* 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.replace(/\\\+/g,"%2B")+\'&contents=\'+encodeURIComponent(top.LZString.compressToBase64(top.ICEcoder.saveAsContent)));
xhr.send(\'timeStart='.$_POST["timeStart"].'&file='.$fileURL.'&newFileName=\'+newFileName.replace(/\\\+/g,"%2B")+\'&contents=\'+encodeURIComponent(top.ICEcoder.saveAsContent));
top.ICEcoder.serverMessage("<b>'.$t['Saving'].'</b><br>" + "'.($finalAction == "Save" ? "newFileName" : "'".$fileName."'").'");
}
}
@@ -284,7 +270,7 @@ if (!$error && $_GET['action']=="save") {
if (isset($_POST['changes'])) {
// Get existing file contents as lines
$loadedFile = toUTF8noBOM(ftpGetContents($ftpConn, $ftpRoot.$fileLoc."/".$fileName, $ftpMode));
$fileLines = explode("\n",$loadedFile);
$fileLines = explode("\n",str_replace("\r","",$loadedFile));
// Need to add a new line at the end of each because explode will lose them,
// want want to end up with same array that 'file($file)' produces for a local file
// - it keeps the line endings at the end of each array item
@@ -319,9 +305,10 @@ if (!$error && $_GET['action']=="save") {
// Write our file contents
if (!ftpWriteFile($ftpConn, $ftpFilepath, $contents, $ftpMode)) {
$doNext .= 'top.ICEcoder.message("Sorry, could not write '.$ftpFilepath.' at '.$ftpHost.'");';
} else {
$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();';
}
$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();';
// Local saving
} else {
if (isset($_POST['changes'])) {

View File

@@ -3,14 +3,6 @@ include("headers.php");
include("settings.php");
include("ftp-control.php");
$t = $text['file-control'];
// Load the LZ String PHP libs and define using LZString
include(dirname(__FILE__)."/../LZCompressor/LZContext.php");
include(dirname(__FILE__)."/../LZCompressor/LZData.php");
include(dirname(__FILE__)."/../LZCompressor/LZReverseDictionary.php");
include(dirname(__FILE__)."/../LZCompressor/LZString.php");
include(dirname(__FILE__)."/../LZCompressor/LZUtil.php");
use LZCompressor\LZString as LZString;
?>
<?php if ($_SESSION['githubDiff']) { ?>
<script src="github.js?microtime=<?php echo microtime(true);?>"></script>
@@ -75,7 +67,15 @@ for ($i=0; $i<count($allFiles); $i++) {
if ($_GET['action']=="load") {
echo 'action="load";';
$lineNumber = max(isset($_REQUEST['lineNumber'])?intval($_REQUEST['lineNumber']):1, 1);
if (isset($ftpSite) || file_exists($file)) {
// Check this file isn't on the banned list at all
$canOpen = true;
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
if(str_replace("*","",$_SESSION['bannedFiles'][$i]) != "" && strpos($file,str_replace("*","",$_SESSION['bannedFiles'][$i]))!==false) {$canOpen = false;}
}
if (!$canOpen) {
echo 'fileType="nothing"; top.ICEcoder.message(\''.$t['Sorry, could not...'].' '.$fileLoc."/".$fileName.'\');';
} elseif (isset($ftpSite) || file_exists($file)) {
$finfo = "text";
// Determine what to do based on mime type
if (!isset($ftpSite) && function_exists('finfo_open')) {
@@ -110,7 +110,7 @@ if ($_GET['action']=="load") {
$encoding=ini_get("default_charset");
if($encoding=="")
$encoding="UTF-8";
echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlentities(LZString::compressToBase64($loadedFile),ENT_COMPAT,$encoding).'</textarea><script>';
echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile,ENT_COMPAT,$encoding).'</textarea><script>';
// Run our custom processes
include_once("../processes/on-file-load.php");
} else if (strpos($finfo,"image")===0) {
@@ -181,7 +181,7 @@ if (action=="load") {
// Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on ICEcoder's load)
top.ICEcoder.switchMode();
cM = top.ICEcoder.getcMInstance();
cM.setValue(top.LZString.decompressFromBase64(document.getElementById('loadedFile').value));
cM.setValue(document.getElementById('loadedFile').value);
top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1] = cM.changeGeneration();
top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1] = cM.getValue();
top.document.getElementById('content').style.visibility='visible';

View File

@@ -20,10 +20,9 @@
.fileManager LI.ext-png:before {background-position: -336px 0}
.fileManager LI.ext-py:before {background-position: -352px 0}
.fileManager LI.ext-rb:before, .fileManager LI.ext-ruby:before {background-position: -368px 0}
.fileManager LI.ext-rs:before {background-position: -384px 0}
.fileManager LI.ext-scss:before {background-position: -400px 0}
.fileManager LI.ext-sql:before {background-position: -416px 0}
.fileManager LI.ext-txt:before {background-position: -432px 0}
.fileManager LI.ext-xml:before {background-position: -448px 0}
.fileManager LI.ext-yaml:before {background-position: -464px 0}
.fileManager LI.ext-zip:before {background-position: -480px 0}
.fileManager LI.ext-scss:before {background-position: -384px 0}
.fileManager LI.ext-sql:before {background-position: -400px 0}
.fileManager LI.ext-txt:before {background-position: -416px 0}
.fileManager LI.ext-xml:before {background-position: -432px 0}
.fileManager LI.ext-yaml:before {background-position: -448px 0}
.fileManager LI.ext-zip:before {background-position: -464px 0}

37
lib/ftp-manager.css Normal file
View File

@@ -0,0 +1,37 @@
/* 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: #2187e7; text-decoration: none}
input {padding: 4px; border: 1px solid #555; background-color: #444; color: #fff}
input:focus {
outline: none;
-webkit-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);
}
.ftpManager {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}
.ftpManager .info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}

212
lib/ftp-manager.php Normal file
View File

@@ -0,0 +1,212 @@
<?php
include("headers.php");
include("settings.php");
$t = $text['ftp-manager'];
// If we have an action to perform
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_GET['action'])) {
// Get our old FTP sites & user settings
$oldFTPSites = $ICEcoder["ftpSites"];
$settingsContents = file_get_contents($settingsFile,false,$context);
// ========
// CHOOSING
// ========
if ($_GET['action']=="choose") {
// Set the site ref in session, hide the popup and reload the file manager
$_SESSION['ftpSiteRef'] = numClean($_GET['ftpSiteRef']);
// Hide this popup and reload file manager
echo "<script>top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));top.ICEcoder.refreshFileManager();</script>";
} else {
// Start creating a new chunk for the FTP sites
$settingsNew = '"ftpSites" => array(
';
}
// ======
// ADDING
// ======
if ($_GET['action']=="add") {
// Add the new FTP site
if ($_POST['ftpSiteNEW'] != "") {
$settingsNew .= ' array(
"site" => "'.$_POST['ftpSiteNEW'].'",
"host" => "'.$_POST['ftpHostNEW'].'",
"user" => "'.$_POST['ftpUserNEW'].'",
"pass" => "'.$_POST['ftpPassNEW'].'",
"pasv" => '.$_POST['ftpPASVNEW'].',
"mode" => "'.$_POST['ftpModeNEW'].'",
"root" => "'.$_POST['ftpRootNEW'].'"
),
';
}
}
// ===============================================
// UPDATING & REMOVING PLUS UPDATE CONFIG SETTINGS
// ===============================================
if ($_GET['action']!="choose" && $_GET['action']!="edit") {
// Look at each of the existing FTP sites
for ($i=0; $i<count($oldFTPSites); $i++) {
// Updating
if ($_GET['action']=="update" && $i == $_GET['ftpSiteRef']) {
$settingsNew .= ' array(
"site" => "'.$_POST['ftpSiteNEW'].'",
"host" => "'.$_POST['ftpHostNEW'].'",
"user" => "'.$_POST['ftpUserNEW'].'",
"pass" => "'.$_POST['ftpPassNEW'].'",
"pasv" => '.$_POST['ftpPASVNEW'].',
"mode" => "'.$_POST['ftpModeNEW'].'",
"root" => "'.$_POST['ftpRootNEW'].'"
),
';
// Deleting
} elseif ($_GET['action']=="remove" && $i == $_GET['ftpSiteRef']) {
// Do nothing, so we ignore this entry now
// Entry is as before
} else {
$settingsNew .= ' array(
"site" => "'.$oldFTPSites[$i]['site'].'",
"host" => "'.$oldFTPSites[$i]['host'].'",
"user" => "'.$oldFTPSites[$i]['user'].'",
"pass" => "'.$oldFTPSites[$i]['pass'].'",
"pasv" => '.($oldFTPSites[$i]['pasv'] ? 'true' : 'false').',
"mode" => "'.($oldFTPSites[$i]['mode'] == 'FTP_ASCII' ? 'FTP_ASCII' : 'FTP_BINARY').'",
"root" => "'.$oldFTPSites[$i]['root'].'"
),
';
}
}
// Rtrim off the last comma
$settingsNew = rtrim($settingsNew,',
');
$settingsNew .= '
),'.PHP_EOL;
// Now we have a new settingsNew string to use
// we can update the FTP sites in the settings file
// Identify the bit to replace
$repPosStart = strpos($settingsContents,'"ftpSites"');
$repPosEnd = strpos($settingsContents,'"githubLocalPaths"');
// Compile our new settings
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents));
// Now update the config file
if (is_writeable($settingsFile)) {
$fh = fopen($settingsFile, 'w');
fwrite($fh, $settingsContents);
fclose($fh);
// Finally, reload the iFrame screen for the user
header("Location: ftp-manager.php?updatedFTPSites&csrf=".$_SESSION["csrf"]);
echo "<script>window.location='ftp-manager.php?updatedFTPSites&csrf='+top.ICEcoder.csrf;</script>";
die($t['Saving FTP sites']);
} else {
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." lib/".$settingsFile." ".$t['and try again']."');</script>";
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> FTP manager</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="ftp-manager.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="ftpManager">
<h1><?php echo $t['ftp manager'];?></h1>
<div style="display: inline-block; width: 620px; height: 440px; overflow-y: auto">
<?php
$ftpSites = $ICEcoder['ftpSites'];
if (count($ftpSites) > 0) {
?>
<div style="display: inline-block; width: 600px; margin-bottom: 30px">
<h2><?php echo $t['Choose existing site'];?></h2><br>
<form id="ftpUpdateForm" action="ftp-manager.php?action=update" method="POST">
<table style="width: 100%">
<?php
for ($i=0; $i<count($ftpSites); $i++) {
echo '<tr>';
echo '<td style="padding: 10px 10px 8px 0">'.$ftpSites[$i]['site'].'</td>';
echo '<td style="padding: 10px 10px 8px 0">'.$ftpSites[$i]['host'].'</td>';
echo '<td style="padding: 10px 10px 8px 0"><a href="ftp-manager.php?action=edit&ftpSiteRef='.$i.'&csrf='.$_SESSION["csrf"].'" class="blue">Edit</a></td>';
echo '<td style="padding: 10px 10px 8px 0"><a href="ftp-manager.php?action=remove&ftpSiteRef='.$i.'&csrf='.$_SESSION["csrf"].'" class="blue" onclick="return top.ICEcoder.ask(\''.$t['Are you sure...'].'\')">Delete</a></td>';
echo '<td style="padding: 2px 20px 8px 0; text-align: right"><div style="display: inline-block; padding: 5px; margin-top: 4px; background: #2187e7; color: #fff; font-size: 12px; cursor: pointer" onclick="window.location=\'ftp-manager.php?action=choose&ftpSiteRef='.$i.'&csrf='.$_SESSION["csrf"].'\'">'.$t['Choose'].'</div></td>';
echo '</tr>';
}
?>
</table>
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form>
</div>
<?php
}
?>
<div style="display: inline-block; width: 600px">
<h2><?php echo isset($_GET['action']) && $_GET['action']=="edit" ? $t['Edit site'] : $t['Add new site'];?></h2><br>
<form id="ftpAddEditForm" action="ftp-manager.php?action=<?php echo isset($_GET['action']) && $_GET['action']=="edit" ? "update&ftpSiteRef=".$_GET['ftpSiteRef'] : "add";?>" method="POST">
<table>
<tr>
<td style="padding-left: 5px"><?php echo $t['Site name'];?> <span class="info" title="<?php echo $t['eg My Site'];?>">[?]</span></td>
<td style="padding-left: 5px"><?php echo $t['Host'];?> <span class="info" title="<?php echo $t['eg ftp.yourdomain.com'];?>">[?]</span></td>
</tr>
<tr>
<td style="padding: 0 10px 8px 0"><input type="text" name="ftpSiteNEW" value="<?php if (isset($_GET['action']) && $_GET['action']=="edit") {echo $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['site'];};?>" style="width: 272px"></td>
<td style="padding: 0 0 8px 0"><input type="text" name="ftpHostNEW" value="<?php if (isset($_GET['action']) && $_GET['action']=="edit") {echo $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['host'];};?>" style="width: 272px"></td>
</tr>
<tr>
<td style="padding-left: 5px"><?php echo $t['Username'];?> <span class="info" title="<?php echo $t['eg user123'];?>">[?]</span></td>
<td style="padding-left: 5px"><?php echo $t['Password'];?> <span class="info" title="<?php echo $t['eg pass123'];?>">[?]</span></td>
</tr>
<tr>
<td style="padding: 0 10px 8px 0"><input type="text" name="ftpUserNEW" value="<?php if (isset($_GET['action']) && $_GET['action']=="edit") {echo $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['user'];};?>" style="width: 272px"></td>
<td style="padding: 0 0 8px 0"><input type="password" name="ftpPassNEW" value="<?php if (isset($_GET['action']) && $_GET['action']=="edit") {echo $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['pass'];};?>" style="width: 272px"></td>
</tr>
<tr>
<td style="padding-left: 5px"><?php echo $t['PASV and mode'];?> <span class="info" title="<?php echo $t['Use PASV mode...'];?>">[?]</span></td>
<td style="padding-left: 5px"><?php echo $t['Root'];?> <span class="info" title="<?php echo $t['eg /htdocs'];?>">[?]</span></td>
</tr>
<tr>
<td style="padding: 0 10px 8px 0">
<select name="ftpPASVNEW">
<option value="false"<?php echo isset($_GET['action']) && $_GET['action']=="edit" && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['pasv'] == false ? " selected" : "";?>><?php echo $t['PASV connection off'];?></option>
<option value="true"<?php echo isset($_GET['action']) && $_GET['action']=="edit" && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['pasv'] == true ? " selected" : "";?>><?php echo $t['PASV connection on'];?></option>
</select>
<select name="ftpModeNEW">
<option value="FTP_ASCII"<?php echo isset($_GET['action']) && $_GET['action']=="edit" && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['mode'] == "FTP_ASCII" ? " selected" : "";?>><?php echo $t['ASCII transfer'];?></option>
<option value="FTP_BINARY"<?php echo isset($_GET['action']) && $_GET['action']=="edit" && $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['mode'] == "FTP_BINARY" ? " selected" : "";?>><?php echo $t['Binary transfer'];?></option>
</select>
</td>
<td style="padding: 0 0 8px 0"><input type="text" name="ftpRootNEW" value="<?php if (isset($_GET['action']) && $_GET['action']=="edit") {echo $ICEcoder['ftpSites'][$_GET['ftpSiteRef']]['root'];};?>" style="width: 272px"></td>
</tr>
<tr>
<td colspan="2" style="padding: 3px 0 8px 0; text-align: right"><div style="display: inline-block; padding: 5px; background: #2187e7; color: #fff; font-size: 12px; cursor: pointer" onclick="document.getElementById('ftpAddEditForm').submit()"><?php echo isset($_GET['action']) && $_GET['action']=="edit" ? $t['Update'] : $t['Add'];?></div></td>
</tr>
</table>
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
</form>
</div>
</div>
</body>
</html>

View File

@@ -143,7 +143,7 @@ if (isset($ftpSite)) {
foreach($finalArray as $entry) {
$canAdd = true;
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
if($_SESSION['bannedFiles'][$i] != "" && strpos($entry,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
if(str_replace("*","",$_SESSION['bannedFiles'][$i]) != "" && strpos($entry,str_replace("*","",$_SESSION['bannedFiles'][$i]))!==false) {$canAdd = false;}
}
// Only applicable for local dir, ignoring ICEcoder's dir
if (!isset($ftpSite) && $docRoot.$iceRoot.$location."/".$entry == $docRoot.$ICEcoderDir) {

View File

@@ -52,6 +52,10 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$fh = fopen($settingsFile, 'w');
fwrite($fh, $settingsContents);
fclose($fh);
// Clear any FTP session we may have
$_SESSION['ftpSiteRef'] = false;
// Hide this popup and reload file manager
echo "<script>top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));top.ICEcoder.refreshFileManager();</script>";
} else {

37
lib/go-localhost-root.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
include_once("settings.php");
$text = $_SESSION['text'];
$t = $text['settings-update'];
// Update our 'root' value to be blank
// which resets the file manager to localhost root again
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) {
$settingsContents = file_get_contents($settingsFile,false,$context);
// Replace our root var
$repPosStart = strpos($settingsContents,'"root"');
$repPosEnd = strpos($settingsContents,'"checkUpdates"');
// Compile our new settings
$settingsContents =
substr($settingsContents,0,$repPosStart).
'"root" => "",'.PHP_EOL.
substr($settingsContents,($repPosEnd),strlen($settingsContents));
// Now update the config file
if (is_writeable($settingsFile)) {
$fh = fopen($settingsFile, 'w');
fwrite($fh, $settingsContents);
fclose($fh);
// Clear any FTP session we may have
$_SESSION['ftpSiteRef'] = false;
// Now we've reset the root path to localhost root, refresh the file manager to show it
echo "<script>top.ICEcoder.refreshFileManager();</script>";
} else {
echo "<script>top.ICEcoder.message('".$t['Cannot update config']." lib/".$settingsFile." ".$t['and try again']."');</script>";
}
?>
<?php
;};
?>

View File

@@ -60,6 +60,7 @@ var ICEcoder = {
renderPaneShiftAmount: 0, // Shift comparison main (negative) vs diff pane (positive)
debounce: "", // Contains debounce timeout object
editorFocusInstance: "", // Name of editor instance that has focus
openSeconds: 0, // Number of seconds ICEcoder has been open for
ready: false, // Indicates if ICEcoder is ready for action
// Set our aliases
@@ -104,6 +105,40 @@ var ICEcoder = {
// Start bug checking
top.ICEcoder.startBugChecking();
// Set the time since last user interaction
top.ICEcoder.autoLogoutTimer = 0;
// Start our interval timer, runs every second
top.ICEcoder.oneSecondInt = setInterval(function() {
top.ICEcoder.autoLogoutTimer++;
var unsavedFiles = false;
// Check if we have any unsaved files
for(var i=1;i<=ICEcoder.savedPoints.length;i++) {
if (ICEcoder.savedPoints[i-1]!=top.ICEcoder.getcMInstance(i).changeGeneration()) {
unsavedFiles = true;
}
}
// Show an auto-logout warning 60 secs before a logout
if(!unsavedFiles && top.ICEcoder.autoLogoutMins > 1 && top.ICEcoder.autoLogoutTimer == (top.ICEcoder.autoLogoutMins*60)-60) {
top.ICEcoder.autoLogoutWarningScreen();
}
if (get('autoLogoutIFrame') && get('autoLogoutIFrame').contentWindow.document.getElementById('timeRemaning')) {
get('autoLogoutIFrame').contentWindow.document.getElementById('timeRemaning').innerHTML =
top.ICEcoder.autoLogoutTimer > 0
? (top.ICEcoder.autoLogoutMins*60) - top.ICEcoder.autoLogoutTimer
: 0;
}
// If there aren't any unsaved files, we have a timeout period > 0 and the time is up, we can logout
if(!unsavedFiles && ICEcoder.autoLogoutMins > 0 && top.ICEcoder.autoLogoutTimer >= top.ICEcoder.autoLogoutMins*60) {
top.ICEcoder.logout('autoLogout');
}
// Finally, increase number of seconds ICEcoder has been open for by 1
top.ICEcoder.openSeconds++;
// Every 5 mins, ping our file to keep the session alive
if (top.ICEcoder.openSeconds % 300 == 0) {
top.ICEcoder.filesFrame.contentWindow.frames['pingActive'].location.href = "lib/session-active-ping.php";
}
},1000);
// ICEcoder is ready to start using
top.ICEcoder.ready = true;
},
@@ -252,7 +287,7 @@ var ICEcoder = {
// EDITOR
// ==============
// On key up
// On focus
cMonFocus: function(thisCM,cMinstance) {
top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay();
@@ -2551,6 +2586,14 @@ var ICEcoder = {
serverQueue: function(action,item,file,changes) {
var cM, nextSaveID, txtArea, topSaveID, element, xhr, statusObj, timeStart;
// If we have this exact item URL, it's almost certain we've got a repetitive save
// situation and so clear the message and server queue item to avoid save jamming
if (ICEcoder.serverQueueItems.indexOf(item) !== -1) {
top.ICEcoder.serverMessage();
top.ICEcoder.serverQueue("del",0);
return;
}
cM = ICEcoder.getcMInstance();
// Firstly, work out how many saves we have to carry out
nextSaveID=0;
@@ -2640,10 +2683,10 @@ var ICEcoder = {
// Save as events need to send all contents
if (item.indexOf('action=saveAs')>0) {
xhr.send('timeStart='+timeStart+'&file='+file+'&contents='+encodeURIComponent(top.LZString.compressToBase64(top.document.getElementById('saveTemp1').value)));
xhr.send('timeStart='+timeStart+'&file='+file+'&contents='+encodeURIComponent(top.document.getElementById('saveTemp1').value));
// Save evens can just sent the changes
} else if (item.indexOf('action=save')>0) {
xhr.send('timeStart='+timeStart+'&file='+file+'&changes='+encodeURIComponent(top.LZString.compressToBase64(top.document.getElementById('saveTemp1').value)));
xhr.send('timeStart='+timeStart+'&file='+file+'&changes='+encodeURIComponent(top.document.getElementById('saveTemp1').value));
// Another type of event
} else {
xhr.send('timeStart='+timeStart+'&file='+file);
@@ -2762,12 +2805,23 @@ var ICEcoder = {
top.ICEcoder.showHide('show',top.get('blackMask'));
},
// Show the auto-logout warning screen
autoLogoutWarningScreen: function() {
top.get('mediaContainer').innerHTML = '<iframe src="lib/auto-logout-warning.php" id="autoLogoutIFrame" class="whiteGlow" style="width: 400px; height: 160px"></iframe>';
top.ICEcoder.showHide('show',top.get('blackMask'));
},
// Show the plugins manager
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'));
},
// Go to localhost root
goLocalhostRoot: function() {
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/go-localhost-root.php";
},
// Show the GitHub commit screen
githubAction: function(action) {
top.get('mediaContainer').innerHTML = '<iframe src="lib/github.php?action='+action+'&selectedFiles='+top.ICEcoder.selectedFiles.join(";")+'&csrf='+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 340px; height: 340px"></iframe>';
@@ -2814,8 +2868,14 @@ var ICEcoder = {
}
},
// Show the FTP manager
ftpManager: function() {
top.get('mediaContainer').innerHTML = '<iframe src="lib/ftp-manager.php" class="whiteGlow" style="width: 660px; height: 550px"></iframe>';
top.ICEcoder.showHide('show',top.get('blackMask'));
},
// 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,lineNumbers,showTrailingSpace,matchBrackets,autoCloseTags,autoCloseBrackets,indentWithTabs,indentAuto,indentSize,pluginPanelAligned,bugFilePaths,bugFileCheckTimer,bugFileMaxLines,githubAuthTokenSet,updateDiffOnSave,autoLogoutMins,refreshFM) {
var styleNode, thisCSS, strCSS, activeLineBG;
// cut out ?microtime= at the end
@@ -2874,18 +2934,33 @@ var ICEcoder = {
thisCSS[strCSS][2].style.cssText = "background-color: " + activeLineBG + " !important";
top.ICEcoder.lineWrapping = lineWrapping;
top.ICEcoder.lineNumbers = lineNumbers;
top.ICEcoder.showTrailingSpace = showTrailingSpace;
top.ICEcoder.matchBrackets = matchBrackets;
top.ICEcoder.autoCloseTags = autoCloseTags;
top.ICEcoder.autoCloseBrackets = autoCloseBrackets;
top.ICEcoder.indentWithTabs = indentWithTabs;
top.ICEcoder.indentSize = indentSize;
top.ICEcoder.indentAuto = indentAuto;
for (var i=0;i<ICEcoder.cMInstances.length;i++) {
// Main pane
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("lineWrapping", top.ICEcoder.lineWrapping);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("lineNumbers", top.ICEcoder.lineNumbers);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("showTrailingSpace", top.ICEcoder.showTrailingSpace);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("matchBrackets", top.ICEcoder.matchBrackets);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("autoCloseTags", top.ICEcoder.autoCloseTags);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("autoCloseBrackets", top.ICEcoder.autoCloseBrackets);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("indentWithTabs", top.ICEcoder.indentWithTabs);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("indentUnit", top.ICEcoder.indentSize);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("tabSize", top.ICEcoder.indentSize);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].refresh();
// Diff pane
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("lineWrapping", top.ICEcoder.lineWrapping);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("lineNumbers", top.ICEcoder.lineNumbers);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("showTrailingSpace", top.ICEcoder.showTrailingSpace);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("matchBrackets", top.ICEcoder.matchBrackets);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("autoCloseTags", top.ICEcoder.autoCloseTags);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("autoCloseBrackets", top.ICEcoder.autoCloseBrackets);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("indentWithTabs", top.ICEcoder.indentWithTabs);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("indentUnit", top.ICEcoder.indentSize);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setOption("tabSize", top.ICEcoder.indentSize);
@@ -2927,6 +3002,9 @@ var ICEcoder = {
// Set the flag to indicate if we update diff pane on save
top.ICEcoder.updateDiffOnSave = updateDiffOnSave;
// Set the auto-logout mins value
top.ICEcoder.autoLogoutMins = autoLogoutMins;
// Finally, refresh the file manager if we need to
if (refreshFM) {top.ICEcoder.refreshFileManager()};
},
@@ -3004,9 +3082,17 @@ var ICEcoder = {
}
},
// Reset auto-logout timer
resetAutoLogoutTimer: function() {
if(top.ICEcoder.autoLogoutMins > 1 && top.ICEcoder.autoLogoutTimer > (top.ICEcoder.autoLogoutMins*60)-60) {
ICEcoder.showHide('hide',get('blackMask'));
}
top.ICEcoder.autoLogoutTimer = 0;
},
// Logout of ICEcoder
logout: function() {
window.location = window.location + "?logout&csrf="+top.ICEcoder.csrf;
logout: function(type) {
window.location = window.location + "?logout&"+(type ? "type="+type+"&" : "")+"csrf="+top.ICEcoder.csrf;
},
// Show a message
@@ -3644,6 +3730,9 @@ var ICEcoder = {
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
// Reset the auto-logout timer
top.ICEcoder.resetAutoLogoutTimer();
// Mac command key handling (224 = Moz, 91/93 = Webkit Left/Right Apple)
if (key==224 || key==91 || key==93) {
top.ICEcoder.cmdKey = true;

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

@@ -1,44 +1,46 @@
var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,savedPoints:[],savedContents:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],openFileVersions:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,scrollbarVisible:!1,mouseDown:!1,mouseDownInCM:!1,draggingFilesW:!1,draggingTab:!1,draggingWithKey:!1,tabLeftPos:[],tabBGcurrent:"#1d1d1b",tabBGselected:"#49d",tabBGopen:"#c3c3c3",tabBGnormal:"transparent",tabFGcurrent:"#fff",
tabFGselected:"#fff",tabFGopenFile:"#000",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(" "),
tabFGselected:"#fff",tabFGopenFile:"#000",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:"",openSeconds:0,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&&setTimeout(function(){top.ICEcoder.autoOpenFiles()},200),clearInterval(top.ICEcoder.autoOpenInt))},
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.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%",
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?
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(),
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),
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)&&
clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){top.ICEcoder.ready&&"w-resize"==top.document.body.style.cursor?top.ICEcoder.mouseDown&&"gutter"==top.ICEcoder.mouseDownInCM&&(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=!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,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"+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]&&-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();for(var k=0;k<b.length;k++)if(e=a.getTokenAt(b[k].anchor),"tag bracket"==e.type&&"<"==e.string&&(e=a.getTokenAt({line:b[k].anchor.line,ch:b[k].anchor.ch+1})),"tag"==e.type){f=d.fold.xml(a,b[k].anchor);g=!0;for(var h=0;h<top.ICEcoder.endTagReplaceData.length;h++)"undefined"!=typeof f&&top.ICEcoder.endTagReplaceData[h].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)&&
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(":"),
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(c=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
1])e=c.substr(c.lastIndexOf("/")+1),f=e.substr(e.lastIndexOf(".")+1);top.ICEcoder.splitPane&&setTimeout(function(){top.ICEcoder.updateDiffs()},0);c&&top.ICEcoder.previewWindow.location&&"/[NEW]"!=c&&top.ICEcoder.updatePreviewWindow(a,c,e,f);top.ICEcoder.indicateChanges()},cMonScroll:function(a,b){var c,d,e;top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!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,b){"keypress"==top.ICEcoder.autoComplete&&top.ICEcoder.codeAssist&&(a.state.completionActive||top.ICEcoder.autocomplete())},cMonGutterClick:function(a,b,c,d,e){top.ICEcoder.mouseDownInCM="gutter"},cMonMouseDown:function(a,b){top.ICEcoder.mouseDownInCM="editor"},cMonDragOver:function(a,b,c){top.ICEcoder.setDragCursor(b,"editor")},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])}},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"==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==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(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,"</textarea>");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},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")?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=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")?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},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"+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&&(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();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,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,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;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=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=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-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&&
4);setInterval(ICEcoder.updateNestingIndicator,30);top.ICEcoder.startBugChecking();top.ICEcoder.autoLogoutTimer=0;top.ICEcoder.oneSecondInt=setInterval(function(){top.ICEcoder.autoLogoutTimer++;for(var a=!1,b=1;b<=ICEcoder.savedPoints.length;b++)ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()&&(a=!0);!a&&1<top.ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer==60*top.ICEcoder.autoLogoutMins-60&&top.ICEcoder.autoLogoutWarningScreen();get("autoLogoutIFrame")&&get("autoLogoutIFrame").contentWindow.document.getElementById("timeRemaning")&&
(get("autoLogoutIFrame").contentWindow.document.getElementById("timeRemaning").innerHTML=0<top.ICEcoder.autoLogoutTimer?60*top.ICEcoder.autoLogoutMins-top.ICEcoder.autoLogoutTimer:0);!a&&0<ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer>=60*top.ICEcoder.autoLogoutMins&&top.ICEcoder.logout("autoLogout");top.ICEcoder.openSeconds++;0==top.ICEcoder.openSeconds%300&&(top.ICEcoder.filesFrame.contentWindow.frames.pingActive.location.href="lib/session-active-ping.php")},1E3);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=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%",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?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(),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),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)&&clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){top.ICEcoder.ready&&"w-resize"==
top.document.body.style.cursor?top.ICEcoder.mouseDown&&"gutter"==top.ICEcoder.mouseDownInCM&&(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=!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,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"+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]&&-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();for(var k=0;k<b.length;k++)if(e=a.getTokenAt(b[k].anchor),"tag bracket"==e.type&&"<"==e.string&&(e=a.getTokenAt({line:b[k].anchor.line,
ch:b[k].anchor.ch+1})),"tag"==e.type){f=d.fold.xml(a,b[k].anchor);g=!0;for(var h=0;h<top.ICEcoder.endTagReplaceData.length;h++)"undefined"!=typeof f&&top.ICEcoder.endTagReplaceData[h].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)&&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(":"),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(c=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])e=c.substr(c.lastIndexOf("/")+1),f=e.substr(e.lastIndexOf(".")+1);top.ICEcoder.splitPane&&setTimeout(function(){top.ICEcoder.updateDiffs()},0);c&&top.ICEcoder.previewWindow.location&&
"/[NEW]"!=c&&top.ICEcoder.updatePreviewWindow(a,c,e,f);top.ICEcoder.indicateChanges()},cMonScroll:function(a,b){var c,d,e;top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!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,b){"keypress"==top.ICEcoder.autoComplete&&top.ICEcoder.codeAssist&&(a.state.completionActive||top.ICEcoder.autocomplete())},
cMonGutterClick:function(a,b,c,d,e){top.ICEcoder.mouseDownInCM="gutter"},cMonMouseDown:function(a,b){top.ICEcoder.mouseDownInCM="editor"},cMonDragOver:function(a,b,c){top.ICEcoder.setDragCursor(b,"editor")},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])}},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"==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==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(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,"</textarea>");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},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")?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=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")?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},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"+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&&(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();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,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,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;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=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=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-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: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||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;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;
@@ -108,49 +110,54 @@ top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top
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.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=
!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"],
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,d){var e,f,g,k,h;e=ICEcoder.getcMInstance();for(g=f=0;g<ICEcoder.serverQueueItems.length;g++)0<ICEcoder.serverQueueItems[g].indexOf("action=save")&&f++;f++;if("add"==a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(g=document.createElement("textarea"),g.setAttribute("id",
"saveTemp"+f),document.body.appendChild(g),0<b.indexOf("saveType=saveAs")||0<b.indexOf("fileVersion=undefined")?top.get("saveTemp"+f).value=e.getValue():top.get("saveTemp"+f).value=d);else if("del"==a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){d=f-1;for(g=1;g<d;g++)top.get("saveTemp"+g).value=top.get("saveTemp"+(g+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")?(k=top.ICEcoder.xhrObj(),k.onreadystatechange=function(){4==k.readyState&&(200==k.status?(h=JSON.parse(k.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(k.responseText),0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(h),h.status.error?(top.ICEcoder.message(h.status.errorMsg),
console.log("ICEcoder error info for your request..."),console.log(h),top.ICEcoder.serverMessage(),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)))},k.open("POST",ICEcoder.serverQueueItems[0],!0),k.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a=(new Date).getTime(),0<b.indexOf("action=saveAs")?
k.send("timeStart="+a+"&file="+c+"&contents="+encodeURIComponent(top.LZString.compressToBase64(top.document.getElementById("saveTemp1").value))):0<b.indexOf("action=save")?k.send("timeStart="+a+"&file="+c+"&changes="+encodeURIComponent(top.LZString.compressToBase64(top.document.getElementById("saveTemp1").value))):k.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()},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(\''+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+" 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?"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: 970px; height: 640px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},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",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",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?(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?"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,m,p,n,l,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),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(),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: "+r+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.indentWithTabs=h;top.ICEcoder.indentSize=p;top.ICEcoder.indentAuto=m;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),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",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=l;top.ICEcoder.bugFileCheckTimer=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"!=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="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.replace(/\+/g,"%2B"));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("/")+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=!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;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>'},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&&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"!=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();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;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")?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+=" \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.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);top.ICEcoder.savedContents.push("");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-
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.openFileVersions[d-1]=ICEcoder.openFileVersions[d];
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();
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.savedContents.splice(a-1,1);top.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.selectDeselectFile("deselect",top.ICEcoder.filesFrame.contentWindow.document.getElementById(c.replace(/\//g,
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,d){var e,f,g,k,h;if(-1!==ICEcoder.serverQueueItems.indexOf(b))top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0);else{e=ICEcoder.getcMInstance();for(g=f=0;g<ICEcoder.serverQueueItems.length;g++)0<ICEcoder.serverQueueItems[g].indexOf("action=save")&&f++;f++;if("add"==
a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(g=document.createElement("textarea"),g.setAttribute("id","saveTemp"+f),document.body.appendChild(g),0<b.indexOf("saveType=saveAs")||0<b.indexOf("fileVersion=undefined")?top.get("saveTemp"+f).value=e.getValue():top.get("saveTemp"+f).value=d);else if("del"==a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){d=f-1;for(g=1;g<d;g++)top.get("saveTemp"+g).value=top.get("saveTemp"+(g+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")?(k=top.ICEcoder.xhrObj(),k.onreadystatechange=function(){4==k.readyState&&(200==k.status?(h=JSON.parse(k.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(k.responseText),
0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(h),h.status.error?(top.ICEcoder.message(h.status.errorMsg),console.log("ICEcoder error info for your request..."),console.log(h),top.ICEcoder.serverMessage(),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)))},k.open("POST",ICEcoder.serverQueueItems[0],
!0),k.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a=(new Date).getTime(),0<b.indexOf("action=saveAs")?k.send("timeStart="+a+"&file="+c+"&contents="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):0<b.indexOf("action=save")?k.send("timeStart="+a+"&file="+c+"&changes="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):k.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()},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(\''+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+" 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?"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: 970px; height: 640px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},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",top.get("blackMask"))},autoLogoutWarningScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/auto-logout-warning.php" id="autoLogoutIFrame" class="whiteGlow" style="width: 400px; height: 160px"></iframe>';
top.ICEcoder.showHide("show",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"))},goLocalhostRoot:function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/go-localhost-root.php"},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"))},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='<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="files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf},ftpManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/ftp-manager.php" class="whiteGlow" style="width: 660px; height: 550px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,k,h,m,p,n,l,q,u,w,v,x,y,z,A,B,C,D){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),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(),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: "+r+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=m;top.ICEcoder.matchBrackets=
p;top.ICEcoder.autoCloseTags=n;top.ICEcoder.autoCloseBrackets=l;top.ICEcoder.indentWithTabs=q;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=u;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("lineNumbers",top.ICEcoder.lineNumbers),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("showTrailingSpace",
top.ICEcoder.showTrailingSpace),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("matchBrackets",top.ICEcoder.matchBrackets),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("autoCloseTags",top.ICEcoder.autoCloseTags),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("autoCloseBrackets",top.ICEcoder.autoCloseBrackets),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"+ICEcoder.cMInstances[f]+"diff"].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("lineNumbers",top.ICEcoder.lineNumbers),
ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("showTrailingSpace",top.ICEcoder.showTrailingSpace),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("matchBrackets",top.ICEcoder.matchBrackets),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("autoCloseTags",top.ICEcoder.autoCloseTags),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("autoCloseBrackets",top.ICEcoder.autoCloseBrackets),
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();d!=top.ICEcoder.tagWrapperCommand&&(top.ICEcoder.tagWrapperCommand=d);
e!=top.ICEcoder.autoComplete&&(top.ICEcoder.autoComplete=e);top.get("plugins").style.left="left"==v?"0":"auto";top.get("plugins").style.right="right"==v?"0":"auto";top.ICEcoder.bugFilePaths=x;top.ICEcoder.bugFileCheckTimer=y;top.ICEcoder.bugFileMaxLines=z;""!=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=A;top.ICEcoder.updateDiffOnSave=
B;top.ICEcoder.autoLogoutMins=C;D&&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?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="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.replace(/\+/g,"%2B"));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("/")+
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=!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){}}}},resetAutoLogoutTimer:function(){1<top.ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer>60*top.ICEcoder.autoLogoutMins-60&&ICEcoder.showHide("hide",get("blackMask"));top.ICEcoder.autoLogoutTimer=0},logout:function(a){window.location=window.location+"?logout&"+(a?"type="+a+"&":"")+"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",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(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&&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"!=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();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;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")?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+=" \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.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);top.ICEcoder.savedContents.push("");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-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.openFileVersions[d-1]=ICEcoder.openFileVersions[d];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();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.savedContents.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.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=
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+
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)+
@@ -159,14 +166,15 @@ f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICE
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=
!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.savedPoints,ICEcoder.savedContents,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=b[0];ICEcoder.savedContents=b[1];ICEcoder.openFiles=b[2];ICEcoder.openFileMDTs=b[3];ICEcoder.openFileVersions=b[4];ICEcoder.cMInstances=b[5];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=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"==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):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)&&"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?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!=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(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,d.getCursor(),!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",
"|"),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")?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*/,"").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,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,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)}}};
(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)+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;top.ICEcoder.resetAutoLogoutTimer();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"==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):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)&&"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?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!=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(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,d.getCursor(),!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","|"),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")?
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*/,
"").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,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,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)}}};

View File

@@ -57,8 +57,11 @@ echo $ICEcoder["password"] == "" && !$ICEcoder["multiUser"] ? "Setup" : "Login";
}
?>
<?php
if ($ICEcoder["password"] == "" && !$ICEcoder["multiUser"]) {
echo '<div class="text" style="position: relative"><input type="checkbox" name="disableFurtherRegistration" value="true" style="position: absolute; margin: -1px 0 0 -20px" checked> '.$t['disable further registrations'].'</div>';
}
if ($ICEcoder["password"] == "" || $ICEcoder["multiUser"]) {
echo '<div class="text"><input type="checkbox" name="checkUpdates" value="true" checked> '.$t['auto-check for updates'].'</div>';
echo '<div class="text" style="position: relative"><input type="checkbox" name="checkUpdates" value="true" style="position: absolute; margin: -1px 0 0 -20px" checked> '.$t['auto-check for updates'].'</div>';
}
if (!$ICEcoder["multiUser"]) { echo '<div class="text"><a href="javascript:alert(\''.$t['To put into...'].'\')">'.$t['multi-user'].'?</a></div>';};
}

View File

@@ -1 +0,0 @@
var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;n<o.length;n++)t[o][o.charAt(n)]=n}return t[o][r]}var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={},i={compressToBase64:function(o){if(null==o)return"";var r=i._compress(o,6,function(o){return n.charAt(o)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(e){return o(n,r.charAt(e))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:i._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=i.compress(o),n=new Uint8Array(2*r.length),e=0,t=r.length;t>e;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<o.length;i+=1)if(u=o.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=f++,p[u]=!0),c=a+u,Object.prototype.hasOwnProperty.call(s,c))a=c;else{if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);

View File

@@ -130,7 +130,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
$foundInSelFile = false;
// Exclude banned files
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
if (strpos($f,$ICEcoder['bannedFiles'][$i])!==false) {$bFile = true;};
if (strpos($f,str_replace("*","",$ICEcoder['bannedFiles'][$i]))!==false) {$bFile = true;};
}
// Exclude the folder ICEcoder is running from
$rootPrefix = '/'.str_replace("/","\/",preg_quote(str_replace("\\","/",$docRoot))).'/';

View File

@@ -142,7 +142,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
// Identify the bit to replace
$repPosStart = strpos($settingsContents,'"plugins"');
$repPosEnd = strpos($settingsContents,'"githubLocalPaths"');
$repPosEnd = strpos($settingsContents,'"ftpSites"');
// Compile our new settings
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents));

View File

@@ -0,0 +1,6 @@
<?php
// Load headings and settings
// Do this every 5 mins to keep session alive
include("headers.php");
include("settings.php");
?>

View File

@@ -130,11 +130,28 @@ function xssClean($data,$type) {
// returns a UTF8 based string with any UFT8 BOM removed
function toUTF8noBOM($string,$message) {
global $text;
$t = $text['settings-common'];
// Attempt to detect encoding
if (function_exists('mb_detect_encoding')) {
$strictUTF8 = mb_detect_encoding($string, 'UTF-8', true);
// Get rid of any UTF-8 BOM
$string = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$string);
// Establish a BOM
$bom = pack("CCC", 0xef, 0xbb, 0xbf);
// If there's a BOM in the first few chars
if (0 === strncmp($string, $bom, 3)) {
// If there's a BOM followed by a Windows based (2 char) line ending
// chop BOM off and prefix returned string with a PHP_EOL
if (0 === strncmp($string, $bom."\r\n", 3)) {
$string = PHP_EOL.substr($string, 3);
// Else, simply chop off the BOM
} else {
$string = substr($string, 3);
}
}
// Remove any other BOMs from view
$string = preg_replace('/'.$bom.'/','',$string);
// Test for any bad characters
$teststring = $string;
$teststringBroken = utf8_decode($teststring);

View File

@@ -185,7 +185,7 @@ for ($i=0;$i<count($themeArray);$i++) {
<div id="styleSection" class="section" style="display: none">
<div style="display: inline-block; width: 400px; margin-right: 40px">
<div style="display: inline-block; width: 400px; margin-right: 35px">
<div style="height: 220px">
<h2>preview</h2><br>
<textarea id="code" name="code">
@@ -213,9 +213,7 @@ function findSequence(goal) {
</select>
<br><br>
</div>
<div style="display: inline-block">
</div><div style="display: inline-block">
<h2><?php echo $t['style'];?></h2><br>
<?php echo $t['theme'];?><br>
<select onchange="selectTheme();showButton()" id="select" name="theme" style="width: 95px">
@@ -229,38 +227,77 @@ function findSequence(goal) {
</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"];?>">
<div style="display: inline-block; width: 95px">
<?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"];?>">
</div><div style="display: inline-block">
<?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"];?>">
</div>
<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"];?>">
<div style="display: inline-block; width: 95px">
<?php echo $t['match brackets'];?><br>
<select onchange="showButton()" name="matchBrackets">
<option value="true"<?php if($ICEcoder["matchBrackets"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["matchBrackets"]) {echo " selected";};?>>no</option>
</select>
</div><div style="display: inline-block">
<?php echo $t['show trailing space'];?><br>
<select onchange="showButton()" name="showTrailingSpace">
<option value="true"<?php if($ICEcoder["showTrailingSpace"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["showTrailingSpace"]) {echo " selected";};?>>no</option>
</select>
</div>
<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>
<div style="display: inline-block; width: 95px">
<?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>
</div><div style="display: inline-block">
<?php echo $t['line numbers'];?><br>
<select onchange="changeLineNumbersToggle();showButton()" name="lineNumbers" id="lineNumbers">
<option value="true"<?php if($ICEcoder["lineNumbers"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["lineNumbers"]) {echo " selected";};?>>no</option>
</select>
</div>
<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>
<div style="display: inline-block; width: 95px">
<?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>
<?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>
</div><div style="display: inline-block">
<?php echo $t['auto close tags'];?><br>
<select onchange="showButton()" name="autoCloseTags">
<option value="true"<?php if($ICEcoder["autoCloseTags"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["autoCloseTags"]) {echo " selected";};?>>no</option>
</select>
<br><br>
<?php echo $t['auto close brackets'];?><br>
<select onchange="showButton()" name="autoCloseBrackets">
<option value="true"<?php if($ICEcoder["autoCloseBrackets"]) {echo " selected";};?>>yes</option>
<option value="false"<?php if(!$ICEcoder["autoCloseBrackets"]) {echo " selected";};?>>no</option>
</select>
</div>
<br><br>
</div>
@@ -297,7 +334,7 @@ function findSequence(goal) {
<div id="securitySection" class="section" style="display: none">
<h2><?php echo $t['security'];?></h2><br>
<?php echo $t['banned files/folders'];?><br>
<?php echo $t['banned files/folders'];?> <span class="info" title="<?php echo $t['Comma delimited'];?>">[?]</span><br>
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedFiles" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["bannedFiles"]); ?>">
<br><br>
@@ -309,11 +346,15 @@ function findSequence(goal) {
<?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>
<?php echo $t['auto-logout after'];?> <span class="info" title="<?php echo $t['Set 0 to...'];?>">[?]</span><br>
<input type="text" onkeydown="showButton()" name="autoLogoutMins" style="width: 100px" value="<?php echo $ICEcoder["autoLogoutMins"]; ?>"> <span style="display: inline-block; padding: 2px 5px"><?php echo $t['mins of inactivity...'];?></span>
<br><br>
</div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
lineNumbers: top.ICEcoder.lineNumbers,
readOnly: "nocursor",
indentUnit: top.ICEcoder.indentSize,
tabSize: top.ICEcoder.indentSize,
@@ -335,6 +376,14 @@ function changeIndentSize() {
editor.refresh();
}
function changeLineNumbersToggle() {
var lineNumbersSelect = document.getElementById("lineNumbers");
var lineNumbers = lineNumbersSelect.options[lineNumbersSelect.selectedIndex].innerHTML == "yes" ? true : false;
editor.setOption("lineNumbers", lineNumbers);
editor.refresh();
}
function changeFontSize() {
cMCSS = document.styleSheets[2];
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';

View File

@@ -2,7 +2,7 @@
$newConfigSettingsFile = '<?php
// ICEcoder system settings
$ICEcoderSettings = array(
"versionNo" => "5.4",
"versionNo" => "5.6",
"codeMirrorDir" => "CodeMirror",
"docRoot" => $_SERVER[\'DOCUMENT_ROOT\'], // Set absolute path of another location if needed
"demoMode" => false,

View File

@@ -31,9 +31,15 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$ICEcoder["bannedFiles"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedFiles']))).'")';
$ICEcoder["bannedPaths"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedPaths']))).'")';
$ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")';
$ICEcoder["autoLogoutMins"] = intval($_POST['autoLogoutMins']);
$ICEcoder["theme"] = strClean($_POST['theme']);
$ICEcoder["fontSize"] = strClean($_POST['fontSize']);
$ICEcoder["lineWrapping"] = strClean($_POST['lineWrapping']);
$ICEcoder["lineNumbers"] = strClean($_POST['lineNumbers']);
$ICEcoder["showTrailingSpace"] = strClean($_POST['showTrailingSpace']);
$ICEcoder["matchBrackets"] = strClean($_POST['matchBrackets']);
$ICEcoder["autoCloseTags"] = strClean($_POST['autoCloseTags']);
$ICEcoder["autoCloseBrackets"] = strClean($_POST['autoCloseBrackets']);
$ICEcoder["indentWithTabs"] = strClean($_POST['indentWithTabs']);
$ICEcoder["indentAuto"] = strClean($_POST['indentAuto']);
$ICEcoder["indentSize"] = intval($_POST['indentSize']);
@@ -43,7 +49,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$ICEcoder["bugFileMaxLines"] = intval($_POST['bugFileMaxLines']);
$ICEcoder["githubAuthToken"] = strClean($_POST['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");
$settingsArray = array("root","checkUpdates","openLastFiles","updateDiffOnSave","languageUser","backupsKept","backupsDays","findFilesExclude","codeAssist","visibleTabs","lockedNav","tagWrapperCommand","autoComplete","password","bannedFiles","bannedPaths","allowedIPs","autoLogoutMins","theme","fontSize","lineWrapping","lineNumbers","showTrailingSpace","matchBrackets","autoCloseTags","autoCloseBrackets","indentWithTabs","indentAuto","indentSize","pluginPanelAligned","bugFilePaths","bugFileCheckTimer","bugFileMaxLines","githubAuthToken");
$settingsNew = "";
for ($i=0;$i<count($settingsArray);$i++) {
$settingsNew .= '"'.$settingsArray[$i].'" => ';
@@ -105,6 +111,6 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
// With all that worked out, we can now hide the settings screen and apply the new settings
$jsBugFilePaths = "['".str_replace(",","','",str_replace(" ","",strClean($_POST['bugFilePaths'])))."']";
echo "<script>top.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",'".$ICEcoder["tagWrapperCommand"]."','".$ICEcoder["autoComplete"]."',".$ICEcoder["visibleTabs"].",'".$ICEcoder["fontSize"]."',".$ICEcoder["lineWrapping"].",".$ICEcoder["indentWithTabs"].",".$ICEcoder["indentAuto"].",".$ICEcoder["indentSize"].",'".$ICEcoder["pluginPanelAligned"]."',".$jsBugFilePaths.",".$ICEcoder["bugFileCheckTimer"].",".$ICEcoder["bugFileMaxLines"].",'".$githubAuthTokenSet."',".$ICEcoder["updateDiffOnSave"].",".$refreshFM.");top.iceRoot = '".$ICEcoder["root"]."';</script>";
echo "<script>top.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",'".$ICEcoder["tagWrapperCommand"]."','".$ICEcoder["autoComplete"]."',".$ICEcoder["visibleTabs"].",'".$ICEcoder["fontSize"]."',".$ICEcoder["lineWrapping"].",".$ICEcoder["lineNumbers"].",".$ICEcoder["showTrailingSpace"].",".$ICEcoder["matchBrackets"].",".$ICEcoder["autoCloseTags"].",".$ICEcoder["autoCloseBrackets"].",".$ICEcoder["indentWithTabs"].",".$ICEcoder["indentAuto"].",".$ICEcoder["indentSize"].",'".$ICEcoder["pluginPanelAligned"]."',".$jsBugFilePaths.",".$ICEcoder["bugFileCheckTimer"].",".$ICEcoder["bugFileMaxLines"].",'".$githubAuthTokenSet."',".$ICEcoder["updateDiffOnSave"].",".$ICEcoder["autoLogoutMins"].",".$refreshFM.");top.iceRoot = '".$ICEcoder["root"]."';</script>";
}
?>

View File

@@ -1,15 +1,4 @@
<?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
$configSettings = 'config___settings.php';
$configUsersTemplate = 'config___users-template.php';
@@ -187,6 +176,18 @@ if (!$allowedIP) {
die('Sorry, access not permitted');
};
// Establish any FTP site to use
if (isset($_SESSION['ftpSiteRef']) && $_SESSION['ftpSiteRef'] !== false) {
$ftpSiteArray = $ICEcoder['ftpSites'][$_SESSION['ftpSiteRef']];
$ftpSite = $ftpSiteArray['site']; // FTP site domain, eg http://yourdomain.com
$ftpHost = $ftpSiteArray['host']; // FTP host, eg ftp.yourdomain.com
$ftpUser = $ftpSiteArray['user']; // FTP username
$ftpPass = $ftpSiteArray['pass']; // FTP password
$ftpPasv = $ftpSiteArray['pasv']; // FTP account requires PASV mode?
$ftpMode = $ftpSiteArray['mode'] == "FTP_ASCII" ? FTP_ASCII : FTP_BINARY; // FTP transfer mode, FTP_ASCII or FTP_BINARY
$ftpRoot = $ftpSiteArray['root']; // FTP root dir to use as base, eg /htdocs
}
// Save currently opened files in previousFiles and last10Files arrays
include(dirname(__FILE__)."/settings-save-current-files.php");
@@ -249,6 +250,28 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on ".$settingsFile." and press refresh");
fwrite($fh, $settingsContents);
fclose($fh);
// Create a duplicate version for the IP address of the domain if it doesn't exist yet
$serverAddr = $_SERVER['SERVER_ADDR'];
if ($serverAddr == "1" || $serverAddr == "::1") {
$serverAddr = "127.0.0.1";
}
$settingsFileAddr = 'config-'.$username.str_replace(".","_",$serverAddr).'.php';
if (!file_exists(dirname(__FILE__)."/".$settingsFileAddr)) {
if (!copy(dirname(__FILE__)."/".$settingsFile, dirname(__FILE__)."/".$settingsFileAddr)) {
die("Couldn't create $settingsFileAddr. Maybe you need write permissions on the lib folder?");
}
}
// Disable the enableRegistration config setting if the user had that option chosen
if (isset($_POST['disableFurtherRegistration'])) {
$updatedConfigSettingsFile = file_get_contents(dirname(__FILE__)."/".$configSettings);
if ($fUConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) {
$updatedConfigSettingsFile = str_replace('"enableRegistration" => true','"enableRegistration" => false',$updatedConfigSettingsFile);
fwrite($fUConfigSettings, $updatedConfigSettingsFile);
fclose($fUConfigSettings);
} else {
die("Cannot update config file lib/".$configSettings.". Please check write permissions on lib/ and try again");
}
}
// Set the session user level
if ($ICEcoder["multiUser"]) {
$_SESSION['username']=$_POST['username'];

View File

@@ -20,10 +20,10 @@ function startUpdate() {
echo 'Checking we can entirely move old ICEcoder version...<br>';
foreach ($iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),RecursiveIteratorIterator::SELF_FIRST) as $item) {
if (strpos($source.DIRECTORY_SEPARATOR.$iterator->getSubPathName(),"oldVersion")==false) {
// Don't move plugins or .git away
// Don't move backups, plugins or .git away
$testPath = $source.DIRECTORY_SEPARATOR.$iterator->getSubPathName();
$testPath = str_replace("\\","/",$testPath);
if (strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
if (strpos($testPath,"/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
if (!is_writeable($item)) {
array_push($cantMoveArray,substr($item,count($source)+2));
}
@@ -64,10 +64,10 @@ function copyOldVersion() {
echo 'Moving current ICEcoder files...<br>';
foreach ($iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),RecursiveIteratorIterator::SELF_FIRST) as $item) {
if (strpos($source.DIRECTORY_SEPARATOR.$iterator->getSubPathName(),"oldVersion")==false) {
// Don't move plugins or .git away
// Don't move backups, plugins or .git away
$testPath = $source.DIRECTORY_SEPARATOR.$iterator->getSubPathName();
$testPath = str_replace("\\","/",$testPath);
if (strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
if (strpos($testPath,"/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
if ($item->isDir()) {
mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0755);
} else {

View File

@@ -25,8 +25,10 @@ top.ICEcoder.switchMode = function(mode) {
fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
if (cM && mode) {
cM.setOption("mode",mode);
cMdiff.setOption("mode",mode);
if (mode != cM.getOption("mode")) {
cM.setOption("mode",mode);
cMdiff.setOption("mode",mode);
}
} else if (cM && fileName) {
fileExt = fileName.split(".");
fileExt = fileExt[fileExt.length-1];
@@ -51,14 +53,15 @@ top.ICEcoder.switchMode = function(mode) {
: fileExt == "go" ? "text/x-go"
: fileExt == "lua" ? "text/x-lua"
: fileExt == "pl" ? "text/x-perl"
: fileExt == "rs" ? "text/x-rustsrc"
: fileExt == "scss" ? "text/x-sass"
: "application/x-httpd-php";
cM.setOption("mode",mode);
cM.setOption("lint",(fileExt == "js" || fileExt == "json") && top.ICEcoder.codeAssist ? true : false);
cMdiff.setOption("mode",mode);
cMdiff.setOption("lint",(fileExt == "js" || fileExt == "json") && top.ICEcoder.codeAssist ? true : false);
if (mode != cM.getOption("mode")) {
cM.setOption("mode",mode);
cM.setOption("lint",(fileExt == "js" || fileExt == "json") && top.ICEcoder.codeAssist ? true : false);
cMdiff.setOption("mode",mode);
cMdiff.setOption("lint",(fileExt == "js" || fileExt == "json") && top.ICEcoder.codeAssist ? true : false);
}
}
}
@@ -67,7 +70,7 @@ top.ICEcoder.lineCommentToggleSub = function(cM, cursorPos, linePos, lineContent
var comments, startLine, endLine, commentCH, commentBS, commentBE;
// Language specific commenting
if (["JavaScript","CoffeeScript","PHP","Python","Ruby","CSS","SQL","Erlang","Julia","Java","YAML","C","C++","C#","Go","Lua","Perl","Rust","Sass"].indexOf(top.ICEcoder.caretLocType)>-1) {
if (["JavaScript","CoffeeScript","PHP","Python","Ruby","CSS","SQL","Erlang","Julia","Java","YAML","C","C++","C#","Go","Lua","Perl","Sass"].indexOf(top.ICEcoder.caretLocType)>-1) {
comments = {
"JavaScript" : ["// ", "/* ", " */"],
@@ -87,7 +90,6 @@ top.ICEcoder.lineCommentToggleSub = function(cM, cursorPos, linePos, lineContent
"Go" : ["// ", "/* ", " */"],
"Lua" : ["-- ", "--[[ ", " ]]"],
"Perl" : ["# ", "/* ", " */"],
"Rust" : ["// ", "/* ", " */"],
"Sass" : ["// ", "/* ", " */"]
}
@@ -159,7 +161,7 @@ top.ICEcoder.updateNestingIndicator = function() {
fileExt = fileName.split(".");
fileExt = fileExt[fileExt.length-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) {
if (thisCM && fileName && ["js","coffee","css","less","sql","erl","yaml","java","jl","c","cpp","ino","cs","go","lua","pl","scss"].indexOf(fileExt)==-1) {
testToken = thisCM.getTokenAt({line:thisCM.lineCount(),ch:thisCM.lineInfo(thisCM.lineCount()-1).text.length});
nestOK = testToken.type && testToken.type.indexOf("error") == -1 ? true : false;
}
@@ -209,7 +211,6 @@ top.ICEcoder.caretLocationType = function() {
: fileExt == "go" ? "Go"
: fileExt == "lua" ? "Lua"
: fileExt == "pl" ? "Perl"
: fileExt == "rs" ? "Rust"
: fileExt == "scss" ? "Sass"
: "Content";
}