Merge branch 'dev' of gitlab.com:crafty-controller/crafty-4 into dev

This commit is contained in:
amcmanu3 2022-06-21 17:14:55 -04:00
commit 7074dd18fb
3 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,7 @@
### New features ### New features
- Add shutdown on backup feature ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/373)) - 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 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 ### Bug fixes
- Backup/Config.json rework for API key hardening ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/369)) - 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)) - 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; 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">
@ -246,6 +248,9 @@
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>
<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> </div>
<h3 id="file_warn"></h3> <h3 id="file_warn"></h3>
<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',
@ -415,6 +420,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);
} }
}, },
}); });
@ -537,8 +543,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

View File

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