diff options
Diffstat (limited to 'lib/models/output.js')
-rw-r--r-- | lib/models/output.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/models/output.js b/lib/models/output.js index 43e36f8..0f008ec 100644 --- a/lib/models/output.js +++ b/lib/models/output.js @@ -1,6 +1,7 @@ var Immutable = require('immutable'); var Book = require('./book'); +var LocationUtils = require('../utils/location'); var Output = Immutable.Record({ book: Book(), @@ -53,6 +54,19 @@ Output.prototype.getState = function() { }; /** + Return a page byt its file path + + @param {String} filePath + @return {Page|undefined} +*/ +Output.prototype.getPage = function(filePath) { + filePath = LocationUtils.normalize(filePath); + + var pages = this.getPages(); + return pages.get(filePath); +}; + +/** Get root folder for output @return {String} |