diff --git a/editor/sahliedit.coffee b/editor/sahliedit.coffee index cac3e62..14a4122 100644 --- a/editor/sahliedit.coffee +++ b/editor/sahliedit.coffee @@ -65,10 +65,16 @@ $(-> else stuff[1].textContent = 'Ascii' @.value = "1" - $(".45box").css {width:'45%',display:'inline-block'} + $(".45box").css {width:'40ex',display:'inline-block'} $(".groupbox p").css {margin:"0 0 .25em 0"} $(".colorbox").change -> sahlicolor() + $("#entryfont").change -> + font = $("#entryfont").val() + if font == "ansifont" + font = "BlockZone" + $('pre').css 'font-family',font + $("#entryfilepick").change -> if @.files[0]? then $("#entryfile").val @.files[0].name @@ -135,7 +141,6 @@ class Sahli .click => $('#sahlioutput').text dumpjson @data $('#dumparea').show 100 - console.log dumpjson @data $('#listlist').button {icons: {primary:"ui-icon-folder-open"}} .click -> getfilelist() @@ -169,12 +174,6 @@ class Sahli e = ui.item.index() @data.filedata = @.rearrangearray s,e,@data.filedata @buildlist @data - console.log name.author,name.name,name.file for name in @data.filedata - console.log '---' - - harry: (potter) -> - console.log "yer a lizzard, harry" - rearrangearray: (startpos,endpos,a) -> moving = a[startpos] @@ -215,6 +214,7 @@ class Sahli entry.line1 = $("#entryline1").val() entry.line2 = $("#entryline2").val() entry.text = $("#entrytext").val() + entry.font = $("#entryfont").val() entry.file = $("#entryfile").val() entry.filetype = $("#entryfiletype").val() @buildlist @data @@ -397,6 +397,7 @@ sahlicolor = -> ### Function for loading the filelist from the specified directory on the server/filesystem. +Needs to be made into an actual real thing. ### getfilelist = -> diff --git a/editor/sahliedit.js b/editor/sahliedit.js index 74a57d5..02d3ce1 100644 --- a/editor/sahliedit.js +++ b/editor/sahliedit.js @@ -86,7 +86,7 @@ Silliness for checking that this works. } }); $(".45box").css({ - width: '45%', + width: '40ex', display: 'inline-block' }); $(".groupbox p").css({ @@ -95,6 +95,14 @@ Silliness for checking that this works. $(".colorbox").change(function() { return sahlicolor(); }); + $("#entryfont").change(function() { + var font; + font = $("#entryfont").val(); + if (font === "ansifont") { + font = "BlockZone"; + } + return $('pre').css('font-family', font); + }); $("#entryfilepick").change(function() { if (this.files[0] != null) { return $("#entryfile").val(this.files[0].name); @@ -181,8 +189,7 @@ Silliness for checking that this works. }).click((function(_this) { return function() { $('#sahlioutput').text(dumpjson(_this.data)); - $('#dumparea').show(100); - return console.log(dumpjson(_this.data)); + return $('#dumparea').show(100); }; })(this)); $('#listlist').button({ @@ -244,27 +251,17 @@ Silliness for checking that this works. }, stop: (function(_this) { return function(event, ui) { - var a, e, name, s, _k, _len2, _ref2; + var a, e, s; a = 2; s = ui.item.data().startpos; e = ui.item.index(); _this.data.filedata = _this.rearrangearray(s, e, _this.data.filedata); - _this.buildlist(_this.data); - _ref2 = _this.data.filedata; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - name = _ref2[_k]; - console.log(name.author, name.name, name.file); - } - return console.log('---'); + return _this.buildlist(_this.data); }; })(this) }); }; - Sahli.prototype.harry = function(potter) { - return console.log("yer a lizzard, harry"); - }; - Sahli.prototype.rearrangearray = function(startpos, endpos, a) { var alen, moving, tarr; moving = a[startpos]; @@ -315,6 +312,7 @@ Silliness for checking that this works. entry.line1 = $("#entryline1").val(); entry.line2 = $("#entryline2").val(); entry.text = $("#entrytext").val(); + entry.font = $("#entryfont").val(); entry.file = $("#entryfile").val(); entry.filetype = $("#entryfiletype").val(); return this.buildlist(this.data); @@ -569,6 +567,7 @@ Silliness for checking that this works. /* Function for loading the filelist from the specified directory on the server/filesystem. + Needs to be made into an actual real thing. */ getfilelist = function() { diff --git a/editor/sahlieditor.html b/editor/sahlieditor.html index e007301..3c9bd68 100644 --- a/editor/sahlieditor.html +++ b/editor/sahlieditor.html @@ -83,12 +83,12 @@