Fix editor to work without a webserver running (dev mode)
This commit is contained in:
parent
e1c14acd3f
commit
d0f5a09f45
4 changed files with 1211 additions and 16 deletions
1178
editor/jquery-ui-dot-luv.css
Normal file
1178
editor/jquery-ui-dot-luv.css
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
// Generated by CoffeeScript 1.7.1
|
||||
(function() {
|
||||
var Sahli, ansiorascii, arraytocolor, booltoint, colorindex, colortoarray, colortoname, dec2hex, dumpjson, emptyfiledef, hex2dec, inttobool, loadsahli, newsahli, resolvefiletype, sahlicolor, statustobool;
|
||||
var Sahli, ansiorascii, arraytocolor, booltoint, colorindex, colortoarray, colortoname, dec2hex, dumpjson, emptyfiledef, getfilelist, hex2dec, inttobool, loadsahli, newsahli, resolvefiletype, sahlicolor, statustobool;
|
||||
|
||||
$(function() {
|
||||
return $("h1").hide().slideDown(500);
|
||||
|
|
@ -145,11 +145,9 @@
|
|||
icons: {
|
||||
primary: "ui-icon-folder-open"
|
||||
}
|
||||
}).click((function(_this) {
|
||||
return function() {
|
||||
return alert('clicked');
|
||||
};
|
||||
})(this));
|
||||
}).click(function() {
|
||||
return getfilelist();
|
||||
});
|
||||
$('#listappend').button({
|
||||
icons: {
|
||||
primary: "ui-icon-1-n"
|
||||
|
|
@ -470,6 +468,14 @@
|
|||
});
|
||||
};
|
||||
|
||||
getfilelist = function() {
|
||||
var location;
|
||||
location = $("#dirlocation").val();
|
||||
return $.get("../" + location, function(listing) {
|
||||
return console.log(listing);
|
||||
});
|
||||
};
|
||||
|
||||
newsahli = function() {
|
||||
var newentry, sahli;
|
||||
sahli = new Sahli;
|
||||
|
|
|
|||
|
|
@ -146,15 +146,15 @@ edit button.
|
|||
edit: ->
|
||||
$('#buttonbox').hide()
|
||||
$('#dirlocation').change (event) =>
|
||||
@.data.location = event.target.value
|
||||
@data.location = event.target.value
|
||||
$('#listsave').button {icons: {primary:"ui-icon-disk"}}
|
||||
.click =>
|
||||
$('#sahlioutput').text dumpjson @.data
|
||||
$('#sahlioutput').text dumpjson @data
|
||||
$('#dumparea').show 100
|
||||
console.log dumpjson @.data
|
||||
console.log dumpjson @data
|
||||
$('#listlist').button {icons: {primary:"ui-icon-folder-open"}}
|
||||
.click =>
|
||||
alert 'clicked'
|
||||
.click ->
|
||||
getfilelist()
|
||||
$('#listappend').button {icons: {primary:"ui-icon-1-n"}}
|
||||
.click (event) =>
|
||||
newentry = new emptyfiledef
|
||||
|
|
@ -400,6 +400,16 @@ A function for changing the fore and background colors of the sahli ascii exampl
|
|||
console.log 'sahlicolor',fg,bg
|
||||
$('#sahliascii').css {'color':fg,'background':bg}
|
||||
|
||||
Function for loading the filelist from the specified directory on the server/filesystem.
|
||||
|
||||
getfilelist = ->
|
||||
location = $("#dirlocation").val()
|
||||
$.get("../#{location}", (listing) ->
|
||||
console.log listing
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
When clicking 'New' we want to make a brand new Sahli, and then clear out
|
||||
the buttons and create the editor bit as blank.
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@
|
|||
as it can't be pulled from afar if the network is down. Use remote if you would like, just uncomment
|
||||
<script src="//code.jquery.com/jquery-2.1.0.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.min.js" type="text/javascript" charset="utf-8" ></script>
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/dot-luv/jquery-ui.css">
|
||||
-->
|
||||
<script src="jquery-2.1.0.min.js" type="text/javascript" async defer></script>
|
||||
<script src="jquery-ui.min.js" type="text/javascript" async defer></script>
|
||||
<script src="/editor/sahliedit.js" type="text/javascript" charset="utf-8" async defer></script>
|
||||
<link rel="stylesheet" href="/editor/sahliedit.css">
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/dot-luv/jquery-ui.css">
|
||||
<script src="jquery-2.1.0.min.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui.min.js" type="text/javascript"></script>
|
||||
<script src="sahliedit.js" type="text/javascript" charset="utf-8"></script>
|
||||
<link rel="stylesheet" href="sahliedit.css">
|
||||
<link rel="stylesheet" href="jquery-ui-dot-luv.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Sahli Editor</h1>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue