});
+Editor.ToolbarButtonsModel = Editor.Model.extend({
+ _className: 'Editor.ToolbarButtonsModel',
+ serverURL: '/api/toolbar/buttons',
+ buttons: {},
+
+ init: function() {
+ this._super();
+ },
+
+ load: function() {
+ if (!this.get('buttons').length) {
+ $.ajax({
+ url: this.serverURL,
+ dataType: 'json',
+ success: this.loadSucceeded.bind(this)
+ });
+ }
+ },
+
+ loadSucceeded: function(data) {
+ this.set('buttons', data);
+ }
+});
+
+
Editor.XMLModel = Editor.Model.extend({
_className: 'Editor.XMLModel',
serverURL: null,
init: function(serverURL) {
this._super();
this.serverURL = serverURL;
+ this.toolbarButtonsModel = new Editor.ToolbarButtonsModel();
},
getData: function() {
$(function() {
doc = new Editor.DocumentModel();
+ var editor = new EditorView('body', doc);
var splitView = new SplitView('#splitview', doc);
leftPanelView = new PanelContainerView('#left-panel-container', doc);
rightPanelContainer = new PanelContainerView('#right-panel-container', doc);