(hoofbeats) Capitalizes error messages.
[profile/ivi/cowhide.git] / examples / hoofbeats / javascripts / library.js
1 $(function() {
2     var library = function() {
3         // For readability:
4         this.initialized = false;
5         this.root = undefined;
6
7         this.initialize = function() {
8             if (this.initialized)
9                 return;
10
11             window.requestFileSystem =
12                 window.requestFileSystem ||
13                 window.webkitRequestFileSystem;
14
15             if (window.requestFileSystem === undefined) {
16                 throw Error("Your browser doesn't support file system " +
17                             "operations");
18             }
19         };
20
21         this.load = function() {
22             this.initialize()
23             if (this.root === undefined) {
24                 throw Error("Root directory is not defined");
25             }
26         };
27     };
28
29     library.prototype = {
30         set root(value) { this._root = value; },
31         get root() { return this._root; },
32
33         set initialized(value) {this._initialized = value; },
34         get initialized() { return this._initialized; }
35     };
36
37     window.HoofbeatsLibrary = library;
38 });