Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Commit

Permalink
Create welcome on first run.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Smith committed Apr 29, 2013
1 parent 93e9ae0 commit f71b203
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/firetext.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ function docsInFolder(callback) {
var cursor = storage.enumerate("Documents");

cursor.onerror = function() {
alert('Load unsuccessful :\'( \n\nInfo for gurus:\n"' + cursor.error.name + '"');
if (cursor.error.name == 'TypeMismatchError') {
saveFile('Welcome','.html','<h1><b>Welcome</b> to <i>Firetext</i>!</h1>', false, function() {
loadToEditor('Welcome', '.html');
});
} else {
alert('Load unsuccessful :\'( \n\nInfo for gurus:\n"' + cursor.error.name + '"');
}
};
cursor.onsuccess = function() {
// Get file
Expand Down

0 comments on commit f71b203

Please sign in to comment.