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

Fix tooltip and move replace in selected cells button. #567

Merged
merged 4 commits into from
Oct 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions notebook/static/notebook/js/searchandreplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ define(function(require){
body.append($('<p/>').addClass('bg-warning').text("Warning, too many matches ("+html.length+"+), some changes might not be shown or applied"));
} else {
body.append($('<p/>').addClass('bg-info').text(html.length+" match"+(html.length==1?'':'es')));

}
for(var rindex=0; rindex<html.length; rindex++){
var pre = $('<pre/>')
Expand Down Expand Up @@ -135,7 +134,7 @@ define(function(require){
res.push([match.index, match.index+match[0].length]);
escape_hatch++;
if(escape_hatch > 100){
console.warn("More than 100 matches, aborting");
console.warn("More than 100 matches, aborting");
abort = true;
break;
}
Expand All @@ -156,7 +155,7 @@ define(function(require){
.attr('id', 'isreg')
.addClass("btn btn-default")
.attr('data-toggle','button')
.attr('title', 'use regular expression (now you have N+1 problems)')
.attr('title', 'Use regex (JavaScript regex syntax)')
.text('.*');

var onlySelectedButton = $('<button/>')
Expand All @@ -166,14 +165,14 @@ define(function(require){
.addClass("fa fa-check-square-o")
)
.attr('data-toggle','button')
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also replace the faux checkbox button with a real checkbox!

Copy link
Member

Choose a reason for hiding this comment

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

or change the icon to fa-square-o (to indicated a "selected" border)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the button is already a toggle button, I don't think it makes sense to add a checkbox too. I'd either need to sync the check state with the button state or keep the checkbox static. Not to mention, on some operating systems/browsers, check boxes aren't that pretty.

The fa-square-o idea is easy though, @ellisonbg would you like that?

.attr('title', 'replace only in selected cells');
.attr('title', 'Replace only in selected cells');

var isCaseSensitiveButton = $('<button/>')
.attr('type', 'button')
.addClass("btn btn-default")
.attr('data-toggle','button')
.attr('tabindex', '0')
.attr('title', 'is search case sensitive')
.attr('title', 'Case sensitive')
.text('a≠A');

var repl = $("<input/>")
Expand All @@ -188,21 +187,15 @@ define(function(require){
$('<div/>').addClass('input-group')
.append(
$('<div/>').addClass('input-group-btn')
.append(isCaseSensitiveButton)
.append(isRegExpButton)
.append(isCaseSensitiveButton)
.append(isRegExpButton)
.append(onlySelectedButton)
)
.append(search)
)
)
.append($('<div/>').addClass('form-group')
.append(
$('<div/>').addClass('input-group')
.append(repl)
.append(
$('<div/>').addClass('input-group-btn')
.append(onlySelectedButton)
)
)
.append(repl)
)
.append(body);

Expand Down
5 changes: 0 additions & 5 deletions notebook/static/notebook/less/searchandreplace.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,4 @@
max-height: 60vh;
overflow: auto;
}

& input:last-child {
border-left:none;
}

}