56 lines
2.2 KiB
HTML
56 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
<link href="/jscss/style.css" rel="stylesheet" type="text/css" />
|
|
<script type="text/javascript" charset="utf-8" src="/jscss/theme.js"></script>
|
|
</head>
|
|
|
|
<body style="overflow: hidden;height: 100vh;">
|
|
<ciy-textarea com="content" minheight="100%"></ciy-textarea>
|
|
<div class="fix b0" style="right:1em">
|
|
<ciy-select com="id" initevent style="display:inline-block;" minsearch="10"></ciy-select>
|
|
<button onclick="save()" class="btn smmm">保存(Ctrl+S)</button>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="/jscss/ciy.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
|
|
<script type="text/javascript" src="../common.js"></script>
|
|
<script type="text/javascript">
|
|
'use strict';
|
|
var table;
|
|
var Glob = {};
|
|
window.addEventListener('keydown', function (e) {
|
|
if (e.ctrlKey && e.keyCode == 83) {//Ctrl+S
|
|
e.preventDefault();
|
|
save();
|
|
}
|
|
});
|
|
ciyfn.pageload(function () {
|
|
ciyfn.callfunc('init', {}, function (json) {
|
|
Glob.com_id = ciycmp({ dom: $5('[com=id]'), value: json.id, range: json.ids, onchange: function (e) {
|
|
if (e.value == 0)
|
|
return;
|
|
ciyfn.callfunc('getdata', { id: e.value }, function (json) {
|
|
ciycmp({ dom: $5('[com=content]'), value: json.data.content, tab: '\t' });
|
|
});
|
|
}
|
|
});
|
|
});
|
|
});
|
|
function save() {
|
|
ciyfn.callfunc('update', { id: $5('[com=id]').val(), content: $5('[com=content]').val() }, function (json) {
|
|
if (json.newid) {
|
|
Glob.com_id.setrange([{ id: json.newid, name: json.newid + ':刚刚' }], true);
|
|
Glob.com_id.setvalue(json.newid);
|
|
}
|
|
ciyfn.toast('已保存');
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |