Fix: Font Picker now shows font chosen and saves font.

This commit is contained in:
Iam Naughton Phier 2015-03-27 18:10:58 +02:00
parent 16207fc2ae
commit f8134f41d2
3 changed files with 29 additions and 29 deletions

View file

@ -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 = ->

View file

@ -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() {

View file

@ -83,12 +83,12 @@
<li>
<label for="font">Font:</label>
<select id='entryfont' name="font">
<option value="propaz">Topaz 2.0</option>
<option value="topaz">Topaz 1.3</option>
<option value="mosoul">mOsOul</option>
<option value="microknight">Microknight</option>
<option value="pot-noodle">P0t-nOodle</option>
<option value="blockzone">BlockZone</option>
<option value="Topaz1200">Topaz1200</option>
<option value="Topaz500">Topaz500</option>
<option value="mOsOul">mOsOul</option>
<option value="MicroKnight">Microknight</option>
<option value="P0t-nOodle">P0t-nOodle</option>
<option value="BlockZone">BlockZone</option>
<option value="ansifont">Ansifont</option>
</select>
</li>