From f35663188bb749cdbc44096f3c37c76b5eb6ec26 Mon Sep 17 00:00:00 2001 From: SebCanet Date: Thu, 15 Oct 2020 10:35:22 +0200 Subject: [PATCH] v0.7.6 UI enhancement --- CHANGELOG.txt | 5 ++ blocklyduino/css/overload.css | 2 +- blocklyduino/js/boards.js | 61 +++++++++++++++++++- blocklyduino/toolbox/toolbox_blocklyduino.js | 23 ++++---- css/UI.css | 36 ++++++++++-- index.html | 17 +++--- js/blockly/playground.js | 4 +- js/buttons_functions.js | 7 ++- js/dialog.js | 44 ++++++++++++-- js/init.js | 4 +- js/toolbox.js | 57 ++++++++++++++++++ msg/UI_ar.js | 2 +- msg/UI_ca.js | 2 +- msg/UI_de.js | 2 +- msg/UI_en.js | 2 +- msg/UI_es.js | 2 +- msg/UI_fr.js | 2 +- msg/UI_ja.js | 2 +- 18 files changed, 229 insertions(+), 45 deletions(-) create mode 100644 js/toolbox.js diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0f0dfad..f4a7bd4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,8 @@ +v0.7.6 2020-10-15 +- fix UI bugs +- add toolbox sorting through list in URL (index.html?toolboxids=SERVO) +- COM port selection is inside list COM port modal + v0.7.5, 2020-10-07 - upate Blockly core to v3.20200924.2 - bug fix on screenshot diff --git a/blocklyduino/css/overload.css b/blocklyduino/css/overload.css index 7b526ec..0fdea4c 100644 --- a/blocklyduino/css/overload.css +++ b/blocklyduino/css/overload.css @@ -18,7 +18,7 @@ body { .config_content { background-color: #006468; } -.modal-header { +.modal-header, .modal-footer { background-color: #006468; } .accordion { diff --git a/blocklyduino/js/boards.js b/blocklyduino/js/boards.js index e5ad9bd..822bcfa 100644 --- a/blocklyduino/js/boards.js +++ b/blocklyduino/js/boards.js @@ -17,7 +17,7 @@ goog.provide('Blockly.Boards'); profile.default = profile["none"][0]; /** - * Sets board + * Set board when click in board modal */ Code.setBoard = function () { var boardId = Code.getStringParamFromUrl('board', ''); @@ -26,10 +26,33 @@ Code.setBoard = function () { } document.getElementById('boardMenu').value = boardId; profile.default = profile[boardId][0]; + // change tooltip & info when a board is selected + if (boardId != "none") { + document.getElementById('boardButton').classList.add('active'); + document.getElementById('boardButton').title = profile["default"].description; + document.getElementById('boardButton').onmouseover = function () { + document.getElementById("content_hoverButton").textContent = profile["default"].description; + }; + document.getElementById('boardButton').onmouseout = function () { + document.getElementById("content_hoverButton").textContent = ""; + }; + } + else { + document.getElementById('boardButton').classList.remove('active'); + document.getElementById('boardButton').title = MSG['boardButtonSpan']; + document.getElementById('boardButton').onmouseover = function () { + document.getElementById("content_hoverButton").textContent = MSG['boardButtonSpan']; + }; + document.getElementById('boardButton').onmouseout = function () { + document.getElementById("content_hoverButton").textContent = ""; + }; + } }; -function changeBoard() { - // var boardMenu = document.getElementById('boardMenu'); +/** + * Set board throught URL + */ +Code.changeBoard = function () { var boardMenu = document.getElementById('boardDescriptionSelector'); var newBoard = encodeURIComponent(boardMenu.options[boardMenu.selectedIndex].value); var search = window.location.search; @@ -43,4 +66,36 @@ function changeBoard() { profile["default"] = profile[newBoard][0]; window.location = window.location.protocol + '//' + window.location.host + window.location.pathname + search; } +; + +/** + * Set COM port + */ +Code.setPort = function () { + var serialPortMenu = document.getElementById('serialMenu'); + var newPort = encodeURIComponent(serialPortMenu.options[serialPortMenu.selectedIndex].value); + console.log(newPort); + document.getElementById('overlayForModals').style.display = "none"; + document.getElementById('portListModal').classList.remove('show'); + if (newPort != 'none') { + document.getElementById('serialButton').classList.add('active'); + document.getElementById('serialButton').title = newPort; + document.getElementById('serialButton').onmouseover = function () { + document.getElementById("content_hoverButton").textContent = newPort; + }; + document.getElementById('serialButton').onmouseout = function () { + document.getElementById("content_hoverButton").textContent = ""; + } + } + else { + document.getElementById('serialButton').classList.remove('active'); + document.getElementById('serialButton').title = MSG['serialButtonSpan']; + document.getElementById('serialButton').onmouseover = function () { + document.getElementById("content_hoverButton").textContent = MSG['serialButtonSpan']; + }; + document.getElementById('serialButton').onmouseout = function () { + document.getElementById("content_hoverButton").textContent = ""; + }; + } +} ; \ No newline at end of file diff --git a/blocklyduino/toolbox/toolbox_blocklyduino.js b/blocklyduino/toolbox/toolbox_blocklyduino.js index 9bd6bdd..83f6837 100644 --- a/blocklyduino/toolbox/toolbox_blocklyduino.js +++ b/blocklyduino/toolbox/toolbox_blocklyduino.js @@ -15,7 +15,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = // From XML string/file, replace ^\s?(\s*)?(<.*>)$ with \+$1'$2' // Tweak first and last line. '' -+ '' ++ '' + '' + '' + '' @@ -25,7 +25,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '' + '' @@ -55,7 +55,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '123' + '' @@ -143,7 +143,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '' + '' @@ -245,7 +245,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '' + '' @@ -297,7 +297,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '' + '' @@ -336,14 +336,14 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '' + '' + '' -+ '' ++ '' + '' -+ '' ++ '' + '' + '' + '' @@ -385,7 +385,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '' + '' @@ -430,7 +430,7 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' -+ '' ++ '' + '' + '' + '' @@ -440,4 +440,5 @@ BLOCKLY_TOOLBOX_XML['toolboxblocklyduino'] = + '' + '' + '' ++ '' + ''; \ No newline at end of file diff --git a/css/UI.css b/css/UI.css index 57b75e2..bd83e3c 100644 --- a/css/UI.css +++ b/css/UI.css @@ -192,6 +192,24 @@ td.tabMiddle { z-index: 10; color: #fff; } +/* modal buttons */ +#boardListModalDialogOkay{ + border: none; + font-size: x-large; + background-color: #4CAF50; + border-radius: 12px; + box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); + margin: 5px; + position: relative; + left: 88px; +} +#portListModalDialogOkay{ + border: none; + font-size: large; + background-color: #4CAF50; + border-radius: 12px; + box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); +} /* Content blocks */ .content_wrapper { @@ -223,6 +241,7 @@ td.tabMiddle { height: 100%; min-width: 10px; } + /* side panel */ .side_content { min-width: 10px; @@ -324,9 +343,12 @@ td.tabMiddle { float: right; font-size: 28px; font-weight: bold; + -ms-transform: translateY(-20%); + transform: translateY(-20%); } .closeModal:hover, .closeModal:focus { + color: #FFCC00; text-decoration: none; cursor: pointer; } @@ -345,15 +367,17 @@ td.tabMiddle { } /* Modal Footer */ .modal-footer { - padding: 2px 16px; - background-color: #5cb85c; + padding: 10px; color: white; + -webkit-border-radius: 15px !important; + -moz-border-radius: 15px !important; + border-top-left-radius: 15px !important; + border-top-right-radius: 15px !important; } /* Modal board selector information */ #boardDescriptionSelector { overflow: auto; - width: 200px; } #hideSelectScrollbar { display: inline-block; @@ -363,7 +387,6 @@ td.tabMiddle { } #hideSelectScrollbar > select { padding: 10px; - margin: -5px -20px -5px -5px; } #board_mini_picture_div { position:absolute; @@ -393,6 +416,11 @@ td.tabMiddle { font-size: large; font-weight: bold; } +/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ +.active, .collapsibleButton:hover { + background-color: #FFCC00; + color: #000000; +} /* Style the collapsible content. Note: hidden by default */ .collapsibleContent { visibility: hidden; diff --git a/index.html b/index.html index df04979..268fff6 100644 --- a/index.html +++ b/index.html @@ -177,9 +177,6 @@ -
... @@ -334,7 +331,7 @@ - +
Connecteur...
@@ -363,9 +360,12 @@
- - - + @@ -395,6 +395,7 @@ + @@ -433,8 +434,8 @@ - +