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

Add RBI support #135

Closed
wants to merge 3 commits into from
Closed
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
55 changes: 55 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,33 @@
}

#editor {
position: relative;
height: calc(100% - 24px);
}

#tabs {
position: absolute;
z-index: 1;
top: 24px;
right: 24px;
background: #1e1e1e;
outline: 2px solid #d4d4d4;
border-radius: 4px;
}

#tabs a {
display: block;
float: left;
color: #d4d4d4;
padding: 0 4px;
cursor: pointer;
}

#tabs a.active {
color: #1e1e1e;
background: #d4d4d4;
}

#editor-statusbar {
position: absolute;
bottom: 0;
Expand Down Expand Up @@ -262,6 +286,10 @@

<main>
<div id="editor">
<div id="tabs">
<a id="ruby-tab" class="active">Ruby</a>
<a id="rbi-tab">RBI</a>
</div>
</div>
<div id="editor-statusbar"></div>
<pre id="output" class="solarized">Loading...</pre>
Expand All @@ -283,6 +311,33 @@
document.getElementById('editor').classList.toggle('editor-only');
document.getElementById('output').classList.toggle('editor-only');
});

var rubyTab = document.getElementById('ruby-tab');
var rbiTab = document.getElementById('rbi-tab');

rubyTab.addEventListener('click', function(ev) {
ev.preventDefault();
window.setEditorModel('ruby');
});

rbiTab.addEventListener('click', function(ev) {
ev.preventDefault();
window.setEditorModel('rbi');
});

const setRubyTab = () => {
rubyTab.classList.add('active');
rbiTab.classList.remove('active');
};

const setRbiTab = () => {
rubyTab.classList.remove('active');
rbiTab.classList.add('active');
};

window.editor.onDidChangeModel((e) => {
e.newModelUrl.path.endsWith('.rbi') ? setRbiTab() : setRubyTab();
})
})();
</script>

Expand Down
71 changes: 62 additions & 9 deletions docs/monaco/lib/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/monaco/lib/client.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/monaco/lib/editor.worker.bundle.js.map

Large diffs are not rendered by default.

Loading