Skip to content

Commit

Permalink
Use a textarea instead of a prompt for export to prevent truncation in
Browse files Browse the repository at this point in the history
Chrome.
  • Loading branch information
Continuities committed Nov 15, 2013
1 parent c27430f commit 1682438
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
5 changes: 5 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,11 @@ body.noMask .eventTitle:after {
min-height: 100px;
}

#description textarea {
width: 100%;
height: 225px;
}

body.noMask #description {
color: white;
}
Expand Down
51 changes: 32 additions & 19 deletions script/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,10 @@ var Engine = {
scenes: {
start: {
text: ['export or import save data, for backing up',
'or migrating computers'],
'or migrating computers'],
buttons: {
'export': {
text: 'export',
nextScene: 'end',
onChoose: Engine.export64
},
'import': {
Expand All @@ -217,22 +216,22 @@ var Engine = {
}
}
},
'confirm': {
text: ['are you sure?',
'if the code is invalid, all data will be lost.',
'this is irreversible.'],
buttons: {
'yes': {
text: 'yes',
nextScene: 'end',
onChoose: Engine.import64
},
'no': {
text: 'no',
nextScene: 'end'
}
}
}
'confirm': {
text: ['are you sure?',
'if the code is invalid, all data will be lost.',
'this is irreversible.'],
buttons: {
'yes': {
text: 'yes',
nextScene: 'end',
onChoose: Engine.import64
},
'no': {
text: 'no',
nextScene: 'end'
}
}
}
}
});
},
Expand All @@ -243,7 +242,21 @@ var Engine = {
string64 = string64.replace(/\s/g, '');
string64 = string64.replace(/\./g, '');
string64 = string64.replace(/\n/g, '');
prompt("save this.",string64);
Events.startEvent({
title: 'Export',
scenes: {
start: {
text: ['save this.'],
textarea: string64,
buttons: {
'done': {
text: 'got it',
nextScene: 'end'
}
}
}
}
});
},

import64: function() {
Expand Down
4 changes: 4 additions & 0 deletions script/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ var Events = {
$('<div>').text(scene.text[i]).appendTo(desc);
}

if(scene.textarea) {
$('<textarea>').val(scene.textarea).appendTo(desc);
}

// Draw any loot
if(scene.loot) {
Events.drawLoot(scene.loot);
Expand Down

0 comments on commit 1682438

Please sign in to comment.