Skip to content

Commit

Permalink
Merge branch 'master' into tcr
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed Aug 4, 2020
2 parents ae35ca9 + 6c4ace4 commit 448f652
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions app/views/kata/_file_new_rename_delete.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(() => {
const openNewFileDialog = () => {
const initialFilename = `filename${cd.extensionFilenames()[0]}`;
const okInitiallyDisabled = !isValidFilename(initialFilename);
const okClicked = newFilename => {
const okClicked = (newFilename) => {
cd.kata.editor.createFile(newFilename, {content:''});
cd.kata.filenames.refresh();
cd.kata.filenames.select(newFilename);
Expand All @@ -33,7 +33,7 @@ $(() => {
const $filenames = $('#filename-list');
const initialFilename = $('.filename.selected', $filenames).text().trim();
const okInitiallyDisabled = false;
const okClicked = filename => {
const okClicked = (filename) => {
cd.kata.editor.deleteFile(filename);
cd.kata.filenames.refresh();
cd.kata.filenames.select(cd.kata.filenames.top());
Expand All @@ -45,7 +45,7 @@ $(() => {

cd.openRenameFileDialog = (originator, filename) => {
const okInitiallyDisabled = true;
const okClicked = newFilename => {
const okClicked = (newFilename) => {
cd.kata.editor.renameFile(filename, newFilename);
cd.kata.filenames.refresh();
cd.kata.filenames.select(newFilename);
Expand Down Expand Up @@ -124,7 +124,7 @@ $(() => {

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

const isValidFilename = filename => {
const isValidFilename = (filename) => {
const contains = illegal => filename.indexOf(illegal) !== -1;
if (alreadyExists(filename)) { return false; }
if (sss(filename)) { return false; }
Expand Down
11 changes: 6 additions & 5 deletions app/views/kata/_tabs.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<div class="tab-filenames">
<div class="tab output">output</div>
<div class="tab filename">cyber-dojo.sh</div>
<div class="tab filename"></div>
<div class="tab REPL">+REPL</div>
</div>

Expand Down Expand Up @@ -36,7 +36,6 @@ $(() => {
tabs.reserves = filename => {
const tabNames = [];
tabNames.push(tabs.output().text());
tabNames.push('status');
tabNames.push(tabs.repl().text());
return tabNames.includes(filename);
};
Expand All @@ -57,9 +56,11 @@ $(() => {
// Alt-O tabs hot-key navigation
// See app/assets/javascripts/cyber-dojo_codemirror.js
// See app/views/shared/_hotkeys.html.erb
switch (tabs.selected().text()) {
default : tabs.output().click(); break;
case tabs.output().text(): tabs.filename().click(); break;
const text = tabs.selected().text();
if (text === 'output') {
tabs.filename().click();
} else {
tabs.output().click();
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $(() => {

const $button = $('#info-button');
const $buttons = $('.info-button');
cd.createTip($button, 'info');
cd.createTip($button, 'toggle info buttons on/off');
$buttons.hide();
$button.clickToggle(() => $buttons.fadeIn(), () => $buttons.fadeOut());

Expand Down

0 comments on commit 448f652

Please sign in to comment.