mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Allow file-editor increase size
This commit is contained in:
parent
d3b1095867
commit
6e1eaf595c
@ -212,7 +212,9 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
html, body, body > .container-scroller {
|
html,
|
||||||
|
body,
|
||||||
|
body>.container-scroller {
|
||||||
overflow: initial;
|
overflow: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,7 +223,9 @@
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="col-md-6 col-sm-12">
|
<div id="editor_container" class="col-md-6 col-sm-12">
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
<div class="editorManager">
|
<div class="editorManager">
|
||||||
<h2 id="fileError"></h2>
|
<h2 id="fileError"></h2>
|
||||||
<div id="editorParent">
|
<div id="editorParent">
|
||||||
@ -239,10 +243,13 @@
|
|||||||
data-handler-name="ace/keyboard/emacs">Emacs</button>
|
data-handler-name="ace/keyboard/emacs">Emacs</button>
|
||||||
<button onclick="setKeyboard(event.target)" class="btn btn-secondary"
|
<button onclick="setKeyboard(event.target)" class="btn btn-secondary"
|
||||||
data-handler-name="ace/keyboard/sublime">Sublime</button>
|
data-handler-name="ace/keyboard/sublime">Sublime</button>
|
||||||
|
<button class="d-none d-md-block btn btn-info" id="screen-size">Toggle Editor
|
||||||
|
Size</button>
|
||||||
</div>
|
</div>
|
||||||
<h3 id="file_warn"></h3>
|
<h3 id="file_warn"></h3>
|
||||||
|
</button>
|
||||||
<button class="btn btn-success" onclick="save()"><i class="fas fa-save"></i> {{ translate('serverFiles',
|
<button class="btn btn-success" onclick="save()"><i class="fas fa-save"></i> {{ translate('serverFiles',
|
||||||
'save', data['lang']) }}</button>
|
'save', data['lang']) }}
|
||||||
<span style="color: #2fb689; margin-left: 10px;" id="save_status"></span>
|
<span style="color: #2fb689; margin-left: 10px;" id="save_status"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -285,7 +292,7 @@
|
|||||||
mac: 'Command-S',
|
mac: 'Command-S',
|
||||||
sender: 'editor|cli'
|
sender: 'editor|cli'
|
||||||
},
|
},
|
||||||
exec: function(env, args, request) {
|
exec: function (env, args, request) {
|
||||||
save()
|
save()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -408,6 +415,7 @@
|
|||||||
setFileName(event.target.innerText);
|
setFileName(event.target.innerText);
|
||||||
editor.session.setValue(json.content);
|
editor.session.setValue(json.content);
|
||||||
serverFileContent = json.content;
|
serverFileContent = json.content;
|
||||||
|
setSaveStatus(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -530,8 +538,10 @@
|
|||||||
document.getElementById('save_status').style.color = saved ? '#2fb689' : 'gray';
|
document.getElementById('save_status').style.color = saved ? '#2fb689' : 'gray';
|
||||||
}
|
}
|
||||||
['change', 'undo', 'redo'].forEach(event => editor.on(event, (event) => setSaveStatus(serverFileContent === editor.session.getValue())))
|
['change', 'undo', 'redo'].forEach(event => editor.on(event, (event) => setSaveStatus(serverFileContent === editor.session.getValue())))
|
||||||
|
$('#screen-size').on('click', function (e) {
|
||||||
|
$('#editor_container').toggleClass(`col-md-6`)
|
||||||
|
|
||||||
|
});
|
||||||
setFileName();
|
setFileName();
|
||||||
$('#editorParent').toggle(false) // show
|
$('#editorParent').toggle(false) // show
|
||||||
$('#fileError').toggle(false) // hide
|
$('#fileError').toggle(false) // hide
|
||||||
@ -1097,7 +1107,7 @@
|
|||||||
if (handlerName == 'null') handlerName = null;
|
if (handlerName == 'null') handlerName = null;
|
||||||
editor.setKeyboardHandler(handlerName, () => {
|
editor.setKeyboardHandler(handlerName, () => {
|
||||||
if (handlerName == 'ace/keyboard/vim') {
|
if (handlerName == 'ace/keyboard/vim') {
|
||||||
require("ace/keyboard/vim").Vim.defineEx('write', 'w', function() {
|
require("ace/keyboard/vim").Vim.defineEx('write', 'w', function () {
|
||||||
save();
|
save();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user