diff --git a/editor/sahliedit.css b/editor/sahliedit.css index 3821a74..f9f3361 100644 --- a/editor/sahliedit.css +++ b/editor/sahliedit.css @@ -17,7 +17,7 @@ textarea { } pre { - font-family: 'TopazPlus a500a1000a2000','mOsOul',Monaco,monospace; + font-family: 'topaz500','mosoul',Monaco,monospace; font-size: 16; border: 2px inset #808080; } @@ -56,12 +56,14 @@ div ul li{ display: inline-block; } -# this does not actually change anything because the design is set by -# the jquery-ui bit. Altering in the script does work. Here for reference. +/* this does not actually change anything because the design is set by */ +/* the jquery-ui bit. Altering in the script does work. Here for reference. */ +/* .45box { width: 45%; display: inline-block; } +*/ div.groupbox p { margin: .25 ex; @@ -79,7 +81,7 @@ div.groupbox p { } #sahlioutput { - font-family: 'TopazPlus a500a1000a2000','mOsOul',Monaco,monospace; + font-family: 'microknight','P0t-nOodle',Monaco,monospace; font-size: 16; background: aliceblue; overflow-wrap: break-word; @@ -95,4 +97,135 @@ div.groupbox p { margin: 0px 0px 1ex; padding: 0px; -} \ No newline at end of file +} + +@font-face { + font-family: 'P0t-nOodle'; + src: url('fonts/P0T-NOoDLE_v1.0.woff2') format('woff2'); + src: url('fonts/P0T-NOoDLE_v1.0.woff') format('woff'); +} + +@font-face { + font-family: 'MicroKnight'; + src: url('fonts/MicroKnightPlus_v1.0.woff2') format('woff2'); + src: url('fonts/MicroKnightPlus_v1.0.woff') format('woff'); +} + +@font-face { + font-family: 'mOsOul'; + src: url('fonts/mOsOul_v1.0.woff2') format('woff2'); + src: url('fonts/mOsOul_v1.0.woff') format('woff'); +} + +@font-face { + font-family: 'Topaz1200'; + src: url('fonts/TopazPlusA1200.woff') format('woff2'); + src: url('fonts/TopazPlusA1200.woff') format('woff'); +} + +@font-face { + font-family: 'Topaz500'; + src: url('fonts/TopazPlusA500.woff2') format('woff2'); + src: url('fonts/TopazPlusA500.woff') format('woff'); +} + +@font-face { + font-family: 'blockzone'; + src: url('fonts/BlockZone.woff2') format('woff2'); + src: url('fonts/BlockZone.woff') format('woff'); +} + +.mosoul { + font-family: mOsOul; + text-align: left; +} + +.pot-noodle , .p0t-noodle { + font-family: 'P0t-nOodle'; + text-align: left; +} + +.topaz, .topaz500 { + font-family: 'Topaz500'; + text-align: left; +} + +.propaz, .topaz1200 { + font-family: 'Topaz1200'; + text-align: left; +} + +.microknight, .microknightplus { + font-family: 'MicroKnight'; + text-align: left; +} + +.blockzone, .pcansifont { + font-family: 'blockzone'; + text-align: left; +} +@font-face { + font-family: 'P0t-nOodle'; + src: url('../fonts/P0T-NOoDLE_v1.0.woff2') format('woff2'); + src: url('../fonts/P0T-NOoDLE_v1.0.woff') format('woff'); +} + +@font-face { + font-family: 'MicroKnight'; + src: url('../fonts/MicroKnightPlus_v1.0.woff2') format('woff2'); + src: url('../fonts/MicroKnightPlus_v1.0.woff') format('woff'); +} + +@font-face { + font-family: 'mOsOul'; + src: url('../fonts/mOsOul_v1.0.woff2') format('woff2'); + src: url('../fonts/mOsOul_v1.0.woff') format('woff'); +} + +@font-face { + font-family: 'Topaz1200'; + src: url('../fonts/TopazPlusA1200.woff') format('woff2'); + src: url('../fonts/TopazPlusA1200.woff') format('woff'); +} + +@font-face { + font-family: 'Topaz500'; + src: url('../fonts/TopazPlusA500.woff2') format('woff2'); + src: url('../fonts/TopazPlusA500.woff') format('woff'); +} + +@font-face { + font-family: 'blockzone'; + src: url('../fonts/BlockZone.woff2') format('woff2'); + src: url('../fonts/BlockZone.woff') format('woff'); +} + +.mosoul { + font-family: mOsOul; + text-align: left; +} + +.pot-noodle , .p0t-noodle { + font-family: 'P0t-nOodle'; + text-align: left; +} + +.topaz, .topaz500 { + font-family: 'Topaz500'; + text-align: left; +} + +.propaz, .topaz1200 { + font-family: 'Topaz1200'; + text-align: left; +} + +.microknight, .microknightplus { + font-family: 'MicroKnight'; + text-align: left; +} + +.blockzone, .pcansifont { + font-family: 'blockzone'; + text-align: left; +} diff --git a/editor/sahliedit.litcoffee b/editor/sahliedit.litcoffee index 412b89c..7341dae 100644 --- a/editor/sahliedit.litcoffee +++ b/editor/sahliedit.litcoffee @@ -41,37 +41,39 @@ Create buttos to choose between the New and Load functionalities Also hide the editor until needed, and initialize some elements. $(-> - $("#newsahli") - .button { disabled: false} - .click -> newsahli() - ) + $("#newsahli") + .button { disabled: false} + .click -> newsahli() + ) $(-> - $("#loadsahli") - .button { disabled: false} - .click -> loadsahli() - ) + $("#loadsahli") + .button { disabled: false} + .click -> loadsahli() + ) + $(-> - $(".hidden").hide() - $("#entryamiga").button {icons: {primary:"ui-icon-gear"}} - .click -> - stuff = $(@).children() - if @.value == "1" - stuff[1].textContent = 'Ansi' - @.value = "0" - else - stuff[1].textContent = 'Ascii' - @.value = "1" - $(".45box").css {width:'45%',display:'inline-block'} - $(".groupbox p").css {margin:"0 0 .25em 0"} - $(".colorbox").change => - sahlicolor() - - $("#entryfilepick").change -> - if @.files[0]? then $("#entryfile").val @.files[0].name - $("#entryfile").click -> - $("#entryfilepick").click() + $(".hidden").hide() + $("#entryamiga").button {icons: {primary:"ui-icon-gear"}} + .click -> + stuff = $(@).children() + if @.value == "1" + stuff[1].textContent = 'Ansi' + @.value = "0" + else + stuff[1].textContent = 'Ascii' + @.value = "1" + $(".45box").css {width:'45%',display:'inline-block'} + $(".groupbox p").css {margin:"0 0 .25em 0"} + $(".colorbox").change -> + sahlicolor() + $("#entryfont").change -> + $('pre').css 'font-family',$('#entryfont').val() + $("#entryfilepick").change -> + if @.files[0]? then $("#entryfile").val @.files[0].name + $("#entryfile").click -> + $("#entryfilepick").click() ) The sahli file definition format is as follows: @@ -85,331 +87,327 @@ The three remaining lines are informational and optional. The slide format is currently unused, but consists of a background picture, a html template, and a css file. - class emptyfiledef - constructor: -> - @file = "" - @name = "" - @amiga = true - @filetype = 'plain' - @width = "" - @author = "" - @font = "Propaz" - @color = [ 255,255,255,255 ] - @bg = [ 0,0,0,0 ] - @line1 = "" - @line2 = "" - @text = "" + class Emptyfiledef + constructor: -> + @file = "" + @name = "" + @amiga = true + @filetype = 'plain' + @width = "" + @author = "" + @font = "Propaz" + @color = [ 255,255,255,255 ] + @bg = [ 0,0,0,0 ] + @line1 = "" + @line2 = "" + @text = "" class Sahli - constructor: -> - @emptyfiledef = new emptyfiledef - @emptyslidesdef = { - "background": "", - "template": "", - "css": "" - } - @empty = { - "location": "", - "slides": @emptyslidesdef, - "filedata": [ ] - } + constructor: -> + @emptyfiledef = new Emptyfiledef + @emptyslidesdef = { + "background": "", + "template": "", + "css": "" + } + @empty = { + "location": "", + "slides": @emptyslidesdef, + "filedata": [ ] + } - loader: -> - $.ajax { - url: '../list.sahli', - dataType: "json", - success: (result) => - @data = result - @.edit() - } + loader: -> + $.ajax { + url: '../list.sahli', + dataType: "json", + success: (result) => + @data = result + @.edit() + } Editor functionality: Close the new/load buttons - unneeded now. list, and allow dragon-droppings for sorting. Doubleclick to edit, or use edit button. - edit: -> - $('#buttonbox').hide() - $('#dirlocation').change (event) => - @data.location = event.target.value - $('#listsave').button {icons: {primary:"ui-icon-disk"}} - .click => - $('#sahlioutput').text dumpjson @data - $('#dumparea').show 100 - console.log dumpjson @data - $('#listlist').button {icons: {primary:"ui-icon-folder-open"}} - .click -> - getfilelist() - $('#listappend').button {icons: {primary:"ui-icon-1-n"}} - .click (event) => - newentry = new emptyfiledef - @data.filedata.push newentry - @buildlist @data - $('#listdisplay').button {icons: {primary:"ui-icon-refresh"}} - .click => - @buildlist @data + edit: -> + $('#buttonbox').hide() + $('#dirlocation').change (event) => + @data.location = event.target.value + $('#listsave').button {icons: {primary:"ui-icon-disk"}} + .click => + $('#sahlioutput').text dumpjson @data + $('#dumparea').show 100 + console.log dumpjson @data + $('#listlist').button {icons: {primary:"ui-icon-folder-open"}} + .click -> + getfilelist() + $('#listappend').button {icons: {primary:"ui-icon-1-n"}} + .click (event) => + newentry = new Emptyfiledef + @data.filedata.push newentry + @buildlist @data + $('#listdisplay').button {icons: {primary:"ui-icon-refresh"}} + .click => + @buildlist @data - $('#closespan').click -> - $(@parentElement.parentElement).hide() - $('#sahlioutput').text '' + $('#closespan').click -> + $(@parentElement.parentElement).hide() + $('#sahlioutput').text '' You need to save the order, and extract these in that order; moving around does not alter the array. Alternately, _have_ it alter the array. - @buildlist @data + @buildlist @data - buildlist: (data) -> - $('#list').show 100 - $('#list ol li').remove() - console.log i.author for i in @data.filedata - x = 0 - $('#dirlocation').val @data.location - $('#sortlist').append @.additem item,x++ for item in @data.filedata - $('#sortlist').sortable - start: (event,ui) -> - ui.item.data {startpos:ui.item.index()} - stop: (event,ui) => - s = ui.item.data().startpos - e = ui.item.index() - @data.filedata = @.rearrangearray s,e,@data.filedata - console.log name.author,name.name,name.file for name in @data.filedata - console.log '---' - @buildlist @data + buildlist: (data) -> + $('#list').show 100 + $('#list ol li').remove() + console.log i.author for i in @data.filedata + x = 0 + $('#dirlocation').val @data.location + $('#sortlist').append @.additem item,x++ for item in @data.filedata + $('#sortlist').sortable + start: (event,ui) -> + ui.item.data {startpos:ui.item.index()} + stop: (event,ui) => + s = ui.item.data().startpos + e = ui.item.index() + @data.filedata = @.rearrangearray s,e,@data.filedata + console.log name.author,name.name,name.file for name in @data.filedata + console.log '---' + @buildlist @data Given a start and and end position, pop the array element at start off and insert it into the array at end position. A la the draggon-dropping. - rearrangearray: (startpos,endpos,a) -> - moving = a[startpos] - alen = a.length - tarr = a[0...startpos].concat a[startpos+1..-1] - tarr[0...endpos].concat [moving].concat tarr[endpos..-1] + rearrangearray: (startpos,endpos,a) -> + moving = a[startpos] + alen = a.length + tarr = a[0...startpos].concat a[startpos+1..-1] + tarr[0...endpos].concat [moving].concat tarr[endpos..-1] - additem: (item,pos) -> - entry = @genentryline item,pos - entry.dblclick => - @editline item,pos + additem: (item,pos) -> + entry = @genentryline item,pos + entry.dblclick => + @editline item,pos - genentryline: (item,pos) -> - arrows = "" - amigastatus = ansiorascii booltoint item.amiga - delbutton = $("delete") - .click (event) => - pos = event.currentTarget.id.replace "del-","" - @data.filedata.splice pos,1 - @buildlist @data - entry = $("
- ________________________, ._____,
- | ___|___ | | | | |_____|
- |_____ | _ | | |__| |
- |_____|_____|___|__|______|___|
+ABCDEFGHIJKLMNOPQRSTUVWXYZ><~`'"^&eXmPl
+abcdefghijklmnopqrstuvwxyz1234567890?+@
+* | ___)___ 7 I | | \-~=#/ $
+: |_____ | {~} ! | \__[ : #~%
+; (_____j__"__l___|__|______]___; 0Oo