Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added a .remove(name) so you can remove a file

  • Loading branch information...
commit 8d5630f571ef1bcf8725ad7b3afd832bc93db9c3 1 parent ab66f5f
@OscarGodson OscarGodson authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 epiceditor.js
View
15 epiceditor.js
@@ -591,6 +591,21 @@
}
/**
+ * Removes a page
+ * @param {string} name The name of the file you want to remove from localStorage
+ * @returns {object} EpicEditor will be returned
+ */
+ EpicEditor.prototype.remove = function(name) {
+ var self = this;
+ name = name || self.settings.file.name;
+ var s = JSON.parse(localStorage['epiceditor']);
+ delete s.files[name];
+ localStorage['epiceditor'] = JSON.stringify(s);
+ this.emit('remove');
+ return this;
+ };
+
+ /**
* Converts content into HTML from markdown
* @returns {string} Returns the HTML that was converted from the markdown
*/
Please sign in to comment.
Something went wrong with that request. Please try again.