Commit 6dba96b2 authored by David Gonçalves's avatar David Gonçalves 📖

...

parent 1d0deca0
......@@ -7,7 +7,10 @@ class Editor {
this.editor = ace.edit("XMLCode");
// Set font size
Editor.changeFontSize();
this.changeFontSize();
// Set line height
this.setLineHeight(1.5);
// Set theme
let theme = $("#theme_selector").val();
......@@ -34,24 +37,27 @@ class Editor {
/**
* Events
*/
const that = this;
this.editor.getSession().on('change', function(e) {
that.setLines();
//const that = this; // I was using an alias to this because the this
// inside the function event was not the same this outside the function
// event. But arrow functions don't have a this, so it takes the outside
// one.
this.editor.getSession().on('change', (e) => {
this.setLines();
});
this.editor.getSession().selection.on('changeCursor', function(e) {
that.setLines();
this.editor.getSession().selection.on('changeCursor', (e) => {
this.setLines();
});
$('#fontsize_selector').on('change', function(e) {
Editor.changeFontSize();
$('#fontsize_selector').on('change', (e) => {
this.changeFontSize();
});
$('#theme_selector').on('change', function(e) {
that.changeTheme();
$('#theme_selector').on('change', (e) => {
this.changeTheme();
});
$('#find').on('click', function(e) {
that.execFind();
$('#find').on('click', (e) => {
this.execFind();
});
$('#findreplace').on('click', function(e) {
that.execFindReplace();
$('#findreplace').on('click', (e) => {
this.execFindReplace();
});
}
......@@ -82,15 +88,15 @@ class Editor {
}
}
static changeFontSize(size) {
if (!size) {
size = $("#fontsize_selector").val();
}
changeFontSize(size) {
let s = (size ? size : $("#fontsize_selector").val());
this.editor.setOptions({ fontSize: s });
}
if (size) {
$("#XMLCode").css("font-size", size);
}
setLineHeight(lineheight) {
let ln = (lineheight ? lineheight : 1.5);
this.editor.container.style.lineHeight = ln;
this.editor.renderer.updateFontSize();
}
execFind() {
......
This diff is collapsed.
......@@ -251,7 +251,87 @@
<!--
Use <a>b</a> to give this character a skin. Other skinds available
are 'a', 'b', 'c'... depending on the character the number of skins available
varies.
varies. The skins available are the following (credits to vinax for finding
them out):
lucas:
"b"(Red Skin 紅衣)
drew:
"b"(Red Skin 紅衣)
shawn:
"b"(Red Skin 紅衣)
vivian:
"a"(Ordinary sword 普通剑)
"b"(Swordless skin 無剑)
giggs:
"a"(Moore skin 摩尔)
Titto:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
jason:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
taylor:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
legge:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
yaga:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
heater:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
iczzy:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
raye:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
eason:
"a"(necklace 项链)
"b"(Sword 持剑)
"c"(Demon Lord's sword 死神之剑)
livermore:
"a"(Swordless skin 无剑)
saws:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
z_swordsman01:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
"e"(Chirs Skin 小春)
"f"(Sherwood Skin細榮)
Others 其他 (Black Skin 黑衣)
horse:
"a"(Ordinary horse 普通马)
"b"(black horse 黑马)
Other troops 其他兵種:
"a"(Blue Skin 藍衣)
"b"(Red Skin 紅衣)
"c"(Green Skin 綠衣)
"d"(Yellow Skin 黃衣)
Others 其他 (Black Skin 黑衣)
-->
<a>a</a>
<f>0</f>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment