Merge branch 'enhancement/file-editor-large' into 'dev'

File-editor size toggle

See merge request crafty-controller/crafty-4!378
This commit is contained in:
Iain Powrie 2022-06-21 21:14:38 +00:00
commit 3c0e23fc2f
3 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,7 @@
### New features
- Add shutdown on backup feature ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/373))
- Add detection and dropdown of java versions ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/375))
- Add file-editor size toggle ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/378))
### Bug fixes
- Backup/Config.json rework for API key hardening ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/369))
- Fix stack on ping result being falsy ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/371))

View File

@ -228,7 +228,9 @@
position: sticky;
}
</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">
<h2 id="fileError"></h2>
<div id="editorParent">
@ -246,6 +248,9 @@
data-handler-name="ace/keyboard/emacs">Emacs</button>
<button onclick="setKeyboard(event.target)" class="btn btn-secondary"
data-handler-name="ace/keyboard/sublime">Sublime</button>
<span class="d-none d-md-block ">&nbsp;&nbsp;&nbsp;<button class="btn btn-info" id="screen-size">{{
translate('serverFiles',
'size', data['lang']) }}</button></span>
</div>
<h3 id="file_warn"></h3>
<button class="btn btn-success" onclick="save()"><i class="fas fa-save"></i> {{ translate('serverFiles',
@ -415,6 +420,7 @@
setFileName(event.target.innerText);
editor.session.setValue(json.content);
serverFileContent = json.content;
setSaveStatus(true);
}
},
});
@ -537,8 +543,10 @@
document.getElementById('save_status').style.color = saved ? '#2fb689' : 'gray';
}
['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();
$('#editorParent').toggle(false) // show
$('#fileError').toggle(false) // hide

View File

@ -372,6 +372,7 @@
"noscript": "The file manager does not work without JavaScript",
"rename": "Rename",
"renameItemQuestion": "What should the new name be?",
"size": "Toggle Editor Size",
"save": "Save",
"stayHere": "DO NOT LEAVE THIS PAGE!",
"unsupportedLanguage": "Warning: This is not a supported file type",
@ -534,4 +535,4 @@
"userSettings": "User Settings",
"uses": "Number of uses allowed (-1==No Limit)"
}
}
}