Commit eb1ed39e authored by damjan's avatar damjan
Browse files

[FEATURE] Save (delete, rename, search) on Ctrl+Enter

Resolves: forge.typo3.org/issues/68523
parent b8fbb124
......@@ -14,7 +14,7 @@
<f:form id="contentForm" action="addConstantSave">
<f:if condition="{constantSelection} != '###default###'">
<div class="tx-lfeditor-buttons">
<f:form.submit value="{f:translate(key:'button.save')}" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.save')}" />
</div>
<p>
......
......@@ -21,7 +21,7 @@
<p class="tx-lfeditor-delConst">{constantSelection}</p>
<p>
<div class="tx-lfeditor-buttons">
<f:form.submit value="{f:translate(key:'button.delete')}" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.delete')}" />
</div>
</p>
</f:form>
......
......@@ -17,7 +17,7 @@
</h2>
<f:form id="contentForm" action="editConstantSave">
<div class="tx-lfeditor-buttons">
<f:form.submit value="{f:translate(key:'button.save')}" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.save')}" />
</div>
<f:for each="{languages}" key="lang" as="constValue" iteration="iterator">
......
......@@ -40,7 +40,7 @@
<f:if condition="{displayNextButton}">
<f:form.submit value="{f:translate(key:'button.session.next')}" onclick="submitLanguageFileEdit(2)" />
</f:if>
<f:form.submit value="{f:translate(key:'button.save')}" onclick="submitLanguageFileEdit(3)" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.save')}" onclick="submitLanguageFileEdit(3)" />
<f:form.submit value="{f:translate(key:'button.cancel')}" onclick="return confirmCancelFileEdit()" />
</div>
......
......@@ -147,7 +147,7 @@
</f:if>
<div class="tx-lfeditor-buttons">
<f:form.submit value="{f:translate(key:'button.save')}" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.save')}" />
</div>
</f:form>
</lfe:extendedIf>
......
......@@ -25,7 +25,7 @@
</p>
<div class="tx-lfeditor-buttons">
<f:form.submit value="{f:translate(key:'button.rename')}" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.rename')}" />
</div>
</f:form>
</lfe:extendedIf>
......
......@@ -19,7 +19,7 @@
</label>
<p>
<f:form.textfield name="searchStr" value="{searchString}" class="tx-lfeditor-wideField" />
<f:form.submit value="{f:translate(key:'button.search')}" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.search')}" />
</p>
<f:if condition="{searchResultArray}">
......
......@@ -135,4 +135,19 @@ function hideUnHideAll() {
}
hideAll = true;
}
}
\ No newline at end of file
}
/**
* Triggers click on button with id = 'tx-lfeditor-button-submit' when user presses Ctrl + Enter.
*
* @param eventParameter
* @returns void
*/
function saveOnKeyDown(eventParameter) {
var eventObject = window.event? event : eventParameter;
if (eventObject.keyCode == 13 && eventObject.ctrlKey) {
document.getElementById('tx-lfeditor-button-submit').click();
}
}
document.onkeydown = saveOnKeyDown;
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment