2013-06-25 16:23:09 +04:00
|
|
|
/*globals window, $, _, Backbone */
|
|
|
|
(function () {
|
2013-05-31 09:58:20 +04:00
|
|
|
"use strict";
|
|
|
|
|
2013-06-04 16:38:45 +04:00
|
|
|
var Ghost = {
|
|
|
|
Layout : {},
|
|
|
|
Views : {},
|
|
|
|
Collections : {},
|
|
|
|
Models : {},
|
|
|
|
|
|
|
|
settings: {
|
|
|
|
apiRoot: '/api/v0.1'
|
|
|
|
},
|
|
|
|
|
|
|
|
// This is a helper object to denote legacy things in the
|
|
|
|
// middle of being transitioned.
|
|
|
|
temporary: {},
|
|
|
|
|
|
|
|
currentView: null,
|
|
|
|
router: null
|
|
|
|
};
|
|
|
|
|
2013-08-21 14:50:49 +04:00
|
|
|
_.extend(Ghost, Backbone.Events);
|
|
|
|
|
2013-06-08 06:16:28 +04:00
|
|
|
Ghost.init = function () {
|
|
|
|
Ghost.router = new Ghost.Router();
|
2013-08-06 11:55:47 +04:00
|
|
|
|
|
|
|
// This is needed so Backbone recognizes elements already rendered server side
|
|
|
|
// as valid views, and events are bound
|
|
|
|
Ghost.notifications = new Ghost.Views.NotificationCollection({model: []});
|
|
|
|
|
2013-06-08 06:16:28 +04:00
|
|
|
Backbone.history.start({
|
|
|
|
pushState: true,
|
|
|
|
hashChange: false,
|
|
|
|
root: '/ghost'
|
|
|
|
});
|
|
|
|
};
|
2013-06-02 03:45:02 +04:00
|
|
|
|
2013-05-31 09:58:20 +04:00
|
|
|
window.Ghost = Ghost;
|
|
|
|
|
2013-06-25 16:23:09 +04:00
|
|
|
}());
|