Major cleanup of Ace editor files, as well as hopefully fixing broken editor issues.
This commit is contained in:
parent
3e7a72046e
commit
7f48b757cd
351 changed files with 44 additions and 360 deletions
|
@ -52,12 +52,6 @@ var InitialLogSent = false;
|
|||
TerminalNotifyElement.addClass('hidden');
|
||||
}
|
||||
})
|
||||
// Socket.on('initial status', function (data) {
|
||||
// Terminal.clear();
|
||||
// if (data.status === 1 || data.status === 2) {
|
||||
// Socket.emit('send server log');
|
||||
// }
|
||||
// });
|
||||
})();
|
||||
|
||||
(function pushOutputQueue() {
|
||||
|
@ -86,7 +80,6 @@ var InitialLogSent = false;
|
|||
(function setupSocketListeners() {
|
||||
// Update Listings on Initial Status
|
||||
Socket.on('initial status', function (data) {
|
||||
console.log('initial status 2');
|
||||
if (! InitialLogSent) {
|
||||
updateServerPowerControls(data.status);
|
||||
|
||||
|
|
|
@ -17,16 +17,19 @@
|
|||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
$(document).ready(function () {
|
||||
const Editor = ace.edit('editor');
|
||||
const Modelist = ace.require('ace/ext/modelist')
|
||||
(function () {
|
||||
window.Editor = ace.edit('editor');
|
||||
var Whitespace = ace.require('ace/ext/whitespace');
|
||||
var Modelist = ace.require('ace/ext/modelist');
|
||||
|
||||
Editor.setTheme('ace/theme/chrome');
|
||||
Editor.getSession().setUseWrapMode(true);
|
||||
Editor.setShowPrintMargin(false);
|
||||
|
||||
if (typeof Pterodactyl !== 'undefined' && typeof Pterodactyl.stat !== 'undefined') {
|
||||
Editor.getSession().setMode(Modelist.getModeForPath(Pterodactyl.stat.name).mode);
|
||||
if (typeof Pterodactyl !== 'undefined') {
|
||||
if(typeof Pterodactyl.stat !== 'undefined') {
|
||||
Editor.getSession().setMode(Modelist.getModeForPath(Pterodactyl.stat.name).mode);
|
||||
}
|
||||
}
|
||||
|
||||
Editor.commands.addCommand({
|
||||
|
@ -42,6 +45,10 @@ $(document).ready(function () {
|
|||
readOnly: false
|
||||
});
|
||||
|
||||
Editor.commands.addCommands(Whitespace.commands);
|
||||
|
||||
Whitespace.detectIndentation(Editor.session);
|
||||
|
||||
$('#save_file').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
save();
|
||||
|
@ -121,4 +128,4 @@ $(document).ready(function () {
|
|||
$('#save_file').html('<i class="fa fa-fw fa-save"></i> Save File').removeClass('disabled');
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -50,13 +50,11 @@ var Server = (function () {
|
|||
|
||||
var notifySocketError = false;
|
||||
|
||||
console.log('Starting connection');
|
||||
window.Socket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/ws/' + Pterodactyl.server.uuid, {
|
||||
'query': 'token=' + Pterodactyl.server.daemonSecret,
|
||||
});
|
||||
|
||||
Socket.io.on('connect_error', function (err) {
|
||||
console.log('connect_error');
|
||||
if(typeof notifySocketError !== 'object') {
|
||||
notifySocketError = $.notify({
|
||||
message: 'There was an error attempting to establish a WebSocket connection to the Daemon. This panel will not work as expected.<br /><br />' + err,
|
||||
|
@ -69,7 +67,6 @@ var Server = (function () {
|
|||
|
||||
// Connected to Socket Successfully
|
||||
Socket.on('connect', function () {
|
||||
console.log('connect');
|
||||
if (notifySocketError !== false) {
|
||||
notifySocketError.close();
|
||||
notifySocketError = false;
|
||||
|
@ -77,7 +74,6 @@ var Server = (function () {
|
|||
});
|
||||
|
||||
Socket.on('initial status', function (data) {
|
||||
console.log('initial status');
|
||||
setStatusIcon(data.status);
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue