Minified version + Char names

This commit is contained in:
Christoph Stahl 2017-07-03 14:20:59 +02:00
parent 3cc588221c
commit d520d8173c
2 changed files with 7 additions and 3 deletions

View File

@ -11,7 +11,7 @@ Usage
3. Paste the following
```
$("<script>").load("https://raw.githubusercontent.com/christofsteel/herosaver/master/herosaver.js").appendTo($("body"))
$("<script>").load("https://raw.githubusercontent.com/christofsteel/herosaver/master/herosaver.min.js").appendTo($("body"))
```
Limitations

View File

@ -207,13 +207,17 @@ stl.click(function(e) {
e.preventDefault();
var exporter = new THREE.STLExporter();
var stlString = exporter.parse(CK.activeCharacter.threeObj.children[1])
download(stlString, 'char.stl', 'text/plain');
var name = CK.activeCharacter.name
name = name === "" ? "unnamed" : name
download(stlString, name + '.stl', 'text/plain');
});
sjson.click(function(e) {
e.preventDefault();
var char_json = JSON.stringify(CK.activeCharacter.characterData);
download(char_json, "char.json", "text/plain");
var name = CK.activeCharacter.name
name = name === "" ? "unnamed" : name
download(char_json, name + ".json", "text/plain");
});
ljson.on('change', function(e) {