##// END OF EJS Templates
ENH: initial .mailmap to unify major contributors appearance in shortlog...
ENH: initial .mailmap to unify major contributors appearance in shortlog Now instead of 785 Fernando Perez 632 Brian Granger 572 MinRK 572 vivainio 307 Thomas Kluyver 253 fperez 250 epatters 205 Ville M. Vainio 187 Brian E. Granger 110 Gael Varoquaux 106 walter.doerwald 69 gvaroquaux 52 Barry Wark 45 Brian E Granger 41 ldufrechou 40 Robert Kern 25 Jorgen Stenarson 20 vivainio2 16 Paul Ivanov 15 bgranger ... it would look like 1052 Fernando Perez 879 Brian E. Granger 802 Ville M. Vainio 588 Benjamin Ragan-Kelley 307 Thomas Kluyver 262 Evan Patterson 180 Gael Varoquaux 108 Walter Doerwald 70 Laurent Dufréchou 52 Barry Wark 42 Robert Kern ... There are more contributors which haven't yet been added to the mailmap file

File last commit:

r4660:de11bafe
r4798:eb389453
Show More
savewidget.js
147 lines | 4.6 KiB | application/javascript | JavascriptLexer
//----------------------------------------------------------------------------
// 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.
//----------------------------------------------------------------------------
//============================================================================
// SaveWidget
//============================================================================
var IPython = (function (IPython) {
var utils = IPython.utils;
var SaveWidget = function (selector) {
this.selector = selector;
this.notebook_name_re = /[^/\\]+/
this.last_saved_name = '';
if (this.selector !== undefined) {
this.element = $(selector);
this.style();
this.bind_events();
}
};
SaveWidget.prototype.style = function () {
this.element.find('input#notebook_name').addClass('ui-widget ui-widget-content');
this.element.find('input#notebook_name').attr('tabindex','1');
this.element.find('button#save_notebook').button();
var left_panel_width = $('div#left_panel').outerWidth();
var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
$('span#save_widget').css({marginLeft:left_panel_width+left_panel_splitter_width});
};
SaveWidget.prototype.bind_events = function () {
var that = this;
this.element.find('button#save_notebook').click(function () {
that.save_notebook();
});
this.element.find('input#notebook_name').keyup(function () {
that.is_renaming();
});
};
SaveWidget.prototype.save_notebook = function () {
IPython.notebook.save_notebook();
this.set_document_title();
this.last_saved_name = this.get_notebook_name();
};
SaveWidget.prototype.is_renaming = function () {
if (this.get_notebook_name() !== this.last_saved_name) {
this.status_rename();
} else {
this.status_save();
};
};
SaveWidget.prototype.get_notebook_name = function () {
return this.element.find('input#notebook_name').attr('value');
}
SaveWidget.prototype.set_notebook_name = function (nbname) {
this.element.find('input#notebook_name').attr('value',nbname);
this.set_document_title();
this.last_saved_name = nbname;
}
SaveWidget.prototype.set_document_title = function () {
nbname = this.get_notebook_name();
document.title = 'IPy: ' + nbname;
};
SaveWidget.prototype.get_notebook_id = function () {
return this.element.find('span#notebook_id').text()
};
SaveWidget.prototype.update_url = function () {
var notebook_id = this.get_notebook_id();
if (notebook_id !== '') {
window.history.replaceState({}, '', notebook_id);
};
};
SaveWidget.prototype.test_notebook_name = function () {
var nbname = this.get_notebook_name();
if (this.notebook_name_re.test(nbname)) {
return true;
} else {
var bad_name = $('<div/>');
bad_name.html(
"The notebook name you entered (" +
nbname +
") is not valid. Notebook names can contain any characters except / and \\"
);
bad_name.dialog({title: 'Invalid name', modal: true});
return false;
};
};
SaveWidget.prototype.status_save = function () {
this.element.find('button#save_notebook').button('option', 'label', '<u>S</u>ave');
this.element.find('button#save_notebook').button('enable');
IPython.print_widget.enable();
};
SaveWidget.prototype.status_saving = function () {
this.element.find('button#save_notebook').button('option', 'label', 'Saving');
this.element.find('button#save_notebook').button('disable');
IPython.print_widget.disable();
};
SaveWidget.prototype.status_loading = function () {
this.element.find('button#save_notebook').button('option', 'label', 'Loading');
this.element.find('button#save_notebook').button('disable');
IPython.print_widget.disable();
};
SaveWidget.prototype.status_rename = function () {
this.element.find('button#save_notebook').button('option', 'label', 'Rename');
this.element.find('button#save_notebook').button('enable');
IPython.print_widget.enable();
};
IPython.SaveWidget = SaveWidget;
return IPython;
}(IPython));