forked from ipython/ipython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ipython#931 from minrk/readonly
The notebook now supports a `--read-only` flag, which allows users to view all notebooks being served but not to edit them or execute any code. These actions are not allowed and the buttons, shortcuts, etc. are removed, but the requests will raise authentication errors if they manage to send the events anyway. Save/print functions remain available. This flag can be used in two modes: 1. When running an unauthenticated server, one can run a *second* read-only server in the same directory on a public IP address. This will let users connect to the read-only view without having to worry about configuring passwords and certificates for the execution server. 2. When running a server configured with authentication (and hopefully an SSL certificate), starting it with `--read-only` allows unauthenticated users read-only access to notebooks. This means that the same server on a single port can be both used by authenticated users for execution and by the public for viewing the available notebooks.
- Loading branch information
Showing
15 changed files
with
197 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//---------------------------------------------------------------------------- | ||
// Copyright (C) 2008-2011 The IPython Development Team | ||
// | ||
// Distributed under the terms of the BSD License. The full license is in | ||
// the file COPYING, distributed as part of this software. | ||
//---------------------------------------------------------------------------- | ||
|
||
//============================================================================ | ||
// Login button | ||
//============================================================================ | ||
|
||
var IPython = (function (IPython) { | ||
|
||
var LoginWidget = function (selector) { | ||
this.selector = selector; | ||
if (this.selector !== undefined) { | ||
this.element = $(selector); | ||
this.style(); | ||
this.bind_events(); | ||
} | ||
}; | ||
|
||
LoginWidget.prototype.style = function () { | ||
this.element.find('button#login').button(); | ||
}; | ||
LoginWidget.prototype.bind_events = function () { | ||
var that = this; | ||
this.element.find("button#login").click(function () { | ||
window.location = "/login?next="+location.pathname; | ||
}); | ||
}; | ||
|
||
// Set module variables | ||
IPython.LoginWidget = LoginWidget; | ||
|
||
return IPython; | ||
|
||
}(IPython)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.