Skip to content

Commit

Permalink
Merge pull request #14 from uclixnjupyternbaccessibility/tao-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
taohan16 committed Jun 20, 2019
2 parents aa64d9d + 3d89a8e commit ad9656e
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 582 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ config.rst
package-lock.json
geckodriver.log
*.ipynb
.vscode/settings.json
563 changes: 0 additions & 563 deletions Create and Deploy an Azure ML Web Service.ipynb

This file was deleted.

8 changes: 7 additions & 1 deletion notebook/static/acc_overwrite.less
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@
// background-color: @navbar-default-link-hover-bg;
}
}
}
}

.menu_focus_highlight{
a:focus {
outline: -webkit-focus-ring-color auto 5px;
}
}
8 changes: 8 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 @@ -193,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
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
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
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
4 changes: 4 additions & 0 deletions notebook/static/tree/js/notebooklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ 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)
Expand Down Expand Up @@ -817,13 +818,16 @@ define([
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");
}
}
else{
$('#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
28 changes: 14 additions & 14 deletions notebook/templates/notebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
<span id="notification_area"></span>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">

<li class="dropdown"><a href="#" class="dropdown-toggle" id="filelink" data-toggle="dropdown" aria-haspopup="true" aria-controls="file_menu">{% trans %}File{% endtrans %}</a>
<ul id="file_menu" class="dropdown-menu" role="menu" aria-labelledby="filelink">
<li id="new_notebook" class="dropdown-submenu" role="none">
<a href="#" role="menuitem">{% trans %}New Notebook{% endtrans %}<span class="sr-only">Dropdown</span></a>
<ul class="dropdown-menu" id="menu-new-notebook-submenu"></ul>
<li id="new_notebook" class="menu_focus_highlight dropdown dropdown-submenu" role="none">
<a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}New Notebook{% endtrans %}<span class="sr-only">Dropdown</span></a>
<ul class="dropdown-menu" id="menu-new-notebook-submenu" role="menu">
</ul>
</li>
<li id="open_notebook" role="none"
title="{% trans %}Opens a new window with the Dashboard view{% endtrans %}">
Expand All @@ -99,7 +99,7 @@
<li id="save_checkpoint" role="none"><a href="#" role="menuitem">{% trans %}Save and Checkpoint{% endtrans %}</a></li>
<!-- <hr/> -->
<li class="divider" role="none"></li>
<li id="restore_checkpoint" class="dropdown-submenu" role="none"><a href="#" role="menuitem">{% trans %}Revert to Checkpoint{% endtrans %}<span class="sr-only">Dropdown</span></a>
<li id="restore_checkpoint" class="menu_focus_highlight dropdown-submenu" role="none"><a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}Revert to Checkpoint{% endtrans %}<span class="sr-only">Dropdown</span></a>
<ul class="dropdown-menu">
<li><a href="#"></a></li>
<li><a href="#"></a></li>
Expand All @@ -110,7 +110,7 @@
</li>
<li class="divider" role="none"></li>
<li id="print_preview" role="none"><a href="#" role="menuitem">{% trans %}Print Preview{% endtrans %}</a></li>
<li class="dropdown-submenu" role="none"><a href="#" role="menuitem">{% trans %}Download as{% endtrans %}<span class="sr-only">Dropdown</span></a>
<li class="dropdown-submenu menu_focus_highlight" role="none"><a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}Download as{% endtrans %}<span class="sr-only">Dropdown</span></a>

<ul id="download_menu" class="dropdown-menu">
{% for exporter in get_frontend_exporters() %}
Expand Down Expand Up @@ -175,8 +175,8 @@
title="{% trans %}Show/Hide line numbers in cells{% endtrans %}">
<a href="#" role="menuitem">{% trans %}Toggle Line Numbers{% endtrans %}</a>
</li>
<li id="menu-cell-toolbar" class="dropdown-submenu" role="none">
<a href="#" role="menuitem">{% trans %}Cell Toolbar{% endtrans %}</a>
<li id="menu-cell-toolbar" class="menu_focus_highlight dropdown-submenu" role="none">
<a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}Cell Toolbar{% endtrans %}</a>
<ul class="dropdown-menu" id="menu-cell-toolbar-submenu"></ul>
</li>
</ul>
Expand Down Expand Up @@ -206,9 +206,9 @@
<li id="run_all_cells_below" role="none" title="{% trans %}Run this cell and all cells below it{% endtrans %}">
<a href="#" role="menuitem">{% trans %}Run All Below{% endtrans %}</a></li>
<li class="divider" role="none"></li>
<li id="change_cell_type" class="dropdown-submenu" role="none"
<li id="change_cell_type" class="menu_focus_highlight dropdown-submenu" role="none"
title="{% trans %}All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells{% endtrans %}">
<a href="#" role="menuitem">{% trans %}Cell Type{% endtrans %}</a>
<a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}Cell Type{% endtrans %}</a>
<ul class="dropdown-menu" role="menu">
<li id="to_code" role="none"
title="{% trans %}Contents will be sent to the kernel for execution, and output will display in the footer of cell{% endtrans %}">
Expand All @@ -222,7 +222,7 @@
</ul>
</li>
<li class="divider" role="none"></li>
<li id="current_outputs" class="dropdown-submenu" role="none"><a href="#" role="menuitem">{% trans %}Current Outputs{% endtrans %}</a>
<li id="current_outputs" class="menu_focus_highlight dropdown-submenu" role="none"><a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}Current Outputs{% endtrans %}</a>
<ul class="dropdown-menu" role="menu">
<li id="toggle_current_output" role="none"
title="{% trans %}Hide/Show the output of the current cell{% endtrans %}">
Expand All @@ -238,7 +238,7 @@
</li>
</ul>
</li>
<li id="all_outputs" class="dropdown-submenu" role="none"><a href="#" role="menuitem">{% trans %}All Output{% endtrans %}</a>
<li id="all_outputs" class="menu_focus_highlight dropdown-submenu" role="none"><a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}All Output{% endtrans %}</a>
<ul class="dropdown-menu" role="menu">
<li id="toggle_all_output" role="none"
title="{% trans %}Hide/Show the output of all cells{% endtrans %}">
Expand Down Expand Up @@ -283,8 +283,8 @@
<a href="#" role="menuitem">{% trans %}Shutdown{% endtrans %}</a>
</li>
<li class="divider" role="none"></li>
<li id="menu-change-kernel" class="dropdown-submenu" role="menuitem">
<a href="#" role="menuitem">{% trans %}Change kernel{% endtrans %}</a>
<li id="menu-change-kernel" class="menu_focus_highlight dropdown-submenu" role="menuitem">
<a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown">{% trans %}Change kernel{% endtrans %}</a>
<ul class="dropdown-menu" id="menu-change-kernel-submenu"></ul>
</li>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions notebook/templates/tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@
</div>

<div class="btn-group">
<button id="refresh_notebook_list" title="{% trans %}Refresh notebook list{% endtrans %}" aria-label="{% trans %}Refresh notebook list{% endtrans %}" class="btn btn-default btn-xs"><i class="fa fa-refresh"></i></button>
</div>
<button id="refresh_notebook_list" title="{% trans %}Refresh notebook list{% endtrans %}" aria-live="polite" class="btn btn-default btn-xs" role="button"><i class="fa fa-refresh"></i></button>
</div>
</div>
</div>
</div>
<div id="notebook_list">
<div id="notebook_list_header" class="row list_header">
<div class="btn-group dropdown" id="tree-selector">
<button title="{% trans %}Select All / None{% endtrans %}" aria-label="{% trans %}Select All / None{% endtrans %}" type="button" class="btn btn-default btn-xs" id="button-select-all" role="checkbox">
<button title="{% trans %}Select All / None{% endtrans %}" aria-label="{% trans %}Select All / None{% endtrans %}" aria-checked="true" type="button" class="btn btn-default btn-xs" id="button-select-all" role="checkbox">
<input type="checkbox" class="pull-left tree-selector" id="select-all" tabindex="-1"><span id="counter-select-all">&nbsp;</span></input>
</button>
<button title="{% trans %}Select Folders/All Notebooks/Running/Files {% endtrans %}" class="btn btn-default btn-xs dropdown-toggle" type="button" id="tree-selector-btn" data-toggle="dropdown" aria-expanded="true">
Expand Down

0 comments on commit ad9656e

Please sign in to comment.