indentation fix, start of changing font in editor

This commit is contained in:
Iam Naughton Phier 2015-03-26 18:15:38 +02:00
parent 4bcfeb755c
commit 6d5c51d0e5
3 changed files with 411 additions and 279 deletions

View file

@ -17,7 +17,7 @@ textarea {
} }
pre { pre {
font-family: 'TopazPlus a500a1000a2000','mOsOul',Monaco,monospace; font-family: 'topaz500','mosoul',Monaco,monospace;
font-size: 16; font-size: 16;
border: 2px inset #808080; border: 2px inset #808080;
} }
@ -56,12 +56,14 @@ div ul li{
display: inline-block; display: inline-block;
} }
# this does not actually change anything because the design is set by /* 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. /* the jquery-ui bit. Altering in the script does work. Here for reference. */
/*
.45box { .45box {
width: 45%; width: 45%;
display: inline-block; display: inline-block;
} }
*/
div.groupbox p { div.groupbox p {
margin: .25 ex; margin: .25 ex;
@ -79,7 +81,7 @@ div.groupbox p {
} }
#sahlioutput { #sahlioutput {
font-family: 'TopazPlus a500a1000a2000','mOsOul',Monaco,monospace; font-family: 'microknight','P0t-nOodle',Monaco,monospace;
font-size: 16; font-size: 16;
background: aliceblue; background: aliceblue;
overflow-wrap: break-word; overflow-wrap: break-word;
@ -96,3 +98,134 @@ div.groupbox p {
padding: 0px; padding: 0px;
} }
@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;
}

View file

@ -51,6 +51,7 @@ Also hide the editor until needed, and initialize some elements.
.button { disabled: false} .button { disabled: false}
.click -> loadsahli() .click -> loadsahli()
) )
$(-> $(->
$(".hidden").hide() $(".hidden").hide()
$("#entryamiga").button {icons: {primary:"ui-icon-gear"}} $("#entryamiga").button {icons: {primary:"ui-icon-gear"}}
@ -64,14 +65,15 @@ Also hide the editor until needed, and initialize some elements.
@.value = "1" @.value = "1"
$(".45box").css {width:'45%',display:'inline-block'} $(".45box").css {width:'45%',display:'inline-block'}
$(".groupbox p").css {margin:"0 0 .25em 0"} $(".groupbox p").css {margin:"0 0 .25em 0"}
$(".colorbox").change => $(".colorbox").change ->
sahlicolor() sahlicolor()
$("#entryfont").change ->
$('pre').css 'font-family',$('#entryfont').val()
$("#entryfilepick").change -> $("#entryfilepick").change ->
if @.files[0]? then $("#entryfile").val @.files[0].name if @.files[0]? then $("#entryfile").val @.files[0].name
$("#entryfile").click -> $("#entryfile").click ->
$("#entryfilepick").click() $("#entryfilepick").click()
) )
The sahli file definition format is as follows: The sahli file definition format is as follows:
@ -85,7 +87,7 @@ The three remaining lines are informational and optional.
The slide format is currently unused, but consists of a background picture, The slide format is currently unused, but consists of a background picture,
a html template, and a css file. a html template, and a css file.
class emptyfiledef class Emptyfiledef
constructor: -> constructor: ->
@file = "" @file = ""
@name = "" @name = ""
@ -103,7 +105,7 @@ a html template, and a css file.
class Sahli class Sahli
constructor: -> constructor: ->
@emptyfiledef = new emptyfiledef @emptyfiledef = new Emptyfiledef
@emptyslidesdef = { @emptyslidesdef = {
"background": "", "background": "",
"template": "", "template": "",
@ -143,7 +145,7 @@ edit button.
getfilelist() getfilelist()
$('#listappend').button {icons: {primary:"ui-icon-1-n"}} $('#listappend').button {icons: {primary:"ui-icon-1-n"}}
.click (event) => .click (event) =>
newentry = new emptyfiledef newentry = new Emptyfiledef
@data.filedata.push newentry @data.filedata.push newentry
@buildlist @data @buildlist @data
$('#listdisplay').button {icons: {primary:"ui-icon-refresh"}} $('#listdisplay').button {icons: {primary:"ui-icon-refresh"}}
@ -239,15 +241,12 @@ insert it into the array at end position. A la the draggon-dropping.
event.preventDefault() event.preventDefault()
@save() @save()
event.currentTarget.previousElementSibling.click() event.currentTarget.previousElementSibling.click()
}] }]
} }
data.amiga = booltoint data.amiga data.amiga = booltoint data.amiga
fcol = colortoname arraytocolor data.color fcol = colortoname arraytocolor data.color
bcol = colortoname arraytocolor data.bg bcol = colortoname arraytocolor data.bg
$("#entryindex").val pos $("#entryindex").val pos
$("#entryname").val data.name $("#entryname").val data.name
$("#entryauthor").val data.author $("#entryauthor").val data.author
@ -309,8 +308,8 @@ Resolve ansi or ascii status
Color conversion from array to color item: Color conversion from array to color item:
This decimal to hex conversion only handles 00-FF but it's fine for this purpose; This decimal to hex conversion only handles 00-FF but it's fine for this
we actually _want_ that limitation in the output. purpose; we actually _want_ that limitation in the output.
dec2hex = (num) -> dec2hex = (num) ->
"#{('000'+num.toString 16).slice -2}" "#{('000'+num.toString 16).slice -2}"
@ -379,7 +378,8 @@ Similarly, need to be able to get the color index.
names[colorname] names[colorname]
A function for changing the fore and background colors of the sahli ascii example A function for changing the fore and background colors of the sahli ascii
example
sahlicolor = -> sahlicolor = ->
fg = $('#entrycolor').val() fg = $('#entrycolor').val()
@ -387,7 +387,8 @@ A function for changing the fore and background colors of the sahli ascii exampl
console.log 'sahlicolor',fg,bg console.log 'sahlicolor',fg,bg
$('#sahliascii').css {'color':fg,'background':bg} $('#sahliascii').css {'color':fg,'background':bg}
Function for loading the filelist from the specified directory on the server/filesystem. Function for loading the filelist from the specified directory on the
server/filesystem.
getfilelist = -> getfilelist = ->
location = $("#dirlocation").val() location = $("#dirlocation").val()
@ -395,16 +396,13 @@ Function for loading the filelist from the specified directory on the server/fil
console.log listing console.log listing
) )
When clicking 'New' we want to make a brand new Sahli, and then clear out When clicking 'New' we want to make a brand new Sahli, and then clear out
the buttons and create the editor bit as blank. the buttons and create the editor bit as blank.
newsahli = -> newsahli = ->
sahli = new Sahli sahli = new Sahli
sahli.data = sahli.empty sahli.data = sahli.empty
newentry = new emptyfiledef newentry = new Emptyfiledef
sahli.data.filedata.push newentry sahli.data.filedata.push newentry
sahli.edit() sahli.edit()

View file

@ -138,10 +138,11 @@
</div> </div>
<div class='45box'> <div class='45box'>
<pre id='sahliascii'> <pre id='sahliascii'>
________________________, ._____, ABCDEFGHIJKLMNOPQRSTUVWXYZ&gt;&lt;~`'"^&amp;eXmPl
| ___|___ | | | | |_____| abcdefghijklmnopqrstuvwxyz1234567890?+@
|_____ | _ | | |__| | * | ___)___ 7 I | | \-~=#/ $
|_____|_____|___|__|______|___| : |_____ | {~} ! | \__[ : #~%
; (_____j__"__l___|__|______]___; 0Oo
</pre> </pre>
</div> </div>
</div> </div>