Reformat _server & delete map
This commit is contained in:
parent
bff5298c7a
commit
81df4a9b19
@ -13,6 +13,7 @@
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
@ -28,7 +29,10 @@
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
|
||||
.CodeMirror-linenumbers {
|
||||
}
|
||||
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
@ -37,8 +41,13 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker { color: black; }
|
||||
.CodeMirror-guttermarker-subtle { color: #999; }
|
||||
.CodeMirror-guttermarker {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker-subtle {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
@ -47,24 +56,29 @@
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
|
||||
.cm-fat-cursor .CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0 !important;
|
||||
background: #7e7;
|
||||
}
|
||||
|
||||
.cm-fat-cursor div.CodeMirror-cursors {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cm-fat-cursor-mark {
|
||||
background-color: rgba(20, 255, 20, 0.5);
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
}
|
||||
|
||||
.cm-animate-fat-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
@ -73,82 +87,199 @@
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
background-color: #7e7;
|
||||
}
|
||||
|
||||
@-moz-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
0% {
|
||||
}
|
||||
50% {
|
||||
background-color: transparent;
|
||||
}
|
||||
100% {
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
0% {
|
||||
}
|
||||
50% {
|
||||
background-color: transparent;
|
||||
}
|
||||
100% {
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
0% {
|
||||
}
|
||||
50% {
|
||||
background-color: transparent;
|
||||
}
|
||||
100% {
|
||||
}
|
||||
}
|
||||
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror-overwrite .CodeMirror-cursor {}
|
||||
.CodeMirror-overwrite .CodeMirror-cursor {
|
||||
}
|
||||
|
||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||
.cm-tab {
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
.CodeMirror-rulers {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: -50px; bottom: -20px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: -50px;
|
||||
bottom: -20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
top: 0; bottom: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
.cm-strikethrough {text-decoration: line-through;}
|
||||
.cm-s-default .cm-header {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-quote {
|
||||
color: #090;
|
||||
}
|
||||
|
||||
.cm-negative {
|
||||
color: #d44;
|
||||
}
|
||||
|
||||
.cm-positive {
|
||||
color: #292;
|
||||
}
|
||||
|
||||
.cm-header, .cm-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cm-em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.cm-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.cm-strikethrough {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-keyword {
|
||||
color: #708;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-atom {
|
||||
color: #219;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-number {
|
||||
color: #164;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-def {
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-punctuation,
|
||||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
.cm-s-default .cm-operator {
|
||||
}
|
||||
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-invalidchar {color: #f00;}
|
||||
.cm-s-default .cm-variable-2 {
|
||||
color: #05a;
|
||||
}
|
||||
|
||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {
|
||||
color: #085;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-comment {
|
||||
color: #a50;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-string {
|
||||
color: #a11;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-string-2 {
|
||||
color: #f50;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-meta {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-qualifier {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-builtin {
|
||||
color: #30a;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-bracket {
|
||||
color: #997;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-tag {
|
||||
color: #170;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-attribute {
|
||||
color: #00c;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-hr {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-link {
|
||||
color: #00c;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-error {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.cm-invalidchar {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.CodeMirror-composing {
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
|
||||
/* Default styles for common addons */
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {
|
||||
color: #0b0;
|
||||
}
|
||||
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {
|
||||
color: #a22;
|
||||
}
|
||||
|
||||
.CodeMirror-matchingtag {
|
||||
background: rgba(255, 150, 0, .3);
|
||||
}
|
||||
|
||||
.CodeMirror-activeline-background {
|
||||
background: #e8f2ff;
|
||||
}
|
||||
|
||||
/* STOP */
|
||||
|
||||
@ -165,12 +296,14 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
overflow: scroll !important; /* Things will break if this is overridden */
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
margin-bottom: -30px;
|
||||
margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
border-right: 30px solid transparent;
|
||||
@ -184,28 +317,39 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0; bottom: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
min-height: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
@ -213,32 +357,45 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
vertical-align: top;
|
||||
margin-bottom: -30px;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-wrapper {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
background: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-background {
|
||||
position: absolute;
|
||||
top: 0; bottom: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
|
||||
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
|
||||
|
||||
.CodeMirror-gutter-wrapper ::selection {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-wrapper ::-moz-selection {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
min-height: 1px; /* prevents collapsing before first draw */
|
||||
}
|
||||
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
@ -255,6 +412,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
-webkit-font-variant-ligatures: contextual;
|
||||
font-variant-ligatures: contextual;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
@ -263,7 +421,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
@ -273,9 +434,12 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
padding: 0.1px; /* Force widget margins to stay inside of the container */
|
||||
}
|
||||
|
||||
.CodeMirror-widget {}
|
||||
.CodeMirror-widget {
|
||||
}
|
||||
|
||||
.CodeMirror-rtl pre { direction: rtl; }
|
||||
.CodeMirror-rtl pre {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.CodeMirror-code {
|
||||
outline: none;
|
||||
@ -303,13 +467,17 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror-measure pre {
|
||||
position: static;
|
||||
}
|
||||
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
div.CodeMirror-dragcursors {
|
||||
visibility: visible;
|
||||
}
|
||||
@ -318,11 +486,25 @@ div.CodeMirror-dragcursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
.CodeMirror-crosshair { cursor: crosshair; }
|
||||
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
|
||||
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
|
||||
.CodeMirror-selected {
|
||||
background: #d9d9d9;
|
||||
}
|
||||
|
||||
.CodeMirror-focused .CodeMirror-selected {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
|
||||
.CodeMirror-crosshair {
|
||||
cursor: crosshair;
|
||||
}
|
||||
|
||||
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
|
||||
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
|
||||
.cm-searching {
|
||||
background-color: #ffa;
|
||||
@ -330,7 +512,9 @@ div.CodeMirror-dragcursors {
|
||||
}
|
||||
|
||||
/* Used to force a border model for a node */
|
||||
.cm-force-border { padding-right: .1px; }
|
||||
.cm-force-border {
|
||||
padding-right: .1px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
@ -340,7 +524,11 @@ div.CodeMirror-dragcursors {
|
||||
}
|
||||
|
||||
/* See issue #2901 */
|
||||
.cm-tab-wrap-hack:after { content: ''; }
|
||||
.cm-tab-wrap-hack:after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
||||
span.CodeMirror-selectedtext {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@ -36,8 +36,10 @@
|
||||
|
||||
// If it's not a 'word-style' token, ignore the token.
|
||||
if (!/^[\w$_]*$/.test(token.string)) {
|
||||
token = {start: cur.ch, end: cur.ch, string: "", state: token.state,
|
||||
type: token.string == "." ? "property" : null};
|
||||
token = {
|
||||
start: cur.ch, end: cur.ch, string: "", state: token.state,
|
||||
type: token.string == "." ? "property" : null
|
||||
};
|
||||
} else if (token.end > cur.ch) {
|
||||
token.end = cur.ch;
|
||||
token.string = token.string.slice(0, cur.ch - token.start);
|
||||
@ -52,14 +54,18 @@
|
||||
if (!context) var context = [];
|
||||
context.push(tprop);
|
||||
}
|
||||
return {list: getCompletions(token, context, keywords, options),
|
||||
return {
|
||||
list: getCompletions(token, context, keywords, options),
|
||||
from: Pos(cur.line, token.start),
|
||||
to: Pos(cur.line, token.end)};
|
||||
to: Pos(cur.line, token.end)
|
||||
};
|
||||
}
|
||||
|
||||
function javascriptHint(editor, options) {
|
||||
return scriptHint(editor, javascriptKeywords,
|
||||
function (e, cur) {return e.getTokenAt(cur);},
|
||||
function (e, cur) {
|
||||
return e.getTokenAt(cur);
|
||||
},
|
||||
options);
|
||||
};
|
||||
CodeMirror.registerHelper("hint", "javascript", javascriptHint);
|
||||
@ -85,6 +91,7 @@
|
||||
function coffeescriptHint(editor, options) {
|
||||
return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);
|
||||
}
|
||||
|
||||
CodeMirror.registerHelper("hint", "coffeescript", coffeescriptHint);
|
||||
|
||||
var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
|
||||
@ -108,10 +115,12 @@
|
||||
|
||||
function getCompletions(token, context, keywords, options) {
|
||||
var found = [], start = token.string, global = options && options.globalScope || window;
|
||||
|
||||
function maybeAdd(str) {
|
||||
if (str == null || str == undefined) return;
|
||||
if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
|
||||
}
|
||||
|
||||
function gatherCompletions(obj) {
|
||||
if (typeof obj == "string") forEach(stringProps, maybeAdd);
|
||||
else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
mod(CodeMirror);
|
||||
})(function (CodeMirror) {
|
||||
"use strict";
|
||||
|
||||
// declare global: JSHINT
|
||||
|
||||
function validator(text, options) {
|
||||
|
||||
@ -31,9 +31,7 @@
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark-error {
|
||||
background-image:
|
||||
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
|
||||
;
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark-warning {
|
||||
@ -69,5 +67,6 @@
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right bottom;
|
||||
width: 100%; height: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@ -23,32 +23,45 @@
|
||||
tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
|
||||
tt.style.left = (e.clientX + 5) + "px";
|
||||
}
|
||||
|
||||
CodeMirror.on(document, "mousemove", position);
|
||||
position(e);
|
||||
if (tt.style.opacity != null) tt.style.opacity = 1;
|
||||
return tt;
|
||||
}
|
||||
|
||||
function rm(elt) {
|
||||
if (elt.parentNode) elt.parentNode.removeChild(elt);
|
||||
}
|
||||
|
||||
function hideTooltip(tt) {
|
||||
if (!tt.parentNode) return;
|
||||
if (tt.style.opacity == null) rm(tt);
|
||||
tt.style.opacity = 0;
|
||||
setTimeout(function() { rm(tt); }, 600);
|
||||
setTimeout(function () {
|
||||
rm(tt);
|
||||
}, 600);
|
||||
}
|
||||
|
||||
function showTooltipFor(e, content, node) {
|
||||
var tooltip = showTooltip(e, content);
|
||||
|
||||
function hide() {
|
||||
CodeMirror.off(node, "mouseout", hide);
|
||||
if (tooltip) { hideTooltip(tooltip); tooltip = null; }
|
||||
if (tooltip) {
|
||||
hideTooltip(tooltip);
|
||||
tooltip = null;
|
||||
}
|
||||
}
|
||||
|
||||
var poll = setInterval(function () {
|
||||
if (tooltip) for (var n = node; ; n = n.parentNode) {
|
||||
if (n && n.nodeType == 11) n = n.host;
|
||||
if (n == document.body) return;
|
||||
if (!n) { hide(); break; }
|
||||
if (!n) {
|
||||
hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!tooltip) return clearInterval(poll);
|
||||
}, 400);
|
||||
@ -60,7 +73,9 @@
|
||||
this.options = options;
|
||||
this.timeout = null;
|
||||
this.hasGutter = hasGutter;
|
||||
this.onMouseOver = function(e) { onMouseOver(cm, e); };
|
||||
this.onMouseOver = function (e) {
|
||||
onMouseOver(cm, e);
|
||||
};
|
||||
this.waitingFor = 0
|
||||
}
|
||||
|
||||
@ -123,16 +138,20 @@
|
||||
function lintAsync(cm, getAnnotations, passOptions) {
|
||||
var state = cm.state.lint
|
||||
var id = ++state.waitingFor
|
||||
|
||||
function abort() {
|
||||
id = -1
|
||||
cm.off("change", abort)
|
||||
}
|
||||
|
||||
cm.on("change", abort)
|
||||
getAnnotations(cm.getValue(), function (annotations, arg2) {
|
||||
cm.off("change", abort)
|
||||
if (state.waitingFor != id) return
|
||||
if (arg2 && annotations instanceof CodeMirror) annotations = arg2
|
||||
cm.operation(function() {updateLinting(cm, annotations)})
|
||||
cm.operation(function () {
|
||||
updateLinting(cm, annotations)
|
||||
})
|
||||
}, passOptions, cm);
|
||||
}
|
||||
|
||||
@ -151,9 +170,13 @@
|
||||
var annotations = getAnnotations(cm.getValue(), passOptions, cm);
|
||||
if (!annotations) return;
|
||||
if (annotations.then) annotations.then(function (issues) {
|
||||
cm.operation(function() {updateLinting(cm, issues)})
|
||||
cm.operation(function () {
|
||||
updateLinting(cm, issues)
|
||||
})
|
||||
});
|
||||
else cm.operation(function() {updateLinting(cm, annotations)})
|
||||
else cm.operation(function () {
|
||||
updateLinting(cm, annotations)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,7 +219,9 @@
|
||||
var state = cm.state.lint;
|
||||
if (!state) return;
|
||||
clearTimeout(state.timeout);
|
||||
state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
|
||||
state.timeout = setTimeout(function () {
|
||||
startLinting(cm);
|
||||
}, state.options.delay || 500);
|
||||
}
|
||||
|
||||
function popupTooltips(annotations, e) {
|
||||
|
||||
@ -56,7 +56,9 @@
|
||||
this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;
|
||||
|
||||
var self = this;
|
||||
cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); });
|
||||
cm.on("cursorActivity", this.activityFunc = function () {
|
||||
self.cursorActivity();
|
||||
});
|
||||
}
|
||||
|
||||
var requestAnimationFrame = window.requestAnimationFrame || function (fn) {
|
||||
@ -102,7 +104,9 @@
|
||||
this.close();
|
||||
} else {
|
||||
var self = this;
|
||||
this.debounce = requestAnimationFrame(function() {self.update();});
|
||||
this.debounce = requestAnimationFrame(function () {
|
||||
self.update();
|
||||
});
|
||||
if (this.widget) this.widget.disable();
|
||||
}
|
||||
},
|
||||
@ -153,22 +157,37 @@
|
||||
|
||||
function buildKeyMap(completion, handle) {
|
||||
var baseMap = {
|
||||
Up: function() {handle.moveFocus(-1);},
|
||||
Down: function() {handle.moveFocus(1);},
|
||||
PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},
|
||||
PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},
|
||||
Home: function() {handle.setFocus(0);},
|
||||
End: function() {handle.setFocus(handle.length - 1);},
|
||||
Up: function () {
|
||||
handle.moveFocus(-1);
|
||||
},
|
||||
Down: function () {
|
||||
handle.moveFocus(1);
|
||||
},
|
||||
PageUp: function () {
|
||||
handle.moveFocus(-handle.menuSize() + 1, true);
|
||||
},
|
||||
PageDown: function () {
|
||||
handle.moveFocus(handle.menuSize() - 1, true);
|
||||
},
|
||||
Home: function () {
|
||||
handle.setFocus(0);
|
||||
},
|
||||
End: function () {
|
||||
handle.setFocus(handle.length - 1);
|
||||
},
|
||||
Enter: handle.pick,
|
||||
Tab: handle.pick,
|
||||
Esc: handle.close
|
||||
};
|
||||
var custom = completion.options.customKeys;
|
||||
var ourMap = custom ? {} : baseMap;
|
||||
|
||||
function addBinding(key, val) {
|
||||
var bound;
|
||||
if (typeof val != "string")
|
||||
bound = function(cm) { return val(cm, handle); };
|
||||
bound = function (cm) {
|
||||
return val(cm, handle);
|
||||
};
|
||||
// This mechanism is deprecated
|
||||
else if (baseMap.hasOwnProperty(val))
|
||||
bound = baseMap[val];
|
||||
@ -176,6 +195,7 @@
|
||||
bound = val;
|
||||
ourMap[key] = bound;
|
||||
}
|
||||
|
||||
if (custom)
|
||||
for (var key in custom) if (custom.hasOwnProperty(key))
|
||||
addBinding(key, custom[key]);
|
||||
@ -254,19 +274,35 @@
|
||||
node.style.paddingRight = cm.display.nativeBarWidth + "px"
|
||||
|
||||
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
|
||||
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
|
||||
setFocus: function(n) { widget.changeActive(n); },
|
||||
menuSize: function() { return widget.screenAmount(); },
|
||||
moveFocus: function (n, avoidWrap) {
|
||||
widget.changeActive(widget.selectedHint + n, avoidWrap);
|
||||
},
|
||||
setFocus: function (n) {
|
||||
widget.changeActive(n);
|
||||
},
|
||||
menuSize: function () {
|
||||
return widget.screenAmount();
|
||||
},
|
||||
length: completions.length,
|
||||
close: function() { completion.close(); },
|
||||
pick: function() { widget.pick(); },
|
||||
close: function () {
|
||||
completion.close();
|
||||
},
|
||||
pick: function () {
|
||||
widget.pick();
|
||||
},
|
||||
data: data
|
||||
}));
|
||||
|
||||
if (completion.options.closeOnUnfocus) {
|
||||
var closingOnBlur;
|
||||
cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
|
||||
cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
|
||||
cm.on("blur", this.onBlur = function () {
|
||||
closingOnBlur = setTimeout(function () {
|
||||
completion.close();
|
||||
}, 100);
|
||||
});
|
||||
cm.on("focus", this.onFocus = function () {
|
||||
clearTimeout(closingOnBlur);
|
||||
});
|
||||
}
|
||||
|
||||
cm.on("scroll", this.onScroll = function () {
|
||||
@ -281,7 +317,10 @@
|
||||
|
||||
CodeMirror.on(hints, "dblclick", function (e) {
|
||||
var t = getHintElement(hints, e.target || e.srcElement);
|
||||
if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
|
||||
if (t && t.hintId != null) {
|
||||
widget.changeActive(t.hintId);
|
||||
widget.pick();
|
||||
}
|
||||
});
|
||||
|
||||
CodeMirror.on(hints, "click", function (e) {
|
||||
@ -293,7 +332,9 @@
|
||||
});
|
||||
|
||||
CodeMirror.on(hints, "mousedown", function () {
|
||||
setTimeout(function(){cm.focus();}, 20);
|
||||
setTimeout(function () {
|
||||
cm.focus();
|
||||
}, 20);
|
||||
});
|
||||
|
||||
CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]);
|
||||
@ -318,7 +359,11 @@
|
||||
disable: function () {
|
||||
this.completion.cm.removeKeyMap(this.keyMap);
|
||||
var widget = this;
|
||||
this.keyMap = {Enter: function() { widget.picked = true; }};
|
||||
this.keyMap = {
|
||||
Enter: function () {
|
||||
widget.picked = true;
|
||||
}
|
||||
};
|
||||
this.completion.cm.addKeyMap(this.keyMap);
|
||||
},
|
||||
|
||||
@ -371,6 +416,7 @@
|
||||
if (helpers.length) {
|
||||
var resolved = function (cm, callback, options) {
|
||||
var app = applicableHelpers(cm, helpers);
|
||||
|
||||
function run(i) {
|
||||
if (i == app.length) return callback(null)
|
||||
fetchHints(app[i], cm, options, function (result) {
|
||||
@ -378,17 +424,23 @@
|
||||
else run(i + 1)
|
||||
})
|
||||
}
|
||||
|
||||
run(0)
|
||||
}
|
||||
resolved.async = true
|
||||
resolved.supportsSelection = true
|
||||
return resolved
|
||||
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
|
||||
return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }
|
||||
return function (cm) {
|
||||
return CodeMirror.hint.fromList(cm, {words: words})
|
||||
}
|
||||
} else if (CodeMirror.hint.anyword) {
|
||||
return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }
|
||||
return function (cm, options) {
|
||||
return CodeMirror.hint.anyword(cm, options)
|
||||
}
|
||||
} else {
|
||||
return function() {}
|
||||
return function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,9 +1,14 @@
|
||||
|
||||
html,body,div,img{margin:0;padding:0;}
|
||||
html, body, div, img {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
/* ::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
} */
|
||||
@ -12,11 +17,13 @@ body{
|
||||
min-height: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#left, #mid, #right {
|
||||
border-radius: 2px;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
||||
}
|
||||
|
||||
#left {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
@ -34,6 +41,7 @@ body{
|
||||
/* padding: 10px 5px; */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#pout {
|
||||
display: block;
|
||||
width: 410px;
|
||||
@ -49,13 +57,15 @@ body{
|
||||
border-radius: 2px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#editTip {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
bottom:10px;
|
||||
margin-bottom: 120px;
|
||||
bottom: 0;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
#editArea p {
|
||||
margin: 10px;
|
||||
display: block;
|
||||
@ -64,11 +74,13 @@ body{
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#editTip .btn {
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#mid {
|
||||
position: absolute;
|
||||
left: 448px;
|
||||
@ -76,6 +88,7 @@ body{
|
||||
width: 440px;
|
||||
height: 630px;
|
||||
}
|
||||
|
||||
.map {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
@ -83,6 +96,7 @@ body{
|
||||
width: 416px;
|
||||
height: 416px;
|
||||
}
|
||||
|
||||
#mid .tools {
|
||||
position: absolute;
|
||||
width: 425px;
|
||||
@ -94,6 +108,7 @@ body{
|
||||
margin-left: 8px;;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#tip {
|
||||
float: right;
|
||||
width: 50%;
|
||||
@ -106,12 +121,14 @@ body{
|
||||
font-size: 15px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.files {
|
||||
width: 50%;
|
||||
height: 120px;
|
||||
/* padding: 10px; */
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.input {
|
||||
display: block;
|
||||
max-width: 150px;
|
||||
@ -125,21 +142,25 @@ body{
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
}
|
||||
|
||||
#bgSelect {
|
||||
width: 50%;
|
||||
height: 100px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#bgSelect span {
|
||||
/* display: block; */
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
#printOut {
|
||||
margin-top: 10px;
|
||||
height: 20px;
|
||||
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 80px;
|
||||
border-radius: 2px;
|
||||
@ -164,10 +185,12 @@ body{
|
||||
color: #fff;
|
||||
background-color: #26A69A;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
background-color: #009688;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
||||
}
|
||||
|
||||
#right {
|
||||
position: absolute;
|
||||
left: 900px;
|
||||
@ -176,6 +199,7 @@ body{
|
||||
height: 630px;
|
||||
/* border: 1px solid rgb(238, 13, 13); */
|
||||
}
|
||||
|
||||
#iconLib {
|
||||
position: absolute;
|
||||
width: 435px;
|
||||
@ -184,12 +208,15 @@ body{
|
||||
top: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.egameCanvas {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.gameCanvas {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#dataSelection, .appendSelection {
|
||||
position: absolute;
|
||||
/* top:0;
|
||||
@ -206,15 +233,18 @@ body{
|
||||
box-shadow: 0 0 0 2px #fff,
|
||||
0 0 0 3px #000;
|
||||
}
|
||||
|
||||
.warnText {
|
||||
color: #D50000;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
.infoText {
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.successText {
|
||||
color: #00897B;
|
||||
line-height: 1.2em;
|
||||
@ -225,18 +255,22 @@ table, td {
|
||||
color: #fff;
|
||||
cursor: crosshair;
|
||||
}
|
||||
|
||||
table.col {
|
||||
position: relative;
|
||||
|
||||
text-align: center;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table.col td {
|
||||
background-color: #4DB6AC;
|
||||
}
|
||||
|
||||
#arrColMark td {
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
#arrColMark {
|
||||
top: 2px;
|
||||
left: 36px;
|
||||
@ -244,6 +278,7 @@ table.col td{
|
||||
height: 16px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#mapColMark {
|
||||
top: 2px;
|
||||
left: 19px;
|
||||
@ -251,9 +286,11 @@ table.col td{
|
||||
height: 16px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#mapColMark td {
|
||||
width: 29px;
|
||||
}
|
||||
|
||||
#mapColMark td:hover .colBlock {
|
||||
position: absolute;
|
||||
top: 19px;
|
||||
@ -262,15 +299,18 @@ table.col td{
|
||||
z-index: 100;
|
||||
background-color: rgba(38, 166, 154, .5);
|
||||
}
|
||||
|
||||
table.row {
|
||||
position: relative;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table.row td {
|
||||
background-color: #4C221B;
|
||||
}
|
||||
|
||||
#arrRowMark {
|
||||
top: 5px;
|
||||
left: 2px;
|
||||
@ -278,6 +318,7 @@ table.row td{
|
||||
height: 262px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#mapRowMark {
|
||||
top: 1px;
|
||||
left: 2px;
|
||||
@ -285,9 +326,11 @@ table.row td{
|
||||
height: 416px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#mapRowMark td {
|
||||
height: 29px;
|
||||
}
|
||||
|
||||
#mapRowMark td:hover .rowBlock {
|
||||
position: absolute;
|
||||
left: 18px;
|
||||
@ -296,6 +339,7 @@ table.row td{
|
||||
z-index: 100;
|
||||
background-color: rgba(76, 34, 27, .5);
|
||||
}
|
||||
|
||||
/* for vue dom */
|
||||
[v-cloak] {
|
||||
display: none !important;
|
||||
|
||||
@ -9,9 +9,18 @@
|
||||
position: absolute;
|
||||
height: 630px;
|
||||
}
|
||||
.leftTab > *{margin:2.5px 5px;}
|
||||
.leftTab > :first-child{margin-top:5px;}
|
||||
.leftTab > :last-child{margin-bottom:5px;}
|
||||
|
||||
.leftTab > * {
|
||||
margin: 2.5px 5px;
|
||||
}
|
||||
|
||||
.leftTab > :first-child {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.leftTab > :last-child {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.leftTab {
|
||||
left: 5px;
|
||||
@ -63,7 +72,12 @@
|
||||
height: 95%;
|
||||
width: 35%;
|
||||
}
|
||||
#left6 #codeArea {width: 99.5%; height: 15.4em;overflow:y;/* resize:none; */}
|
||||
|
||||
#left6 #codeArea {
|
||||
width: 99.5%;
|
||||
height: 15.4em;
|
||||
overflow: y; /* resize:none; */
|
||||
}
|
||||
|
||||
#left7 {
|
||||
/* height: 440px; width: 375px;float:left; */
|
||||
@ -75,6 +89,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#left7 .CodeMirror {
|
||||
/* border-top: 1px solid black;
|
||||
border-bottom: 1px solid black; */
|
||||
@ -95,36 +110,54 @@
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.etable table {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.etable table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.etable table th {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.etable table th,
|
||||
.etable table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #dfe2e5;
|
||||
}
|
||||
|
||||
.etable table tr {
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #c6cbd1;
|
||||
}
|
||||
|
||||
.etable table tr:nth-child(2n) {
|
||||
background-color: #f6f8fa;
|
||||
}
|
||||
|
||||
/* copy end --------------------------------------------- */
|
||||
|
||||
.etable tr {width:100%}
|
||||
.etable tr > :nth-child(1) {width:20%}
|
||||
.etable tr > :nth-child(2) {width:20%}
|
||||
.etable tr > :nth-child(3) {width:60%}
|
||||
.etable tr {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.etable tr > :nth-child(1) {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.etable tr > :nth-child(2) {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.etable tr > :nth-child(3) {
|
||||
width: 60%
|
||||
}
|
||||
|
||||
.etable table {
|
||||
overflow: visible;
|
||||
@ -188,6 +221,7 @@ div.etableInputDiv {
|
||||
.etableInputDiv textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.etableInputDiv textarea:hover {
|
||||
margin: -5px;
|
||||
}
|
||||
|
||||
@ -12,7 +12,11 @@ editor.prototype.init = function(callback){
|
||||
editor.reset(function () {
|
||||
editor.drawMapBg();
|
||||
var mapArray = core.maps.save(core.status.maps, core.status.floorId);
|
||||
editor.map = mapArray.map(function(v){return v.map(function(v){return editor.ids[[editor.indexs[parseInt(v)][0]]]})});
|
||||
editor.map = mapArray.map(function (v) {
|
||||
return v.map(function (v) {
|
||||
return editor.ids[[editor.indexs[parseInt(v)][0]]]
|
||||
})
|
||||
});
|
||||
editor.updateMap();
|
||||
editor.currentFloorId = core.status.floorId;
|
||||
editor.currentFloorData = core.floors[core.status.floorId];
|
||||
@ -22,9 +26,21 @@ editor.prototype.init = function(callback){
|
||||
}
|
||||
|
||||
var afterMainInit = function () {
|
||||
core.floors=JSON.parse(JSON.stringify(core.floors,function(k,v){if(v instanceof Function){return v.toString()}else return v}));
|
||||
core.data=JSON.parse(JSON.stringify(core.data,function(k,v){if(v instanceof Function){return v.toString()}else return v}));
|
||||
data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d=JSON.parse(JSON.stringify(data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d,function(k,v){if(v instanceof Function){return v.toString()}else return v}));
|
||||
core.floors = JSON.parse(JSON.stringify(core.floors, function (k, v) {
|
||||
if (v instanceof Function) {
|
||||
return v.toString()
|
||||
} else return v
|
||||
}));
|
||||
core.data = JSON.parse(JSON.stringify(core.data, function (k, v) {
|
||||
if (v instanceof Function) {
|
||||
return v.toString()
|
||||
} else return v
|
||||
}));
|
||||
data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = JSON.parse(JSON.stringify(data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d, function (k, v) {
|
||||
if (v instanceof Function) {
|
||||
return v.toString()
|
||||
} else return v
|
||||
}));
|
||||
editor.main = main;
|
||||
editor.core = core;
|
||||
editor.fs = fs;
|
||||
@ -178,7 +194,11 @@ editor.prototype.drawMapBg = function(img){
|
||||
}
|
||||
|
||||
editor.prototype.updateMap = function () {
|
||||
var blocks = main.editor.mapIntoBlocks(editor.map.map(function(v){return v.map(function(v){return v.idnum||v||0})}),{'events':{},'changeFloor':{}});
|
||||
var blocks = main.editor.mapIntoBlocks(editor.map.map(function (v) {
|
||||
return v.map(function (v) {
|
||||
return v.idnum || v || 0
|
||||
})
|
||||
}), {'events': {}, 'changeFloor': {}});
|
||||
core.status.thisMap.blocks = blocks;
|
||||
main.editor.updateMap();
|
||||
|
||||
@ -303,11 +323,19 @@ editor.prototype.updateMap = function(){
|
||||
}
|
||||
|
||||
editor.prototype.changeFloor = function (floorId, callback) {
|
||||
editor.currentFloorData.map = editor.map.map(function(v){return v.map(function(v){return v.idnum||v||0})});
|
||||
editor.currentFloorData.map = editor.map.map(function (v) {
|
||||
return v.map(function (v) {
|
||||
return v.idnum || v || 0
|
||||
})
|
||||
});
|
||||
core.changeFloor(floorId, null, core.firstData.hero.loc, null, function () {
|
||||
editor.drawMapBg();
|
||||
var mapArray = core.maps.save(core.status.maps, core.status.floorId);
|
||||
editor.map = mapArray.map(function(v){return v.map(function(v){return editor.ids[[editor.indexs[parseInt(v)][0]]]})});
|
||||
editor.map = mapArray.map(function (v) {
|
||||
return v.map(function (v) {
|
||||
return editor.ids[[editor.indexs[parseInt(v)][0]]]
|
||||
})
|
||||
});
|
||||
editor.updateMap();
|
||||
editor.currentFloorId = core.status.floorId;
|
||||
editor.currentFloorData = core.floors[core.status.floorId];
|
||||
@ -324,7 +352,9 @@ editor.prototype.guid = function() {
|
||||
}
|
||||
|
||||
editor.prototype.HTMLescape = function (str_) {
|
||||
return String(str_).split('').map(function(v){return '&#'+v.charCodeAt(0)+';'}).join('');
|
||||
return String(str_).split('').map(function (v) {
|
||||
return '&#' + v.charCodeAt(0) + ';'
|
||||
}).join('');
|
||||
}
|
||||
|
||||
editor.prototype.listen = function () {
|
||||
@ -344,7 +374,8 @@ editor.prototype.listen = function() {
|
||||
'y': scrollTop + e.clientY - mid.offsetTop - mapEdit.offsetTop,
|
||||
'size': 32
|
||||
};
|
||||
return editor.loc; }//返回可用的组件内坐标
|
||||
return editor.loc;
|
||||
}//返回可用的组件内坐标
|
||||
|
||||
function locToPos(loc) {
|
||||
editor.pos = {'x': ~~(loc.x / loc.size), 'y': ~~(loc.y / loc.size)}
|
||||
@ -355,6 +386,7 @@ editor.prototype.listen = function() {
|
||||
var stepPostfix = null;//用于存放寻路检测的第一个点之后的后续移动
|
||||
|
||||
var mouseOutCheck = 2;
|
||||
|
||||
function clear1() {
|
||||
if (mouseOutCheck > 1) {
|
||||
mouseOutCheck--;
|
||||
@ -395,7 +427,9 @@ editor.prototype.listen = function() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (holdingPath == 0) { return; }
|
||||
if (holdingPath == 0) {
|
||||
return;
|
||||
}
|
||||
mouseOutCheck = 2;
|
||||
e.stopPropagation();
|
||||
var loc = eToLoc(e);
|
||||
|
||||
@ -293,7 +293,6 @@ editor_blockly.runOne = function (){
|
||||
//console.log(converter);
|
||||
|
||||
|
||||
|
||||
var script = document.createElement('script');
|
||||
//var initscript = document.getElementById('initscript').innerText;
|
||||
script.innerHTML = converter.mainFile[5] + initscript;
|
||||
@ -346,7 +345,9 @@ editor_blockly.runCode = function () {
|
||||
|
||||
editor_blockly.parse = function () {
|
||||
MotaActionFunctions.parse(
|
||||
eval('obj=' + codeAreaHL.getValue().replace(/[<>&]/g,function(c){return {'<':'<','>':'>','&':'&'}[c];})),
|
||||
eval('obj=' + codeAreaHL.getValue().replace(/[<>&]/g, function (c) {
|
||||
return {'<': '<', '>': '>', '&': '&'}[c];
|
||||
})),
|
||||
document.getElementById('entryType').value
|
||||
);
|
||||
}
|
||||
@ -427,7 +428,8 @@ editor_blockly.doubleClickBlock = function (blockId){
|
||||
var value = b.getFieldValue(f);
|
||||
//多行编辑
|
||||
editor_multi.multiLineEdit(value, b, f, {'lint': f === 'RawEvalString_0'}, function (newvalue, b, f) {
|
||||
if(textStringDict[b.type]!=='RawEvalString_0'){}
|
||||
if (textStringDict[b.type] !== 'RawEvalString_0') {
|
||||
}
|
||||
b.setFieldValue(newvalue.split('\n').join('\\n'), f);
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,7 +20,9 @@ editor_file = function(editor, callback){
|
||||
script.onload = function () {
|
||||
editor_file[value] = eval(key.replace('.', '_') + '_c456ea59_6018_45ef_8bcc_211a24c627dc');
|
||||
var loaded = Boolean(callback);
|
||||
for(var key_ in commentjs){loaded = loaded && editor_file[commentjs[key_]]}
|
||||
for (var key_ in commentjs) {
|
||||
loaded = loaded && editor_file[commentjs[key_]]
|
||||
}
|
||||
if (loaded) callback();
|
||||
}
|
||||
})(key);
|
||||
@ -28,7 +30,11 @@ editor_file = function(editor, callback){
|
||||
|
||||
|
||||
editor_file.getFloorFileList = function (callback) {
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
/* var fs = editor.fs;
|
||||
fs.readdir('project/floors',function(err, data){
|
||||
callback([data,err]);
|
||||
@ -38,7 +44,11 @@ editor_file = function(editor, callback){
|
||||
//callback([Array<String>,err:String])
|
||||
editor_file.loadFloorFile = function (filename, callback) {
|
||||
//filename不含'/'不含'.js'
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
/* var fs = editor.fs;
|
||||
fs.readFile('project/floors/'+filename+'.js','utf-8',function(err, data){
|
||||
if (err!=null){callback(err);return;}
|
||||
@ -63,16 +73,28 @@ editor_file = function(editor, callback){
|
||||
}
|
||||
//callback(err:String)
|
||||
editor_file.saveFloorFile = function (callback) {
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
/* if (!isset(editor.currentFloorId) || !isset(editor.currentFloorData)) {
|
||||
callback('未选中文件或无数据');
|
||||
} */
|
||||
var filename = 'project/floors/' + editor.currentFloorId + '.js';
|
||||
var datastr = ['main.floors.', editor.currentFloorId, '=\n{'];
|
||||
if (editor.currentFloorData.map == 'new')
|
||||
editor.currentFloorData.map = editor.map.map(function(v){return v.map(function(){return 0})});
|
||||
editor.currentFloorData.map = editor.map.map(function (v) {
|
||||
return v.map(function () {
|
||||
return 0
|
||||
})
|
||||
});
|
||||
else
|
||||
editor.currentFloorData.map = editor.map.map(function(v){return v.map(function(v){return v.idnum||v||0})});
|
||||
editor.currentFloorData.map = editor.map.map(function (v) {
|
||||
return v.map(function (v) {
|
||||
return v.idnum || v || 0
|
||||
})
|
||||
});
|
||||
for (var ii in editor.currentFloorData)
|
||||
if (editor.currentFloorData.hasOwnProperty(ii)) {
|
||||
if (ii == 'map')
|
||||
@ -89,12 +111,30 @@ editor_file = function(editor, callback){
|
||||
//callback(err:String)
|
||||
editor_file.saveNewFile = function (saveFilename, callback) {
|
||||
//saveAsFilename不含'/'不含'.js'
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (!isset(editor.currentFloorData)) {
|
||||
callback('无数据');
|
||||
}
|
||||
editor.currentFloorData={floorId: saveFilename, title: "新建楼层", name: "0", canFlyTo: true, canUseQuickShop: true, images: [], item_ratio: 1,
|
||||
firstArrive: [], events: {}, changeFloor: {}, afterBattle: {}, afterGetItem: {}, afterOpenDoor: {}, cannotMove: {}};
|
||||
editor.currentFloorData = {
|
||||
floorId: saveFilename,
|
||||
title: "新建楼层",
|
||||
name: "0",
|
||||
canFlyTo: true,
|
||||
canUseQuickShop: true,
|
||||
images: [],
|
||||
item_ratio: 1,
|
||||
firstArrive: [],
|
||||
events: {},
|
||||
changeFloor: {},
|
||||
afterBattle: {},
|
||||
afterGetItem: {},
|
||||
afterOpenDoor: {},
|
||||
cannotMove: {}
|
||||
};
|
||||
editor.currentFloorData.map = "new";
|
||||
editor.currentFloorId = saveFilename;
|
||||
editor_file.saveFloorFile(callback);
|
||||
@ -104,7 +144,11 @@ editor_file = function(editor, callback){
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
editor_file.changeIdAndIdnum = function (id, idnum, info, callback) {
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
//检查maps中是否有重复的idnum或id
|
||||
var change = -1;
|
||||
for (var ii in editor.core.maps.blocksInfo) {
|
||||
@ -152,10 +196,20 @@ editor_file = function(editor, callback){
|
||||
saveSetting('maps', [["add", "['" + idnum + "']", {'cls': info.images, 'id': id}]], tempcallback);
|
||||
saveSetting('icons', [["add", "['" + info.images + "']['" + id + "']", info.y]], tempcallback);
|
||||
if (info.images === 'items') {
|
||||
saveSetting('items',[["add","['items']['"+id+"']",editor_file.comment._data.items_template]],function(err){if(err){printe(err);throw(err)}});
|
||||
saveSetting('items', [["add", "['items']['" + id + "']", editor_file.comment._data.items_template]], function (err) {
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
});
|
||||
}
|
||||
if (info.images === 'enemys' || info.images === 'enemy48') {
|
||||
saveSetting('enemys',[["add","['"+id+"']",editor_file.comment._data.enemys_template]],function(err){if(err){printe(err);throw(err)}});
|
||||
saveSetting('enemys', [["add", "['" + id + "']", editor_file.comment._data.enemys_template]], function (err) {
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
callback(null);
|
||||
@ -169,7 +223,11 @@ editor_file = function(editor, callback){
|
||||
]
|
||||
为[]时只查询不修改
|
||||
*/
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
actionList.forEach(function (value) {
|
||||
var tempindex = value[1].indexOf(']') + 1;
|
||||
@ -232,7 +290,11 @@ editor_file = function(editor, callback){
|
||||
]
|
||||
为[]时只查询不修改
|
||||
*/
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
actionList.forEach(function (value) {
|
||||
value[1] = "['" + id + "']" + value[1];
|
||||
@ -277,7 +339,11 @@ editor_file = function(editor, callback){
|
||||
]
|
||||
为[]时只查询不修改
|
||||
*/
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
actionList.forEach(function (value) {
|
||||
value[1] = "['" + idnum + "']" + value[1];
|
||||
@ -322,7 +388,11 @@ editor_file = function(editor, callback){
|
||||
]
|
||||
为[]时只查询不修改
|
||||
*/
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
actionList.forEach(function (value) {
|
||||
value[1] = value[1] + "['" + x + "," + y + "']";
|
||||
@ -370,7 +440,11 @@ editor_file = function(editor, callback){
|
||||
]
|
||||
为[]时只查询不修改
|
||||
*/
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
saveSetting('floors', actionList, function (err) {
|
||||
callback([
|
||||
@ -423,7 +497,11 @@ editor_file = function(editor, callback){
|
||||
为[]时只查询不修改
|
||||
*/
|
||||
var data_obj = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d;
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
saveSetting('data', actionList, function (err) {
|
||||
callback([
|
||||
@ -463,7 +541,13 @@ editor_file = function(editor, callback){
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
var fmap = {};
|
||||
var fjson = JSON.stringify(functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a,function(k,v){if(v instanceof Function){var id_ = editor.guid();fmap[id_]=v.toString();return id_;}else return v},4);
|
||||
var fjson = JSON.stringify(functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a, function (k, v) {
|
||||
if (v instanceof Function) {
|
||||
var id_ = editor.guid();
|
||||
fmap[id_] = v.toString();
|
||||
return id_;
|
||||
} else return v
|
||||
}, 4);
|
||||
var fobj = JSON.parse(fjson);
|
||||
editor_file.functionsMap = fmap;
|
||||
editor_file.functionsJSON = fjson;
|
||||
@ -481,7 +565,11 @@ editor_file = function(editor, callback){
|
||||
]
|
||||
为[]时只查询不修改
|
||||
*/
|
||||
if (!isset(callback)) {printe('未设置callback');throw('未设置callback')};
|
||||
if (!isset(callback)) {
|
||||
printe('未设置callback');
|
||||
throw('未设置callback')
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
saveSetting('functions', actionList, function (err) {
|
||||
callback([
|
||||
@ -562,7 +650,13 @@ editor_file = function(editor, callback){
|
||||
//datastr+=JSON.stringify(maps_90f36752_8815_4be8_b32b_d7fad1d0542e,null,4);
|
||||
|
||||
var emap = {};
|
||||
var estr = JSON.stringify(maps_90f36752_8815_4be8_b32b_d7fad1d0542e,function(k,v){if(v.id!=null){var id_ = editor.guid();emap[id_]=JSON.stringify(v);return id_;}else return v},'\t');
|
||||
var estr = JSON.stringify(maps_90f36752_8815_4be8_b32b_d7fad1d0542e, function (k, v) {
|
||||
if (v.id != null) {
|
||||
var id_ = editor.guid();
|
||||
emap[id_] = JSON.stringify(v);
|
||||
return id_;
|
||||
} else return v
|
||||
}, '\t');
|
||||
for (var id_ in emap) {
|
||||
estr = estr.replace('"' + id_ + '"', emap[id_])
|
||||
}
|
||||
@ -590,7 +684,13 @@ editor_file = function(editor, callback){
|
||||
});
|
||||
var datastr = 'enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = \n';
|
||||
var emap = {};
|
||||
var estr = JSON.stringify(enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80,function(k,v){if(v.hp!=null){var id_ = editor.guid();emap[id_]=JSON.stringify(v);return id_;}else return v},'\t');
|
||||
var estr = JSON.stringify(enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80, function (k, v) {
|
||||
if (v.hp != null) {
|
||||
var id_ = editor.guid();
|
||||
emap[id_] = JSON.stringify(v);
|
||||
return id_;
|
||||
} else return v
|
||||
}, '\t');
|
||||
for (var id_ in emap) {
|
||||
estr = estr.replace('"' + id_ + '"', emap[id_])
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ function editor_mode(){
|
||||
this.info = {};
|
||||
this.appendPic = {};
|
||||
}
|
||||
|
||||
editor_mode.prototype.init = function (callback) {
|
||||
if (Boolean(callback)) callback();
|
||||
}
|
||||
@ -189,29 +190,71 @@ editor_mode.prototype.doActionList = function(mode,actionList){
|
||||
switch (mode) {
|
||||
case 'loc':
|
||||
|
||||
editor.file.editLoc(editor_mode.pos.x,editor_mode.pos.y,actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
editor.file.editLoc(editor_mode.pos.x, editor_mode.pos.y, actionList, function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printf('修改成功')
|
||||
});
|
||||
break;
|
||||
case 'emenyitem':
|
||||
|
||||
if (editor_mode.info.images == 'enemys' || editor_mode.info.images == 'enemy48') {
|
||||
editor.file.editEnemy(editor_mode.info.id,actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
editor.file.editEnemy(editor_mode.info.id, actionList, function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printf('修改成功')
|
||||
});
|
||||
} else if (editor_mode.info.images == 'items') {
|
||||
editor.file.editItem(editor_mode.info.id,actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
editor.file.editItem(editor_mode.info.id, actionList, function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printf('修改成功')
|
||||
});
|
||||
} else {
|
||||
editor.file.editMapBlocksInfo(editor_mode.info.idnum,actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
editor.file.editMapBlocksInfo(editor_mode.info.idnum, actionList, function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printf('修改成功')
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'floor':
|
||||
|
||||
editor.file.editFloor(actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
editor.file.editFloor(actionList, function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printf('修改成功')
|
||||
});
|
||||
break;
|
||||
case 'tower':
|
||||
|
||||
editor.file.editTower(actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
editor.file.editTower(actionList, function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printf('修改成功')
|
||||
});
|
||||
break;
|
||||
case 'functions':
|
||||
|
||||
editor.file.editFunctions(actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
editor.file.editFunctions(actionList, function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printf('修改成功')
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -245,7 +288,10 @@ editor_mode.prototype.loc = function(callback){
|
||||
document.getElementById('pos_a6771a78_a099_417c_828f_0a24851ebfce').innerText = editor_mode.pos.x + ',' + editor_mode.pos.y;
|
||||
|
||||
var objs = [];
|
||||
editor.file.editLoc(editor_mode.pos.x,editor_mode.pos.y,[],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
editor.file.editLoc(editor_mode.pos.x, editor_mode.pos.y, [], function (objs_) {
|
||||
objs = objs_;
|
||||
/*console.log(objs_)*/
|
||||
});
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo = editor_mode.objToTable_(objs[0], objs[1]);
|
||||
document.getElementById('table_3d846fc4_7644_44d1_aa04_433d266a73df').innerHTML = tableinfo.HTML;
|
||||
@ -269,13 +315,22 @@ editor_mode.prototype.emenyitem = function(callback){
|
||||
|
||||
var objs = [];
|
||||
if (editor_mode.info.images == 'enemys' || editor_mode.info.images == 'enemy48') {
|
||||
editor.file.editEnemy(editor_mode.info.id,[],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
editor.file.editEnemy(editor_mode.info.id, [], function (objs_) {
|
||||
objs = objs_;
|
||||
/*console.log(objs_)*/
|
||||
});
|
||||
} else if (editor_mode.info.images == 'items') {
|
||||
editor.file.editItem(editor_mode.info.id,[],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
editor.file.editItem(editor_mode.info.id, [], function (objs_) {
|
||||
objs = objs_;
|
||||
/*console.log(objs_)*/
|
||||
});
|
||||
} else {
|
||||
/* document.getElementById('table_a3f03d4c_55b8_4ef6_b362_b345783acd72').innerHTML='';
|
||||
return; */
|
||||
editor.file.editMapBlocksInfo(editor_mode.info.idnum,[],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
editor.file.editMapBlocksInfo(editor_mode.info.idnum, [], function (objs_) {
|
||||
objs = objs_;
|
||||
/*console.log(objs_)*/
|
||||
});
|
||||
}
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo = editor_mode.objToTable_(objs[0], objs[1]);
|
||||
@ -287,7 +342,10 @@ editor_mode.prototype.emenyitem = function(callback){
|
||||
|
||||
editor_mode.prototype.floor = function (callback) {
|
||||
var objs = [];
|
||||
editor.file.editFloor([],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
editor.file.editFloor([], function (objs_) {
|
||||
objs = objs_;
|
||||
/*console.log(objs_)*/
|
||||
});
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo = editor_mode.objToTable_(objs[0], objs[1]);
|
||||
document.getElementById('table_4a3b1b09_b2fb_4bdf_b9ab_9f4cdac14c74').innerHTML = tableinfo.HTML;
|
||||
@ -297,7 +355,10 @@ editor_mode.prototype.floor = function(callback){
|
||||
|
||||
editor_mode.prototype.tower = function (callback) {
|
||||
var objs = [];
|
||||
editor.file.editTower([],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
editor.file.editTower([], function (objs_) {
|
||||
objs = objs_;
|
||||
/*console.log(objs_)*/
|
||||
});
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo = editor_mode.objToTable_(objs[0], objs[1]);
|
||||
document.getElementById('table_b6a03e4c_5968_4633_ac40_0dfdd2c9cde5').innerHTML = tableinfo.HTML;
|
||||
@ -307,7 +368,10 @@ editor_mode.prototype.tower = function(callback){
|
||||
|
||||
editor_mode.prototype.functions = function (callback) {
|
||||
var objs = [];
|
||||
editor.file.editFunctions([],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
editor.file.editFunctions([], function (objs_) {
|
||||
objs = objs_;
|
||||
/*console.log(objs_)*/
|
||||
});
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo = editor_mode.objToTable_(objs[0], objs[1]);
|
||||
document.getElementById('table_e260a2be_5690_476a_b04e_dacddede78b3').innerHTML = tableinfo.HTML;
|
||||
@ -329,7 +393,10 @@ editor_mode.prototype.listen = function(callback){
|
||||
return;
|
||||
}
|
||||
editor.file.changeIdAndIdnum(id, idnum, editor_mode.info, function (err) {
|
||||
if(err){printe(err);throw(err)}
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
printe('添加id的idnum成功,请F5刷新编辑器');
|
||||
});
|
||||
} else {
|
||||
@ -355,18 +422,33 @@ editor_mode.prototype.listen = function(callback){
|
||||
var saveFloor = document.getElementById('saveFloor');
|
||||
saveFloor.onclick = function () {
|
||||
editor_mode.onmode('');
|
||||
editor.file.saveFloorFile(function(err){if(err){printe(err);throw(err)};printf('保存成功');});
|
||||
editor.file.saveFloorFile(function (err) {
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
;printf('保存成功');
|
||||
});
|
||||
}
|
||||
|
||||
var saveFloorAs = document.getElementById('saveFloorAs');
|
||||
var saveAsName = document.getElementById('saveAsName');
|
||||
saveFloorAs.onclick = function(){
|
||||
if (!saveAsName.value)return;
|
||||
var newMap = document.getElementById('newMap');
|
||||
var newFileName = document.getElementById('newFileName');
|
||||
newMap.onclick = function () {
|
||||
if (!newFileName.value) return;
|
||||
editor_mode.onmode('');
|
||||
editor.file.saveNewFile(saveAsName.value,function(err){
|
||||
if(err){printe(err);throw(err)}
|
||||
core.floorIds.push(saveAsName.value);
|
||||
editor.file.editTower([['change',"['main']['floorIds']",core.floorIds]],function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printe('新建成功,请F5刷新编辑器生效');});
|
||||
editor.file.saveNewFile(newFileName.value, function (err) {
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
core.floorIds.push(newFileName.value);
|
||||
editor.file.editTower([['change', "['main']['floorIds']", core.floorIds]], function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printe('新建成功,请F5刷新编辑器生效');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -510,7 +592,10 @@ editor_mode.prototype.listen = function(callback){
|
||||
}
|
||||
var imgbase64 = sprite.toDataURL().split(',')[1];
|
||||
fs.writeFile('./project/images/' + editor_mode.appendPic.imageName + '.png', imgbase64, 'base64', function (err, data) {
|
||||
if(err){printe(err);throw(err)}
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
printe('追加素材成功,请F5刷新编辑器');
|
||||
});
|
||||
}
|
||||
|
||||
@ -22,7 +22,8 @@ codeEditor.on("keyup", function (cm, event) {
|
||||
if (codeEditor.getOption("autocomplete") && (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 49 && event.keyCode <= 57) || event.keyCode == 190) {
|
||||
try {
|
||||
CodeMirror.commands.autocomplete(cm, null, {completeSingle: false});
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -38,7 +39,9 @@ editor_multi.show = function(){
|
||||
editor_multi.setLint();
|
||||
document.getElementById('left7').style = '';
|
||||
}
|
||||
editor_multi.hide = function(){document.getElementById('left7').style='z-index:-1;opacity: 0;';}
|
||||
editor_multi.hide = function () {
|
||||
document.getElementById('left7').style = 'z-index:-1;opacity: 0;';
|
||||
}
|
||||
editor_multi.setLint = function () {
|
||||
codeEditor.setOption("lint", editor_multi.lintAutocomplete);
|
||||
codeEditor.setOption("autocomplete", editor_multi.lintAutocomplete);
|
||||
@ -73,7 +76,13 @@ editor_multi.import = function(id_,args){
|
||||
var num = editor_multi.indent(field);
|
||||
eval('var tobj=' + (input.value || 'null'));
|
||||
var tmap = {};
|
||||
var tstr = JSON.stringify(tobj,function(k,v){if(typeof(v)===typeof('') && v.slice(0,8)==='function'){var id_ = editor.guid();tmap[id_]=v.toString();return id_;}else return v},num);
|
||||
var tstr = JSON.stringify(tobj, function (k, v) {
|
||||
if (typeof(v) === typeof('') && v.slice(0, 8) === 'function') {
|
||||
var id_ = editor.guid();
|
||||
tmap[id_] = v.toString();
|
||||
return id_;
|
||||
} else return v
|
||||
}, num);
|
||||
for (var id_ in tmap) {
|
||||
tstr = tstr.replace('"' + id_ + '"', tmap[id_])
|
||||
}
|
||||
@ -108,7 +117,13 @@ editor_multi.confirm = function (){
|
||||
} else {
|
||||
eval('var tobj=' + (value || 'null'));
|
||||
var tmap = {};
|
||||
var tstr = JSON.stringify(tobj,function(k,v){if(v instanceof Function){var id_ = editor.guid();tmap[id_]=v.toString();return id_;}else return v},4);
|
||||
var tstr = JSON.stringify(tobj, function (k, v) {
|
||||
if (v instanceof Function) {
|
||||
var id_ = editor.guid();
|
||||
tmap[id_] = v.toString();
|
||||
return id_;
|
||||
} else return v
|
||||
}, 4);
|
||||
for (var id_ in tmap) {
|
||||
tstr = tstr.replace('"' + id_ + '"', JSON.stringify(tmap[id_]))
|
||||
}
|
||||
|
||||
@ -95,7 +95,9 @@
|
||||
throw 'Type Error in fs.readdir';
|
||||
var data = '';
|
||||
data += 'name=' + path;
|
||||
postsomething(data,'/listFile',function(err, data){callback(err,JSON.parse(data))});
|
||||
postsomething(data, '/listFile', function (err, data) {
|
||||
callback(err, JSON.parse(data))
|
||||
});
|
||||
return;
|
||||
}
|
||||
})();
|
||||
@ -1,21 +1,38 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head><meta charset="utf-8"></head>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<script src="./fs.js"></script>
|
||||
<script>
|
||||
fs.writeFile('_test.txt','123中a文bc','utf-8',function(e,d){console.log(e);console.log(d);})
|
||||
fs.writeFile('_test.txt', '123中a文bc', 'utf-8', function (e, d) {
|
||||
console.log(e);
|
||||
console.log(d);
|
||||
})
|
||||
setTimeout(function () {
|
||||
fs.writeFile('_test_bin.txt','abc=','base64',function(e,d){console.log(e);console.log(d);})
|
||||
fs.writeFile('_test_bin.txt', 'abc=', 'base64', function (e, d) {
|
||||
console.log(e);
|
||||
console.log(d);
|
||||
})
|
||||
}, 1000);
|
||||
setTimeout(function () {
|
||||
fs.readFile('_test.txt','utf-8',function(e,d){console.log(e);console.log(d);})
|
||||
fs.readFile('_test.txt', 'utf-8', function (e, d) {
|
||||
console.log(e);
|
||||
console.log(d);
|
||||
})
|
||||
}, 2000);
|
||||
setTimeout(function () {
|
||||
fs.readFile('_test_bin.txt','base64',function(e,d){console.log(e);console.log(d);})
|
||||
fs.readFile('_test_bin.txt', 'base64', function (e, d) {
|
||||
console.log(e);
|
||||
console.log(d);
|
||||
})
|
||||
}, 3000);
|
||||
setTimeout(function () {
|
||||
fs.readdir('.',function(e,d){console.log(e);console.log(d);})
|
||||
fs.readdir('.', function (e, d) {
|
||||
console.log(e);
|
||||
console.log(d);
|
||||
})
|
||||
}, 4000);
|
||||
|
||||
|
||||
|
||||
@ -16,7 +16,13 @@ document.body.onmousedown = function(e){
|
||||
if (eid.indexOf('tip') === -1) {
|
||||
if (selectBox.isSelected) {
|
||||
editor_mode.onmode('');
|
||||
editor.file.saveFloorFile(function(err){if(err){printe(err);throw(err)};printf('地图保存成功');});
|
||||
editor.file.saveFloorFile(function (err) {
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
;printf('地图保存成功');
|
||||
});
|
||||
}
|
||||
selectBox.isSelected = false;
|
||||
}
|
||||
@ -27,8 +33,8 @@ document.body.onmousedown = function(e){
|
||||
iconLib.onmousedown = function (e) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
var exportM = new Vue({
|
||||
el: '#exportM',
|
||||
var exportMap = new Vue({
|
||||
el: '#exportMap',
|
||||
data: {
|
||||
isExport: false,
|
||||
},
|
||||
@ -84,8 +90,8 @@ var editArea = new Vue({
|
||||
mapArr: function (val, oldval) {
|
||||
var that = this;
|
||||
if (val == '') return;
|
||||
if(exportM.isExport){
|
||||
exportM.isExport = false;
|
||||
if (exportMap.isExport) {
|
||||
exportMap.isExport = false;
|
||||
return;
|
||||
}
|
||||
if (that.formatArr()) {
|
||||
@ -158,8 +164,8 @@ var editArea = new Vue({
|
||||
}
|
||||
}
|
||||
});
|
||||
var editTip = new Vue({
|
||||
el: '#editTip',
|
||||
var copyMap = new Vue({
|
||||
el: '#copyMap',
|
||||
data: {
|
||||
err: ''
|
||||
},
|
||||
@ -187,12 +193,20 @@ var editTip = new Vue({
|
||||
}
|
||||
},
|
||||
})
|
||||
var clear = new Vue({
|
||||
el: '#clear',
|
||||
var clearMap = new Vue({
|
||||
el: '#clearMap',
|
||||
|
||||
methods: {
|
||||
clearMap: function () {
|
||||
editor.mapInit();
|
||||
editor_mode.onmode('');
|
||||
editor.file.saveFloorFile(function (err) {
|
||||
if (err) {
|
||||
printe(err);
|
||||
throw(err)
|
||||
}
|
||||
;printf('地图清除成功');
|
||||
});
|
||||
editor.updateMap();
|
||||
clearTimeout(editArea.formatTimer);
|
||||
clearTimeout(tip.timer);
|
||||
@ -203,6 +217,26 @@ var clear = new Vue({
|
||||
}
|
||||
}
|
||||
})
|
||||
var deleteMap = new Vue({
|
||||
el: '#deleteMap',
|
||||
methods: {
|
||||
deleteMap: function () {
|
||||
editor_mode.onmode('');
|
||||
var index = core.floorIds.indexOf(editor.currentFloorId);
|
||||
if (index>=0) {
|
||||
core.floorIds.splice(index,1);
|
||||
editor.file.editTower([['change', "['main']['floorIds']", core.floorIds]], function (objs_) {/*console.log(objs_);*/
|
||||
if (objs_.slice(-1)[0] != null) {
|
||||
printe(objs_.slice(-1)[0]);
|
||||
throw(objs_.slice(-1)[0])
|
||||
}
|
||||
;printe('删除成功,请F5刷新编辑器生效');
|
||||
});
|
||||
}
|
||||
else printe('删除成功,请F5刷新编辑器生效');
|
||||
}
|
||||
}
|
||||
})
|
||||
printf = function (str_, type) {
|
||||
selectBox.isSelected = false;
|
||||
if (!type) {
|
||||
@ -220,7 +254,9 @@ printf = function(str_,type) {
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
printe = function(str_){printf(str_,'error')}
|
||||
printe = function (str_) {
|
||||
printf(str_, 'error')
|
||||
}
|
||||
tip_in_showMode = [
|
||||
'涉及图片的更改需要F5刷新浏览器来生效',
|
||||
'文本域可以通过双击,在文本编辑器或事件编辑器中编辑',
|
||||
|
||||
102
editor.html
102
editor.html
@ -18,15 +18,15 @@
|
||||
<textarea cols="10" rows="10" id="pout" v-model="mapArr"></textarea>
|
||||
<p class="warnText" v-if="error">{{ errors[error-1] }}</p>
|
||||
</div>
|
||||
<div id="editTip" v-cloak>
|
||||
<br>
|
||||
<input type="button" value="新建空白地图" id='saveFloorAs'/>
|
||||
<input id='saveAsName' placeholder="输入新楼层id"/>
|
||||
<input class='btn' type="button" value="复制地图" v-on:click="copyMap"/>
|
||||
<div id="editTip">
|
||||
<input type="button" value="新建空白地图" id='newMap'/>
|
||||
<input id='newFileName' placeholder="输入新楼层id"/>
|
||||
</div>
|
||||
<div style="position: absolute;right: 10px;bottom:70px;">
|
||||
<input class='btn' id='clear' type="button" value="清除地图" v-on:click="clearMap"/>
|
||||
<input class='btn' type="button" value="导出地图" id="exportM" v-on:click="exportMap"/>
|
||||
<div style="position: absolute;left: 10px;bottom:0; margin-bottom: 90px">
|
||||
<input type="button" value="导出地图" id="exportMap" v-on:click="exportMap"/>
|
||||
<input type="button" value="复制地图" id="copyMap" v-on:click="copyMap"/>
|
||||
<input type="button" value="清除地图" id='clearMap' v-on:click="clearMap"/>
|
||||
<input type="button" value="删除地图" id="deleteMap" v-on:click="deleteMap"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="objDataEditor">
|
||||
@ -42,7 +42,8 @@
|
||||
<div class="leftTabContent">
|
||||
<p>
|
||||
<input id="selectFileBtn" type="button" value="导入文件到画板"/>
|
||||
<select id="selectAppend"></select><!-- ["terrains", "animates", "enemys", "enemy48", "items", "npcs", "npc48"] -->
|
||||
<select id="selectAppend"></select>
|
||||
<!-- ["terrains", "animates", "enemys", "enemy48", "items", "npcs", "npc48"] -->
|
||||
<input id="appendConfirm" type="button" value="追加"/>
|
||||
</p>
|
||||
<div id="appendPicCanvas" style="position:relative;overflow: auto;height:470px;">
|
||||
@ -57,21 +58,29 @@
|
||||
<div class="appendSelection"><span style="top: 12px; left: 14px;">4</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="left2" class='leftTab' style="z-index:-1;opacity: 0;"><!-- loc -->
|
||||
<h3 class="leftTabHeader">地图选点 <button onclick="editor.mode.onmode('save')">save</button></h3>
|
||||
<h3 class="leftTabHeader">地图选点 <button onclick="editor.mode.onmode('save')">save</button>
|
||||
</h3>
|
||||
<div class="leftTabContent">
|
||||
<p id='pos_a6771a78_a099_417c_828f_0a24851ebfce' style="margin-left: 15px">0,0</p>
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_3d846fc4_7644_44d1_aa04_433d266a73df'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
<tr>
|
||||
<td>条目</td>
|
||||
<td>注释</td>
|
||||
<td>值</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="left3" class='leftTab' style="z-index:-1;opacity: 0;"><!-- emenyitem -->
|
||||
<h3 class="leftTabHeader">图块属性 <button onclick="editor.mode.onmode('save')">save</button></h3>
|
||||
<h3 class="leftTabHeader">图块属性 <button onclick="editor.mode.onmode('save')">save</button>
|
||||
</h3>
|
||||
<div class="leftTabContent">
|
||||
<div id='newIdIdnum'><!-- id and idnum -->
|
||||
<input placeholder="输入新id(唯一标识符)"/>
|
||||
@ -82,35 +91,53 @@
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_a3f03d4c_55b8_4ef6_b362_b345783acd72'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
<tr>
|
||||
<td>条目</td>
|
||||
<td>注释</td>
|
||||
<td>值</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="left4" class='leftTab' style="z-index:-1;opacity: 0;"><!-- floor -->
|
||||
<h3 class="leftTabHeader">楼层属性 <button onclick="editor.mode.onmode('save')">save</button></h3>
|
||||
<h3 class="leftTabHeader">楼层属性 <button onclick="editor.mode.onmode('save')">save</button>
|
||||
</h3>
|
||||
<div class="leftTabContent">
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_4a3b1b09_b2fb_4bdf_b9ab_9f4cdac14c74'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
<tr>
|
||||
<td>条目</td>
|
||||
<td>注释</td>
|
||||
<td>值</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="left5" class='leftTab' style="z-index:-1;opacity: 0;"><!-- tower -->
|
||||
<h3 class="leftTabHeader">全塔属性 <button onclick="editor.mode.onmode('save')">save</button></h3>
|
||||
<h3 class="leftTabHeader">全塔属性 <button onclick="editor.mode.onmode('save')">save</button>
|
||||
</h3>
|
||||
<div class="leftTabContent">
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_b6a03e4c_5968_4633_ac40_0dfdd2c9cde5'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
<tr>
|
||||
<td>条目</td>
|
||||
<td>注释</td>
|
||||
<td>值</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
<div id="left6" class='leftTab' style="z-index:-1;opacity: 0;"><div style="position: relative; height: 95%"><!-- eventsEditor -->
|
||||
</div>
|
||||
</div>
|
||||
<div id="left6" class='leftTab' style="z-index:-1;opacity: 0;">
|
||||
<div style="position: relative; height: 95%"><!-- eventsEditor -->
|
||||
<h3>事件编辑器
|
||||
<button onclick="editor_blockly.showXML()">Show XML</button>
|
||||
<button onclick="editor_blockly.runCode()">console.log(obj=code)</button>
|
||||
@ -135,28 +162,38 @@
|
||||
</xml>
|
||||
</h3>
|
||||
<div style="position: relative;height: 100%">
|
||||
<div id="blocklyArea"><div id="blocklyDiv"></div></div>
|
||||
<div id="blocklyArea">
|
||||
<div id="blocklyDiv"></div>
|
||||
</div>
|
||||
<textarea id="codeArea" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="left7" style="z-index:-1;opacity: 0;"><!-- 多行文本编辑器 -->
|
||||
<button onclick="editor_multi.confirm()">confirm</button>
|
||||
<button onclick="editor_multi.cancel()">cancel</button>
|
||||
<input type="checkbox" onclick="editor_multi.toggerLint()" id="lintCheckbox" style="vertical-align: bottom;margin-left:6px" />
|
||||
<input type="checkbox" onclick="editor_multi.toggerLint()" id="lintCheckbox"
|
||||
style="vertical-align: bottom;margin-left:6px"/>
|
||||
<span style="vertical-align: bottom; margin-left: -3px">Lint</span>
|
||||
<textarea id="multiLineCode" name="multiLineCode"></textarea>
|
||||
</div>
|
||||
<div id="left8" class='leftTab' style="z-index:-1;opacity: 0;"><!-- functions -->
|
||||
<h3 class="leftTabHeader">脚本编辑 <button onclick="editor.mode.onmode('save')">save</button></h3>
|
||||
<h3 class="leftTabHeader">脚本编辑 <button onclick="editor.mode.onmode('save')">save</button>
|
||||
</h3>
|
||||
<div class="leftTabContent">
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_e260a2be_5690_476a_b04e_dacddede78b3'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
<tr>
|
||||
<td>条目</td>
|
||||
<td>注释</td>
|
||||
<td>值</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mid">
|
||||
<table class="col" id='mapColMark'></table>
|
||||
<table class="row" id='mapRowMark'></table>
|
||||
@ -174,7 +211,8 @@
|
||||
<p v-if="hasId">图块编号:<span class="infoText">{{ infos['idnum'] }}</span></p>
|
||||
<p v-if="hasId">图块ID:<span class="infoText">{{ infos['id'] }}</span></p>
|
||||
<p v-else class="warnText">该图块无对应的数字或ID存在,请先前往icons.js和maps.js中进行定义!</p>
|
||||
<p>图块所在素材:<span class="infoText">{{ infos['images'] + (isAutotile ? '( '+infos['id']+' )' : '') }}</span></p>
|
||||
<p>图块所在素材:<span class="infoText">{{ infos['images'] + (isAutotile ? '( '+infos['id']+' )' : '') }}</span>
|
||||
</p>
|
||||
<p>图块索引:<span class="infoText">{{ infos['y'] }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
@ -356,10 +394,11 @@
|
||||
//所有全局量
|
||||
__all__ = ['Vue', 'fs', 'editor_file', 'editor_mode', 'main', 'core', 'hasOwnProp', 'printf', 'printe', 'editor', 'converter', 'ActionParser', 'MotaActionFunctions', 'MotaActionBlocks'];
|
||||
__id__ = ['editArea', 'arrRowMark', 'mapRowMark', 'data', 'bg', 'dataSelection', 'blocklyDiv', 'codeAreaHL', 'entryType'];
|
||||
__Vue__=['exportM','editArea','editTip','clear','tip','selectBox'];
|
||||
__Vue__ = ['editArea', 'exportMap', 'copyMap', 'clearMap', 'deleteMap', 'tip', 'selectBox'];
|
||||
//var event = document.getElementById('event');
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
function hasOwnProp(obj, key) {
|
||||
return hasOwnProperty.call(obj, key)
|
||||
}
|
||||
@ -383,7 +422,6 @@ main.init('editor', function() {
|
||||
});
|
||||
|
||||
|
||||
|
||||
//main.listen();
|
||||
</script>
|
||||
|
||||
|
||||
@ -301,7 +301,7 @@ utils.prototype.readFile = function (success, error, readType) {
|
||||
|
||||
if (core.platform.fileInput==null) {
|
||||
core.platform.fileInput = document.createElement("input");
|
||||
core.platform.fileInput.style.display = 'none';
|
||||
core.platform.fileInput.style.opacity = 0;
|
||||
core.platform.fileInput.type = 'file';
|
||||
core.platform.fileInput.onchange = function () {
|
||||
var files = core.platform.fileInput.files;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user