autoFormat & clearPoint
This commit is contained in:
parent
d27fc7c3fc
commit
bd008a2d48
@ -1230,15 +1230,14 @@ editor.prototype.listen = function () {
|
||||
});
|
||||
}
|
||||
|
||||
var clearLoc = document.getElementById('clearLoc');
|
||||
clearLoc.onmousedown = function(e){
|
||||
var _clearPoint = function (clearPoint) {
|
||||
editor.hideMidMenu();
|
||||
e.stopPropagation();
|
||||
editor.preMapData = null;
|
||||
reDo = null;
|
||||
editor.info = 0;
|
||||
editor_mode.onmode('');
|
||||
var now = editor.pos;
|
||||
if (clearPoint)
|
||||
editor.map[now.y][now.x]=editor.info;
|
||||
editor.updateMap();
|
||||
fields.forEach(function(v){
|
||||
@ -1249,11 +1248,23 @@ editor.prototype.listen = function () {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
;printf('清空此点及事件成功');
|
||||
;printf(clearPoint?'清空该点和事件成功':'只清空该点事件成功');
|
||||
editor.drawPosSelection();
|
||||
});
|
||||
}
|
||||
|
||||
var clearEvent = document.getElementById('clearEvent');
|
||||
clearEvent.onmousedown = function (e) {
|
||||
e.stopPropagation();
|
||||
_clearPoint(false);
|
||||
}
|
||||
|
||||
var clearLoc = document.getElementById('clearLoc');
|
||||
clearLoc.onmousedown = function(e){
|
||||
e.stopPropagation();
|
||||
_clearPoint(true);
|
||||
}
|
||||
|
||||
var brushMod=document.getElementById('brushMod');
|
||||
brushMod.onchange=function(){
|
||||
editor.brushMod=brushMod.value;
|
||||
|
||||
@ -64,11 +64,8 @@ editor_multi = function () {
|
||||
return '\t';
|
||||
}
|
||||
|
||||
editor_multi.format = function () {
|
||||
if (!editor_multi.lintAutocomplete) {
|
||||
alert("只有代码才能进行格式化操作!");
|
||||
return;
|
||||
}
|
||||
var _format = function () {
|
||||
if (!editor_multi.lintAutocomplete) return;
|
||||
codeEditor.setValue(js_beautify(codeEditor.getValue(), {
|
||||
brace_style: "collapse-preserve-inline",
|
||||
indent_with_tabs: true,
|
||||
@ -76,6 +73,15 @@ editor_multi = function () {
|
||||
}));
|
||||
}
|
||||
|
||||
editor_multi.format = function () {
|
||||
if (!editor_multi.lintAutocomplete) {
|
||||
alert("只有代码才能进行格式化操作!");
|
||||
return;
|
||||
}
|
||||
_format();
|
||||
}
|
||||
|
||||
|
||||
editor_multi.import = function (id_, args) {
|
||||
var thisTr = document.getElementById(id_);
|
||||
if (!thisTr) return false;
|
||||
@ -122,6 +128,8 @@ editor_multi = function () {
|
||||
editor_multi.id = '';
|
||||
return;
|
||||
}
|
||||
// ----- 自动格式化
|
||||
_format();
|
||||
if (editor_multi.id === 'callFromBlockly') {
|
||||
editor_multi.id = '';
|
||||
editor_multi.multiLineDone();
|
||||
|
||||
@ -316,6 +316,7 @@
|
||||
<div id='chooseInRight' class="menuitem"><div class="menuitem-content">在素材区选中此图块</div></div>
|
||||
<div id='copyLoc' class="menuitem"><div class="menuitem-content">复制此事件</div></div>
|
||||
<div id='moveLoc' class="menuitem"><div class="menuitem-content">移动此事件</div></div>
|
||||
<div id='clearEvent' class="menuitem"><div class="menuitem-content">仅清空此点事件</div></div>
|
||||
<div id='clearLoc' class="menuitem"><div class="menuitem-content">清空此点及事件</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -336,6 +336,7 @@
|
||||
<div id='chooseInRight' class="menuitem"><div class="menuitem-content">在素材区选中此图块</div></div>
|
||||
<div id='copyLoc' class="menuitem"><div class="menuitem-content">复制此事件</div></div>
|
||||
<div id='moveLoc' class="menuitem"><div class="menuitem-content">移动此事件</div></div>
|
||||
<div id='clearEvent' class="menuitem"><div class="menuitem-content">仅清空此点事件</div></div>
|
||||
<div id='clearLoc' class="menuitem"><div class="menuitem-content">清空此点及事件</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user