Browse Source

2.0.7.71

master
ming.hong 1 year ago
parent
commit
c758567b49
  1. 26
      Aida/python.html
  2. 4
      Aida/setting.html

26
Aida/python.html

@ -805,25 +805,41 @@
var rows = $grid.datagrid('getRows');
if (rows.length > 0 && rows[0].isNew) {
return;
return; // 如果已有新檔案輸入欄位,則不執行
}
// 增加輸入欄位在最上面
$grid.datagrid('insertRow', {
index: 0,
row: { filename: '<input type="text" class="new-file-name" placeholder="Enter new file name">', isNew: true }
row: {
filename: '<input type="text" class="new-file-name" placeholder="Enter new file name (must end with .py)">',
isNew: true
}
});
$grid.datagrid('selectRow', 0);
$('.new-file-name').on('keypress', function (e) {
if (e.which == 13) { // 按下 Enter
var newFileName = $(this).val();
// 是否以 .py 結尾
if (!newFileName.endsWith('.py')) {
alert('Only new Python files (.py) are supported');
return;
}
// 是否名稱有效
if (newFileName) {
pythoncode = ""
pythoncode = "";
func_FileUpload(newFileName);
}
// 刪除新檔案輸入欄位
$grid.datagrid('deleteRow', 0);
}
});
}
// 自動選擇列表中的某個文件
function selectFileInDataGrid(fileName) {
var $grid = $('#file-data-grid');
@ -954,6 +970,10 @@
if (file) {
var reader = new FileReader();
reader.onload = function(e) {
if (!file.name.endsWith('.py')) {
alert('Only supports uploading Python files (.py)');
return;
}
pythoncode = e.target.result;
var fileName = file.name;
func_FileUpload(fileName);

4
Aida/setting.html

@ -1958,7 +1958,7 @@
</div>
</div>
<div id="system_python_border" class="system_python_border" style="border:1px gray solid;padding:20px;margin:15px 15px 15px 15px;">
<div id="system_python_border" class="system_python_border" style="border:1px gray solid;padding:20px;margin:15px 15px 15px 15px;display:none;">
<div class="titlebox"><nobr id="TITLEBOX_PAGE22"></nobr></div>
<table align="center" valign="center" style="border-collapse: collapse; width: 900px; height: auto; ">
<tbody>
@ -1991,7 +1991,7 @@
<div>
<div align="center">
<input align="center" id="IDOK_python" type="button" value=" Set " onclick="func_setPythonData()" style="background-color:#6c87d4;color:white;height:36px;width:300px;" />
<input align="center" id="IDOK_python" type="button" value=" Set " onclick="func_setPythonData()" style="background-color:#6c87d4;color:white;height:36px;width:300px;display:none;" />
</div>
</div>

Loading…
Cancel
Save