mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-20 15:27:23 +01:00
Compare commits
118 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0027259e67 | ||
|
|
5337ff5fe9 | ||
|
|
749dc212d9 | ||
|
|
9d7565c317 | ||
|
|
9efbe9a9bf | ||
|
|
67e929dc75 | ||
|
|
a0e48b5088 | ||
|
|
667417262c | ||
|
|
83e7c62b9b | ||
|
|
8797e8f5e0 | ||
|
|
ee90c48a1c | ||
|
|
93c33162a1 | ||
|
|
068ec67c9d | ||
|
|
761f39407a | ||
|
|
227eefa332 | ||
|
|
1d6c60c19a | ||
|
|
a9402eb4ae | ||
|
|
d449623153 | ||
|
|
31d96eca3b | ||
|
|
3d8644ae4c | ||
|
|
893894f97b | ||
|
|
d992173967 | ||
|
|
483ac6cd6c | ||
|
|
e3868fb285 | ||
|
|
410ef385d5 | ||
|
|
d5c019d05a | ||
|
|
76b782535c | ||
|
|
2a998016eb | ||
|
|
f1a4710aea | ||
|
|
f8bbe45de7 | ||
|
|
f5d8384469 | ||
|
|
1266f73f64 | ||
|
|
cfee2c0182 | ||
|
|
afe4222eb6 | ||
|
|
f2017c17b3 | ||
|
|
f15a1b1d8e | ||
|
|
41f52cc3be | ||
|
|
3bfbc918f0 | ||
|
|
2c7a338dfb | ||
|
|
db518cf2c6 | ||
|
|
8e790bec60 | ||
|
|
f3edf9e2ae | ||
|
|
95a3d09672 | ||
|
|
1a654ec172 | ||
|
|
78117d52d0 | ||
|
|
157d9a40fa | ||
|
|
b5e78fb04c | ||
|
|
a2dea59b24 | ||
|
|
cc300f7edd | ||
|
|
1f0acdfe5f | ||
|
|
76c03cffff | ||
|
|
ae1188f81d | ||
|
|
313002e4a0 | ||
|
|
63364001ea | ||
|
|
1af9d60dd3 | ||
|
|
76fce1c2b8 | ||
|
|
67e28106f9 | ||
|
|
191990ffdb | ||
|
|
af318dd703 | ||
|
|
f83929584f | ||
|
|
c967325b7d | ||
|
|
11fe0ad17a | ||
|
|
8da4352ee4 | ||
|
|
8a1fec4e18 | ||
|
|
d686faf8a7 | ||
|
|
e8ef9e5195 | ||
|
|
6735caae36 | ||
|
|
eabae9bed4 | ||
|
|
5d23115c95 | ||
|
|
55692d3c49 | ||
|
|
3391b60836 | ||
|
|
2727bcb3e8 | ||
|
|
f6d19d2650 | ||
|
|
22bca280f5 | ||
|
|
20614885de | ||
|
|
6831cea155 | ||
|
|
9a4e93fc43 | ||
|
|
d44bc40c85 | ||
|
|
f8c1fbfbec | ||
|
|
94fe55cc14 | ||
|
|
e2f63a1d3b | ||
|
|
f8565d87b7 | ||
|
|
5a9cd5e85c | ||
|
|
09d34da6c3 | ||
|
|
d31db1de4e | ||
|
|
f388545412 | ||
|
|
f5705393ee | ||
|
|
1e7b735b7f | ||
|
|
6c12f36805 | ||
|
|
838612932c | ||
|
|
b9f08b160b | ||
|
|
fcf72f0d12 | ||
|
|
d1a2f6ab8f | ||
|
|
38693781a0 | ||
|
|
1fdb6c0086 | ||
|
|
1fce9834db | ||
|
|
095d626883 | ||
|
|
4b12f4f365 | ||
|
|
5d3ffae30c | ||
|
|
9b6a701ffc | ||
|
|
d909d5ce1c | ||
|
|
3d866fa2f2 | ||
|
|
6ed0861f5b | ||
|
|
4154b2bf3b | ||
|
|
59a18645c6 | ||
|
|
aa92f86aa9 | ||
|
|
444e7ef6b4 | ||
|
|
d9393bf059 | ||
|
|
904dee8f80 | ||
|
|
cca5836698 | ||
|
|
a406abd610 | ||
|
|
5cde633847 | ||
|
|
de5460b43f | ||
|
|
a66661b194 | ||
|
|
587132d81b | ||
|
|
ed7bde9d14 | ||
|
|
a10eb21d70 | ||
|
|
df78d5bb61 |
4
CodeMirror/addon/lint/lint.css
vendored
4
CodeMirror/addon/lint/lint.css
vendored
@@ -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;
|
||||
|
||||
22
CodeMirror/lib/codemirror-compressed.js
vendored
22
CodeMirror/lib/codemirror-compressed.js
vendored
File diff suppressed because one or more lines are too long
6
CodeMirror/theme/icecoder.css
vendored
6
CodeMirror/theme/icecoder.css
vendored
@@ -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; }
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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-7-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).
|
||||
|
||||
19
editor.php
19
editor.php
@@ -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"
|
||||
};
|
||||
@@ -272,8 +273,8 @@ function createNewCMInstance(num) {
|
||||
window['cM'+num+'diff'] .on("beforeSelectionChange", function(thisCM, changeObj) {top.ICEcoder.prevLineDiff = thisCM.getCursor().line;});
|
||||
|
||||
// Change
|
||||
window['cM'+num] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num,changeObj)});
|
||||
window['cM'+num+'diff'] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num+'diff',changeObj)});
|
||||
window['cM'+num] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num,changeObj,CodeMirror)});
|
||||
window['cM'+num+'diff'] .on("change", function(thisCM, changeObj) {top.ICEcoder.cMonChange(thisCM,'cM'+num+'diff',changeObj,CodeMirror)});
|
||||
|
||||
// Before change
|
||||
window['cM'+num] .on("beforeChange", function(thisCM, changeObj) {top.ICEcoder.cMonBeforeChange(thisCM,'cM'+num,changeObj,CodeMirror)});
|
||||
|
||||
@@ -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 |
48
index.php
48
index.php
@@ -3,28 +3,11 @@ include("lib/headers.php");
|
||||
include("lib/settings.php");
|
||||
$t = $text['index'];
|
||||
|
||||
// Check IP permissions
|
||||
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
||||
header('Location: /');
|
||||
die("Sorry, not in allowed IPs list");
|
||||
};
|
||||
|
||||
$updateMsg = '';
|
||||
// Check for updates
|
||||
if ($ICEcoder["checkUpdates"]) {
|
||||
$icv_url = "https://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"];
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$icvInfo = @file_get_contents($icv_url,false,$context);
|
||||
if (!$icvInfo) {
|
||||
$icvInfo = file_get_contents(str_replace("https:","http:",$icv_url), false, $context);
|
||||
}
|
||||
$icvInfo = explode("\n",$icvInfo);
|
||||
} elseif (function_exists('curl_init')) {
|
||||
$ch = curl_init($icv_url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$icvInfo = explode("\n", curl_exec($ch));
|
||||
}
|
||||
$icvInfo = explode("\n", getData($icv_url,'curl'));
|
||||
$icv = $icvInfo[0];
|
||||
$icvI = str_replace('"','\\\'',$icvInfo[1]);
|
||||
$thisV = $ICEcoder["versionNo"];
|
||||
@@ -37,7 +20,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 +36,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 +65,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 +77,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 +85,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"].";".
|
||||
@@ -168,7 +158,7 @@ $t = $text['index'];
|
||||
<span id="singleFileMenuItems">
|
||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()"><?php echo $t['Rename'];?></a>
|
||||
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
|
||||
<a nohref onClick="window.open(iceRoot + top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()" style="cursor: pointer"><?php echo $t['View Webpage'];?></a>
|
||||
<a nohref onClick="window.open('//<?php echo $_SERVER['HTTP_HOST'];?>' + iceRoot + top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()" style="cursor: pointer"><?php echo $t['View Webpage'];?></a>
|
||||
</span>
|
||||
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
|
||||
<?php
|
||||
@@ -234,14 +224,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">
|
||||
@@ -321,6 +313,8 @@ $t = $text['index'];
|
||||
<div class="nesting" id="nestValid"></div>
|
||||
<div class="versionsDisplay" id="versionsDisplay" onclick="top.ICEcoder.versionsScreen(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1].replace(/\//g,'|'))"></div>
|
||||
<div class="splitPaneControls" id="splitPaneControls"><div class="off" id="splitPaneControlsOff" title="<?php echo $t['Single pane'];?>" onclick="top.ICEcoder.setSplitPane('off')"></div><div class="on" id="splitPaneControlsOn" title="<?php echo $t['Diff pane also'];?>" onclick="top.ICEcoder.setSplitPane('on')" style="opacity: 0.5"></div></div>
|
||||
<div class="splitPaneNames" id="splitPaneNamesMain">Main Pane</div>
|
||||
<div class="splitPaneNames" id="splitPaneNamesDiff">Diff Pane</div>
|
||||
<div class="byteDisplay" id="byteDisplay" style="display: none" onClick="top.ICEcoder.showDisplay('char')"></div>
|
||||
<div class="charDisplay" id="charDisplay" style="display: inline-block" onClick="top.ICEcoder.showDisplay('byte')"></div>
|
||||
</div>
|
||||
|
||||
123
lang/dutch.php
123
lang/dutch.php
@@ -12,7 +12,6 @@ $text = array(
|
||||
|
||||
"editor" =>
|
||||
array(
|
||||
"Click icons for..." => "<strong>Klik op de icoontjes<br>voor hulp &<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ë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ërd",
|
||||
"into" => "naar",
|
||||
"Uploaded file(s) OK" => "Geü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 <div>",
|
||||
"Wrap with span" => "Omhullen met <span>",
|
||||
"Wrap unwrap p" => "Omhullen / onthullen met <p>",
|
||||
@@ -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",
|
||||
)
|
||||
);
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -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",
|
||||
@@ -145,8 +152,8 @@ $text = array(
|
||||
"Sorry, cannot delete more..." => "Sorry, cannot delete more then one item at a time under FTP mode",
|
||||
"Sorry, cannot delete..." => "Sorry, cannot delete the root level",
|
||||
"Sorry, cannot delete" => "Sorry, cannot delete",
|
||||
"Sorry, this file..." => "Sorry, this file has changed, cannot save",
|
||||
"Reload this file..." => "Reload this file and copy your version to a diff pane?",
|
||||
"Sorry, this file..." => "Sorry, this file has changed outside of ICEcoder, cannot save",
|
||||
"Reload this file..." => "Reload this file and copy your version to a diff pane?\\\\n(left side = file from server, right side = unsaved file)",
|
||||
"There was a..." => "There was a tech hiccup, likely something was not quite ready. So ICEcoder reloaded its file control again.",
|
||||
"displayed at" => "displayed at",
|
||||
"Enter filename to..." => "Enter filename to save at",
|
||||
@@ -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 base" => "Site base",
|
||||
"Host" => "Host",
|
||||
"Username" => "Username",
|
||||
"Password" => "Password",
|
||||
"PASV and mode" => "PASV and mode",
|
||||
"Root" => "Root",
|
||||
"eg http://yourdomain.com" => "eg http://yourdomain.com",
|
||||
"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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
28
lib/auto-logout-warning.css
Normal file
28
lib/auto-logout-warning.css
Normal 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}
|
||||
24
lib/auto-logout-warning.php
Normal file
24
lib/auto-logout-warning.php
Normal 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>
|
||||
@@ -6,7 +6,7 @@ include("settings.php");
|
||||
$file = str_replace("|","/",xssClean($_GET['file'],'html'));
|
||||
|
||||
// Get contents
|
||||
$loadedFile = toUTF8noBOM(file_get_contents("../backups/".$file,false,$context),true);
|
||||
$loadedFile = toUTF8noBOM(getData("../backups/".$file),true);
|
||||
$encoding=ini_get("default_charset");
|
||||
if($encoding=="")
|
||||
$encoding="UTF-8";
|
||||
|
||||
@@ -24,8 +24,25 @@ $versions = $fileCountInfo['count'];
|
||||
.CodeMirror {position: absolute; width: 409px; height: 180px; font-size: <?php echo $ICEcoder["fontSize"];?>}
|
||||
.CodeMirror-scroll {overflow: hidden}
|
||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||
.cm-tab {border-left-width: <?php echo $ICEcoder["visibleTabs"] ? "1px" : "0";?>; margin-left: <?php echo $ICEcoder["visibleTabs"] ? "-1px" : "0";?>; border-left-style: solid; border-left-color: rgba(255,255,255,0.2)}
|
||||
.cm-tab {border-left-width: <?php echo $ICEcoder["visibleTabs"] ? "1px" : "0";?>; margin-left: <?php echo $ICEcoder["visibleTabs"] ? "-1px" : "0";?>; border-left-style: solid; border-left-color: rgba(255,255,255,0.15)}
|
||||
.cm-trailingspace {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==);
|
||||
background-position: bottom left;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
.CodeMirror-foldmarker {font-family: arial; line-height: .3; color: #b00; cursor: pointer;
|
||||
text-shadow: #fff 1px 1px 2px, #fff -1px -1px 2px, #fff 1px -1px 2px, #fff -1px 1px 2px;
|
||||
}
|
||||
.CodeMirror-foldgutter {display: inline-block; width: 13px}
|
||||
.CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded {position: absolute; display: inline-block; width: 13px; height: 13px; font-size: 14px; text-align: center; cursor: pointer}
|
||||
.CodeMirror-foldgutter-open {background: rgba(255,255,255,0.04); color: #666}
|
||||
.CodeMirror-foldgutter-open:after {position: relative; top: -2px}
|
||||
.CodeMirror-foldgutter-folded {background: #800; color: #ddd}
|
||||
.CodeMirror-foldgutter-folded:after {position: relative; top: -3px}
|
||||
</style>
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/fold/foldcode.js?microtime=<?php echo microtime(true);?>"></script>
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/fold/foldgutter.js?microtime=<?php echo microtime(true);?>"></script>
|
||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/fold/foldgutter.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" href="editor.css?microtime=<?php echo microtime(true);?>">
|
||||
<?php
|
||||
$themeArray = array();
|
||||
@@ -74,9 +91,7 @@ foreach ($dateCounts as $key => $value) {
|
||||
<div style="display: none; width: 180px; margin-left: 30px" id="buttonsContainer">
|
||||
<div class="button" onclick="openNew()">Open in new tab</div>
|
||||
<div class="button" onclick="openDiff()">Open in diff mode</div>
|
||||
<!--
|
||||
<div class="button" onclick="alert('Function not available yet - Coming in v5.4')">Restore as new version</div>
|
||||
//-->
|
||||
<div class="button" onclick="restoreVersion()">Restore as new version</div>
|
||||
<div id="infoContainer"></div>
|
||||
</div>
|
||||
<div style="display: none">
|
||||
@@ -93,12 +108,27 @@ var highlightVersion = function(elem) {
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
echo "fileName = '".basename($file)."';";
|
||||
include(dirname(__FILE__)."/language-modes-partial.js");
|
||||
?>
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
readOnly: "nocursor",
|
||||
mode: mode,
|
||||
lineNumbers: top.ICEcoder.lineNumbers,
|
||||
gutters: ["CodeMirror-foldgutter","CodeMirror-lint-markers","CodeMirror-linenumbers"],
|
||||
foldGutter: {gutter: "CodeMirror-foldgutter"},
|
||||
foldOptions: {minFoldSize: 1},
|
||||
lineWrapping: top.ICEcoder.lineWrapping,
|
||||
indentWithTabs: top.ICEcoder.indentWithTabs,
|
||||
indentUnit: top.ICEcoder.indentSize,
|
||||
tabSize: top.ICEcoder.indentSize,
|
||||
mode: "javascript",
|
||||
matchBrackets: top.ICEcoder.matchBrackets,
|
||||
electricChars: false,
|
||||
highlightSelectionMatches: true,
|
||||
showTrailingSpace: top.ICEcoder.showTrailingSpace,
|
||||
lint: false,
|
||||
readOnly: "nocursor",
|
||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||
});
|
||||
editor.setSize("480px","500px");
|
||||
@@ -121,6 +151,18 @@ var openDiff = function() {
|
||||
top.ICEcoder.focus('diff');
|
||||
cMDiff.setValue(editor.getValue());
|
||||
}
|
||||
|
||||
var restoreVersion = function() {
|
||||
var cM;
|
||||
|
||||
if (top.ICEcoder.ask("To confirm - this will paste the displayed backup content to your current tab and save, OK?")) {
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
top.ICEcoder.focus();
|
||||
cM.setValue(editor.getValue());
|
||||
top.ICEcoder.saveFile();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
$ICEcoderUserSettings = array(
|
||||
"versionNo" => "5.4",
|
||||
"versionNo" => "5.7",
|
||||
"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" => "",
|
||||
|
||||
@@ -6,7 +6,7 @@ include("settings.php");
|
||||
$file = realpath($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['file'])));
|
||||
// If it doesn't exist, or doesn't start with the $docRoot, stop here
|
||||
if (!file_exists($file) || strpos(str_replace("\\","/",$file),$docRoot) !== 0) {
|
||||
die("<script>alert('Sorry, that file doesn\'t appear to exist');</script>");
|
||||
die("<script>top.ICEcoder.message('Sorry, that file doesn\'t appear to exist');</script>");
|
||||
}
|
||||
|
||||
if (file_exists($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}
|
||||
@@ -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='.numClean($_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'])) {
|
||||
@@ -332,7 +319,7 @@ if (!$error && $_GET['action']=="save") {
|
||||
// get old file contents, and count stats on usage \n and \r there
|
||||
// in this case we can keep line endings, which file had before, without
|
||||
// making code version control systems going crazy about line endings change in whole file.
|
||||
$oldContents = file_exists($file)?file_get_contents($file):'';
|
||||
$oldContents = file_exists($file)?getData($file):'';
|
||||
$unixNewLines = preg_match_all('/[^\r][\n]/u', $oldContents);
|
||||
$windowsNewLines = preg_match_all('/[\r][\n]/u', $oldContents);
|
||||
} else {
|
||||
@@ -412,7 +399,7 @@ if (!$error && $_GET['action']=="save") {
|
||||
// Have a version index already? Update contents
|
||||
if (file_exists($backupIndex)) {
|
||||
$versionsInfo = "";
|
||||
$versionsInfoOrig = file_get_contents($backupIndex,false,$context);
|
||||
$versionsInfoOrig = getData($backupIndex);
|
||||
$versionsInfoOrig = explode("\n",$versionsInfoOrig);
|
||||
$replacedLine = false;
|
||||
// For each line, either re-set number or simply include the line
|
||||
@@ -464,7 +451,7 @@ if (!$error && $_GET['action']=="save") {
|
||||
// Reload previewWindow window if not a Markdown file
|
||||
// In doing this, we check on an interval for the page to be complete and if we last saw it loading
|
||||
// When we are done loading, so set the loading status to false and load plugins ontop...
|
||||
$doNext .= 'if (top.ICEcoder.previewWindow.location && top.ICEcoder.previewWindow.location.pathname.indexOf(".md")==-1) {
|
||||
$doNext .= 'if (top.ICEcoder.previewWindow.location && top.ICEcoder.previewWindow.location.pathname && top.ICEcoder.previewWindow.location.pathname.indexOf(".md")==-1) {
|
||||
top.ICEcoder.previewWindowLoading = false;
|
||||
top.ICEcoder.previewWindow.location.reload(true);
|
||||
|
||||
@@ -508,7 +495,7 @@ if (!$error && $_GET['action']=="save") {
|
||||
|
||||
} else {
|
||||
// Only applicable for local files
|
||||
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||
$loadedFile = toUTF8noBOM(getData($file),true);
|
||||
$fileCountInfo = getVersionsCount($fileLoc,$fileName);
|
||||
$doNext .= '
|
||||
var loadedFile = document.createElement("textarea");
|
||||
@@ -865,7 +852,7 @@ function rrmdir($dir) {
|
||||
|
||||
if (!isset($ftpSite) && !$error && $_GET['action']=="replaceText") {
|
||||
if (!$demoMode && is_writable($file)) {
|
||||
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||
$loadedFile = toUTF8noBOM(getData($file),true);
|
||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||
$fh = fopen($file, 'w') or die($t['Sorry, cannot save']);
|
||||
fwrite($fh, $newContent);
|
||||
@@ -886,7 +873,7 @@ if (!isset($ftpSite) && !$error && $_GET['action']=="replaceText") {
|
||||
|
||||
if (!isset($ftpSite) && !$error && $_GET['action']=="getRemoteFile") {
|
||||
$lineNumber = max(isset($_REQUEST['lineNumber'])?intval($_REQUEST['lineNumber']):1, 1);
|
||||
if ($remoteFile = toUTF8noBOM(file_get_contents($file,false,$context),true)) {
|
||||
if ($remoteFile = toUTF8noBOM(getData($file,'curl'),true)) {
|
||||
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
|
||||
$remoteFile = str_replace("\r\n", $ICEcoder["lineEnding"], $remoteFile);
|
||||
$remoteFile = str_replace("\r", $ICEcoder["lineEnding"], $remoteFile);
|
||||
@@ -959,7 +946,7 @@ if (!isset($filemtime) && !is_dir($file)) {
|
||||
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
||||
}
|
||||
// Set $timeStart, use 0 if not available
|
||||
$timeStart = isset($_POST["timeStart"]) ? $_POST["timeStart"] : 0;
|
||||
$timeStart = isset($_POST["timeStart"]) ? numClean($_POST["timeStart"]) : 0;
|
||||
|
||||
if (isset($ftpSite)) {
|
||||
// Get info on dir/file now
|
||||
@@ -992,12 +979,12 @@ echo '{
|
||||
"exists": '.$itemExists.'
|
||||
},
|
||||
"action": {
|
||||
"initial" : "'.$_GET["action"].'",
|
||||
"initial" : "'.xssClean($_GET['action'],"html").'",
|
||||
"final" : "'.$finalAction.'",
|
||||
"timeStart": '.$timeStart.',
|
||||
"timeEnd": 0,
|
||||
"timeTaken": 0,
|
||||
"csrf": "'.$_GET["csrf"].'",
|
||||
"csrf": "'.xssClean($_GET['csrf'],"html").'",
|
||||
"doNext" : "'.preg_replace('/\r|\n/','',str_replace(' ','',str_replace('"','\"',$doNext))).'top.ICEcoder.switchMode();"
|
||||
},
|
||||
"status": {
|
||||
|
||||
@@ -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>
|
||||
@@ -67,7 +59,7 @@ for ($i=0; $i<count($allFiles); $i++) {
|
||||
// Or a remote URL that doesn't start http
|
||||
($_GET['action']=="getRemoteFile" && strpos($allFiles[$i],"http") !== 0)
|
||||
) {
|
||||
die("alert('Sorry! - problem with file requested');</script>");
|
||||
die("top.ICEcoder.message('Sorry! - problem with file requested');</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')) {
|
||||
@@ -97,7 +97,7 @@ if ($_GET['action']=="load") {
|
||||
ftpStart();
|
||||
// Show user warning if no good connection
|
||||
if (!$ftpConn || !$ftpLogin) {
|
||||
die('alert("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>');
|
||||
die('top.ICEcoder.message("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>');
|
||||
exit;
|
||||
}
|
||||
// Get our file contents and close the FTP connection
|
||||
@@ -105,12 +105,12 @@ if ($_GET['action']=="load") {
|
||||
ftpEnd();
|
||||
// Get local file
|
||||
} else {
|
||||
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||
$loadedFile = toUTF8noBOM(getData($file),true);
|
||||
}
|
||||
$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';
|
||||
@@ -216,10 +216,13 @@ if (action=="load") {
|
||||
"<div class=\"whiteGlow\" style=\"display: inline-block; margin-top: -10px; border: solid 10px #fff; color: #000; background-color: #fff\" id=\"imgInfo\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\">" +
|
||||
"<b><?php echo $fileLoc."/".$fileName;?></b>" +
|
||||
"</div><br>" +
|
||||
"<div id=\"canvasPickerColorInfo\">"+
|
||||
"<input type=\"text\" id=\"hexMouseXY\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||
"<input type=\"text\" id=\"rgbMouseXY\" style=\"border: 1px solid #888; margin-right: 10px; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||
"<input type=\"text\" id=\"hex\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||
"<input type=\"text\" id=\"rgb\" style=\"border: 1px solid #888; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>";
|
||||
"<input type=\"text\" id=\"rgb\" style=\"border: 1px solid #888; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>"+
|
||||
"</div>"+
|
||||
"<div id=\"canvasPickerCORSInfo\" style=\"display: none; padding-top: 4px\">CORS not enabled on resource site</div>";
|
||||
top.document.getElementById('floatingContainer').style.background = "#fff url('<?php echo $fileLoc."/".$fileName;?>') no-repeat 0 0";
|
||||
}
|
||||
|
||||
|
||||
@@ -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
37
lib/ftp-manager.css
Normal 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
212
lib/ftp-manager.php
Normal 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 = getData($settingsFile);
|
||||
|
||||
// ========
|
||||
// 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" => "'.injClean($_POST['ftpSiteNEW']).'",
|
||||
"host" => "'.injClean($_POST['ftpHostNEW']).'",
|
||||
"user" => "'.injClean($_POST['ftpUserNEW']).'",
|
||||
"pass" => "'.injClean($_POST['ftpPassNEW']).'",
|
||||
"pasv" => '.injClean($_POST['ftpPASVNEW']).',
|
||||
"mode" => "'.injClean($_POST['ftpModeNEW']).'",
|
||||
"root" => "'.injClean($_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" => "'.injClean($_POST['ftpSiteNEW']).'",
|
||||
"host" => "'.injClean($_POST['ftpHostNEW']).'",
|
||||
"user" => "'.injClean($_POST['ftpUserNEW']).'",
|
||||
"pass" => "'.injClean($_POST['ftpPassNEW']).'",
|
||||
"pasv" => '.injClean($_POST['ftpPASVNEW']).',
|
||||
"mode" => "'.injClean($_POST['ftpModeNEW']).'",
|
||||
"root" => "'.injClean($_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=".numClean($_GET['ftpSiteRef']) : "add";?>" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="padding-left: 5px"><?php echo $t['Site base'];?> <span class="info" title="<?php echo $t['eg http://yourdomain.com'];?>">[?]</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'][numClean($_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'][numClean($_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'][numClean($_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'][numClean($_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'][numClean($_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>
|
||||
@@ -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) {
|
||||
@@ -230,7 +230,7 @@ if (!isset($ftpSite) && $_SESSION['githubDiff']) {
|
||||
// If we're not looking at a .git dir, it's not a .gitignore excluded path and not a dir
|
||||
if (strpos($fileFolderName,".git/") == false && !in_array($docRoot.$iceRoot.$fileFolderName, $excluded) && !is_dir($docRoot.$iceRoot.$fileFolderName)) {
|
||||
// Get contents of file
|
||||
$contents = file_get_contents($docRoot.$iceRoot.$fileFolderName);
|
||||
$contents = getData($docRoot.$iceRoot.$fileFolderName);
|
||||
|
||||
$finfo = "text";
|
||||
// Determine if we should remove \r line endings based on mime type (text files yes, others no)
|
||||
|
||||
@@ -9,7 +9,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
// Get our old paths & user settings
|
||||
$oldLocal = $ICEcoder["githubLocalPaths"];
|
||||
$oldRemote = $ICEcoder["githubRemotePaths"];
|
||||
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||
$settingsContents = getData($settingsFile);
|
||||
|
||||
// ========
|
||||
// CHOOSING
|
||||
@@ -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 {
|
||||
@@ -73,7 +77,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
|
||||
// Add the new one
|
||||
if ($_POST['githubLocalPathNEW'] != "" && $_POST['githubRemotePathNEW'] != "") {
|
||||
$settingsNew .= '"'.xssClean($_POST['githubLocalPathNEW'],"html").'",';
|
||||
$settingsNew .= '"'.injClean(xssClean($_POST['githubLocalPathNEW'],"html")).'",';
|
||||
}
|
||||
|
||||
// Then set all the old local paths
|
||||
@@ -89,7 +93,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
|
||||
// Add the new one
|
||||
if ($_POST['githubLocalPathNEW'] != "" && $_POST['githubRemotePathNEW'] != "") {
|
||||
$settingsNew .= '"'.xssClean($_POST['githubRemotePathNEW'],"html").'",';
|
||||
$settingsNew .= '"'.injClean(xssClean($_POST['githubRemotePathNEW'],"html")).'",';
|
||||
}
|
||||
|
||||
// Then set all the old remote paths
|
||||
@@ -114,7 +118,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
// Redo the arrays using the form data
|
||||
for ($i=0; $i<count($oldLocal); $i++) {
|
||||
if ($_POST['githubLocalPath'.$i] != "") {
|
||||
$settingsNew .= '"'.xssClean($_POST['githubLocalPath'.$i],"html").'",';
|
||||
$settingsNew .= '"'.injClean(xssClean($_POST['githubLocalPath'.$i],"html")).'",';
|
||||
}
|
||||
}
|
||||
// Rtrim off the last comma
|
||||
@@ -127,7 +131,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
// Redo the arrays using the form data
|
||||
for ($i=0; $i<count($oldRemote); $i++) {
|
||||
if ($_POST['githubRemotePath'.$i] != "") {
|
||||
$settingsNew .= '"'.xssClean($_POST['githubRemotePath'.$i],"html").'",';
|
||||
$settingsNew .= '"'.injClean(xssClean($_POST['githubRemotePath'.$i],"html")).'",';
|
||||
}
|
||||
}
|
||||
// Rtrim off the last comma
|
||||
|
||||
@@ -88,14 +88,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$zipURL = $iceGithubRemotePaths[$pathPos].'/zipball/master';
|
||||
$zipFile = "../tmp/".basename($zipURL);
|
||||
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$fileData = file_get_contents($zipURL, false, $context);
|
||||
} elseif (function_exists('curl_init')) {
|
||||
$client = curl_init($zipURL);
|
||||
curl_setopt($client, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($client, CURLOPT_RETURNTRANSFER, 1); //fixed this line
|
||||
$fileData = curl_exec($client);
|
||||
}
|
||||
$fileData = getData($zipURL,'curl');
|
||||
file_put_contents($zipFile, $fileData);
|
||||
|
||||
// Now unpack the zip
|
||||
@@ -189,10 +182,10 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
|
||||
// Only get the file if it exists and begins with our $docRoot
|
||||
if (file_exists($file) && strpos($file,$docRoot) === 0) {
|
||||
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||
$loadedFile = toUTF8noBOM(getData($file),true);
|
||||
echo '<textarea name="loadedFile'.$i.'" id="loadedFile'.$i.'" style="display: none">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$loadedFile)).'</textarea><br><br>'.PHP_EOL.PHP_EOL;
|
||||
} else {
|
||||
die("<script>alert('Sorry, that file doesn\'t appear to exist');</script>");
|
||||
die("<script>top.ICEcoder.message('Sorry, that file doesn\'t appear to exist');</script>");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
37
lib/go-localhost-root.php
Normal file
37
lib/go-localhost-root.php
Normal 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 = getData($settingsFile);
|
||||
// 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
|
||||
;};
|
||||
?>
|
||||
@@ -141,6 +141,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
.footer .splitPaneControls {position: absolute; display: inline-block; width: 50px; text-align: center; padding: 6px}
|
||||
.footer .splitPaneControls .off {display: inline-block; width: 18px; height: 18px; margin-right: 10px; background: url('../images/split-pane-controls.gif') no-repeat 0 0; cursor: pointer}
|
||||
.footer .splitPaneControls .on {display: inline-block; width: 19px; height: 18px; background: url('../images/split-pane-controls.gif') no-repeat -18px 0; cursor: pointer}
|
||||
.footer .splitPaneNames {position: absolute; display: inline-block; width: 100px; text-align: center; margin-top: 9px; color: #555; opacity: 0; transition: opacity 0.3s ease-in-out}
|
||||
.footer .charDisplay, .footer .byteDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; margin-right: 10px; right: 0; font-weight: bold; font-size: 12px; color: #fff; text-align: right; text-align: right; cursor: pointer}
|
||||
|
||||
.fileMenu {position: absolute; display: none; left: 0; top: 0; background-color: #333; z-index: 10;
|
||||
|
||||
318
lib/ice-coder.js
318
lib/ice-coder.js
@@ -47,7 +47,7 @@ var ICEcoder = {
|
||||
pluginIntervalRefs: [], // Array of plugin interval refs
|
||||
overPopup: false, // Indicates if we're over a popup or not
|
||||
cmdKey: false, // Tracking apple Command key up/down state
|
||||
endTagReplaceData: [], // Will contain data for automatic end tag replacement
|
||||
oppTagReplaceData: [], // Will contain data for automatic opposite tag replacement to sync them
|
||||
fmReady: false, // Indicates if the file manager is ready for action
|
||||
bugReportStatus: "off", // Values of: off, error, ok, bugs
|
||||
bugReportPath: "", // Bug report file path
|
||||
@@ -56,15 +56,17 @@ var ICEcoder = {
|
||||
githubDiff: false, // Toggle for viewing GitHub/FM diff view
|
||||
githubAuthTokenSet: false, // Has the user set their GitHub token yet
|
||||
splitPane: false, // Single or split pane editing
|
||||
splitPaneLeftPerc: 100, // Width of left pane as a percentage
|
||||
renderLineStyle: [], // Array of styles to apply on renderLine event
|
||||
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
|
||||
initAliases: function() {
|
||||
var aliasArray = ["header","files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame","editor","tabsBar","findBar","content","footer","nestValid","versionsDisplay","splitPaneControls","charDisplay","byteDisplay"];
|
||||
var aliasArray = ["header","files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame", "editor", "tabsBar", "findBar", "content", "footer", "nestValid", "versionsDisplay", "splitPaneControls", "splitPaneNamesMain", "splitPaneNamesDiff", "charDisplay", "byteDisplay"];
|
||||
|
||||
// Create our ID aliases
|
||||
for (var i=0;i<aliasArray.length;i++) {
|
||||
@@ -104,6 +106,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;
|
||||
},
|
||||
@@ -129,6 +165,8 @@ var ICEcoder = {
|
||||
this.nestValid.style.left = (this.filesW+10) + "px";
|
||||
this.versionsDisplay.style.left = (this.filesW+25) + "px";
|
||||
this.splitPaneControls.style.left = (parseInt((winW-this.filesW)/2,10)-25-4+this.filesW) + "px";
|
||||
this.splitPaneNamesMain.style.left = (parseInt((winW-this.filesW)*0.25,10)-50+this.filesW) + "px";
|
||||
this.splitPaneNamesDiff.style.left = (parseInt((winW-this.filesW)*0.75,10)-50+this.filesW) + "px";
|
||||
top.ICEcoder.setTabWidths();
|
||||
|
||||
// If we need to set the editor sizes
|
||||
@@ -140,12 +178,13 @@ var ICEcoder = {
|
||||
setTimeout(function(){
|
||||
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||
// Done the long way here as we need to call them in specific order to stop showing background and so avoiding a flicker effect
|
||||
if (!top.ICEcoder.splitPane) {
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setSize(top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height);
|
||||
}
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setSize((100-top.ICEcoder.splitPaneLeftPerc)+"%",top.ICEcoder.content.style.height);
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].getWrapperElement().style.left = top.ICEcoder.splitPaneLeftPerc+"%";
|
||||
if (top.ICEcoder.splitPane) {
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setSize("50%",top.ICEcoder.content.style.height);
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setSize("50%",top.ICEcoder.content.style.height);
|
||||
} else {
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setSize("100%",top.ICEcoder.content.style.height);
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]+'diff'].setSize("0",top.ICEcoder.content.style.height);
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setSize(top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height);
|
||||
}
|
||||
}
|
||||
// Place resultsBar to edge of pane or it's scrollbar
|
||||
@@ -165,6 +204,7 @@ var ICEcoder = {
|
||||
top.ICEcoder.splitPane = onOff == "on" ? true : false;
|
||||
top.get('splitPaneControlsOff').style.opacity = top.ICEcoder.splitPane ? 0.5 : 1;
|
||||
top.get('splitPaneControlsOn').style.opacity = top.ICEcoder.splitPane ? 1 : 0.5;
|
||||
top.get('splitPaneNamesMain').style.opacity = top.get('splitPaneNamesDiff').style.opacity = top.ICEcoder.splitPane ? 1 : 0;
|
||||
top.ICEcoder.setLayout();
|
||||
|
||||
// Also clear marks (if going to a single pane) or redo the marks (if split pane)
|
||||
@@ -177,17 +217,40 @@ var ICEcoder = {
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cMdiff = top.ICEcoder.getcMdiffInstance();
|
||||
|
||||
// Clear all main pane marks
|
||||
cMmarks = cM.getAllMarks();
|
||||
for (var i=0; i<cMmarks.length; i++) {
|
||||
cMmarks[i].clear();
|
||||
}
|
||||
// Clear all diff pane marks
|
||||
cMdiffMarks = cMdiff.getAllMarks();
|
||||
for (var i=0; i<cMdiffMarks.length; i++) {
|
||||
cMdiffMarks[i].clear();
|
||||
if (cM) {
|
||||
// Clear all main pane marks
|
||||
cMmarks = cM.getAllMarks();
|
||||
for (var i=0; i<cMmarks.length; i++) {
|
||||
cMmarks[i].clear();
|
||||
}
|
||||
// Clear all diff pane marks
|
||||
cMdiffMarks = cMdiff.getAllMarks();
|
||||
for (var i=0; i<cMdiffMarks.length; i++) {
|
||||
cMdiffMarks[i].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Animate in/out the split pane
|
||||
// First, clear any existing split pane interval anim
|
||||
if ("undefined" != typeof top.ICEcoder.animSplitPaneInt) {
|
||||
clearInterval(top.ICEcoder.animSplitPaneInt);
|
||||
}
|
||||
// Now set the interval to animate it in/out
|
||||
top.ICEcoder.animSplitPaneInt = setInterval(function() {
|
||||
// Animate split pane in
|
||||
if (top.ICEcoder.splitPane && top.ICEcoder.splitPaneLeftPerc > 50.1) {
|
||||
top.ICEcoder.splitPaneLeftPerc = ((top.ICEcoder.splitPaneLeftPerc-50)/1.8)+50;
|
||||
// Animate split pane out
|
||||
} else if (!top.ICEcoder.splitPane && top.ICEcoder.splitPaneLeftPerc < 99.9) {
|
||||
top.ICEcoder.splitPaneLeftPerc = (50-((100-top.ICEcoder.splitPaneLeftPerc)/1.8))+50;
|
||||
// Finish animating split pane in/out
|
||||
} else {
|
||||
top.ICEcoder.splitPaneLeftPerc = top.ICEcoder.splitPane ? 50 : 100;
|
||||
clearInterval(top.ICEcoder.animSplitPaneInt);
|
||||
}
|
||||
top.ICEcoder.setLayout();
|
||||
},4);
|
||||
},
|
||||
|
||||
// Set the width of the file manager on demand
|
||||
@@ -252,7 +315,7 @@ var ICEcoder = {
|
||||
// EDITOR
|
||||
// ==============
|
||||
|
||||
// On key up
|
||||
// On focus
|
||||
cMonFocus: function(thisCM,cMinstance) {
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
@@ -331,34 +394,25 @@ var ICEcoder = {
|
||||
|
||||
// On before change
|
||||
cMonBeforeChange: function(thisCM,cMinstance,changeObj,cM) {
|
||||
var sels, tokenString, range, canMaybeReplace, thisData;
|
||||
var sels, tagInfo, tagOpp, thisData;
|
||||
|
||||
// Get the selections
|
||||
sels = thisCM.listSelections();
|
||||
|
||||
// For each of the user selections
|
||||
sels = thisCM.listSelections();
|
||||
for (var i=0; i<sels.length; i++) {
|
||||
// Get the token at the cursor start (anchor) position
|
||||
tokenString = thisCM.getTokenAt(sels[i].anchor);
|
||||
// If we're just inside a tag, move along 1 char pos and get token info at that position
|
||||
if (tokenString.type == "tag bracket" && tokenString.string == "<") {
|
||||
tokenString = thisCM.getTokenAt({line: sels[i].anchor.line, ch: sels[i].anchor.ch+1});
|
||||
}
|
||||
// If we're inside a tag now
|
||||
if (tokenString.type == "tag") {
|
||||
// Test for range info
|
||||
range = cM.fold['xml'](thisCM, sels[i].anchor);
|
||||
canMaybeReplace = true;
|
||||
for (var j=0; j<top.ICEcoder.endTagReplaceData.length; j++) {
|
||||
// If we have range info and we're start and end are on the same line
|
||||
if ("undefined" != typeof range && top.ICEcoder.endTagReplaceData[j].split(";")[1] == range.to.line + ":" + range.to.ch) {
|
||||
canMaybeReplace = false;
|
||||
}
|
||||
}
|
||||
// If we can still replace and have range info and not undoing/redoing (as that replaces chunks itself)
|
||||
if (canMaybeReplace && "undefined" != typeof range && changeObj.origin != "undo" && changeObj.origin != "redo") {
|
||||
// Work out the data string to set and if not in array, push in ready to handle on change event
|
||||
thisData = tokenString.string + ";" + range.to.line + ":" + range.to.ch;
|
||||
if (top.ICEcoder.endTagReplaceData.indexOf(thisData) == -1) {
|
||||
top.ICEcoder.endTagReplaceData.push(thisData);
|
||||
// Get the matching tagInfo for current cursor position
|
||||
tagInfo = cM.findMatchingTag(thisCM, sels[i].anchor);
|
||||
// If we're not ending a tag (autocompletion) and we have tagInfo and not undoing/redoing (which handles changes itself)
|
||||
if (changeObj.text[0].indexOf(">") !== 0 && "undefined" != typeof tagInfo && changeObj.origin != "undo" && changeObj.origin != "redo") {
|
||||
// If we also have both open and close tag info
|
||||
if ("undefined" != typeof tagInfo.open && "undefined" != typeof tagInfo.close) {
|
||||
// Log the opposite tag info
|
||||
tagOpp = tagInfo.at == "open" ? "close" : "open";
|
||||
thisData = tagInfo[tagOpp].tag + ";" + tagInfo[tagOpp].from.line + ":" + tagInfo[tagOpp].from.ch;
|
||||
// Check that string firstly isn't in array and if not, push it in
|
||||
if (top.ICEcoder.oppTagReplaceData.indexOf(thisData) == -1) {
|
||||
top.ICEcoder.oppTagReplaceData.push(thisData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,8 +420,11 @@ var ICEcoder = {
|
||||
},
|
||||
|
||||
// On change
|
||||
cMonChange: function(thisCM,cMinstance,changeObj) {
|
||||
var rData, thisToken, repl1, repl2, tTS, filepath, filename, fileExt;
|
||||
cMonChange: function(thisCM,cMinstance,changeObj,cM) {
|
||||
var sels, rData, theTag, thisLine, thisChar, tagInfo, charDiff, closeDiff, repl1, repl2, thisToken, tTS, filepath, filename, fileExt;
|
||||
|
||||
// Get the selections
|
||||
sels = thisCM.listSelections();
|
||||
|
||||
// If we're not loading the file, it's a change, so update tab
|
||||
if (!top.ICEcoder.loadingFile) {
|
||||
@@ -380,34 +437,55 @@ var ICEcoder = {
|
||||
top.ICEcoder.setLayout();
|
||||
},0);
|
||||
|
||||
// If we're replacing end tag strings, do that
|
||||
if (top.ICEcoder.endTagReplaceData.length > 0) {
|
||||
|
||||
// If we're replacing opposite tag strings, do that
|
||||
if ("undefined" != typeof top.ICEcoder.oppTagReplaceData[0]) {
|
||||
// For each one of them, grab our data to work with
|
||||
for (var i=0; i<top.ICEcoder.endTagReplaceData.length; i++) {
|
||||
rData = top.ICEcoder.endTagReplaceData[i].split(";");
|
||||
for (var i=0; i<top.ICEcoder.oppTagReplaceData.length; i++) {
|
||||
// Extract data from that string
|
||||
rData = top.ICEcoder.oppTagReplaceData[i].split(";");
|
||||
theTag = rData[0];
|
||||
thisLine = rData[1].split(":")[0]*1;
|
||||
thisChar = rData[1].split(":")[1]*1;
|
||||
|
||||
// Don't do anything if it's the same line, as we can't rely on fold range data due to nested tags
|
||||
if (rData[1].split(":")[0]*1 == changeObj.from.line) {
|
||||
continue;
|
||||
// Get the tag info for matching tag
|
||||
if (sels[i]) {
|
||||
tagInfo = cM.findMatchingTag(thisCM, sels[i].anchor);
|
||||
}
|
||||
// Otherwise, work out the replace ranges
|
||||
repl1 = {line: rData[1].split(":")[0]*1, ch: (rData[1].split(":")[1]*1)+2};
|
||||
repl2 = {line: rData[1].split(":")[0]*1, ch: (rData[1].split(":")[1]*1)+2+rData[0].length};
|
||||
// Establish the string to replace with
|
||||
thisToken = thisCM.getTokenAt(thisCM.listSelections()[i].anchor);
|
||||
tTS = thisToken.string;
|
||||
if (tTS == "<" ) {
|
||||
tTS = "";
|
||||
|
||||
// If we have tagInfo
|
||||
if ("undefined" != typeof tagInfo) {
|
||||
// Get the opposite tag string
|
||||
theTag = tagInfo.at == "open" ? tagInfo.open.tag : tagInfo.close.tag;
|
||||
// If we have changeObj.from info to work with
|
||||
if ("undefined" != typeof changeObj.from) {
|
||||
// Same line changing needs a chararacter pos shift
|
||||
charDiff = thisLine == changeObj.from.line
|
||||
? changeObj.text[0].length - changeObj.removed[0].length
|
||||
: 0;
|
||||
// Also need to adjust if we're in the close tag on same line
|
||||
closeDiff = tagInfo.at == "close" && thisLine == changeObj.from.line
|
||||
? changeObj.removed[0].length - changeObj.text[0].length + 1
|
||||
: 1
|
||||
// Work out the replace from and to positions
|
||||
repl1 = {line: thisLine, ch: thisChar+charDiff+(tagInfo.at == "open" ? 2 : closeDiff)};
|
||||
repl2 = {line: thisLine, ch: thisChar+charDiff+(tagInfo.at == "open" ? 2 : closeDiff)+rData[0].length};
|
||||
}
|
||||
}
|
||||
// Replace our string over the range
|
||||
// Disabled for now, as buggy
|
||||
// thisCM.replaceRange(tTS, repl1, repl2);
|
||||
|
||||
// Replace our string over the range, if this token string isn't blank and the end tag matches our original tag
|
||||
if (theTag.trim() != "" && "undefined" != typeof repl1 && "undefined" != typeof repl2 && thisCM.getRange(repl1,repl2) == rData[0]) {
|
||||
thisCM.replaceRange(theTag, repl1, repl2);
|
||||
// If at the close tag, don't autocomplete
|
||||
if (tagInfo.at == "close") {
|
||||
top.ICEcoder.autocompleteSkip = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// Reset the array ready for next time
|
||||
top.ICEcoder.endTagReplaceData = [];
|
||||
// Reset our array for next time
|
||||
top.ICEcoder.oppTagReplaceData = [];
|
||||
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
@@ -449,8 +527,10 @@ var ICEcoder = {
|
||||
cMdiff = top.ICEcoder.getcMdiffInstance();
|
||||
otherCM = cMinstance.indexOf('diff') > -1 ? cM : cMdiff;
|
||||
|
||||
// Scroll other pane x & y to match this one we're scrolling, after a 0ms tickover to avoid judder
|
||||
setTimeout(function(){otherCM.scrollTo(thisCM.getScrollInfo().left, thisCM.getScrollInfo().top);},0);
|
||||
if (cM) {
|
||||
// Scroll other pane x & y to match this one we're scrolling, after a 0ms tickover to avoid judder
|
||||
setTimeout(function(){otherCM.scrollTo(thisCM.getScrollInfo().left, thisCM.getScrollInfo().top);},0);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
@@ -462,7 +542,11 @@ var ICEcoder = {
|
||||
// clearTimeout(top.ICEcoder.debounce);
|
||||
if (!thisCM.state.completionActive) {
|
||||
// top.ICEcoder.debounce = setTimeout(function() {
|
||||
top.ICEcoder.autocomplete();
|
||||
if (!top.ICEcoder.autocompleteSkip) {
|
||||
top.ICEcoder.autocomplete();
|
||||
} else {
|
||||
top.ICEcoder.autocompleteSkip = false;
|
||||
}
|
||||
// },0);
|
||||
}
|
||||
}
|
||||
@@ -2386,10 +2470,33 @@ var ICEcoder = {
|
||||
img = new Image();
|
||||
img.crossOrigin = "Anonymous";
|
||||
img.src = imgThis.src;
|
||||
|
||||
// Issue with loading, display CORS error info
|
||||
img.onerror = function() {
|
||||
get('floatingContainer').style.visibility = "hidden";
|
||||
get('canvasPickerColorInfo').style.display = "none";
|
||||
get('canvasPickerCORSInfo').style.display = "block";
|
||||
}
|
||||
|
||||
// On image load
|
||||
img.onload = function() {
|
||||
// Get width and height and draw this image into the canvas
|
||||
top.get('canvasPicker').width = imgThis.width;
|
||||
top.get('canvasPicker').height = imgThis.height;
|
||||
canvas.drawImage(img,0,0,imgThis.width,imgThis.height);
|
||||
|
||||
// Display color picker info and hide CORS message
|
||||
get('canvasPickerColorInfo').style.display = "block";
|
||||
get('canvasPickerCORSInfo').style.display = "none";
|
||||
|
||||
// Show image preview box on mouse over
|
||||
top.get('canvasPicker').onmouseover = function(event) {
|
||||
get('floatingContainer').style.visibility = "visible";
|
||||
};
|
||||
// Hide image preview box on mouse out
|
||||
top.get('canvasPicker').onmouseout = function(event) {
|
||||
get('floatingContainer').style.visibility = "hidden";
|
||||
};
|
||||
}
|
||||
|
||||
top.document.getElementById('floatingContainer').style.backgroundSize = (imgThis.naturalWidth*5)+"px "+(imgThis.naturalHeight*5)+"px";
|
||||
@@ -2432,18 +2539,11 @@ var ICEcoder = {
|
||||
fcBGY = -((y*5)*(imgThis.naturalHeight/imgThis.height))+25;
|
||||
fcElem.style.backgroundPosition = fcBGX+"px "+fcBGY+"px";
|
||||
};
|
||||
// Show image preview box on mouse over
|
||||
top.get('canvasPicker').onmouseover = function(event) {
|
||||
get('floatingContainer').style.visibility = "visible";
|
||||
};
|
||||
// Hide image preview box on mouse out
|
||||
top.get('canvasPicker').onmouseout = function(event) {
|
||||
get('floatingContainer').style.visibility = "hidden";
|
||||
};
|
||||
|
||||
// Set pointer colors on clicking canvas
|
||||
top.get('canvasPicker').onclick = function() {
|
||||
top.get('rgb').value = top.get('rgbMouseXY').value;
|
||||
top.get('hex').value = top.get('hexMouseXY').value;
|
||||
top.get('hex').value = top.get('hexMouseXY').value;
|
||||
top.get('hex').style.backgroundColor = top.get('rgb').style.backgroundColor = top.get('hex').value;
|
||||
top.get('hex').style.color = top.get('rgb').style.color = textColor;
|
||||
}
|
||||
@@ -2551,6 +2651,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 +2748,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 +2870,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 +2933,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 +2999,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 +3067,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 +3147,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 +3795,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;
|
||||
|
||||
149
lib/ice-coder.min.js
vendored
149
lib/ice-coder.min.js
vendored
@@ -1,24 +1,29 @@
|
||||
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(" "),
|
||||
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",
|
||||
tabFGselected:"#fff",tabFGopenFile:"#000",tabFGnormalFile:"#eee",tabFGnormalTab:"#888",serverQueueItems:[],previewWindow:!1,previewWindowLoading:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,oppTagReplaceData:[],fmReady:!1,bugReportStatus:"off",bugReportPath:"",bugFilesSizesSeen:[],bugFilesSizesActual:[],githubDiff:!1,githubAuthTokenSet:!1,splitPane:!1,splitPaneLeftPerc:100,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 splitPaneNamesMain splitPaneNamesDiff 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.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";this.splitPaneNamesMain.style.left=parseInt(.25*(b-this.filesW),10)-50+this.filesW+"px";this.splitPaneNamesDiff.style.left=parseInt(.75*
|
||||
(b-this.filesW),10)-50+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]].setSize(top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].setSize(100-
|
||||
top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].getWrapperElement().style.left=top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.splitPane&&top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize(top.ICEcoder.splitPaneLeftPerc+"%",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.get("splitPaneNamesMain").style.opacity=
|
||||
top.get("splitPaneNamesDiff").style.opacity=top.ICEcoder.splitPane?1:0;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 if(b=top.ICEcoder.getcMInstance(),a=top.ICEcoder.getcMdiffInstance(),b){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()}"undefined"!=
|
||||
typeof top.ICEcoder.animSplitPaneInt&&clearInterval(top.ICEcoder.animSplitPaneInt);top.ICEcoder.animSplitPaneInt=setInterval(function(){top.ICEcoder.splitPane&&50.1<top.ICEcoder.splitPaneLeftPerc?top.ICEcoder.splitPaneLeftPerc=(top.ICEcoder.splitPaneLeftPerc-50)/1.8+50:!top.ICEcoder.splitPane&&99.9>top.ICEcoder.splitPaneLeftPerc?top.ICEcoder.splitPaneLeftPerc=50-(100-top.ICEcoder.splitPaneLeftPerc)/1.8+50:(top.ICEcoder.splitPaneLeftPerc=top.ICEcoder.splitPane?50:100,clearInterval(top.ICEcoder.animSplitPaneInt));
|
||||
top.ICEcoder.setLayout()},4)},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;b=a.listSelections();for(var g=0;g<b.length;g++)e=d.findMatchingTag(a,b[g].anchor),0!==c.text[0].indexOf(">")&&"undefined"!=typeof e&&"undo"!=c.origin&&"redo"!=c.origin&&"undefined"!=typeof e.open&&"undefined"!=typeof e.close&&(f="open"==e.at?"close":"open",e=e[f].tag+";"+e[f].from.line+":"+e[f].from.ch,-1==top.ICEcoder.oppTagReplaceData.indexOf(e)&&top.ICEcoder.oppTagReplaceData.push(e))},
|
||||
cMonChange:function(a,b,c,d){var e,f,g,k,h,l,p,n,m,q;b=a.listSelections();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("undefined"!=typeof top.ICEcoder.oppTagReplaceData[0])for(var r=0;r<top.ICEcoder.oppTagReplaceData.length;r++)e=top.ICEcoder.oppTagReplaceData[r].split(";"),f=e[0],g=1*e[1].split(":")[0],k=1*e[1].split(":")[1],
|
||||
b[r]&&(h=d.findMatchingTag(a,b[r].anchor)),"undefined"!=typeof h&&(f="open"==h.at?h.open.tag:h.close.tag,"undefined"!=typeof c.from&&(l=g==c.from.line?c.text[0].length-c.removed[0].length:0,p="close"==h.at&&g==c.from.line?c.removed[0].length-c.text[0].length+1:1,n={line:g,ch:k+l+("open"==h.at?2:p)},l={line:g,ch:k+l+("open"==h.at?2:p)+e[0].length})),""!=f.trim()&&"undefined"!=typeof n&&"undefined"!=typeof l&&a.getRange(n,l)==e[0]&&(a.replaceRange(f,n,l),"close"==h.at&&(top.ICEcoder.autocompleteSkip=
|
||||
!0));top.ICEcoder.oppTagReplaceData=[];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])m=c.substr(c.lastIndexOf("/")+1),q=m.substr(m.lastIndexOf(".")+1);top.ICEcoder.splitPane&&
|
||||
setTimeout(function(){top.ICEcoder.updateDiffs()},0);c&&top.ICEcoder.previewWindow.location&&"/[NEW]"!=c&&top.ICEcoder.updatePreviewWindow(a,c,m,q);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,c&&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.autocompleteSkip?top.ICEcoder.autocompleteSkip=!1: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,
|
||||
@@ -71,13 +76,13 @@ b.onreadystatechange=function(){4==b.readyState&&(200==b.status?(c=JSON.parse(b.
|
||||
console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)):eval(c.action.doNext)):(top.ICEcoder.message(top.t["Sorry there was..."]),console.log("ICEcoder error info for your request..."),console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))};b.open("POST","lib/file-control-xhr.php?action=checkExists&csrf="+top.ICEcoder.csrf,!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");d=(new Date).getTime();b.send("timeStart="+d+"&file="+
|
||||
a.replace(/\+/g,"%2B"))},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=this.isPathFolder(top.ICEcoder.selectedFiles[0])?"folder":"file",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?
|
||||
"block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display="inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-
|
||||
10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){var k,h,m,p,n,l,q;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,
|
||||
"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));m=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+
|
||||
10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){var k,h,l,p,n,m,q;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,
|
||||
"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+
|
||||
g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" "+("folder"==g?"ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\"":"")+' onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {'+("folder"==g?"top.ICEcoder.openCloseDir(this,"+("folder"==g?"true":"false")+");":"")+' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px"> <span id="'+
|
||||
b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+n+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(!m||3>m.childNodes.length)l=document.createElement("ul"),m=h.parentNode.parentNode,m.parentNode.insertBefore(l,m.nextSibling),l=document.createElement("li"),l.className=k,l.draggable=!1,l.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)},l.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&
|
||||
(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},l.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")},l.ondragend=function(){top.ICEcoder.dropFile(this)},l.innerHTML=n,m.nextSibling.appendChild(l),m.nextSibling.appendChild(p);else for(h=0;h<m.childNodes.length;h++)if(m.childNodes[h].className&&(l=0<m.childNodes[h].className.indexOf("directory")?"folder":"file",q=m.childNodes[h].getElementsByTagName("span")[0].innerHTML,
|
||||
l==g&&q>c||"folder"==g&&"file"==l||h==m.childNodes.length-1)){l=document.createElement("li");l.className=k;l.draggable=!1;l.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};l.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};l.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};l.ondragend=
|
||||
function(){top.ICEcoder.dropFile(this)};l.innerHTML=n;h==m.childNodes.length-1?(m.appendChild(l),m.appendChild(p)):(m.insertBefore(l,m.childNodes[h]),m.insertBefore(p,m.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+
|
||||
b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+n+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(!l||3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m,l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)},m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&
|
||||
(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m),l.nextSibling.appendChild(p);else for(h=0;h<l.childNodes.length;h++)if(l.childNodes[h].className&&(m=0<l.childNodes[h].className.indexOf("directory")?"folder":"file",q=l.childNodes[h].getElementsByTagName("span")[0].innerHTML,
|
||||
m==g&&q>c||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className=k;m.draggable=!1;m.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};m.ondragend=
|
||||
function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;h==l.childNodes.length-1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[h]),l.insertBefore(p,l.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+
|
||||
"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms",top.ICEcoder.renameInChildren(h,e,b,c));"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",e.substr(0,e.lastIndexOf("/")),c));"chmod"==a&&(f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(f.replace(/\//g,"|")+"_perms"),h.style.background=777==d?"#800":"none",h.style.color=777==
|
||||
d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},renameInChildren:function(a,b,c,d){var e,f;if(a.parentNode.parentNode.nextSibling&&"UL"==a.parentNode.parentNode.nextSibling.nodeName){a=a.parentNode.parentNode.nextSibling;
|
||||
for(var g=0;g<a.childNodes.length;g++)"LI"==a.childNodes[g].nodeName&&(e=a.childNodes[g].childNodes[0].childNodes[1],e.id=e.id.replace(b.replace(/\//g,"|"),c.replace(/\//g,"|")+"|"+d),e.parentNode.title=e.id.replace(/\|/g,"/"),f=top.get("filesFrame").contentWindow.document.getElementById(e.id).nextSibling.nextSibling,f.id=e.id+"_perms",top.ICEcoder.renameInChildren(e,b,c,d))}},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);
|
||||
@@ -101,38 +106,43 @@ top.ICEcoder.area=b;"top"!=b&&(top.ICEcoder.mouseY+=70);"editor"==b&&(top.ICEcod
|
||||
a}},serverMessage:function(a){var b;b=top.get("serverMessage");a?(b.innerHTML=top.ICEcoder.xssClean(a).replace(/\<b\>/g,"<b>").replace(/\<\/b\>/g,"</b>").replace(/\<br\>/g,"<br>"),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();if(a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a){b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=
|
||||
c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&&b.parentNode.removeChild(b);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&
|
||||
(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}},showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'color\').value)" value="insert >" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'colorRGB\').value)" value="insert >" class="insertColorValue">';
|
||||
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},initCanvasImage:function(a){var b,c;b=top.get("canvasPicker").getContext("2d");c=new Image;c.crossOrigin="Anonymous";c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.document.getElementById("floatingContainer").style.backgroundSize=5*a.naturalWidth+"px "+5*a.naturalHeight+"px"},interactCanvasImage:function(a){var b,c,d,e,f,
|
||||
g,k,h,m,p,n,l,q;b=top.get("canvasPicker").getContext("2d");top.get("canvasPicker").onmousemove=function(u){c=u.pageX-this.offsetLeft;d=u.pageY-this.offsetTop;e=b.getImageData(c,d,1,1).data;f=e[0];g=e[1];k=e[2];h=f+","+g+","+k;m=top.ICEcoder.rgbToHex(f,g,k);top.get("rgbMouseXY").value=h;top.get("hexMouseXY").value="#"+m;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+m;p=128>f||128>g||128>k&&200>f&&200>g&&50<k?"#fff":"#000";top.get("hexMouseXY").style.color=
|
||||
top.get("rgbMouseXY").style.color=p;n=get("floatingContainer");n.style.left=top.ICEcoder.mouseX+20+"px";n.style.top=top.ICEcoder.mouseY+"px";l=-(a.naturalWidth/a.width*c*5)+25;q=-(a.naturalHeight/a.height*d*5)+25;n.style.backgroundPosition=l+"px "+q+"px"};top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"};top.get("canvasPicker").onclick=function(){top.get("rgb").value=
|
||||
top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=p}},rgbToHex:function(a,b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789abcdef".charAt((a-a%16)/16)+"0123456789abcdef".charAt(a%16)},insertColorValue:function(a){var b,
|
||||
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")},
|
||||
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},initCanvasImage:function(a){var b,c;b=top.get("canvasPicker").getContext("2d");c=new Image;c.crossOrigin="Anonymous";c.src=a.src;c.onerror=function(){get("floatingContainer").style.visibility="hidden";get("canvasPickerColorInfo").style.display="none";get("canvasPickerCORSInfo").style.display="block"};c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height);
|
||||
get("canvasPickerColorInfo").style.display="block";get("canvasPickerCORSInfo").style.display="none";top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"}};top.document.getElementById("floatingContainer").style.backgroundSize=5*a.naturalWidth+"px "+5*a.naturalHeight+"px"},interactCanvasImage:function(a){var b,c,d,e,f,g,k,h,l,p,n,m,q;b=top.get("canvasPicker").getContext("2d");
|
||||
top.get("canvasPicker").onmousemove=function(r){c=r.pageX-this.offsetLeft;d=r.pageY-this.offsetTop;e=b.getImageData(c,d,1,1).data;f=e[0];g=e[1];k=e[2];h=f+","+g+","+k;l=top.ICEcoder.rgbToHex(f,g,k);top.get("rgbMouseXY").value=h;top.get("hexMouseXY").value="#"+l;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+l;p=128>f||128>g||128>k&&200>f&&200>g&&50<k?"#fff":"#000";top.get("hexMouseXY").style.color=top.get("rgbMouseXY").style.color=p;n=get("floatingContainer");
|
||||
n.style.left=top.ICEcoder.mouseX+20+"px";n.style.top=top.ICEcoder.mouseY+"px";m=-(a.naturalWidth/a.width*c*5)+25;q=-(a.naturalHeight/a.height*d*5)+25;n.style.backgroundPosition=m+"px "+q+"px"};top.get("canvasPicker").onclick=function(){top.get("rgb").value=top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=p}},rgbToHex:function(a,
|
||||
b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789abcdef".charAt((a-a%16)/16)+"0123456789abcdef".charAt(a%16)},insertColorValue:function(a){var b,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;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,l,p,n,m,q,r,w,v,x,y,z,A,B,C,D){var t,u=a.slice(0,a.lastIndexOf("?")),u=u.slice(u.lastIndexOf("/")+1,u.lastIndexOf("."));top.ICEcoder.theme!==u&&(top.ICEcoder.theme=u,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),t=document.createElement("link"),t.setAttribute("rel","stylesheet"),t.setAttribute("type",
|
||||
"text/css"),t.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(t),t=-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: "+t+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=l;top.ICEcoder.matchBrackets=p;top.ICEcoder.autoCloseTags=n;top.ICEcoder.autoCloseBrackets=m;top.ICEcoder.indentWithTabs=q;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=r;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!=
|
||||
@@ -159,14 +169,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)}}};
|
||||
27
lib/language-modes-partial.js
Normal file
27
lib/language-modes-partial.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// Provide a fileName and get fileExt and mode set based on supported languages
|
||||
|
||||
fileExt = fileName.split(".");
|
||||
fileExt = fileExt[fileExt.length-1];
|
||||
var mode =
|
||||
fileExt == "js" || fileExt == "json" ? "text/javascript"
|
||||
: fileExt == "coffee" ? "text/x-coffeescript"
|
||||
: fileExt == "rb" ? "text/x-ruby"
|
||||
: fileExt == "py" ? "text/x-python"
|
||||
: fileExt == "css" ? "text/css"
|
||||
: fileExt == "less" ? "text/x-less"
|
||||
: fileExt == "md" ? "text/x-markdown"
|
||||
: fileExt == "xml" ? "application/xml"
|
||||
: fileExt == "sql" ? "text/x-mysql" // also text/x-sql, text/x-mariadb, text/x-cassandra or text/x-plsql
|
||||
: fileExt == "erl" ? "text/x-erlang"
|
||||
: fileExt == "yaml" ? "text/x-yaml"
|
||||
: fileExt == "java" ? "text/x-java"
|
||||
: fileExt == "jl" ? "text/x-julia"
|
||||
: fileExt == "c" ? "text/x-csrc"
|
||||
: fileExt == "cpp" ? "text/x-c++src"
|
||||
: fileExt == "ino" ? "text/x-c++src"
|
||||
: fileExt == "cs" ? "text/x-csharp"
|
||||
: fileExt == "go" ? "text/x-go"
|
||||
: fileExt == "lua" ? "text/x-lua"
|
||||
: fileExt == "pl" ? "text/x-perl"
|
||||
: fileExt == "scss" ? "text/x-sass"
|
||||
: "application/x-httpd-php";
|
||||
@@ -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>';};
|
||||
}
|
||||
|
||||
1
lib/lz-string.min.js
vendored
1
lib/lz-string.min.js
vendored
@@ -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);
|
||||
@@ -125,12 +125,12 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
||||
$fullPath = $path.$slash.$f;
|
||||
if(is_dir($fullPath)) {
|
||||
$ret .= phpGrep($q, $fullPath, $base);
|
||||
} else if(stristr(toUTF8noBOM(file_get_contents($fullPath,false,$context),false), $q)) {
|
||||
} else if(stristr(toUTF8noBOM(getData($fullPath),false), $q)) {
|
||||
$bFile = false;
|
||||
$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))).'/';
|
||||
@@ -147,7 +147,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
||||
}
|
||||
if (!$bFile && (count($selectedFiles)==0 || count($selectedFiles)>0 && $foundInSelFile)) {
|
||||
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.goFindAfterOpenInt = setInterval(function(){goFindAfterOpen('".$fullPath."')},20);top.ICEcoder.showHide('hide',top.get('blackMask'))\\\">";
|
||||
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">".$t['Found']." ".substr_count(strtolower(toUTF8noBOM(file_get_contents($fullPath,false,$context),false)),$q)." ".$t['times']."</div>";
|
||||
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">".$t['Found']." ".substr_count(strtolower(toUTF8noBOM(getData($fullPath),false)),$q)." ".$t['times']."</div>";
|
||||
if (isset($_GET['replace'])) {
|
||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">".$t['replace']."</div>";
|
||||
};
|
||||
|
||||
@@ -7,17 +7,7 @@ $t = $text['plugins-manager'];
|
||||
$pluginsDataSrc = "https://icecoder.net/plugin-data?format=JSON";
|
||||
|
||||
// Now get our plugin data and put into a PHP array
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$pluginsDataJS = @file_get_contents($pluginsDataSrc, false, $context);
|
||||
if (!$pluginsDataJS) {
|
||||
$pluginsDataJS = file_get_contents(str_replace("https:","http:",$pluginsDataSrc), false, $context);
|
||||
}
|
||||
} elseif (function_exists('curl_init')) {
|
||||
$pDSrc = curl_init($pluginsDataSrc);
|
||||
curl_setopt($pDSrc, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($pDSrc, CURLOPT_RETURNTRANSFER, true);
|
||||
$pluginsDataJS = curl_exec($pDSrc);
|
||||
}
|
||||
$pluginsDataJS = getData($pluginsDataSrc,'curl');
|
||||
$pluginsData = json_decode($pluginsDataJS, true);
|
||||
|
||||
// If we have an action to perform
|
||||
@@ -25,7 +15,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
|
||||
// Get our old plugin & user settings
|
||||
$oldPlugins = $ICEcoder["plugins"];
|
||||
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||
$settingsContents = getData($settingsFile);
|
||||
|
||||
// ==========
|
||||
// INSTALLING
|
||||
@@ -37,13 +27,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$target = '../plugins/';
|
||||
$zipURL = $pluginsData[strClean($_GET['plugin'])]['zipURL'];
|
||||
$zipFile = "../tmp/".basename($zipURL);
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$fileData = file_get_contents($zipURL, false, $context);
|
||||
} elseif (function_exists('curl_init')) {
|
||||
$client = curl_init($zipURL);
|
||||
curl_setopt($client, CURLOPT_RETURNTRANSFER, 1); //fixed this line
|
||||
$fileData = curl_exec($client);
|
||||
}
|
||||
$fileData = getData($zipURL,'curl');
|
||||
file_put_contents($zipFile, $fileData);
|
||||
|
||||
// Now unpack the zip
|
||||
@@ -142,7 +126,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));
|
||||
|
||||
6
lib/session-active-ping.php
Normal file
6
lib/session-active-ping.php
Normal 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");
|
||||
?>
|
||||
@@ -45,6 +45,40 @@ if (isset($_SESSION['text'])) {
|
||||
$t = $text['settings-common'];
|
||||
}
|
||||
|
||||
// Get data from a fopen or CURL connection
|
||||
function getData($url,$type='fopen',$dieMessage=false) {
|
||||
global $context;
|
||||
|
||||
// Request is to connect via CURL
|
||||
if ($type == "curl" && function_exists('curl_init')) {
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'ICEcoder');
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
$data = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
// Otherwise, use an fopen connection
|
||||
} elseif (ini_get('allow_url_fopen')) {
|
||||
$data = @file_get_contents($url,false,$context);
|
||||
if (!$data) {
|
||||
$data = @file_get_contents(str_replace("https:","http:",$url), false, $context);
|
||||
}
|
||||
}
|
||||
// Return data or die with message
|
||||
if ($data) {
|
||||
return $data;
|
||||
} elseif ($dieMessage) {
|
||||
die($dieMessage);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Logout if that's the action we're taking
|
||||
if (isset($_GET['logout'])) {
|
||||
include(dirname(__FILE__)."/../processes/on-user-logout.php");
|
||||
@@ -128,13 +162,37 @@ function xssClean($data,$type) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Clean PHP code injection attempts
|
||||
function injClean($data) {
|
||||
$output = str_replace("(", "", str_replace(")", "", str_replace(";", "", $data)));
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 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);
|
||||
@@ -209,11 +267,15 @@ function getVersionsCount($fileLoc,$fileName) {
|
||||
$backupIndex = $backupDirBase.$backupDirHost."/".$backupDateDirs[$i]."/.versions-index";
|
||||
// Have a .versions-index file? Get contents
|
||||
if (file_exists($backupIndex) && is_readable($backupIndex)) {
|
||||
$versionsInfo = file_get_contents($backupIndex,false,$context);
|
||||
$versionsInfo = getData($backupIndex);
|
||||
$versionsInfo = explode("\n",$versionsInfo);
|
||||
// For each line, check if it's our file and if so, add the count to our $count value and $dateCount array
|
||||
for ($j=0; $j<count($versionsInfo); $j++) {
|
||||
$fileRef = $fileLoc."/".$fileName." = ";
|
||||
// Replace any backslashes in $fileLoc
|
||||
$fileLoc = str_replace("\\","/",$fileLoc);
|
||||
// Join $fileLock and $fileName into a path and replace double slashes
|
||||
$fileRef = str_replace("//","/",$fileLoc."/".$fileName." = ");
|
||||
// Check if we have a match
|
||||
if (strpos($versionsInfo[$j],$fileRef) === 0) {
|
||||
// We have a match, so split on the " = " and we can grab number as 2nd part
|
||||
$lineInfo = explode(" = ",$versionsInfo[$j]);
|
||||
|
||||
@@ -5,7 +5,7 @@ $t = $text['settings-save-current-files'];
|
||||
|
||||
// Save the currently opened files for next time
|
||||
if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
||||
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||
$settingsContents = getData($settingsFile);
|
||||
|
||||
// Replace our previousFiles var with the the current
|
||||
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
$newConfigSettingsFile = '<?php
|
||||
// ICEcoder system settings
|
||||
$ICEcoderSettings = array(
|
||||
"versionNo" => "5.4",
|
||||
"versionNo" => "5.7",
|
||||
"codeMirrorDir" => "CodeMirror",
|
||||
"docRoot" => $_SERVER[\'DOCUMENT_ROOT\'], // Set absolute path of another location if needed
|
||||
"demoMode" => false,
|
||||
|
||||
@@ -5,7 +5,7 @@ $t = $text['settings-update'];
|
||||
|
||||
// Update this config file?
|
||||
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||
$settingsContents = getData($settingsFile);
|
||||
// Replace our settings vars
|
||||
$repPosStart = strpos($settingsContents,'"root"');
|
||||
$repPosEnd = strpos($settingsContents,'"plugins"');
|
||||
@@ -31,19 +31,25 @@ 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']);
|
||||
$ICEcoder["pluginPanelAligned"] = strClean($_POST['pluginPanelAligned']);
|
||||
$ICEcoder["bugFilePaths"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bugFilePaths']))).'")';
|
||||
$ICEcoder["bugFileCheckTimer"] = intval($_POST['bugFileCheckTimer']);
|
||||
$ICEcoder["bugFileCheckTimer"] = intval($_POST['bugFileCheckTimer']) >= 0 ? intval($_POST['bugFileCheckTimer']) : 0;
|
||||
$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].'" => ';
|
||||
@@ -78,7 +84,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false";
|
||||
|
||||
// Change multiUser and enableRegistration in config___settings.php
|
||||
$generalSettingsContents = file_get_contents($configSettings,false,$context);
|
||||
$generalSettingsContents = getData($configSettings);
|
||||
$isMultiUser = isset($_POST['multiUser']) && $_POST['multiUser'] ? "true" : "false";
|
||||
$generalSettingsContents = str_replace('"multiUser" => true,','"multiUser" => '.$isMultiUser.',',$generalSettingsContents);
|
||||
$generalSettingsContents = str_replace('"multiUser" => false,','"multiUser" => '.$isMultiUser.',',$generalSettingsContents);
|
||||
@@ -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>";
|
||||
}
|
||||
?>
|
||||
@@ -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';
|
||||
@@ -66,7 +55,7 @@ $ICEcoderUserSettings['previousFiles'] = $prevFilesAvail;
|
||||
|
||||
// Replace our config created date with the filemtime?
|
||||
if (basename($_SERVER['SCRIPT_NAME']) == "index.php" && $ICEcoderUserSettings['configCreateDate'] == 0) {
|
||||
$settingsContents = file_get_contents(dirname(__FILE__)."/".$settingsFile,false,$context);
|
||||
$settingsContents = getData(dirname(__FILE__)."/".$settingsFile);
|
||||
clearstatcache();
|
||||
$configfilemtime = filemtime(dirname(__FILE__)."/"."config___settings.php");
|
||||
// Make it a number (avoids null, undefined etc)
|
||||
@@ -175,18 +164,25 @@ for ($i=0;$i<count($settingsArray);$i++) {
|
||||
if (!isset($_SESSION[$settingsArray[$i]])) {$_SESSION[$settingsArray[$i]] = $ICEcoder[$settingsArray[$i]];}
|
||||
}
|
||||
|
||||
// Determin our allowed IP addresses
|
||||
$allowedIP = false;
|
||||
for($i=0;$i<count($_SESSION['allowedIPs']);$i++) {
|
||||
if ($_SESSION['allowedIPs'][$i]==$_SERVER["REMOTE_ADDR"]||$_SESSION['allowedIPs'][$i]=="*") {
|
||||
$allowedIP = true;
|
||||
}
|
||||
}
|
||||
// If user not allowed to view, display message
|
||||
if (!$allowedIP) {
|
||||
die('Sorry, access not permitted');
|
||||
// Check IP permissions
|
||||
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
||||
header('Location: /');
|
||||
die("Sorry, not in allowed IPs list");
|
||||
exit;
|
||||
};
|
||||
|
||||
// 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");
|
||||
|
||||
@@ -207,7 +203,7 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
|
||||
// If we're unlocking ICEcoder after donating
|
||||
} elseif (isset($_POST['submit']) && (strpos($_POST['submit'],"Unlock ICEcoder")>-1)) {
|
||||
if (generateHash(strClean($_POST['email']),$_POST['code'])==$_POST['code']) {
|
||||
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||
$settingsContents = getData($settingsFile);
|
||||
// Replace our empty email & code with the one submitted by user
|
||||
$settingsContents = str_replace('"licenseEmail" => "",','"licenseEmail" => "'.$_POST['email'].'",',$settingsContents);
|
||||
$settingsContents = str_replace('"licenseCode" => "",','"licenseCode" => "'.$_POST['code'].'",',$settingsContents);
|
||||
@@ -237,7 +233,7 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
|
||||
// If the password hasn't been set and we're setting it
|
||||
if ($ICEcoder["password"] == "" && isset($_POST['submit']) && (strpos($_POST['submit'],"set password")>-1)) {
|
||||
$password = generateHash(strClean($_POST['password']));
|
||||
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||
$settingsContents = getData($settingsFile);
|
||||
// Replace our empty password with the one submitted by user
|
||||
$settingsContents = str_replace('"password" => "",','"password" => "'.$password.'",',$settingsContents);
|
||||
// Also set the update checker preference
|
||||
@@ -249,6 +245,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 = getData(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'];
|
||||
|
||||
@@ -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 {
|
||||
@@ -78,19 +78,7 @@ function copyOldVersion() {
|
||||
}
|
||||
$icv_url = "https://icecoder.net/latest-version.txt";
|
||||
echo 'Detecting current version of ICEcoder...<br>';
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$icvInfo = @file_get_contents($icv_url,false,$context);
|
||||
if (!$icvInfo) {
|
||||
$icvInfo = file_get_contents(str_replace("https:","http:",$icv_url), false, $context);
|
||||
}
|
||||
} elseif (function_exists('curl_init')) {
|
||||
$ch = curl_init($icv_url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$icvInfo = curl_exec($ch);
|
||||
} else {
|
||||
die('Sorry, couldn\'t figure out latest version.');
|
||||
}
|
||||
$icvInfo = getData($icv_url,'curl','Sorry, couldn\'t figure out latest version.');
|
||||
echo 'Latest version of ICEcoder is '.$icvInfo.'<br>';
|
||||
openZipNew($icvInfo);
|
||||
}
|
||||
@@ -104,18 +92,7 @@ function openZipNew($icvInfo) {
|
||||
|
||||
$remoteFile = 'https://icecoder.net/ICEcoder-v'.(str_replace(" beta", "-beta",$icvInfo)).'.zip';
|
||||
$file = "../tmp/new-version.zip";
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$fileData = @file_get_contents($remoteFile,false,$context);
|
||||
if (!$fileData) {
|
||||
$fileData = file_get_contents(str_replace("https:","http:",$remoteFile), false, $context);
|
||||
}
|
||||
} elseif (function_exists('curl_init')) {
|
||||
$client = curl_init($remoteFile);
|
||||
curl_setopt($client, CURLOPT_RETURNTRANSFER, 1); //fixed this line
|
||||
$fileData = curl_exec($client);
|
||||
} else {
|
||||
die('Sorry, couldn\'t get latest version zip file.');
|
||||
}
|
||||
$fileData = getData($remoteFile,'curl','Sorry, couldn\'t get latest version zip file.');
|
||||
echo 'Storing zip file...<br>';
|
||||
file_put_contents($file, $fileData);
|
||||
|
||||
@@ -156,9 +133,9 @@ function transposeSettings($oldFile,$newFile,$saveFile) {
|
||||
|
||||
echo '- Getting old and new settings...<br>';
|
||||
// Get old and new settings and start a new $contents
|
||||
$oldSettingsContent = file_get_contents($oldFile,false,$context);
|
||||
$oldSettingsContent = getData($oldFile);
|
||||
$oldSettingsArray = explode("\n",$oldSettingsContent);
|
||||
$newSettingsContent = file_get_contents($newFile,false,$context);
|
||||
$newSettingsContent = getData($newFile);
|
||||
$newSettingsArray = explode("\n",$newSettingsContent);
|
||||
$contents = "";
|
||||
|
||||
|
||||
@@ -25,40 +25,19 @@ 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];
|
||||
var mode =
|
||||
fileExt == "js" || fileExt == "json" ? "text/javascript"
|
||||
: fileExt == "coffee" ? "text/x-coffeescript"
|
||||
: fileExt == "rb" ? "text/x-ruby"
|
||||
: fileExt == "py" ? "text/x-python"
|
||||
: fileExt == "css" ? "text/css"
|
||||
: fileExt == "less" ? "text/x-less"
|
||||
: fileExt == "md" ? "text/x-markdown"
|
||||
: fileExt == "xml" ? "application/xml"
|
||||
: fileExt == "sql" ? "text/x-mysql" // also text/x-sql, text/x-mariadb, text/x-cassandra or text/x-plsql
|
||||
: fileExt == "erl" ? "text/x-erlang"
|
||||
: fileExt == "yaml" ? "text/x-yaml"
|
||||
: fileExt == "java" ? "text/x-java"
|
||||
: fileExt == "jl" ? "text/x-julia"
|
||||
: fileExt == "c" ? "text/x-csrc"
|
||||
: fileExt == "cpp" ? "text/x-c++src"
|
||||
: fileExt == "ino" ? "text/x-c++src"
|
||||
: fileExt == "cs" ? "text/x-csharp"
|
||||
: 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";
|
||||
<?php include(dirname(__FILE__)."/../lib/language-modes-partial.js");?>
|
||||
|
||||
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 +46,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 +66,6 @@ top.ICEcoder.lineCommentToggleSub = function(cM, cursorPos, linePos, lineContent
|
||||
"Go" : ["// ", "/* ", " */"],
|
||||
"Lua" : ["-- ", "--[[ ", " ]]"],
|
||||
"Perl" : ["# ", "/* ", " */"],
|
||||
"Rust" : ["// ", "/* ", " */"],
|
||||
"Sass" : ["// ", "/* ", " */"]
|
||||
}
|
||||
|
||||
@@ -159,7 +137,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;
|
||||
}
|
||||
@@ -178,8 +156,8 @@ top.ICEcoder.caretLocationType = function() {
|
||||
caretChunk = thisCM.getValue().substr(0,top.ICEcoder.caretPos+1);
|
||||
|
||||
if(caretChunk.lastIndexOf("<script")>caretChunk.lastIndexOf("/script>")&&caretLocType=="Unknown") {caretLocType = "JavaScript";}
|
||||
else if (caretChunk.lastIndexOf("<?")>caretChunk.lastIndexOf("?>")&&caretLocType=="Unknown") {caretLocType = "PHP";}
|
||||
else if (caretChunk.lastIndexOf("<%")>caretChunk.lastIndexOf("%>")&&caretLocType=="Unknown") {caretLocType = "Ruby";}
|
||||
else if (caretChunk.lastIndexOf("<\?")>caretChunk.lastIndexOf("?\>")&&caretLocType=="Unknown") {caretLocType = "PHP";}
|
||||
else if (caretChunk.lastIndexOf("<\%")>caretChunk.lastIndexOf("%\>")&&caretLocType=="Unknown") {caretLocType = "Ruby";}
|
||||
else if (caretChunk.lastIndexOf("<style")>caretChunk.lastIndexOf("/style>")&&caretLocType=="Unknown") {caretLocType = "CSS";}
|
||||
else if (caretChunk.lastIndexOf("<")>caretChunk.lastIndexOf(">")&&caretLocType=="Unknown") {caretLocType = "HTML";}
|
||||
else if (caretLocType=="Unknown") {caretLocType = "Content";};
|
||||
@@ -209,7 +187,6 @@ top.ICEcoder.caretLocationType = function() {
|
||||
: fileExt == "go" ? "Go"
|
||||
: fileExt == "lua" ? "Lua"
|
||||
: fileExt == "pl" ? "Perl"
|
||||
: fileExt == "rs" ? "Rust"
|
||||
: fileExt == "scss" ? "Sass"
|
||||
: "Content";
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ test = {
|
||||
setTimeout(function() {
|
||||
ICEcoder.closeTab(1,false,true);
|
||||
console.log('TEST COMPLETE!');
|
||||
alert('Test Complete!\n\nRan '+s+' of '+total+' tests OK.\nSee console for more details.');
|
||||
top.ICEcoder.message('Test Complete!\n\nRan '+s+' of '+total+' tests OK.\nSee console for more details.');
|
||||
},200);
|
||||
} else {
|
||||
testResult("- FAIL",title);
|
||||
@@ -276,7 +276,7 @@ function displayResults(successful) {
|
||||
|
||||
function testStopped() {
|
||||
unitTestResults.innerHTML += " - Test stopped";
|
||||
alert("Test stopped, see console for details.");
|
||||
top.ICEcoder.message("Test stopped, see console for details.");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user