You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RnQ/Distro/Template/enterstring.htm

40 lines
1.1 KiB
HTML

<html window-resizable="false">
<head>
<include src="common.htm" />
<style src="enterstring.css" />
<script>
var txt = $("#txt"),
str = $("#str"),
okBtn = $("#ok"),
cancelBtn = $("#cancel");
view.uniqueid = view.parameters.uniqueid;
view.isDialog = true;
view.loadIcon("themepicsingle:" + view.parameters.icon);
if (view.icon == null) CommonNative.SetLargeWindowIcon(document, "");
if (view.parameters.text) txt.text = view.parameters.text; else txt.setVisible(false);
CommonNative.ShowTaskbarButton(document);
setupWindow(false, false, false);
translateWindow("span");
animateWindow();
function returnString() {
view.close(str.value.trim());
}
okBtn.on("click", () => { returnString() });
document.on("keydown", (e) => {
if (e.keyCode == Event.VK_ESCAPE || (e.ctrlKey && e.keyCode == Event.VK_W)) view.close();
else if (e.keyCode == Event.VK_RETURN && e.target == str) returnString();
});
</script>
</head>
<body>
<div id="txt"></div>
<div class="row">
<input uwp id="str" />
<button uwp id="ok"><span>OK</span></button>
</div>
</body>
</html>