Files
OMS/app/desktop/view/keyboard_setting.html
2026-01-04 19:08:31 +08:00

73 lines
2.9 KiB
HTML

<!--
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<form action="<{$form_action_url}>" method="POST" id="desktop_keyboard_setting_form" >
<{foreach from=$setting item=row key=key}>
<div class='gridlist-action'>
<strong class="span-auto c-black"><{$key}></strong>
</div>
<table cellspacing="0" cellpadding="0" border="0" class="gridlist">
<col style="width:50%"></col><col style="width:50%"></col>
<thead id="productNodeTitle">
<tr><th >功能</th><th >快捷键</th></tr>
</thead>
<tbody>
<{foreach from=$row item=item key=_key}>
<{if !$item.title}><{continue;}><{/if}>
<tr>
<td>
<label style="float:left;margin-left:1em"><input type="checkbox" name="keyboard_setting[<{$key}>][<{$_key}>][use]" value="true" <{if $item.use=='true'}>checked="checked"<{/if}> />
<{$item.title}></label>
</td>
<td>
<{foreach from=$item.params.control key=control item=flag}>
<input type="checkbox" name="keyboard_setting[<{$key}>][<{$_key}>][params][control][<{$control}>]" value="true" <{if $flag=='true'}>checked="checked"<{/if}> /><{$control|ucfirst}> +
<{/foreach}>
<{input type="select" options=$keyword value="{$item.params.keyword}" name="keyboard_setting[{$key}][{$_key}][params][keyword]" required="true" }>
</td>
</tr>
<{/foreach}>
</tbody>
</table>
<{/foreach}>
</form>
<{area inject='.mainFoot'}>
<div class="table-action">
<{button class="btn-close" label=$___a="保存设置"|t:'image' type="button" id="desktop_keyboard_setting_button"}>
</div>
<{/area}>
<script>
$('desktop_keyboard_setting_button').addEvent('click',function(){
var _form=$('desktop_keyboard_setting_form');
if(_form)new Request({url:_form.action,data:_form,method:'post',onComplete:function(keyObj){
_form.getParent('.dialog').retrieve('instance').close();
$(window.gecko?document.documentElement:document.body).removeEvents('keydown').addEvent('keydown',function(e){
if(e.target==this){
if(e.code==32)e.stop();
Hotkey.init(e,JSON.decode(keyObj));
}
});
}}).send();
});
</script>