Skip to content

Commit

Permalink
Merge branch 'dev' into josh-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuazeltser authored Jun 28, 2019
2 parents 4b6461c + 25a1ca6 commit ff715e2
Show file tree
Hide file tree
Showing 18 changed files with 139 additions and 634 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ __pycache__
.coverage
.pytest_cache
src

*.iml
*.swp
*.map
.idea/
Expand All @@ -43,3 +43,4 @@ package-lock.json
geckodriver.log
*.ipynb
*.iml
.vscode/settings.json
563 changes: 0 additions & 563 deletions Create and Deploy an Azure ML Web Service.ipynb

This file was deleted.

15 changes: 10 additions & 5 deletions notebook/static/acc_overwrite.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@
// To make keyboard focus clearly visible on the Controls(File,Edit,View,Insert,Cell...etc)present on the menubar.
//&:hover, //To use browser's hover default value
&:focus {
/* -webkit-focus-ring-color = '#5B9DD9' */
outline: -webkit-focus-ring-color auto 5px;
// color: @navbar-default-link-hover-color;
// background-color: @navbar-default-link-hover-bg;
outline: 1px dotted #212121;
outline: 5px auto -webkit-focus-ring-color;

}
}
}
}

.menu_focus_highlight{
a:focus {
outline: -webkit-focus-ring-color auto 5px;
}
}
11 changes: 11 additions & 0 deletions notebook/static/base/js/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ define(['jquery',
.attr("data-dismiss", "modal")
.attr("aria-hidden", "true")
.html("×")
.attr("tabindex","0")
).append(
options.type ? options.type.addClass('modal-title').text(options.title || "")
: $("<h4/>").addClass('modal-title').text(options.title || "")
Expand Down Expand Up @@ -130,6 +131,9 @@ define(['jquery',
options.keyboard_manager.enable();
options.keyboard_manager.command_mode();
}
if (options.focus_button) {
$('#notification_trusted').focus();
}
});

if (options.keyboard_manager) {
Expand Down Expand Up @@ -190,12 +194,19 @@ define(['jquery',
.append(textarea)
)
);

//fix issue#4012
var editor = CodeMirror.fromTextArea(textarea[0], {
lineNumbers: true,
matchBrackets: true,
indentUnit: 2,
autoIndent: true,
mode: 'application/json',
extraKeys:{
Tab:false,
Shift:false,
'Shift-Tab':false
}
});
var title_msg;
if (options.name === "Notebook") {
Expand Down
9 changes: 7 additions & 2 deletions notebook/static/base/js/notificationarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ define([

// create the element for the notification widget and add it
// to the notification aread element
var div = $('<div/>').attr('id', 'notification_' + name);
$(this.selector).append(div);
if (name === 'trusted') {
var div = $('<button/>').attr('id', 'notification_' + name);
$(this.selector).append(div);
} else {
var div = $('<div/>').attr('id', 'notification_' + name);
$(this.selector).append(div);
}

// create the widget object and return it
this.widget_dict[name] = new NotificationWidget('#notification_' + name);
Expand Down
1 change: 1 addition & 0 deletions notebook/static/notebook/js/celltoolbarpresets/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ define([
.attr('rows', '13')
.attr('cols', '80')
.attr('name', 'tags')
// .attr('title','edit text area')
.text(tag_list.join('\n'));

var dialogform = $('<div/>').attr('title', i18n.msg._('Edit the tags'))
Expand Down
2 changes: 1 addition & 1 deletion notebook/static/notebook/js/codecell.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ define([
cell: this,
notebook: this.notebook});
inner_cell.append(this.celltoolbar.element);
var input_area = $('<div/>').addClass('input_area');
var input_area = $('<div/>').addClass('input_area').attr("aria-label", "Edit code here");
this.code_mirror = new CodeMirror(input_area.get(0), this._options.cm_config);
// In case of bugs that put the keyboard manager into an inconsistent state,
// ensure KM is enabled when CodeMirror is focused:
Expand Down
3 changes: 2 additions & 1 deletion notebook/static/notebook/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ requirejs([
'notebook/js/about',
'notebook/js/searchandreplace',
'notebook/js/clipboard',
'bidi/bidi'
'bidi/bidi',
'notebook/js/celltoolbarpresets/tags'
], function(
$,
contents_service,
Expand Down
15 changes: 15 additions & 0 deletions notebook/static/notebook/js/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,27 @@ define([
this.events.trigger('resize-header.Page');
};

(function($){
$(document).ready(function(){
$('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
event.preventDefault();
event.stopPropagation();
$(this).parent().siblings().removeClass('open');
$(this).parent().toggleClass('open');
});
});
})(jQuery);

MenuBar.prototype.bind_events = function () {
/**
* File
*/
var that = this;

this.element.find("#new_notebook").click(function(){
console.log("11");
})

this.element.find('#open_notebook').click(function () {
var parent = utils.url_path_split(that.notebook.notebook_path)[0];
window.open(
Expand Down
10 changes: 8 additions & 2 deletions notebook/static/notebook/js/notebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ define([
// where they came from. It will do until we have proper undo support.
undelete_backup.index = cursor_ix_after;
$('#undelete_cell').removeClass('disabled');

$('.undelete_link').removeAttr("aria-disabled");
this.undelete_backup_stack.push(undelete_backup);
this.set_dirty(true);

Expand Down Expand Up @@ -1621,13 +1621,16 @@ define([
if (!this.paste_enabled) {
$('#paste_cell_replace').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-replace');});
'jupyter-notebook:paste-cell-replace');})
$('.paste_replace').removeAttr("aria-disabled");
$('#paste_cell_above').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-above');});
$('.paste_above').removeAttr("aria-disabled");
$('#paste_cell_below').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-below');});
$('.paste_below').removeAttr("aria-disabled");
this.paste_enabled = true;
}
};
Expand Down Expand Up @@ -1938,6 +1941,7 @@ define([
Notebook.prototype.enable_attachments_paste = function () {
if (!this.paste_attachments_enabled) {
$('#paste_cell_attachments').removeClass('disabled');
$('.paste_attachments').removeAttr("aria-disabled");
this.paste_attachments_enabled = true;
}
};
Expand All @@ -1948,6 +1952,7 @@ define([
Notebook.prototype.set_insert_image_enabled = function(enabled) {
if (enabled) {
$('#insert_image').removeClass('disabled');
$('.image_link').removeAttr("aria-disabled");
} else {
$('#insert_image').addClass('disabled');
}
Expand Down Expand Up @@ -2993,6 +2998,7 @@ define([
keyboard_manager: this.keyboard_manager,
title: i18n.msg._("Trust this notebook?"),
body: body,
focus_button: 'notification_trusted',

buttons: {
Cancel : {},
Expand Down
2 changes: 0 additions & 2 deletions notebook/static/notebook/js/notificationarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,13 @@ define([
return false;
}, {'title':'Javascript enabled for notebook display'});
// don't allow 'Trusted' button to be clicked
$(tnw.selector).attr('role', 'button')
$(tnw.selector).attr('disabled', true)
$(tnw.selector).css('cursor', 'help');
} else {
tnw.set_message(i18n.msg._("Not Trusted"), undefined, function() {
that.notebook.trust_notebook();
return false;
}, {'title':'Javascript disabled for notebook display'});
$(tnw.selector).attr('role', 'button')
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion notebook/static/notebook/js/textcell.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ define([
cell: this,
notebook: this.notebook});
inner_cell.append(this.celltoolbar.element);
var input_area = $('<div/>').addClass('input_area');
var input_area = $('<div/>').addClass('input_area').attr("aria-label", "Edit Markup Text here");;
this.code_mirror = new CodeMirror(input_area.get(0), this._options.cm_config);
// In case of bugs that put the keyboard manager into an inconsistent state,
// ensure KM is enabled when CodeMirror is focused:
Expand Down
7 changes: 7 additions & 0 deletions notebook/static/notebook/less/menubar.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@


#menubar {

.border-box-sizing();
margin-top: 1px;

Expand Down Expand Up @@ -44,6 +47,8 @@
}
}

ul.dropdown-menu:focus

[dir="rtl"] ul.dropdown-menu {
text-align: right;
left : auto;
Expand Down Expand Up @@ -86,6 +91,8 @@ ul#help_menu li a{
}
}



// Make sub menus work in BS3.
// Credit: http://www.bootply.com/86684
.dropdown-submenu {
Expand Down
14 changes: 14 additions & 0 deletions notebook/static/tree/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ requirejs([
)
);



$("#refresh_notebook_list").click(function(){
if($(this).attr("aria-label")=="pressing refresh button"){
$(this).attr("aria-label","pressing refresh button.");
}
else if($(this).attr("aria-label")=="pressing refresh button."){
$(this).attr("aria-label","pressing refresh button");
}
else{
$(this).attr("aria-label","pressing refresh button");
}
});

var interval_id=0;
// auto refresh every xx secondes, no need to be fast,
// update is done most of the time when page get focus
Expand Down
53 changes: 27 additions & 26 deletions notebook/static/tree/js/notebooklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,22 +420,23 @@ define([
);
var crumb = $('<li/>').append(
$('<a/>')
.attr('href', url)
.attr('title',"link to"+url)
.text(path_part)
.click(function(e) {
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
if(e.altKey || e.metaKey || e.shiftKey) {
return true;
}
window.history.pushState(
{path: path},
path,
url
);
that.update_location(path);
return false;
})

.attr('href', url)
.attr('title',"link to"+url)
.text(path_part)
.click(function(e) {
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
if(e.altKey || e.metaKey || e.shiftKey) {
return true;
}
window.history.pushState(
{path: path},
path,
url
);
that.update_location(path);
return false;
})
);
breadcrumb.append(crumb);
});
Expand Down Expand Up @@ -824,18 +825,18 @@ define([

//#issue 3961, update the checkbox aria-label when it changed
if(selected.length>=1){
if($('#select-all').prop("checked")){
$('#button-select-all').attr("aria-label","Selected All "+ selected.length+" items");
$("#button-select-all").attr("aria-checked","true");
}
else{
$('#button-select-all').attr("aria-label","Selected, "+ selected.length+" items");
$("#button-select-all").attr("aria-checked","true");
}
if($('#select-all').prop("checked")){
$('#button-select-all').attr("aria-label","Selected All "+ selected.length+" items");
$("#button-select-all").attr("aria-checked","true");
}
else{
$('#button-select-all').attr("aria-label","Selected, "+ selected.length+" items");
$("#button-select-all").attr("aria-checked","true");
}
}
else{
$('#button-select-all').attr("aria-label","Select All/None");
$("#button-select-all").attr("aria-checked","false");
$('#button-select-all').attr("aria-label","Select All/None");
$("#button-select-all").attr("aria-checked","false");
}

// If at aleast on item is selected, hide the selection instructions.
Expand Down
Loading

0 comments on commit ff715e2

Please sign in to comment.