Skip to content

Commit

Permalink
Editor: Separate stored MicroPython version and fix rtd link.
Browse files Browse the repository at this point in the history
The URL used to get generated based on the UPY_VERSION global,
however the current v2 documentation URL doesn't follow this patter
and might not exists forever (right now is a branch in the micropython
repository). So for now the editor will link to the docs entry
point.
  • Loading branch information
microbit-carlos committed Nov 17, 2020
1 parent 682096d commit fa1f994
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
<script type="application/javascript">
// VERSION INFORMATION
EDITOR_VERSION = "2.1.0-beta.6";
UPY_VERSION = "1.0.1/2.0-3e09245a46";
UPY_1_VERSION = "1.0.1";
UPY_2_VERSION = "2.0-3e09245a46";
</script>
<script id="files-template" type="x-tmpl-mustache">
<div id="files-modal" tabindex="-1" role="dialog" aria-label="load/save modal" aria-modal="true" class="modal-div">
Expand Down Expand Up @@ -345,7 +346,7 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
</div>
<div class="buttons_menu_rhs">
<div class="buttons_menu_item"><span id="editor-ver">Editor Version:</span> <script>document.write(EDITOR_VERSION);</script></div>
<div class="buttons_menu_item"><span id="mp-ver">MicroPython Version:</span> <script>document.write(UPY_VERSION);</script></div>
<div class="buttons_menu_item"><span id="mp-ver">MicroPython Version:</span> <script>document.write(UPY_1_VERSION + '/' + UPY_2_VERSION);</script></div>
</div>
</div>
<div id="small-icons-left" class="vbox small-icons">
Expand Down
4 changes: 0 additions & 4 deletions python-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1807,10 +1807,6 @@ function web_editor(config) {
})
});

// Update the MicroPython docs link to append the version to the URL
var docsAnchor = $('#docs-link');
docsAnchor.attr('href', docsAnchor.attr('href') + 'en/v' + UPY_VERSION);

window.addEventListener('resize', function() {
formatMenuContainer('command-options', 'options_container');
formatMenuContainer('command-help', 'helpsupport_container');
Expand Down

0 comments on commit fa1f994

Please sign in to comment.