##// END OF EJS Templates
Style and bug fixes
KesterTong -
Show More
@@ -4,7 +4,8 b''
4 define([
4 define([
5 'base/js/namespace',
5 'base/js/namespace',
6 'jquery',
6 'jquery',
7 ], function(IPython, $) {
7 'base/js/utils',
8 ], function(IPython, $, utils) {
8 var ContentManager = function(notebook_path, base_url) {
9 var ContentManager = function(notebook_path, base_url) {
9 // Constructor
10 // Constructor
10 //
11 //
@@ -18,7 +19,7 b' define(['
18 this.version = 0.1;
19 this.version = 0.1;
19 this.notebook_path = notebook_path;
20 this.notebook_path = notebook_path;
20 this.base_url = base_url;
21 this.base_url = base_url;
21 }
22 };
22
23
23 ContentManager.prototype.new_notebook = function() {
24 ContentManager.prototype.new_notebook = function() {
24 var path = this.notebook_path;
25 var path = this.notebook_path;
@@ -49,7 +50,7 b' define(['
49 path
50 path
50 );
51 );
51 $.ajax(url,settings);
52 $.ajax(url,settings);
52 }
53 };
53
54
54 ContentManager.prototype.delete_notebook = function(notebook) {
55 ContentManager.prototype.delete_notebook = function(notebook) {
55 var that = notebook;
56 var that = notebook;
@@ -67,7 +68,7 b' define(['
67 that.notebook_name
68 that.notebook_name
68 );
69 );
69 $.ajax(url, settings);
70 $.ajax(url, settings);
70 }
71 };
71
72
72 ContentManager.prototype.rename_notebook = function(notebook, nbname) {
73 ContentManager.prototype.rename_notebook = function(notebook, nbname) {
73 var that = notebook;
74 var that = notebook;
@@ -93,7 +94,7 b' define(['
93 this.notebook_name
94 this.notebook_name
94 );
95 );
95 $.ajax(url, settings);
96 $.ajax(url, settings);
96 }
97 };
97
98
98 ContentManager.prototype.save_notebook = function(notebook, extra_settings) {
99 ContentManager.prototype.save_notebook = function(notebook, extra_settings) {
99 // Create a JSON model to be sent to the server.
100 // Create a JSON model to be sent to the server.
@@ -129,11 +130,10 b' define(['
129 );
130 );
130 $.ajax(url, settings);
131 $.ajax(url, settings);
131 };
132 };
132 }
133
133
134 ContentManager.prototype.save_checkpoint = function() {
134 ContentManager.prototype.save_checkpoint = function() {
135 // This is not necessary - integrated into save
135 // This is not necessary - integrated into save
136 }
136 };
137
137
138 ContentManager.prototype.restore_checkpoint = function(notebook, id) {
138 ContentManager.prototype.restore_checkpoint = function(notebook, id) {
139 that = notebook;
139 that = notebook;
@@ -151,7 +151,7 b' define(['
151 ).fail(
151 ).fail(
152 $.proxy(that.restore_checkpoint_error, that)
152 $.proxy(that.restore_checkpoint_error, that)
153 );
153 );
154 }
154 };
155
155
156 ContentManager.prototype.list_checkpoints = function(notebook) {
156 ContentManager.prototype.list_checkpoints = function(notebook) {
157 that = notebook;
157 that = notebook;
@@ -167,7 +167,9 b' define(['
167 ).fail(
167 ).fail(
168 $.proxy(that.list_checkpoints_error, that)
168 $.proxy(that.list_checkpoints_error, that)
169 );
169 );
170 }
170 };
171
172 IPython.ContentManager = ContentManager;
171
173
172 return ContentManager;
174 return {'ContentManager': ContentManager};
173 });
175 });
General Comments 0
You need to be logged in to leave comments. Login now