Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] bootstrapify #3393

Merged
merged 55 commits into from
Jun 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
2f8f8b4
start using bootstrap
minrk May 30, 2013
6adb9f5
bootstrap base, auth
minrk May 31, 2013
e14ee7b
overriding baseLineHeight is not a good idea
minrk May 31, 2013
b88c841
jquery-ui.custom has been renamed
minrk May 31, 2013
69b99ab
bootstrap menubar
minrk May 31, 2013
1b9fe34
bootstrap toolbar
minrk May 31, 2013
7bc0eff
shrink login button
minrk May 31, 2013
cd4af66
bootstrap tree
minrk May 31, 2013
de5cd00
remove unused jquery-ui checkpoint
minrk May 31, 2013
4761f8e
don't use $(document).append (it's wrong and broken)
minrk May 31, 2013
7740665
use components jquery-ui
minrk May 31, 2013
f8e87bb
bootstrap dialogs
minrk Jun 1, 2013
6f86ba4
tree style tweaks
minrk Jun 1, 2013
0aeca46
bootstrap button output area
minrk Jun 1, 2013
c648d83
ipython-main-app should be a bootstrap container
minrk Jun 2, 2013
19c3997
center login
minrk Jun 2, 2013
0abbd0e
use responsive bootstrap
minrk Jun 2, 2013
3589385
tweak header
minrk Jun 2, 2013
a200045
hide save status as it shrinks
minrk Jun 2, 2013
04d068c
add missing dialog.js
minrk Jun 2, 2013
1beae23
fix wrong arrow direction
minrk Jun 2, 2013
173853a
disabile bootstrap's capitalized nav-header
minrk Jun 2, 2013
52652dc
tweak header styling
minrk Jun 3, 2013
3519f28
set layout with outerHeight
minrk Jun 3, 2013
ec0f6c8
fix bad `$(body)`
minrk Jun 3, 2013
853c4c1
only put the notebook in a container
minrk Jun 3, 2013
67e3e66
add missing cell_type = "code";
minrk Jun 3, 2013
f633042
fight with bootstrap a little less in tree view
minrk Jun 3, 2013
f5b8701
shrink navbars a little
minrk Jun 3, 2013
b148dd6
inherit bootstrap properly
minrk Jun 3, 2013
ce49fa5
pager styling
minrk Jun 3, 2013
c74fd65
use row-fluid for tree_list
minrk Jun 11, 2013
871f6b9
use row-fluid for cluster list
minrk Jun 11, 2013
7d1e9b4
bootstrapify delete dialog
minrk Jun 11, 2013
28f1de1
bootstrapify quickhelp
minrk Jun 11, 2013
138a5cf
remove console.log
minrk Jun 11, 2013
92b6154
fix select alignment on FF
minrk Jun 11, 2013
32813e5
fix Invalid Password message location
minrk Jun 11, 2013
7eb4a1b
don't remove nav-tab border
minrk Jun 11, 2013
1fd03b8
fix tab hash / url behavior
minrk Jun 11, 2013
417a87b
use named tabs in tree
minrk Jun 11, 2013
c2b5798
bootstrapify notification widget
minrk Jun 12, 2013
fb2bed4
fix raw_input
minrk Jun 13, 2013
91ae4d7
fix cell toolbar
minrk Jun 13, 2013
090ba2d
don't color delete buton
minrk Jun 13, 2013
4555371
remove extra console.log
minrk Jun 13, 2013
dce0929
specify end-space height in less
minrk Jun 13, 2013
0777e66
tweak quick-help
minrk Jun 13, 2013
7333b2b
use IPython border color for tree view
minrk Jun 15, 2013
29237be
reduce horizontal padding for pager-container
minrk Jun 15, 2013
bbf21d1
add break between prompt and input in Rename dialog
minrk Jun 15, 2013
9cd23a6
reduce height of notification_widget by a few pixels
minrk Jun 15, 2013
61176fb
fix cell alignment by a few pixels
minrk Jun 15, 2013
3d07434
menubar not full-width
minrk Jun 15, 2013
d114724
compress menubar a few pixels vertically
minrk Jun 16, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions IPython/frontend/html/notebook/static/auth/js/loginmain.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
$(document).ready(function () {

IPython.page = new IPython.Page();
$('input#login_submit').button();
$('#ipython-main-app').addClass('border-box-sizing ui-widget');
$('button#login_submit').addClass("btn");
IPython.page.show();
$('input#password_input').focus();

Expand Down
3 changes: 1 addition & 2 deletions IPython/frontend/html/notebook/static/auth/js/loginwidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ var IPython = (function (IPython) {
};

LoginWidget.prototype.style = function () {
this.element.find('button#logout').button();
this.element.find('button#login').button();
this.element.find("button").addClass("btn btn-small");
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$(document).ready(function () {

IPython.page = new IPython.Page();
$('#ipython-main-app').addClass('border-box-sizing ui-widget');
$('#ipython-main-app').addClass('border-box-sizing');
IPython.page.show();

});
Expand Down
7 changes: 6 additions & 1 deletion IPython/frontend/html/notebook/static/auth/less/login.less
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
// Custom styles for login.html
// Custom styles for login.html
.center-nav {
display: inline-block;
// pull the lower margin back
margin-bottom: -4px;
}
75 changes: 75 additions & 0 deletions IPython/frontend/html/notebook/static/base/js/dialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
//----------------------------------------------------------------------------
// Copyright (C) 2013 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.
//----------------------------------------------------------------------------

//============================================================================
// Utility for modal dialogs with bootstrap
//============================================================================

IPython.namespace('IPython.dialog');

IPython.dialog = (function (IPython) {

var modal = function (options) {
var dialog = $("<div/>").addClass("modal").attr("role", "dialog");
dialog.append(
$("<div/>")
.addClass("modal-header")
.append($("<button>")
.addClass("close")
.attr("data-dismiss", "modal")
.html("&times;")
).append(
$("<h3/>").text(options.title || "")
)
).append(
$("<div/>").addClass("modal-body").append(
options.body || $("<p/>")
)
);

var footer = $("<div/>").addClass("modal-footer");

for (var label in options.buttons) {
var btn_opts = options.buttons[label];
var button = $("<button/>")
.addClass("btn")
.attr("data-dismiss", "modal")
.text(label);
if (btn_opts.click) {
button.click($.proxy(btn_opts.click, dialog));
}
if (btn_opts.class) {
button.addClass(btn_opts.class);
}
footer.append(button);
}
dialog.append(footer);
// hook up on-open event
dialog.on("shown", function() {
setTimeout(function() {
footer.find("button").last().focus();
if (options.open) {
$.proxy(options.open, dialog)();
}
}, 0);
});

// destroy dialog on hide, unless explicitly asked not to
if (options.destroy == undefined || options.destroy) {
dialog.on("hidden", function () {
dialog.remove();
});
}

return dialog.modal(options);
}

return {
modal : modal,
};

}(IPython));
8 changes: 2 additions & 6 deletions IPython/frontend/html/notebook/static/base/js/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ var IPython = (function (IPython) {
};

Page.prototype.style = function () {
$('div#header').addClass('border-box-sizing').
addClass('ui-widget-content').
css('border-top-style','none').
css('border-left-style','none').
css('border-right-style','none');
$('div#site').addClass('border-box-sizing')
$('div#header').addClass('border-box-sizing');
$('div#site').addClass('border-box-sizing');
};


Expand Down
43 changes: 23 additions & 20 deletions IPython/frontend/html/notebook/static/base/less/page.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,19 @@ body {
overflow: visible;
}


div#header {
/* Initially hidden to prevent FLOUC */
display: none;
position: relative;
height: 40px;
padding: 5px;
margin: 0px;
width: 100%;
}

span#ipython_notebook {
position: absolute;
padding: 2px 2px 2px 5px;
#ipython_notebook {
padding-left: 16px;
}

span#ipython_notebook img {
#ipython_notebook img {
font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
height: 24px;
text-decoration:none;
display: inline;
color: black;
}

Expand All @@ -46,15 +38,6 @@ span#ipython_notebook img {
display: none;
}

/* We set the fonts by hand here to override the values in the theme */
.ui-widget {
font-family: "Lucinda Grande", "Lucinda Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
}

.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
font-family: "Lucinda Grande", "Lucinda Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
}

/* Smaller buttons */
.ui-button .ui-button-text {
padding: 0.2em 0.8em;
Expand All @@ -64,7 +47,27 @@ span#ipython_notebook img {
input.ui-button {
padding: 0.3em 0.9em;
}
.navbar span {
margin-top: 3px;
}

span#login_widget {
float: right;
}

.nav-header {
text-transform: none;
}

.navbar-nobg {
background-color: transparent;
background-image: none;
}

#header > span {
margin-top: 10px;
}

.modal-body {
max-height: 500px;
}
2 changes: 2 additions & 0 deletions IPython/frontend/html/notebook/static/base/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
@import "../base/less/mixins.less";
@import "../base/less/flexbox.less";
@import "../base/less/page.less";
@import "../components/font-awesome/build/assets/font-awesome/less/font-awesome.less";
@FontAwesomePath: "../components/font-awesome/build/assets/font-awesome/font";
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

@textColor: @black;
@baseFontSize: 13px;
@baseLineHeight: 1.231;
@monoFontFamily: monospace; // to allow user to customize their fonts
@monoFontFamily: monospace; // to allow user to customize their fonts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we are moving away from this line height as a global? Is there a reason for this? What is used instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were never using it as a global, that's the problem. We only used it in code text areas, but we used a generic Bootstrap variable to do it. As soon as I started adding bootstrap elements, it got all messed up. We still use the variable in the same way, it just has a more accurate name (code_line_height below).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this makes sense.

@navbarHeight: 36px;

// Our own global variables for all pages go here

@corner_radius: 4px;
@corner_radius: 4px;
@code_line_height: 1.231em;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions IPython/frontend/html/notebook/static/jquery/js/jquery-ui.min.js

This file was deleted.

42 changes: 0 additions & 42 deletions IPython/frontend/html/notebook/static/jquery/js/jquery.autogrow.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ This is only required when different pages style the same element differently. T
a hack to deal with our current css styles and no new styling should be added in this file.*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of these override files now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get rid of them, but I didn't do the cleanup required to do so. All we would have to do is give the main-app a class for each page. Should I do that here, or let it be another PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not do that here if there is still coding to do...

#ipython-main-app {
width: 100%;
position: relative;
font-size: 110%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,36 @@
lineNumbers: true,
matchBrackets: true,
});
$(dialogform).dialog({
autoOpen: true,
height: 300,
width: 650,
modal: true,
IPython.dialog.modal({
title: "Edit Cell Metadata",
body: dialogform,
buttons: {
"Ok": function() {
"OK": { class : "btn-primary",
click: function() {
//validate json and set it
try {
var json = JSON.parse(editor.getValue());
cell.metadata = json;
$( this ).dialog( "close" );
}
catch(e)
{
} catch(e) {
error_div.text('Warning, invalid json, not saved');
return false;
}
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
//cleanup on close
$(this).remove();
}},
Cancel: {}
}
});
editor.refresh();
}

var add_raw_edit_button = function(div, cell) {
var button_container = div
var button = $('<div/>').button({label:'Raw Edit'})
.click(function(){raw_edit(cell); return false;})
var button_container = div;
var button = $('<button/>')
.addClass("btn btn-mini")
.text("Raw Edit")
.click( function () {
raw_edit(cell);
return false;
});
button_container.append(button);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var IPython = (function (IPython) {
this.input_prompt_number = null;
this.collapsed = false;
this.default_mode = 'ipython';
this.cell_type = "code";


var cm_overwrite_options = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ var IPython = (function (IPython) {

var pager_height = IPython.pager.percentage_height*app_height;
var pager_splitter_height = $('div#pager_splitter').outerHeight(true);
$('div#pager').height(pager_height);
$('div#pager').outerHeight(pager_height);
if (IPython.pager.expanded) {
$('div#notebook').height(app_height-pager_height-pager_splitter_height);
$('div#notebook').outerHeight(app_height-pager_height-pager_splitter_height);
} else {
$('div#notebook').height(app_height-pager_splitter_height);
$('div#notebook').outerHeight(app_height-pager_splitter_height);
}
};

Expand Down
4 changes: 1 addition & 3 deletions IPython/frontend/html/notebook/static/notebook/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ function (marked) {
IPython.read_only = $('body').data('readOnly') === 'True';
$('#ipython-main-app').addClass('border-box-sizing');
$('div#notebook_panel').addClass('border-box-sizing');
// The header's bottom border is provided by the menu bar so we remove it.
$('div#header').css('border-bottom-style','none');

var baseProjectUrl = $('body').data('baseProjectUrl')

Expand All @@ -59,7 +57,7 @@ function (marked) {
IPython.notebook = new IPython.Notebook('div#notebook',{baseProjectUrl:baseProjectUrl, read_only:IPython.read_only});
IPython.save_widget = new IPython.SaveWidget('span#save_widget');
IPython.menubar = new IPython.MenuBar('#menubar',{baseProjectUrl:baseProjectUrl})
IPython.toolbar = new IPython.MainToolBar('#maintoolbar')
IPython.toolbar = new IPython.MainToolBar('#maintoolbar-container')
IPython.tooltip = new IPython.Tooltip()
IPython.notification_area = new IPython.NotificationArea('#notification_area')
IPython.notification_area.init_notification_widgets();
Expand Down