Address @rgbkrk 's comments

Jonathan Frederic 11 years ago
parent c802038415
commit 84ce0cee2c

@ -4,7 +4,7 @@
var IPython = require('base/js/namespace');
var page = require('base/js/page');
module.exports = function() {
module.exports = function loginMain() {
var page_instance = new page.Page();
$('button#login_submit').addClass("btn btn-default");
page_instance.show();

@ -4,7 +4,7 @@
var IPython = require('base/js/namespace');
var page = require('base/js/page');
module.exports = function () {
module.exports = function logoutMain() {
var page_instance = new page.Page();
page_instance.show();

@ -2,6 +2,7 @@
// Distributed under the terms of the Modified BSD License.
"use strict";
var CodeMirror = require('codemirror/lib/codemirror');
/**
* A wrapper around bootstrap modal for easier use
@ -159,43 +160,41 @@
.append(textarea)
)
);
requirejs(['codemirror/lib/codemirror'], function(CodeMirror) {
var editor = CodeMirror.fromTextArea(textarea[0], {
lineNumbers: true,
matchBrackets: true,
indentUnit: 2,
autoIndent: true,
mode: 'application/json',
});
var modal_obj = modal({
title: "Edit " + options.name + " Metadata",
body: dialogform,
buttons: {
OK: { class : "btn-primary",
click: function() {
/**
* validate json and set it
*/
var new_md;
try {
new_md = JSON.parse(editor.getValue());
} catch(e) {
console.log(e);
error_div.text('WARNING: Could not save invalid JSON.');
return false;
}
options.callback(new_md);
var editor = CodeMirror.fromTextArea(textarea[0], {
lineNumbers: true,
matchBrackets: true,
indentUnit: 2,
autoIndent: true,
mode: 'application/json',
});
var modal_obj = modal({
title: "Edit " + options.name + " Metadata",
body: dialogform,
buttons: {
OK: { class : "btn-primary",
click: function() {
/**
* validate json and set it
*/
var new_md;
try {
new_md = JSON.parse(editor.getValue());
} catch(e) {
console.log(e);
error_div.text('WARNING: Could not save invalid JSON.');
return false;
}
},
Cancel: {}
options.callback(new_md);
}
},
notebook: options.notebook,
keyboard_manager: options.keyboard_manager,
});
Cancel: {}
},
notebook: options.notebook,
keyboard_manager: options.keyboard_manager,
});
modal_obj.on('shown.bs.modal', function(){ editor.refresh(); });
modal_obj.on('shown.bs.modal', function(){ editor.refresh(); });
});
};
module.exports = {

@ -14,8 +14,7 @@
var example_preset = [];
var simple_button = function(div
cell) {
var simple_button = function(div, cell) {
var button_container = $(div);
var button = $('<div/>').button({icons:{primary:'ui-icon-locked'}});
var fun = function(value){

@ -111,26 +111,25 @@
}
];
var that = this;
requirejs(['bootstraptour'], function(Tour) {
that.tour = new Tour({
function assignTour(Tour) {
this.tour = new Tour({
storage: false, // start tour from beginning every time
debug: true,
reflex: true, // click on element to continue tour
animation: false,
duration: that.step_duration,
duration: this.step_duration,
onStart: function() { console.log('tour started'); },
// TODO: remove the onPause/onResume logic once pi's patch has been
// merged upstream to make this work via data-resume-class and
// data-resume-text attributes.
onPause: that.toggle_pause_play,
onResume: that.toggle_pause_play,
steps: that.tour_steps,
onPause: this.toggle_pause_play,
onResume: this.toggle_pause_play,
steps: this.tour_steps,
template: tour_style,
orphan: true
});
});
}
requirejs(['bootstraptour'], assignTour.bind(this));
};
NotebookTour.prototype.start = function () {

@ -250,5 +250,5 @@
};
exports.Contents = Contents;
window.define([], function() { return {Contents: Contents}; })
define([], function() { return {Contents: Contents}; });
Loading…
Cancel
Save