├── index.html.gz ├── images ├── SD1.PNG ├── SD2.PNG ├── Camera.PNG ├── ESP3D1.PNG ├── Full1.PNG ├── Full2.PNG ├── Macro.PNG ├── Restart.PNG ├── SD-Dir.PNG ├── SD1.5.PNG ├── SPIFFS.PNG ├── status.PNG ├── Commands.PNG ├── Repetier.PNG ├── WebUpdate.PNG ├── controls.PNG ├── esxtruders.PNG ├── smoothieware.PNG └── temperatures.PNG ├── .gitignore ├── www ├── js │ ├── language │ │ └── en.js │ ├── creditsdlg.js │ ├── alertdlg.js │ ├── confirmdlg.js │ ├── tabs.js │ ├── wizard.js │ ├── inputdlg.js │ ├── localstorage.js │ ├── restartdlg.js │ ├── dropmenu.js │ ├── modaldlg.js │ ├── printercmd.js │ ├── statusdlg.js │ ├── passworddlg.js │ ├── http.js │ ├── translate.js │ ├── connectdlg.js │ ├── camera.js │ ├── updatedlg.js │ ├── scanwifidlg.js │ ├── commands.js │ ├── logindlg.js │ ├── extruders.js │ ├── app.js │ ├── controls.js │ └── temperatures.js ├── docs │ ├── findattribut.js │ ├── nav.html │ ├── dropsdown.html │ ├── tabs.html │ ├── roundtab-index.html │ ├── library.html │ ├── modal.html │ └── files.htm ├── sub │ ├── restartdlg.html │ ├── connectdlg.html │ ├── inputdlg.html │ ├── dashtab.html │ ├── alertdlg.html │ ├── updatedlg.html │ ├── creditsdlg.html │ ├── macrodlg.html │ ├── configtab.html │ ├── confirmdlg.html │ ├── commandpanel.html │ ├── logindlg.html │ ├── statusdlg.html │ ├── passworddlg.html │ ├── scanwifidlg.html │ ├── cameratab.html │ ├── SPIFFSdlg.html │ ├── setupdlg.html │ ├── files.html │ ├── settingstab.html │ ├── controlspanel.html │ └── temperaturepanel.html ├── css │ ├── tabs.css │ ├── menu.css │ ├── wizard.css │ ├── modaldlg.css │ └── style.css ├── tools │ └── includes.js └── images │ └── jogdial.svg ├── install.bat ├── package.json ├── .travis.yml ├── gulpfile.js └── README.md /index.html.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/index.html.gz -------------------------------------------------------------------------------- /images/SD1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/SD1.PNG -------------------------------------------------------------------------------- /images/SD2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/SD2.PNG -------------------------------------------------------------------------------- /images/Camera.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/Camera.PNG -------------------------------------------------------------------------------- /images/ESP3D1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/ESP3D1.PNG -------------------------------------------------------------------------------- /images/Full1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/Full1.PNG -------------------------------------------------------------------------------- /images/Full2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/Full2.PNG -------------------------------------------------------------------------------- /images/Macro.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/Macro.PNG -------------------------------------------------------------------------------- /images/Restart.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/Restart.PNG -------------------------------------------------------------------------------- /images/SD-Dir.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/SD-Dir.PNG -------------------------------------------------------------------------------- /images/SD1.5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/SD1.5.PNG -------------------------------------------------------------------------------- /images/SPIFFS.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/SPIFFS.PNG -------------------------------------------------------------------------------- /images/status.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/status.PNG -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | 4 | package-lock.json 5 | index2.html.gz 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /images/Commands.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/Commands.PNG -------------------------------------------------------------------------------- /images/Repetier.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/Repetier.PNG -------------------------------------------------------------------------------- /images/WebUpdate.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/WebUpdate.PNG -------------------------------------------------------------------------------- /images/controls.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/controls.PNG -------------------------------------------------------------------------------- /images/esxtruders.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/esxtruders.PNG -------------------------------------------------------------------------------- /images/smoothieware.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/smoothieware.PNG -------------------------------------------------------------------------------- /images/temperatures.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/ESP3D-WEBUI/master/images/temperatures.PNG -------------------------------------------------------------------------------- /www/js/language/en.js: -------------------------------------------------------------------------------- 1 | //english 2 | var englishtrans = { 3 | "STA":"Client Station", 4 | "AP":"Access Point", 5 | }; 6 | -------------------------------------------------------------------------------- /www/js/creditsdlg.js: -------------------------------------------------------------------------------- 1 | //Credits dialog 2 | function creditsdlg () { 3 | var modal = setactiveModal('creditsdlg.html'); 4 | if ( modal == null) return; 5 | showModal() ; 6 | } 7 | -------------------------------------------------------------------------------- /www/docs/findattribut.js: -------------------------------------------------------------------------------- 1 | function FindByAttributeValue(attribute, value) { 2 | var All = document.getElementsByTagName('*'); 3 | for (var i = 0; i < All.length; i++) { 4 | if (All[i].getAttribute(attribute) == value) { return All[i]; } 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /www/js/alertdlg.js: -------------------------------------------------------------------------------- 1 | //alert dialog 2 | function alertdlg (titledlg, textdlg, closefunc) { 3 | var modal = setactiveModal('alertdlg.html',closefunc); 4 | if ( modal == null) return; 5 | var title = modal.element.getElementsByClassName("modal-title")[0]; 6 | var body = modal.element.getElementsByClassName("modal-text")[0]; 7 | title.innerHTML=titledlg; 8 | body.innerHTML=textdlg; 9 | showModal() ; 10 | } 11 | -------------------------------------------------------------------------------- /www/js/confirmdlg.js: -------------------------------------------------------------------------------- 1 | //confirm dialog 2 | function confirmdlg(titledlg, textdlg, closefunc) { 3 | var modal = setactiveModal('confirmdlg.html',closefunc); 4 | if ( modal == null) return; 5 | var title = modal.element.getElementsByClassName("modal-title")[0]; 6 | var body = modal.element.getElementsByClassName("modal-text")[0]; 7 | title.innerHTML=titledlg; 8 | body.innerHTML=textdlg; 9 | showModal() ; 10 | } 11 | -------------------------------------------------------------------------------- /install.bat: -------------------------------------------------------------------------------- 1 | npm install --global gulp-cli 2 | npm install --save-dev gulp 3 | npm install --save-dev gulp-jshint 4 | npm install --save-dev jshint 5 | npm install --save-dev gulp-if 6 | npm install --save-dev gulp-concat 7 | npm install --save-dev gulp-uglify 8 | npm install --save-dev gulp-clean-css 9 | npm install --save-dev gulp-remove-code 10 | npm install --save-dev del 11 | npm install --save-dev gulp-zip 12 | npm install --save-dev gulp-gzip 13 | npm install --save-dev gulp-htmlmin 14 | npm install --save-dev gulp-replace 15 | npm install --save-dev gulp-smoosher 16 | -------------------------------------------------------------------------------- /www/js/tabs.js: -------------------------------------------------------------------------------- 1 | function opentab(evt, tabname) { 2 | var i, tabcontent, tablinks; 3 | tabcontent = document.getElementsByClassName("tabcontent"); 4 | for (i = 0; i < tabcontent.length; i++) { 5 | tabcontent[i].style.display = "none"; 6 | } 7 | tablinks = document.getElementsByClassName("tablinks"); 8 | for (i = 0; i < tablinks.length; i++) { 9 | tablinks[i].className = tablinks[i].className.replace(" active", ""); 10 | } 11 | document.getElementById(tabname).style.display = "block"; 12 | evt.currentTarget.className += " active"; 13 | } 14 | -------------------------------------------------------------------------------- /www/js/wizard.js: -------------------------------------------------------------------------------- 1 | var can_revert_wizard = false; 2 | function openstep(evt,stepname) { 3 | var i, stepcontent, steplinks; 4 | if (evt.currentTarget.className.indexOf("wizard_done") > -1 && !can_revert_wizard) return; 5 | stepcontent = document.getElementsByClassName("stepcontent"); 6 | for (i = 0; i < stepcontent.length; i++) { 7 | stepcontent[i].style.display = "none"; 8 | } 9 | steplinks = document.getElementsByClassName("steplinks"); 10 | for (i = 0; i < steplinks.length; i++) { 11 | steplinks[i].className = steplinks[i].className.replace(" active", ""); 12 | } 13 | document.getElementById(stepname).style.display = "block"; 14 | evt.currentTarget.className += " active"; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /www/sub/restartdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ESP3D-WebUI", 3 | "description": "Web UI for ESP3D", 4 | "devDependencies": { 5 | "del": "^3.0.0", 6 | "gulp": "^4.0.0", 7 | "gulp-bytediff": "^1.0.0", 8 | "gulp-clean-css": "^4.0.0", 9 | "gulp-concat": "^2.6.1", 10 | "gulp-gzip": "^1.4.2", 11 | "gulp-htmlmin": "^5.0.1", 12 | "gulp-if": "^2.0.2", 13 | "gulp-jshint": "^2.1.0", 14 | "gulp-remove-code": "^3.0.4", 15 | "gulp-replace": "^1.0.0", 16 | "gulp-smoosher": "0.0.9", 17 | "gulp-uglify": "^3.0.1", 18 | "gulp-zip": "^4.2.0", 19 | "jshint": "^2.9.7", 20 | "merge-stream": "^1.0.1" 21 | }, 22 | "repository": "https://github.com/luc-github/ESP3D-WEBUI", 23 | "author": "Luc LEBOSSE", 24 | "license": "(ISC OR GPL-3.0)" 25 | } 26 | -------------------------------------------------------------------------------- /www/js/inputdlg.js: -------------------------------------------------------------------------------- 1 | //input dialog 2 | function inputdlg(titledlg, textdlg, closefunc, preset) { 3 | var modal = setactiveModal('inputdlg.html',closefunc); 4 | if ( modal == null) return; 5 | var title = modal.element.getElementsByClassName("modal-title")[0]; 6 | var body = modal.element.getElementsByClassName("modal-text")[0]; 7 | title.innerHTML=titledlg; 8 | body.innerHTML=textdlg; 9 | if (typeof preset !== 'undefined') document.getElementById('inputldg_text').value=preset; 10 | else document.getElementById('inputldg_text').value = ""; 11 | showModal() ; 12 | } 13 | 14 | 15 | function closeInputModal(response) { 16 | var answer = ""; 17 | if (response == "ok") { 18 | var input = document.getElementById('inputldg_text').value; 19 | answer = input.trim(); 20 | } 21 | closeModal(answer); 22 | } 23 | -------------------------------------------------------------------------------- /www/js/localstorage.js: -------------------------------------------------------------------------------- 1 | function store_localdata(key, value){ 2 | 3 | if (typeof localStorage !== 'undefined'){ 4 | try { 5 | localStorage.setItem(key, value); 6 | } 7 | catch (exception) { 8 | return false; 9 | } 10 | return true; 11 | } 12 | return false; 13 | } 14 | 15 | function get_localdata(key){ 16 | if (typeof localStorage !== 'undefined'){ 17 | var r =""; 18 | try { 19 | r = localStorage.getItem(key); 20 | } 21 | catch (exception) { 22 | r = ""; 23 | } 24 | return r; 25 | } 26 | return ""; 27 | } 28 | 29 | function delete_localdata(key){ 30 | if (typeof localStorage !== 'undefined') 31 | { 32 | try { 33 | window.localStorage.removeItem(key); 34 | } 35 | catch (exception) { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /www/sub/connectdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | -------------------------------------------------------------------------------- /www/docs/nav.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 32 | 33 | 34 |
35 | 36 | 37 | 38 | 39 | 40 |
41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /www/sub/inputdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "5.8.0" 4 | 5 | before_script: 6 | - npm install --global gulp-cli 7 | - sleep 3 8 | - npm install --save-dev gulp 9 | - npm install --save-dev gulp-jshint 10 | - npm install --save-dev jshint 11 | - npm install --save-dev gulp-if 12 | - npm install --save-dev gulp-concat 13 | - npm install --save-dev gulp-uglify 14 | - npm install --save-dev gulp-clean-css 15 | - npm install --save-dev gulp-ng-annotate 16 | - npm install --save-dev gulp-bytediff 17 | - npm install --save-dev gulp-cdnizer 18 | - npm install --save-dev gulp-remove-code 19 | - npm install --save-dev merge-stream 20 | - npm install --save-dev del 21 | - npm install --save-dev gulp-zip 22 | - npm install --save-dev gulp-gzip 23 | - npm install --save-dev gulp-htmlmin 24 | - npm install --save-dev gulp-replace 25 | - npm install --save-dev fs 26 | - npm install --save-dev gulp-smoosher 27 | - npm install gulp 28 | 29 | 30 | script: 31 | - echo "build index.html" 32 | - gulp package 33 | 34 | notifications: 35 | email: 36 | on_success: change 37 | on_failure: change 38 | -------------------------------------------------------------------------------- /www/sub/dashtab.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 | -------------------------------------------------------------------------------- /www/sub/alertdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 28 | 29 | -------------------------------------------------------------------------------- /www/sub/updatedlg.html: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | -------------------------------------------------------------------------------- /www/sub/creditsdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | -------------------------------------------------------------------------------- /www/js/restartdlg.js: -------------------------------------------------------------------------------- 1 | //restart dialog 2 | function restartdlg () { 3 | console.log("show restart"); 4 | var modal = setactiveModal('restartdlg.html'); 5 | if ( modal == null) return; 6 | document.getElementById('prgrestart').style.display = 'block'; 7 | document.getElementById('restartmsg').innerHTML = translate_text_item("Restarting, please wait...."); 8 | showModal(); 9 | SendPrinterCommand("[ESP444]RESTART", false, restart_esp_success, restart_esp_failed); 10 | } 11 | 12 | function restart_esp_success(response){ 13 | var i = 0; 14 | var interval; 15 | var x = document.getElementById("prgrestart"); 16 | http_communication_locked = true; 17 | x.max=40; 18 | interval = setInterval(function(){ 19 | i=i+1; 20 | var x = document.getElementById("prgrestart"); 21 | x.value=i; 22 | document.getElementById('restartmsg').innerHTML = translate_text_item("Restarting, please wait....") + (41-i) +translate_text_item(" seconds") ; 23 | if (i>40) 24 | { 25 | clearInterval(interval); 26 | location.reload(); 27 | } 28 | },1000); 29 | //console.log(response); 30 | } 31 | 32 | function restart_esp_failed(errorcode, response){ 33 | document.getElementById('prgrestart').style.display = 'none'; 34 | document.getElementById('restartmsg').innerHTML = translate_text_item("Upload failed : ") + errorcode + " :" + response; 35 | console.log("Error " + errorcode + " : " + response); 36 | closeModal('Cancel') 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /www/js/dropmenu.js: -------------------------------------------------------------------------------- 1 | function clear_drop_menu(event){ 2 | var item = get_parent_by_class(event.target, "dropdownselect"); 3 | var ignore_id="-1"; 4 | if (item!==null && typeof item.id!=='undefined'){ 5 | ignore_id = item.id; 6 | } 7 | var list = document.getElementsByClassName("dropmenu-content"); 8 | for (var index = 0; index < list.length ; index++){ 9 | var item2 = get_parent_by_class(list[index], "dropdownselect"); 10 | if ( item2 !== null && typeof item2.id!=='undefined' && item2.id!=ignore_id && list[index].classList.contains('show')) { 11 | list[index].classList.remove('show'); 12 | } 13 | } 14 | } 15 | 16 | function get_parent_by_class(item, classname){ 17 | if (item === null || typeof item === 'undefined') return null; 18 | if (item.classList.contains(classname)) { 19 | return item; 20 | } 21 | return get_parent_by_class(item.parentElement, classname); 22 | } 23 | 24 | function hide_drop_menu(event){ 25 | var item = get_parent_by_class(event.target, "dropmenu-content"); 26 | if (typeof item !== 'undefined' && item.classList.contains('show')) { 27 | item.classList.remove('show'); 28 | } 29 | } 30 | function showhide_drop_menu(event){ 31 | var item = get_parent_by_class(event.target, "dropdownselect"); 32 | if (item === null) return; 33 | var menu = item.getElementsByClassName("dropmenu-content")[0]; 34 | if (typeof menu !== 'undefined')menu.classList.toggle("show"); 35 | } 36 | -------------------------------------------------------------------------------- /www/css/tabs.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Style the tab */ 4 | div.tab { 5 | overflow: hidden; 6 | border-left: 1px solid #ccc; 7 | border-right: 1px solid #ccc; 8 | border-top: 1px solid #ccc; 9 | border-bottom: 1px solid #ccc; 10 | background-color: #f1f1f1; 11 | border-top-left-radius: 6px; 12 | border-top-right-radius: 6px; 13 | } 14 | 15 | 16 | /* Style the buttons inside the tab */ 17 | div.tab button { 18 | background-color: inherit; 19 | float: left; 20 | border-top: 1px solid #f1f1f1; 21 | border-bottom: 1px solid #f1f1f1; 22 | border-left: 1px solid #f1f1f1; 23 | border-right: 1px solid #f1f1f1; 24 | outline: none; 25 | cursor: pointer; 26 | padding: 12px 14px; 27 | transition: 0.3s; 28 | color:#337AB7; 29 | } 30 | 31 | /* Change background color of buttons on hover */ 32 | div.tab button:hover { 33 | background-color: #ddd; 34 | border-top-left-radius: 6px; 35 | border-top-right-radius: 6px; 36 | border-top: 1px solid #ddd; 37 | border-bottom: 1px solid #ddd; 38 | border-left: 1px solid #ddd; 39 | border-right: 1px solid #ddd; 40 | } 41 | 42 | /* Create an active/current tablink class */ 43 | div.tab button.active { 44 | background-color: #ffffff; 45 | border-top: 1px solid #ccc; 46 | border-bottom: 1px solid #fff; 47 | border-left: 1px solid #ccc; 48 | border-right: 1px solid #ccc; 49 | border-top-left-radius: 6px; 50 | border-top-right-radius: 6px; 51 | color:#555555; 52 | } 53 | 54 | /* Style the tab content */ 55 | .tabcontent { 56 | display: none; 57 | padding: 6px 12px; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /www/sub/macrodlg.html: -------------------------------------------------------------------------------- 1 | 2 | 41 | 42 | -------------------------------------------------------------------------------- /www/docs/dropsdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 46 | 47 | 48 | 49 |

Aligned Dropdown Content

50 |

Determine whether the dropdown content should go from left to right or right to left with the left and right properties.

51 | 52 | 60 | 61 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /www/css/menu.css: -------------------------------------------------------------------------------- 1 | .dropbtn { 2 | padding: 16px; 3 | font-size: 14px; 4 | border: none; 5 | cursor: pointer; 6 | } 7 | 8 | .dropdown { 9 | position: relative; 10 | display: inline-block; 11 | border-color: #000000; 12 | } 13 | 14 | .dropdownselect { 15 | position: relative; 16 | display: inline-block; 17 | border-color: #000000; 18 | } 19 | 20 | .dropmenu-content, 21 | .dropdown-content { 22 | display: none; 23 | position: absolute; 24 | background-color: #f9f9f9; 25 | min-width: 160px; 26 | box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); 27 | z-index: 1; 28 | border:1px solid #dddddd; 29 | padding-top: 4px; 30 | padding-bottom: 4px; 31 | } 32 | 33 | .dropmenu-content a, 34 | .dropdown-content a { 35 | color: black; 36 | padding: 12px 16px; 37 | text-decoration: none; 38 | display: block; 39 | } 40 | 41 | .dropmenu-content a:hover, 42 | .dropdown-content a:hover {background-color: #e1e1e1} 43 | 44 | .dropdown:hover .dropdown-content { 45 | display: block; 46 | } 47 | 48 | .dropdown:hover .dropbtn { 49 | background-color: #e1e1e1; 50 | } 51 | 52 | .menu-title { 53 | padding: 5px 10px; 54 | font-size: 12px; 55 | } 56 | 57 | .menu-divider { 58 | height: 1px; 59 | margin: 2px 0; 60 | overflow: hidden; 61 | background-color: #e5e5e5; 62 | } 63 | 64 | .dropmenu-content-up { 65 | bottom: 3em; 66 | left: 0em 67 | } 68 | 69 | .dropmenu-content-down { 70 | top: 3em; 71 | left: 0em 72 | } 73 | 74 | @media (min-width: 768px) { 75 | .dropdown-content { 76 | top: 3em; 77 | right: 1em; 78 | } 79 | } 80 | 81 | @media screen and (max-width: 767px) { 82 | .dropdown-content { 83 | top: 3em; 84 | left: 1.2em; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /www/sub/configtab.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | Printer configuration 5 |

6 | 13 |
14 | 15 |
16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
LabelValueHelp
28 |
29 |
30 |
31 | -------------------------------------------------------------------------------- /www/sub/confirmdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 34 | 35 | -------------------------------------------------------------------------------- /www/sub/commandpanel.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Commands 4 | 5 |
6 |
7 |

 8 |     
9 | 38 |
39 | -------------------------------------------------------------------------------- /www/sub/logindlg.html: -------------------------------------------------------------------------------- 1 | 2 | 38 | 39 | -------------------------------------------------------------------------------- /www/js/modaldlg.js: -------------------------------------------------------------------------------- 1 | // Create the modal 2 | var listmodal =[]; 3 | 4 | 5 | function setactiveModal(html_template, closefunc){ 6 | if (typeof document.getElementById(html_template) === 'undefined') 7 | { 8 | console.log("Error: no " + html_template); 9 | return null; 10 | } 11 | var modal = new Object; 12 | modal.element=document.getElementById(html_template); 13 | modal.id = listmodal.length; 14 | modal.name=html_template; 15 | if (typeof closefunc !== 'undefined') modal.closefn = closefunc; 16 | else modal.closefn = myfnclose; 17 | listmodal.push(modal) 18 | //console.log("Creation of modal " + modal.name + " with ID " +modal.id); 19 | return listmodal[listmodal.length-1];; 20 | } 21 | 22 | function getactiveModal(){ 23 | if (listmodal.length>0) 24 | { 25 | return listmodal[listmodal.length-1]; 26 | } 27 | else return null; 28 | } 29 | 30 | // open the modal 31 | function showModal() { 32 | var currentmodal = getactiveModal(); 33 | currentmodal.element.style.display = "block"; 34 | //console.log("Show modal " + currentmodal.name + " with ID " + currentmodal.id ); 35 | } 36 | 37 | // When the user clicks on (x), close the modal 38 | function closeModal( response) { 39 | var currentmodal = getactiveModal(); 40 | if (currentmodal != null) { 41 | currentmodal.element.style.display = "none"; 42 | var closefn = currentmodal.closefn; 43 | //console.log("Deletetion of modal " + currentmodal.name + " with ID " + currentmodal.id); 44 | listmodal.pop(); 45 | delete currentmodal; 46 | currentmodal = getactiveModal(); 47 | //if (currentmodal != null)console.log("New active modal is " + currentmodal.name + " with ID " + currentmodal.id); 48 | //else console.log("No active modal"); 49 | closefn(response); 50 | } 51 | } 52 | //default close function 53 | function myfnclose(value) { 54 | //console.log("modale closed: " + value); 55 | } 56 | -------------------------------------------------------------------------------- /www/sub/statusdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 38 | 39 | -------------------------------------------------------------------------------- /www/css/wizard.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Style the step */ 4 | div.step { 5 | overflow: hidden; 6 | } 7 | 8 | div.no_navigationr { 9 | pointer-events:none; 10 | } 11 | 12 | /* Style the buttons inside the step */ 13 | div.step button { 14 | background-color: inherit; 15 | float: left; 16 | border-radius: 50px; 17 | border-top: 1px solid #337AB7; 18 | border-bottom: 1px solid #337AB7; 19 | border-left: 1px solid #337AB7; 20 | border-right: 1px solid #337AB7; 21 | outline: none; 22 | cursor: pointer; 23 | padding: 12px 14px; 24 | margin: 0 auto; 25 | color:#337AB7; 26 | } 27 | 28 | .connecting-line { 29 | float: left; 30 | height: 2px; 31 | background: #e0e0e0; 32 | width: 50px; 33 | top: 50%; 34 | margin: 25px auto; 35 | z-index: 1; 36 | } 37 | 38 | .spacer { 39 | float: left; 40 | height: 1px; 41 | width: 25px; 42 | } 43 | 44 | .steplinks.disabled { 45 | cursor:not-allowed; 46 | background-color: #ddd; 47 | border-top: 1px solid #f1f1f1; 48 | border-bottom: 1px solid #f1f1f1; 49 | border-left: 1px solid #f1f1f1; 50 | border-right: 1px solid #f1f1f1; 51 | color:#555555; 52 | } 53 | 54 | 55 | 56 | /* Change background color of buttons on hover */ 57 | div.step button:hover { 58 | background-color: #23567F; 59 | color:#FFFFFF; 60 | } 61 | 62 | div.step button.disabled:hover { 63 | background-color: #ddd; 64 | color:#555555; 65 | } 66 | .steplinks.no_revert_wizard:hover, 67 | .steplinks.no_revert_wizard { 68 | cursor:not-allowed; 69 | color: #337AB7; 70 | background-color:#FFFFFF; 71 | } 72 | /* Create an active/current steplink class */ 73 | div.step button.active { 74 | background-color: #337AB7; 75 | color:#FFFFFF; 76 | margin-bottom: 40; 77 | } 78 | 79 | /* Style the step content */ 80 | .stepcontent { 81 | display: none; 82 | padding: 6px 12px; 83 | 84 | } 85 | 86 | @media (max-width: 360px) { 87 | .connecting-line{ 88 | width:2px!important; 89 | } 90 | 91 | .input-group { 92 | display: block; 93 | } 94 | } 95 | 96 | -------------------------------------------------------------------------------- /www/js/printercmd.js: -------------------------------------------------------------------------------- 1 | function SendPrinterCommand(cmd, echo_on, processfn, errorfn){ 2 | var url = "/command?commandText="; 3 | var push_cmd = true; 4 | if (typeof echo_on !== 'undefined') { 5 | push_cmd = echo_on; 6 | } 7 | if (cmd.trim().length == 0) return; 8 | if (push_cmd)Monitor_output_Update(cmd + "\n"); 9 | //removeIf(production) 10 | console.log(cmd); 11 | if (typeof processfn !== 'undefined')processfn("Test response"); 12 | else SendPrinterCommandSuccess("Test response"); 13 | return; 14 | //endRemoveIf(production) 15 | if (typeof processfn === 'undefined' || processfn == null) processfn = SendPrinterCommandSuccess; 16 | if (typeof errorfn === 'undefined' || errorfn ==null) errorfn = SendPrinterCommandFailed; 17 | SendGetHttp(url + encodeURI(cmd), processfn, errorfn); 18 | //console.log(cmd); 19 | } 20 | 21 | function SendPrinterSilentCommand(cmd, processfn, errorfn){ 22 | var url = "/command_silent?commandText="; 23 | if (cmd.trim().length == 0) return; 24 | //removeIf(production) 25 | console.log(cmd); 26 | if (typeof processfn !== 'undefined')processfn("Test response"); 27 | else SendPrinterCommandSuccess("Test response"); 28 | return; 29 | //endRemoveIf(production) 30 | if (typeof processfn === 'undefined' || processfn == null) processfn = SendPrinterSilentCommandSuccess; 31 | if (typeof errorfn === 'undefined' || errorfn == null) errorfn = SendPrinterCommandFailed; 32 | SendGetHttp(url + encodeURI(cmd), processfn, errorfn); 33 | //console.log(cmd); 34 | } 35 | 36 | function SendPrinterSilentCommandSuccess(response){ 37 | //console.log(response); 38 | } 39 | 40 | 41 | function SendPrinterCommandSuccess(response){ 42 | if (response[response.length-1] != '\n')Monitor_output_Update(response + "\n"); 43 | else Monitor_output_Update(response); 44 | } 45 | 46 | function SendPrinterCommandFailed(error_code,response){ 47 | Monitor_output_Update("Error " + error_code + " :" + response+ "\n"); 48 | console.log("Error " + error_code + " :" + response); 49 | } 50 | -------------------------------------------------------------------------------- /www/sub/passworddlg.html: -------------------------------------------------------------------------------- 1 | 2 | 53 | 54 | -------------------------------------------------------------------------------- /www/sub/scanwifidlg.html: -------------------------------------------------------------------------------- 1 | 2 | 55 | 56 | -------------------------------------------------------------------------------- /www/js/statusdlg.js: -------------------------------------------------------------------------------- 1 | //status dialog 2 | function statusdlg () { 3 | var modal = setactiveModal('statusdlg.html'); 4 | if ( modal == null) return; 5 | showModal() ; 6 | refreshstatus (); 7 | } 8 | 9 | 10 | function statussuccess(response){ 11 | document.getElementById('refreshstatusbtn').style.display='block'; 12 | var modal = getactiveModal(); 13 | if ( modal == null) return; 14 | var text = modal.element.getElementsByClassName("modal-text")[0]; 15 | var tresponse = response.split("\n"); 16 | var output = ""; 17 | for (var i = 0; i < tresponse.length; i++){ 18 | var data = tresponse[i].split(":"); 19 | if (data.length >= 2) { 20 | output+= " "+ data[1]; 21 | for (v=2;v"; 27 | } 28 | text.innerHTML= output; 29 | //console.log(response); 30 | } 31 | 32 | function statusfailed(errorcode, response){ 33 | document.getElementById('refreshstatusbtn').style.display='block'; 34 | document.getElementById('status_msg').style.display='block'; 35 | console.log("Error " + errorcode + " : " + response); 36 | document.getElementById('status_msg').innerHTML = "Error " + errorcode + " : " + response; 37 | } 38 | 39 | function refreshstatus() { 40 | document.getElementById('refreshstatusbtn').style.display='none'; 41 | var modal = getactiveModal(); 42 | if ( modal == null) return; 43 | var text = modal.element.getElementsByClassName("modal-text")[0]; 44 | text.innerHTML= ""; 45 | document.getElementById('status_msg').style.display='none'; 46 | //removeIf(production) 47 | var response = "Chip ID: 13874112\nCPU Frequency: 160Mhz\nFree memory: 24.23 KB\nSDK: 2.0.0(656edbf)\nFlash Size: 4.00 MB\nAvailable Size for update: 652.17 KB(Ok)\nAvailable Size for SPIFFS: 3.00 MB\nBaud rate: 115200\nSleep mode: None\nChannel: 1\nPhy Mode: 11g\nWeb port: 80\nData port: 8888\nHostname: lucesp\nActive Mode: Station (5C:CF:7F:D3:B3:C0)\nConnected to: NETGEAR_2GEXT_OFFICE2\nSignal: 98%\nIP Mode: DHCP\nIP: 192.168.1.51\nGateway: 192.168.1.1\nMask: 255.255.255.0\nDNS: 192.168.1.1\nDisabled Mode: Access Point (5E:CF:7F:D3:B3:C0)\nCaptive portal: Enabled\nSSDP: Enabled\nNetBios: Enabled\nmDNS: Enabled\nWeb Update: Enabled\nPin Recovery: Disabled\nAuthentication: Disabled\nTarget Firmware: Smoothieware\nSD Card Support: Enabled\nFW version: 0.9.93\n"; 48 | statussuccess(response); 49 | //statusfailed(500, "Error") 50 | return; 51 | //endRemoveIf(production) 52 | var url = "/command?plain="+encodeURIComponent("[ESP420]plain");; 53 | SendGetHttp(url, statussuccess, statusfailed) 54 | } 55 | -------------------------------------------------------------------------------- /www/js/passworddlg.js: -------------------------------------------------------------------------------- 1 | 2 | //changepassword dialog 3 | function changepassworddlg() { 4 | var modal = setactiveModal('passworddlg.html'); 5 | if ( modal == null) return; 6 | document.getElementById('password_loader').style.display = "none"; 7 | document.getElementById('change_password_content').style.display = "block"; 8 | document.getElementById('change_password_btn').style.display = "none"; 9 | document.getElementById('password_content').innerHTML =""; 10 | document.getElementById('password_password_text').innerHTML=""; 11 | document.getElementById('password_password_text1').innerHTML=""; 12 | document.getElementById('password_password_text2').innerHTML=""; 13 | showModal() ; 14 | } 15 | 16 | 17 | function checkpassword(){ 18 | var pwd = document.getElementById('password_password_text').value.trim(); 19 | var pwd1 = document.getElementById('password_password_text1').value.trim(); 20 | var pwd2 = document.getElementById('password_password_text2').value.trim(); 21 | document.getElementById('password_content').innerHTML =""; 22 | document.getElementById('change_password_btn').style.display = "none"; 23 | if (pwd1 != pwd2) document.getElementById('password_content').innerHTML =translate_text_item("Passwords do not matches!"); 24 | else if (pwd1.length <1 || pwd1.length > 16 || pwd1.indexOf(" ")> -1 ) document.getElementById('password_content').innerHTML =translate_text_item("Password must be >1 and <16 without space!"); 25 | else document.getElementById('change_password_btn').style.display = "block"; 26 | } 27 | 28 | 29 | function ChangePasswordfailed(errorcode, response_text){ 30 | var response = JSON.parse(response_text); 31 | if (typeof(response.status ) !== 'undefined' )document.getElementById('password_content').innerHTML = translate_text_item(response.status) ; 32 | console.log("Error " + errorcode + " : " + response_text); 33 | document.getElementById('password_loader').style.display = "none"; 34 | document.getElementById('change_password_content').style.display = "block"; 35 | } 36 | 37 | function ChangePasswordsuccess(response_text){ 38 | document.getElementById('password_loader').style.display = "none"; 39 | closeModal("Connection successful"); 40 | } 41 | 42 | function SubmitChangePassword() { 43 | var user = document.getElementById('current_ID').innerHTML.trim(); 44 | var password = document.getElementById('password_password_text').value.trim(); 45 | var newpassword = document.getElementById('password_password_text1').value.trim(); 46 | var url = "/login?USER="+encodeURIComponent(user) + "&PASSWORD=" + encodeURIComponent(password) + "&NEWPASSWORD=" + encodeURIComponent(newpassword) +"&SUBMIT=yes" ; 47 | document.getElementById('password_loader').style.display = "block"; 48 | document.getElementById('change_password_content').style.display = "none"; 49 | SendGetHttp(url, ChangePasswordsuccess, ChangePasswordfailed); 50 | } 51 | -------------------------------------------------------------------------------- /www/js/http.js: -------------------------------------------------------------------------------- 1 | var http_communication_locked = false; 2 | 3 | function SendGetHttp(url, resultfn, errorfn){ 4 | if (http_communication_locked) { 5 | errorfn(503, translate_text_item("Communication locked!")); 6 | return; 7 | } 8 | var xmlhttp = new XMLHttpRequest(); 9 | xmlhttp.onreadystatechange = function() { 10 | if (xmlhttp.readyState == 4) { 11 | if (xmlhttp.status == 200 ) 12 | { 13 | if (typeof resultfn != 'undefined' && resultfn != null )resultfn(xmlhttp.responseText); 14 | } 15 | else { 16 | if (xmlhttp.status == 401)GetIdentificationStatus(); 17 | if (typeof errorfn != 'undefined' && errorfn != null )errorfn(xmlhttp.status, xmlhttp.responseText); 18 | } 19 | } 20 | } 21 | //console.log(url); 22 | xmlhttp.open("GET", url, true); 23 | xmlhttp.send(); 24 | } 25 | 26 | function SendPostHttp(url, postdata,resultfn, errorfn){ 27 | if (http_communication_locked) { 28 | errorfn(503, translate_text_item("Communication locked!")); 29 | return; 30 | } 31 | var xmlhttp = new XMLHttpRequest(); 32 | xmlhttp.onreadystatechange = function() { 33 | if (xmlhttp.readyState == 4) { 34 | if (xmlhttp.status == 200 ) 35 | { 36 | if (typeof resultfn != 'undefined' && resultfn != null )resultfn(xmlhttp.responseText); 37 | } 38 | else { 39 | if (xmlhttp.status == 401)GetIdentificationStatus(); 40 | if (typeof errorfn != 'undefined' && errorfn != null)errorfn(xmlhttp.status, xmlhttp.responseText); 41 | } 42 | } 43 | } 44 | //console.log(url); 45 | xmlhttp.open("POST", url, true); 46 | xmlhttp.send(postdata); 47 | } 48 | 49 | function SendFileHttp(url, postdata, progressfn,resultfn, errorfn){ 50 | if (http_communication_locked) { 51 | errorfn(503, translate_text_item("Communication locked!")); 52 | return; 53 | } 54 | http_communication_locked = true; 55 | var xmlhttp = new XMLHttpRequest(); 56 | xmlhttp.onreadystatechange = function() { 57 | if (xmlhttp.readyState == 4) { 58 | http_communication_locked = false; 59 | if (xmlhttp.status == 200 ) 60 | { 61 | if (typeof resultfn != 'undefined' && resultfn != null )resultfn(xmlhttp.responseText); 62 | } 63 | else { 64 | if (xmlhttp.status == 401)GetIdentificationStatus(); 65 | if (typeof errorfn != 'undefined' && errorfn != null)errorfn(xmlhttp.status, xmlhttp.responseText); 66 | } 67 | } 68 | } 69 | //console.log(url); 70 | xmlhttp.open("POST", url, true); 71 | if (typeof progressfn !='undefined' && progressfn != null)xmlhttp.upload.addEventListener("progress", progressfn, false); 72 | xmlhttp.send(postdata); 73 | } 74 | -------------------------------------------------------------------------------- /www/css/modaldlg.css: -------------------------------------------------------------------------------- 1 | /* The Modal (background) */ 2 | .modal { 3 | display: none; /* Hidden by default */ 4 | position: fixed; /* Stay in place */ 5 | z-index: 10000; /* Sit on top */ 6 | padding-top: 100px; /* Location of the box */ 7 | left: 0; 8 | top: 0; 9 | width: 100%; /* Full width */ 10 | height: 100%; /* Full height */ 11 | overflow: auto; /* Enable scroll if needed */ 12 | background-color: rgb(0,0,0); /* Fallback color */ 13 | background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ 14 | -webkit-animation-name: fadeIn; /* Fade in the background */ 15 | -webkit-animation-duration: 0.4s; 16 | animation-name: fadeIn; 17 | animation-duration: 0.4s; 18 | } 19 | .topmodal { 20 | z-index: 20000 ! important; /* Sit on top of the top */ 21 | } 22 | 23 | /* Modal Content */ 24 | .modal-content { 25 | border-top-left-radius: 10px; 26 | border-top-right-radius: 10px; 27 | border-bottom-left-radius: 10px; 28 | border-bottom-right-radius: 10px; 29 | border: 2px solid #337AB7; 30 | box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); 31 | position: relative; 32 | margin: auto; 33 | padding: 0; 34 | background-color: #fefefe; 35 | -webkit-animation-name: slideIn; 36 | -webkit-animation-duration: 0.4s; 37 | animation-name: slideIn; 38 | animation-duration: 0.4s 39 | } 40 | 41 | /* The Close Button */ 42 | .close { 43 | color: #000; 44 | float: right; 45 | font-size: 28px; 46 | font-weight: bold; 47 | } 48 | 49 | .close:hover, 50 | .close:focus { 51 | color: #337AB7; 52 | text-decoration: none; 53 | cursor: pointer; 54 | } 55 | 56 | .modal-header { 57 | padding: 2px 16px; 58 | color: #0f0f0f; 59 | background-color: #f2f2f2; 60 | border-top-left-radius: 10px; 61 | border-top-right-radius: 10px; 62 | border-bottom: 1px solid #cfcfcf; 63 | } 64 | 65 | .modal-body {padding: 10px 16px;} 66 | 67 | .modal-footer { 68 | padding: 16px 16px; 69 | height: 4.5em; 70 | color: #0f0f0f; 71 | background-color: #f2f2f2; 72 | border-top: 1px solid #cfcfcf; 73 | border-bottom-left-radius: 10px; 74 | border-bottom-right-radius: 10px; 75 | } 76 | 77 | /* Add Animation */ 78 | @-webkit-keyframes slideIn { 79 | from {top:-300px; opacity:0} 80 | to {top:0; opacity:1} 81 | } 82 | 83 | @keyframes slideIn { 84 | from {top:-300px; opacity:0} 85 | to {top:0; opacity:1} 86 | } 87 | 88 | @-webkit-keyframes fadeIn { 89 | from {opacity: 0} 90 | to {opacity: 1} 91 | } 92 | 93 | @keyframes fadeIn { 94 | from {opacity: 0} 95 | to {opacity: 1} 96 | } 97 | 98 | @media (min-width: 768px) { 99 | .modal-content { 100 | width: 580px; 101 | } 102 | } 103 | 104 | @media (min-height: 640px) { 105 | .modal { 106 | padding-top: 5px; 107 | } 108 | } 109 | 110 | @media (max-width: 767px) { 111 | .modal-content { 112 | width: 100%; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /www/docs/tabs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 53 | 54 | 55 | 56 |

Click on the x button in the top right corner to close the current tab:

57 | 58 |
59 | 60 | 61 | 62 |
63 | 64 |
65 | x 66 |

London

67 |

London is the capital city of England.

68 |
69 | 70 |
71 | x 72 |

Paris

73 |

Paris is the capital of France.

74 |
75 | 76 |
77 | x 78 |

Tokyo

79 |

Tokyo is the capital of Japan.

80 |
81 | 82 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /www/js/translate.js: -------------------------------------------------------------------------------- 1 | var language = 'en'; 2 | 3 | var language_list = [['de', 'Deutsch', 'germantrans'],['en', 'English','englishtrans'], ['es', 'Español' ,'spanishtrans'],['fr', 'Français', 'frenchtrans'], ['it', 'Italiano', 'italiantrans']]; 4 | 5 | //removeIf(production) 6 | var translated_list=[]; 7 | //endRemoveIf(production) 8 | 9 | function translate_text(lang){ 10 | var currenttrans ={}; 11 | var translated_content=""; 12 | store_localdata('language',lang); 13 | language = lang; 14 | for (var lang_i =0 ; lang_i < language_list.length; lang_i++){ 15 | if ( language_list[lang_i][0] == lang) { 16 | currenttrans = eval(language_list[lang_i][2]); 17 | document.getElementById("translate_menu").innerHTML=language_list[lang_i][1]; 18 | } 19 | } 20 | var All = document.getElementsByTagName('*'); 21 | for (var i = 0; i < All.length; i++) { 22 | if (All[i].hasAttribute( 'translate')) { 23 | var content= ""; 24 | if (!All[i].hasAttribute( 'english_content')) { 25 | content = All[i].innerHTML; 26 | content.trim(); 27 | All[i].setAttribute( 'english_content', content); 28 | //removeIf(production) 29 | var item = {content:content}; 30 | translated_list.push(item); 31 | //endRemoveIf(production) 32 | } 33 | content = All[i].getAttribute('english_content'); 34 | translated_content = translate_text_item(content); 35 | 36 | All[i].innerHTML = translated_content; 37 | } 38 | //add support for placeholder attribut 39 | if (All[i].hasAttribute( 'translateph') && All[i].hasAttribute( 'placeholder') ) { 40 | var content= ""; 41 | if (!All[i].hasAttribute( 'english_content')) { 42 | content = All[i].getAttribute('placeholder'); 43 | content.trim(); 44 | //removeIf(production) 45 | var item = {content:content}; 46 | translated_list.push(item); 47 | //endRemoveIf(production) 48 | All[i].setAttribute( 'english_content', content); 49 | } 50 | content = All[i].getAttribute('english_content'); 51 | 52 | translated_content = translate_text_item(content); 53 | All[i].setAttribute( 'placeholder', translated_content) 54 | } 55 | } 56 | }; 57 | 58 | function translate_text_item( item_text, withtag) { 59 | var currenttrans ={}; 60 | var translated_content; 61 | var with_tag = false; 62 | if (typeof withtag != "undefined") with_tag = withtag; 63 | for (var lang_i =0 ; lang_i < language_list.length; lang_i++){ 64 | if ( language_list[lang_i][0] == language) { 65 | currenttrans = eval(language_list[lang_i][2]); 66 | } 67 | } 68 | translated_content = currenttrans[item_text]; 69 | if (typeof translated_content === 'undefined' ) translated_content = item_text; 70 | if (with_tag) { 71 | var translated_content_tmp = "" + translated_content + ""; 72 | translated_content = translated_content_tmp; 73 | } 74 | return translated_content; 75 | } 76 | -------------------------------------------------------------------------------- /www/sub/cameratab.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
@
8 | 9 |
10 |
11 | 14 | 19 | 23 |
24 |
25 | 26 | 27 | 32 | 39 | 42 | 43 |
28 |
29 | 30 |
31 |
33 | 38 | 40 |        41 |
44 |
45 | 46 |
47 | -------------------------------------------------------------------------------- /www/js/connectdlg.js: -------------------------------------------------------------------------------- 1 | //Connect dialog 2 | function connectdlg () { 3 | var value = get_localdata('language'); 4 | if (String(value).length == 0 || String(value)=="null") value="en"; 5 | build_language_menu(); 6 | translate_text(value); 7 | var modal = setactiveModal('connectdlg.html'); 8 | if ( modal == null) return; 9 | showModal() ; 10 | //removeIf(production) 11 | connectsuccess("FW version:0.9.9X # FW target:Smoothieware # FW HW:Direct SD # primary : /sd/ # secondary : /ext/ # authentication: no"); 12 | return; 13 | //endRemoveIf(production) 14 | retryconnect (); 15 | } 16 | 17 | function getFWdata(response){ 18 | var tlist = response.split("#"); 19 | //FW version:0.9.200 # FW target:smoothieware # FW HW:Direct SD # primary sd:/ext/ # secondary sd:/sd/ # authentication: yes 20 | if (tlist.length < 3) { 21 | return false; 22 | } 23 | //FW version 24 | var sublist = tlist[0].split(":"); 25 | if (sublist.length != 2) { 26 | return false; 27 | } 28 | fw_version = sublist[1].toLowerCase().trim(); 29 | //FW target 30 | sublist = tlist[1].split(":"); 31 | if (sublist.length != 2) { 32 | return false; 33 | } 34 | target_firmware = sublist[1].toLowerCase().trim(); 35 | //FW HW 36 | sublist = tlist[2].split(":"); 37 | if (sublist.length != 2) { 38 | return false; 39 | } 40 | var sddirect = sublist[1].toLowerCase().trim(); 41 | if (sddirect == "direct sd") direct_sd=true; 42 | else direct_sd = false; 43 | //primary sd 44 | sublist = tlist[3].split(":"); 45 | if (sublist.length != 2) { 46 | return false; 47 | } 48 | primary_sd = sublist[1].toLowerCase().trim(); 49 | //secondary sd 50 | sublist = tlist[4].split(":"); 51 | if (sublist.length != 2) { 52 | return false; 53 | } 54 | secondary_sd = sublist[1].toLowerCase().trim(); 55 | //authentication 56 | var sublist = tlist[5].split(":"); 57 | if (sublist.length != 2) { 58 | return false; 59 | } 60 | if ((sublist[0].trim() == "authentication" ) && (sublist[1].trim() == "yes")) ESP3D_authentication = true; 61 | else ESP3D_authentication = false; 62 | return true; 63 | } 64 | 65 | function connectsuccess(response){ 66 | if (getFWdata( response)) 67 | { 68 | //document.getElementById('main_ui').style.display='block'; 69 | closeModal("Connection successful"); 70 | if (ESP3D_authentication) { 71 | document.getElementById('menu_autthentication').style.display='inline'; 72 | logindlg(initUI, true); 73 | } 74 | else { 75 | document.getElementById('menu_autthentication').style.display='none'; 76 | initUI(); 77 | } 78 | } 79 | else { 80 | console.log(response); 81 | connectfailed(406, "Wrong data"); 82 | } 83 | } 84 | 85 | function connectfailed(errorcode, response){ 86 | document.getElementById('connectbtn').style.display='block'; 87 | document.getElementById('failed_connect_msg').style.display='block'; 88 | document.getElementById('connecting_msg').style.display='none'; 89 | console.log("Error " + errorcode + " : " + response); 90 | } 91 | 92 | function retryconnect () { 93 | document.getElementById('connectbtn').style.display='none'; 94 | document.getElementById('failed_connect_msg').style.display='none'; 95 | document.getElementById('connecting_msg').style.display='block'; 96 | var url = "/command?plain="+encodeURIComponent("[ESP800]");; 97 | SendGetHttp(url, connectsuccess, connectfailed) 98 | } 99 | -------------------------------------------------------------------------------- /www/js/camera.js: -------------------------------------------------------------------------------- 1 | var cam_is_checked=false; 2 | function OnCheckCam() { 3 | if (typeof document.getElementById('camcheck') != "undefined") { 4 | cam_is_checked = !cam_is_checked; 5 | document.getElementById("camcheck").checked = cam_is_checked; 6 | if (typeof document.getElementById('camtab') != "undefined") { 7 | if (cam_is_checked){ 8 | document.getElementById('camtablink').style.display = "block"; 9 | document.getElementById("camtablink").click(); 10 | var saddress = document.getElementById('camera_webaddress').value 11 | if (saddress.length == 0)camera_GetAddress(); 12 | } 13 | else { 14 | document.getElementById("maintablink").click(); 15 | document.getElementById('camtablink').style.display = "none"; 16 | } 17 | } 18 | } 19 | } 20 | 21 | function cameraformataddress() { 22 | var saddress = document.getElementById('camera_webaddress').value; 23 | var saddressl =saddress.trim().toLowerCase(); 24 | saddress =saddress.trim(); 25 | if (saddress.length > 0) { 26 | if ( !(saddressl.indexOf("https://") != -1 || saddressl.indexOf("http://") != -1 || saddressl.indexOf("rtp://") != -1 || saddressl.indexOf("rtps://") != -1 || saddressl.indexOf("rtp://") != -1 )) { 27 | saddress = "http://" + saddress; 28 | } 29 | } 30 | document.getElementById('camera_webaddress').value = saddress; 31 | } 32 | 33 | function camera_loadframe(){ 34 | var saddress = document.getElementById('camera_webaddress').value; 35 | saddress =saddress.trim(); 36 | if(saddress.length == 0) { 37 | document.getElementById('camera_frame').src = ""; 38 | document.getElementById('camera_frame_display').style.display = "none"; 39 | } 40 | else{ 41 | cameraformataddress(); 42 | document.getElementById('camera_frame').src = document.getElementById('camera_webaddress').value; 43 | document.getElementById('camera_frame_display').style.display = "block"; 44 | } 45 | } 46 | 47 | function camera_OnKeyUp(event){ 48 | if (event.keyCode == 13) { 49 | camera_loadframe(); 50 | } 51 | return true; 52 | } 53 | 54 | function DisplayAddress(webaddress){ 55 | document.getElementById('camera_webaddress').value = webaddress; 56 | cameraformataddress(); 57 | camera_loadframe(); 58 | } 59 | 60 | function camera_GetAddress(){ 61 | var url = "/command?plain="+encodeURIComponent("[ESP301]"); 62 | SendGetHttp(url, camera_GetAddressSuccess, camera_GetAddressFailed); 63 | } 64 | 65 | function camera_saveaddress(){ 66 | var saddress = ""; 67 | var url = ""; 68 | cameraformataddress(); 69 | saddress = document.getElementById('camera_webaddress').value; 70 | url = "/command?plain="+encodeURIComponent("[ESP300]" + saddress); 71 | SendGetHttp(url, camera_saveaddressSuccess, camera_saveaddressFailed); 72 | } 73 | 74 | function camera_detachcam(){ 75 | var webaddress = document.getElementById('camera_frame').src; 76 | document.getElementById('camera_frame').src = ""; 77 | document.getElementById('camera_frame_display').style.display = "none"; 78 | window.open(webaddress); 79 | } 80 | 81 | function camera_GetAddressSuccess(response){ 82 | //console.log(response); 83 | DisplayAddress(response); 84 | } 85 | 86 | function camera_GetAddressFailed(error_code,response){ 87 | console.log("Error " + error_code + " :" + response); 88 | } 89 | 90 | function camera_saveaddressSuccess(response){ 91 | //console.log(response); 92 | } 93 | 94 | function camera_saveaddressFailed(error_code,response){ 95 | console.log("Error " + error_code + " :" + response); 96 | } 97 | -------------------------------------------------------------------------------- /www/js/updatedlg.js: -------------------------------------------------------------------------------- 1 | var update_ongoing=false; 2 | var current_update_filename=""; 3 | //update dialog 4 | function updatedlg () { 5 | var modal = setactiveModal('updatedlg.html'); 6 | if ( modal == null) return; 7 | document.getElementById('fw-select').style.display = 'block'; 8 | document.getElementById('prgfw').style.display = 'none'; 9 | document.getElementById('uploadfw-button').style.display = 'none'; 10 | document.getElementById('updatemsg').innerHTML = ""; 11 | document.getElementById('fw-select').value=""; 12 | showModal() ; 13 | } 14 | 15 | function closeUpdateDialog(msg){ 16 | if (update_ongoing) { 17 | alertdlg (translate_text_item("Busy..."), translate_text_item("Update is ongoing, please wait and retry.")); 18 | return; 19 | } 20 | closeModal(msg); 21 | } 22 | 23 | function checkupdatefile(){ 24 | var files = document.getElementById('fw-select').files; 25 | document.getElementById('updatemsg').style.display='none'; 26 | if (files.length==0)document.getElementById('uploadfw-button').style.display = 'none'; 27 | else document.getElementById('uploadfw-button').style.display = 'block'; 28 | } 29 | 30 | 31 | function UpdateProgressDisplay(oEvent){ 32 | if (oEvent.lengthComputable) { 33 | var percentComplete = (oEvent.loaded / oEvent.total)*100; 34 | document.getElementById('prgfw').value=percentComplete; 35 | document.getElementById('updatemsg').innerHTML = translate_text_item("Uploading ") + current_update_filename + " " + percentComplete.toFixed(0)+"%" ; 36 | } else { 37 | // Impossible because size is unknown 38 | } 39 | } 40 | 41 | function UploadUpdatefile() { 42 | confirmdlg(translate_text_item("Please confirm"), translate_text_item("Update Firmware ?"), StartUploadUpdatefile) 43 | } 44 | 45 | 46 | 47 | function StartUploadUpdatefile( response) { 48 | if (response != "yes") return; 49 | if (http_communication_locked) { 50 | alertdlg (translate_text_item("Busy..."), translate_text_item("Communications are currently locked, please wait and retry.")); 51 | return; 52 | } 53 | var files = document.getElementById('fw-select').files 54 | var formData = new FormData(); 55 | var url = "/updatefw"; 56 | for (var i = 0; i < files.length; i++) { 57 | var file = files[i]; 58 | formData.append('myfile[]', file, "/"+file.name); 59 | } 60 | document.getElementById('fw-select').style.display = 'none'; 61 | document.getElementById('uploadfw-button').style.display = 'none'; 62 | update_ongoing=true; 63 | document.getElementById('updatemsg').style.display='block'; 64 | document.getElementById('prgfw').style.display = 'block'; 65 | if (files.length == 1)current_update_filename = files[0].name; 66 | else current_update_filename = ""; 67 | document.getElementById('updatemsg').innerHTML = translate_text_item("Uploading ") + current_update_filename; 68 | SendFileHttp(url, formData, UpdateProgressDisplay, updatesuccess, updatefailed) 69 | } 70 | 71 | function updatesuccess(response){ 72 | document.getElementById('updatemsg').innerHTML = translate_text_item("Restarting, please wait...."); 73 | document.getElementById('fw-select').value=""; 74 | var i = 0; 75 | var interval; 76 | var x = document.getElementById("prgfw"); 77 | x.max=40; 78 | interval = setInterval(function(){ 79 | i=i+1; 80 | var x = document.getElementById("prgfw"); 81 | x.value=i; 82 | document.getElementById('updatemsg').innerHTML = translate_text_item("Restarting, please wait....") + (41-i) +translate_text_item(" seconds") ; 83 | if (i>40) 84 | { 85 | update_ongoing=false; 86 | clearInterval(interval); 87 | location.reload(); 88 | } 89 | },1000); 90 | //console.log(response); 91 | } 92 | 93 | function updatefailed(errorcode, response){ 94 | document.getElementById('fw-select').style.display = 'block'; 95 | document.getElementById('prgfw').style.display = 'none'; 96 | document.getElementById('uploadfw-button').style.display = 'block'; 97 | document.getElementById('updatemsg').innerHTML = translate_text_item("Upload failed : ") + errorcode + " :" + response; 98 | console.log("Error " + errorcode + " : " + response); 99 | update_ongoing=false; 100 | } 101 | 102 | -------------------------------------------------------------------------------- /www/docs/roundtab-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | (Better) Round Out Tabs 8 | 9 | 10 | 103 | 104 | 119 | 120 | 121 | 122 | 123 | Hi 128 |
129 |

Tab 0

130 |

London is the capital city of England.

131 |
132 | 133 |
134 |

Tab 1

135 |

Paris is the capital of France.

136 |
137 | 138 |
139 |

Tab 2

140 |

Tokyo is the capital of Japan.

141 |
142 | 143 | 146 | 147 | -------------------------------------------------------------------------------- /www/sub/SPIFFSdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 88 | 89 | -------------------------------------------------------------------------------- /www/js/scanwifidlg.js: -------------------------------------------------------------------------------- 1 | var ssid_item_scanwifi = -1; 2 | //scanwifi dialog 3 | function scanwifidlg (item) { 4 | var modal = setactiveModal('scanwifidlg.html',scanwifidlg_close); 5 | if ( modal == null) return; 6 | ssid_item_scanwifi = item; 7 | showModal() ; 8 | refresh_scanwifi(); 9 | } 10 | 11 | function refresh_scanwifi(){ 12 | document.getElementById('AP_scan_loader').style.display='block'; 13 | document.getElementById('AP_scan_list').style.display='none'; 14 | document.getElementById('AP_scan_status').style.display='block'; 15 | document.getElementById('AP_scan_status').innerHTML = translate_text_item("Scanning"); 16 | document.getElementById('refresh_scanwifi_btn').style.display='none'; 17 | //removeIf(production) 18 | var response_text = "{\"AP_LIST\":[{\"SSID\":\"HP-Setup>71-M277LaserJet\",\"SIGNAL\":\"90\",\"IS_PROTECTED\":\"0\"},{\"SSID\":\"NETGEAR_2GEXT_OFFICE2\",\"SIGNAL\":\"58\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"NETGEAR_2GEXT_OFFICE\",\"SIGNAL\":\"34\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"NETGEAR_2GEXT_COULOIR\",\"SIGNAL\":\"18\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"HP-Print-D3-ColorLaserJetPro\",\"SIGNAL\":\"14\",\"IS_PROTECTED\":\"0\"},{\"SSID\":\"external-wifi\",\"SIGNAL\":\"20\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"Livebox-4D0F\",\"SIGNAL\":\"24\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"SFR_2000\",\"SIGNAL\":\"20\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"SFR_0D90\",\"SIGNAL\":\"26\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"SFRWiFiFON\",\"SIGNAL\":\"18\",\"IS_PROTECTED\":\"0\"},{\"SSID\":\"SFRWiFiMobile\",\"SIGNAL\":\"18\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"FreeWifi\",\"SIGNAL\":\"16\",\"IS_PROTECTED\":\"0\"}]}"; 19 | getscanWifiSuccess(response_text); 20 | return; 21 | //endRemoveIf(production) 22 | var url = "/command?plain="+encodeURIComponent("[ESP410]"); 23 | SendGetHttp(url, getscanWifiSuccess, getscanWififailed); 24 | } 25 | 26 | function process_scanWifi_answer(response_text){ 27 | var result= true; 28 | var content = ""; 29 | try { 30 | var response = JSON.parse(response_text); 31 | if(typeof response.AP_LIST == 'undefined') { 32 | result = false; 33 | } 34 | else { 35 | var aplist = response.AP_LIST; 36 | //console.log("found " + aplist.length + " AP"); 37 | aplist.sort(function(a, b) { 38 | return (parseInt(a.SIGNAL) < parseInt(b.SIGNAL)) ? -1 : (parseInt(a.SIGNAL) > parseInt(b.SIGNAL)) ? 1 : 0 39 | }); 40 | for (var i = aplist.length-1; i >=0; i--){ 41 | content+=""; 42 | content+=""; 43 | content+=aplist[i].SSID; 44 | content+=""; 45 | content+=""; 46 | content+=aplist[i].SIGNAL; 47 | content+="%"; 48 | content+="
"; 49 | if (aplist[i].IS_PROTECTED == "1")content += get_icon_svg("lock"); 50 | content+=""; 51 | content+=""; 52 | content+=""; 55 | content+=""; 56 | content+=""; 57 | } 58 | } 59 | } 60 | catch (e) { 61 | console.error("Parsing error:", e); 62 | result= false; 63 | } 64 | document.getElementById('AP_scan_data').innerHTML = content; 65 | return result; 66 | } 67 | 68 | function select_ap_ssid(ssid_name){ 69 | document.getElementById("setting_" + ssid_item_scanwifi).value=ssid_name; 70 | document.getElementById("setting_"+ ssid_item_scanwifi).focus(); 71 | setsettingchanged(ssid_item_scanwifi); 72 | closeModal("Ok") ; 73 | } 74 | 75 | function getscanWifiSuccess(response){ 76 | if (!process_scanWifi_answer(response)){ 77 | getscanWififailed(406, translate_text_item("Wrong data")); 78 | return; 79 | } 80 | document.getElementById('AP_scan_loader').style.display="none"; 81 | document.getElementById('AP_scan_list').style.display="block"; 82 | document.getElementById('AP_scan_status').style.display="none"; 83 | document.getElementById('refresh_scanwifi_btn').style.display="block"; 84 | } 85 | 86 | function getscanWififailed(error_code, response){ 87 | console.log("Error " + error_code + " :" + response); 88 | document.getElementById('AP_scan_loader').style.display="none"; 89 | document.getElementById('AP_scan_status').style.display="block"; 90 | document.getElementById('AP_scan_status').innerHTML=translate_text_item( "Failed:") + error_code + " " + response; 91 | document.getElementById('refresh_scanwifi_btn').style.display="block"; 92 | } 93 | 94 | function scanwifidlg_close (response) { 95 | //console.log(response); 96 | } 97 | -------------------------------------------------------------------------------- /www/js/commands.js: -------------------------------------------------------------------------------- 1 | var CustomCommand_history = []; 2 | var CustomCommand_history_index = -1; 3 | var Monitor_output = []; 4 | 5 | function init_command_panel(){ 6 | var value = get_localdata('monitor_autoscroll'); 7 | if (value == 'true'){ 8 | document.getElementById('monitor_enable_autoscroll').checked =true; 9 | Monitor_check_autoscroll(); 10 | } 11 | value = get_localdata('monitor_filter_temperatures'); 12 | if (value == 'true'){ 13 | document.getElementById('monitor_enable_filter_temperatures').checked =true; 14 | Monitor_check_filter_temperatures(); 15 | } 16 | } 17 | 18 | function Monitor_output_autoscrollcmd(){ 19 | document.getElementById('cmd_content').scrollTop = document.getElementById('cmd_content').scrollHeight; 20 | } 21 | 22 | function Monitor_check_autoscroll(){ 23 | if (document.getElementById('monitor_enable_autoscroll').checked == true) Monitor_output_autoscrollcmd(); 24 | store_localdata('monitor_autoscroll', document.getElementById('monitor_enable_autoscroll').checked); 25 | } 26 | 27 | function Monitor_check_filter_temperatures(){ 28 | Monitor_output_Update(); 29 | store_localdata('monitor_filter_temperatures', document.getElementById('monitor_enable_filter_temperatures').checked); 30 | } 31 | 32 | function Monitor_output_Clear(){ 33 | Monitor_output = []; 34 | Monitor_output_Update(); 35 | } 36 | 37 | function Monitor_output_Update(message){ 38 | if (message) { 39 | if (typeof message === 'string' || message instanceof String) { 40 | Monitor_output = Monitor_output.concat(message); 41 | } 42 | else 43 | { 44 | try { 45 | var msg = JSON.stringify(message, null, " "); 46 | Monitor_output= Monitor_output.concat(msg + "\n"); 47 | } 48 | catch(err) { 49 | Monitor_output = Monitor_output.concat(message.toString() + "\n"); 50 | } 51 | } 52 | Monitor_output = Monitor_output.slice(-300); 53 | } 54 | var regex = /ok T:/g; 55 | 56 | if (target_firmware == "repetier" || target_firmware == "repetier4davinci"){ 57 | regex = /T:/g; 58 | } 59 | var output = ""; 60 | var Monitor_outputLength = Monitor_output.length; 61 | var istempfilter = document.getElementById("monitor_enable_filter_temperatures").checked; 62 | for (var i = 0; i < Monitor_outputLength; i++) { 63 | if (istempfilter && Monitor_output[i].match(regex)) continue; 64 | if ((Monitor_output[i].trim()==="\n") || (Monitor_output[i].trim()==="\r") || (Monitor_output[i].trim()==="\r\n") || (Monitor_output[i].trim()==="") )continue; 65 | else { 66 | m = Monitor_output[i].replace("&", "&"); 67 | m = m.replace("<", "<"); 68 | m = m.replace(">", ">"); 69 | output += m ; 70 | } 71 | } 72 | document.getElementById("cmd_content").innerHTML = output; 73 | Monitor_check_autoscroll(); 74 | } 75 | 76 | function SendCustomCommand(){ 77 | var cmd = document.getElementById("custom_cmd_txt").value ; 78 | var url = "/command?commandText="; 79 | cmd = cmd.trim(); 80 | if (cmd.trim().length == 0) return; 81 | CustomCommand_history.push(cmd); 82 | CustomCommand_history.slice(-40); 83 | CustomCommand_history_index = CustomCommand_history.length; 84 | document.getElementById("custom_cmd_txt").value = ""; 85 | Monitor_output_Update(cmd + "\n"); 86 | SendGetHttp(url + encodeURI(cmd), SendCustomCommandSuccess, SendCustomCommandFailed); 87 | //console.log(cmd); 88 | } 89 | 90 | function CustomCommand_OnKeyUp(event){ 91 | if (event.keyCode == 13) { 92 | SendCustomCommand(); 93 | } 94 | if (event.keyCode == 38 || event.keyCode == 40) { 95 | if (event.keyCode == 38 && CustomCommand_history.length > 0 && CustomCommand_history_index > 0) { 96 | CustomCommand_history_index--; 97 | } else if (event.keyCode == 40 &&CustomCommand_history_index < CustomCommand_history.length - 1) { 98 | CustomCommand_history_index++; 99 | } 100 | 101 | if (CustomCommand_history_index >= 0 &&CustomCommand_history_index < CustomCommand_history.length) { 102 | document.getElementById("custom_cmd_txt").value = CustomCommand_history[CustomCommand_history_index]; 103 | } 104 | return false; 105 | } 106 | return true; 107 | } 108 | 109 | function SendCustomCommandSuccess(response){ 110 | if (response[response.length-1] != '\n')Monitor_output_Update(response + "\n"); 111 | else Monitor_output_Update(response); 112 | } 113 | 114 | function SendCustomCommandFailed(error_code,response){ 115 | Monitor_output_Update("Error " + error_code + " :" + response+ "\n"); 116 | console.log("Error " + error_code + " :" + response); 117 | } 118 | -------------------------------------------------------------------------------- /www/js/logindlg.js: -------------------------------------------------------------------------------- 1 | //login dialog 2 | function logindlg(closefunc, check_first) { 3 | var modal = setactiveModal('logindlg.html',closefunc); 4 | var need_query_auth = false; 5 | if ( modal == null) return; 6 | document.getElementById('login_title').innerHTML = translate_text_item("Identification requested") ; 7 | document.getElementById('login_loader').style.display = "none"; 8 | document.getElementById('login_content').style.display = "block"; 9 | if (typeof check_first !== 'undefined')need_query_auth = check_first; 10 | if (need_query_auth) { 11 | var url = "/login" ; 12 | SendGetHttp(url, checkloginsuccess); 13 | } else { 14 | showModal() ; 15 | } 16 | } 17 | function checkloginsuccess(response_text){ 18 | var response = JSON.parse(response_text); 19 | if (typeof(response.authentication_lvl ) !== 'undefined' ) { 20 | if ( response.authentication_lvl != "guest") { 21 | if (typeof(response.authentication_lvl ) !== 'undefined' )document.getElementById('current_auth_level').innerHTML = "(" + translate_text_item(response.authentication_lvl) + ")"; 22 | if (typeof(response.user ) !== 'undefined' )document.getElementById('current_ID').innerHTML = response.user ; 23 | closeModal('cancel'); 24 | } 25 | else showModal() ; 26 | } else { 27 | showModal() ; 28 | } 29 | } 30 | 31 | 32 | 33 | function loginfailed(errorcode, response_text){ 34 | var response = JSON.parse(response_text); 35 | if (typeof(response.status ) !== 'undefined' )document.getElementById('login_title').innerHTML = translate_text_item(response.status) ; 36 | else document.getElementById('login_title').innerHTML = translate_text_item("Identification invalid!") ; 37 | console.log("Error " + errorcode + " : " + response_text); 38 | document.getElementById('login_content').style.display = "block"; 39 | document.getElementById('login_loader').style.display = "none"; 40 | document.getElementById('current_ID').innerHTML = translate_text_item("guest"); 41 | document.getElementById('logout_menu').style.display = "none"; 42 | document.getElementById("password_menu").style.display = "none"; 43 | } 44 | 45 | function loginsuccess(response_text){ 46 | var response = JSON.parse(response_text); 47 | if (typeof(response.authentication_lvl ) !== 'undefined' )document.getElementById('current_auth_level').innerHTML = "(" + translate_text_item(response.authentication_lvl) + ")"; 48 | document.getElementById('login_loader').style.display = "none"; 49 | document.getElementById('logout_menu').style.display = "block"; 50 | document.getElementById("password_menu").style.display = "block"; 51 | closeModal("Connection successful"); 52 | } 53 | 54 | function SubmitLogin() { 55 | var user = document.getElementById('login_user_text').value.trim(); 56 | var password = document.getElementById('login_password_text').value.trim(); 57 | var url = "/login?USER="+encodeURIComponent(user) + "&PASSWORD=" + encodeURIComponent(password) + "&SUBMIT=yes" ; 58 | document.getElementById('current_ID').innerHTML = user; 59 | document.getElementById('current_auth_level').innerHTML = ""; 60 | document.getElementById('login_content').style.display = "none"; 61 | document.getElementById('login_loader').style.display = "block"; 62 | SendGetHttp(url, loginsuccess, loginfailed); 63 | } 64 | 65 | function GetIdentificationStatus(){ 66 | var url = "/login" ; 67 | SendGetHttp(url, GetIdentificationStatusSuccess); 68 | } 69 | 70 | function GetIdentificationStatusSuccess(response_text){ 71 | var response = JSON.parse(response_text); 72 | if (typeof(response.authentication_lvl ) !== 'undefined' ) { 73 | if (response.authentication_lvl == "guest") { 74 | document.getElementById('current_ID').innerHTML = translate_text_item("guest"); 75 | document.getElementById('current_auth_level').innerHTML = ""; 76 | } 77 | } 78 | } 79 | 80 | function DisconnectionSuccess(response_text) { 81 | document.getElementById('current_ID').innerHTML = translate_text_item("guest"); 82 | document.getElementById('current_auth_level').innerHTML = ""; 83 | document.getElementById('logout_menu').style.display = "none"; 84 | document.getElementById("password_menu").style.display = "none"; 85 | } 86 | 87 | function DisconnectionFailed(errorcode, response) { 88 | document.getElementById('current_ID').innerHTML = translate_text_item("guest"); 89 | document.getElementById('current_auth_level').innerHTML = ""; 90 | document.getElementById('logout_menu').style.display = "none"; 91 | document.getElementById("password_menu").style.display = "none"; 92 | console.log("Error " + errorcode + " : " + response); 93 | } 94 | 95 | function DisconnectLogin(answer) { 96 | if (answer == "yes") { 97 | var url = "/login?DISCONNECT=yes" ; 98 | SendGetHttp(url, DisconnectionSuccess, DisconnectionFailed); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /www/js/extruders.js: -------------------------------------------------------------------------------- 1 | function init_extruder_panel(){ 2 | var value = parseInt(get_localdata('e_length')); 3 | if (!(isNaN(value))) document.getElementById('filament_length').value = value; 4 | value = get_localdata('enable_second_extruder'); 5 | if (value == 'true'){ 6 | document.getElementById('enable_second_extruder').checked =true; 7 | update_second_extruder(); 8 | } 9 | } 10 | 11 | function update_second_extruder(){ 12 | temperature_second_extruder(document.getElementById('enable_second_extruder').checked); 13 | if (document.getElementById('enable_second_extruder').checked) { 14 | document.getElementById('second_extruder_UI').style.display='block'; 15 | document.getElementById('temperature_secondExtruder').style.display='table-row'; 16 | } 17 | else { 18 | document.getElementById('second_extruder_UI').style.display='none'; 19 | document.getElementById('temperature_secondExtruder').style.display='none'; 20 | } 21 | store_localdata('enable_second_extruder', document.getElementById('enable_second_extruder').checked); 22 | } 23 | 24 | function on_extruder_length_Change(){ 25 | var value = parseInt(document.getElementById('filament_length').value); 26 | if (value < 0.001 || value > 9999 || isNaN(value) || (value === null)) { 27 | } 28 | else { 29 | store_localdata('e_length', value); 30 | } 31 | } 32 | 33 | function on_extruder_velocity_Change(){ 34 | var value = parseInt(document.getElementById('extruder_velocity').value); 35 | if (value < 0.001 || value > 9999 || isNaN(value) || (value === null)) { 36 | } 37 | else { 38 | store_localdata('e_velocity', value); 39 | } 40 | } 41 | 42 | function Extrude_cmd(extruder, direction){ 43 | var filament_length = parseInt(document.getElementById('filament_length').value); 44 | var velocity = parseInt(document.getElementById('extruder_velocity').value); 45 | if (velocity < 1 || velocity > 9999 || isNaN(velocity) || (velocity === null)) { 46 | document.getElementById('extruder_velocity').value = parseInt(get_localdata('e_velocity')); 47 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of extruder velocity must be between1 mm/min and 9999 mm/min !")); 48 | return; 49 | } 50 | if (filament_length < 0.001 || filament_length > 9999 || isNaN(filament_length) || (filament_length === null)) { 51 | document.getElementById('filament_length').value = parseInt(get_localdata('e_length')); 52 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of filament length must be between 0.001 mm and 9999 mm !")); 53 | return; 54 | } 55 | //Todo send command by command TBD 56 | var command = extruder +"\n"+"G91\nG1 E" + (filament_length * direction) + " F" + velocity + "\nG90" 57 | SendPrinterCommand(command, true); 58 | } 59 | 60 | function flowInit_cmd(){ 61 | document.getElementById('flowSelectedValue').value = 100; 62 | flowSet_cmd(); 63 | } 64 | 65 | function flowSet_cmd(){ 66 | var command = "M221 S"; 67 | var value = parseInt(document.getElementById('flowSelectedValue').value); 68 | if (value < 50 || value > 300 || isNaN(value)) { 69 | document.getElementById('flowSelectedValue').value = 100; 70 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 50% and 300% !")); 71 | } 72 | else { 73 | SendPrinterCommand(command + value, true); 74 | } 75 | } 76 | 77 | function feedInit_cmd(){ 78 | document.getElementById('feedSelectedValue').value = 100; 79 | feedSet_cmd(); 80 | } 81 | 82 | function feedSet_cmd(){ 83 | var command = "M220 S"; 84 | var value = parseInt(document.getElementById('feedSelectedValue').value); 85 | if (value < 25 || value > 150 || isNaN(value)) { 86 | document.getElementById('feedSelectedValue').value = 100; 87 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 25% and 150% !")); 88 | } 89 | else { 90 | SendPrinterCommand(command + value, true); 91 | } 92 | } 93 | 94 | function fanOff_cmd(){ 95 | document.getElementById('fanSelectedValue').value = 0; 96 | fanSet_cmd(); 97 | } 98 | 99 | function fanSet_cmd(){ 100 | var command = "M106 S"; 101 | var fvalue = parseInt(document.getElementById('fanSelectedValue').value); 102 | var value = Math.round((fvalue* 255)/100); 103 | if (fvalue< 0 || fvalue>100 || isNaN(fvalue) || fvalue === null) { 104 | document.getElementById('fanSelectedValue').value = 0; 105 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0% and 100% !")); 106 | } 107 | else { 108 | SendPrinterCommand(command + value, true); 109 | } 110 | } 111 | 112 | function extruder_handleKeyUp(event, target){ 113 | if (event.keyCode == 13) { 114 | if (target == 'Feed')feedSet_cmd(); 115 | else if (target == 'Flow')flowSet_cmd(); 116 | else if (target == 'Fan')fanSet_cmd(); 117 | } 118 | return true; 119 | } 120 | -------------------------------------------------------------------------------- /www/docs/library.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Trash
4 | 5 |
6 | Create dir
7 | 8 | + 9 |
10 | File
11 | '; 12 | 13 |
14 | Directory
15 | 16 |
17 | Trash
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | Camera
29 | 30 | 31 | 32 | 33 |
34 | 35 | SD
36 | 37 | 38 | SD 39 | 40 |
41 | Info
42 | 43 | 44 | i 45 | 46 |
47 | 48 | Signal
49 | 50 | 51 | 52 | 53 | 54 | 55 |
56 | 57 | Pen
58 | 59 | 60 | 61 | 62 | 63 | 64 |
65 | 66 | rod
67 | 68 | 69 | 70 | 71 |
72 | Dash
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |
82 | 83 | wrench
84 | 85 | 86 | 87 | 88 | 89 |
90 | 91 | power
92 | 93 | 94 | 95 | 96 |
97 | 98 | settings
99 | 100 | 101 | 102 | 103 |
104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /www/js/app.js: -------------------------------------------------------------------------------- 1 | var ESP3D_authentication = false; 2 | 3 | window.onload = function() { 4 | //to check if javascript is disabled like in anroid preview 5 | document.getElementById('warningmsg').style.display = 'none'; 6 | connectdlg(); 7 | }; 8 | 9 | window.addEventListener("resize", OnresizeWindow); 10 | 11 | function OnresizeWindow(){ 12 | } 13 | 14 | function build_language_menu(){ 15 | var content =""; 16 | for (var lang_i =0 ; lang_i < language_list.length; lang_i++){ 17 | content+=""; 20 | content+= language_list[lang_i][1]; 21 | content+= ""; 22 | if ( language_list[lang_i][0] == language){ 23 | document.getElementById("translate_menu").innerHTML=language_list[lang_i][1]; 24 | } 25 | } 26 | document.getElementById("lang_menu").innerHTML=content; 27 | } 28 | 29 | function update_ui_text(){ 30 | build_HTML_setting_list(current_setting_filter); 31 | } 32 | 33 | function update_UI_firmware_target() { 34 | var fwName; 35 | if (target_firmware == "repetier" ) { 36 | fwName = "Repetier"; 37 | document.getElementById('configtablink').style.display = 'block'; 38 | } 39 | else if (target_firmware == "repetier4davinci" ) { 40 | fwName = "Repetier for Davinci"; 41 | document.getElementById('configtablink').style.display = 'block'; 42 | } 43 | else if (target_firmware == "smoothieware" ) { 44 | fwName = "Smoothieware"; 45 | document.getElementById('configtablink').style.display = 'block'; 46 | } 47 | else if (target_firmware == "marlin" ) { 48 | fwName = "Marlin"; 49 | document.getElementById('configtablink').style.display = 'none'; 50 | } 51 | else if (target_firmware == "marlinkimbra" ) { 52 | fwName = "Marlin Kimbra"; 53 | document.getElementById('configtablink').style.display = 'none'; 54 | } 55 | else { 56 | fwName = "Unknown"; 57 | document.getElementById('configtablink').style.display = 'none'; 58 | } 59 | if (typeof document.getElementById('fwName') != "undefined")document.getElementById('fwName').innerHTML=fwName; 60 | //SD image or not 61 | if (direct_sd && typeof document.getElementById('showSDused')!= "undefined")document.getElementById('showSDused').innerHTML=""; 62 | else document.getElementById('showSDused').innerHTML=""; 63 | return fwName; 64 | } 65 | 66 | function initUI() { 67 | document.getElementById("main_page_loader").style.display = 'block'; 68 | //initial check 69 | if ((typeof target_firmware == "undefined") || (typeof web_ui_version == "undefined") || (typeof direct_sd == "undefined") ) alert('Missing init data!'); 70 | //check FW 71 | update_UI_firmware_target(); 72 | //update UI version 73 | if (typeof document.getElementById('UI_VERSION') != "undefined")document.getElementById('UI_VERSION').innerHTML=web_ui_version; 74 | //update FW version 75 | if (typeof document.getElementById('FW_VERSION') != "undefined")document.getElementById('FW_VERSION').innerHTML=fw_version; 76 | // Get the element with id="defaultOpen" and click on it 77 | document.getElementById("maintablink").click(); 78 | //var value = get_localdata('language'); 79 | //translate_text(value); 80 | //removeIf(production) 81 | console.log(JSON.stringify(translated_list)); 82 | //endRemoveIf(production) 83 | //get all settings from ESP3D 84 | refreshSettings(); 85 | //init panels 86 | init_temperature_panel(); 87 | init_extruder_panel(); 88 | init_command_panel(); 89 | init_controls_panel(); 90 | init_files_panel(false); 91 | //check if we need setup 92 | if ( target_firmware == "???"){ 93 | setupdlg(); 94 | } else { 95 | setup_is_done = true; 96 | build_HTML_setting_list(current_setting_filter); 97 | document.getElementById('main_ui').style.display='block'; 98 | } 99 | document.getElementById("main_page_loader").style.display = 'none'; 100 | } 101 | 102 | function compareStrings(a, b) { 103 | // case-insensitive comparison 104 | a = a.toLowerCase(); 105 | b = b.toLowerCase(); 106 | return (a < b) ? -1 : (a > b) ? 1 : 0; 107 | } 108 | 109 | function compareInts(a, b) { 110 | return (a < b) ? -1 : (a > b) ? 1 : 0; 111 | } 112 | 113 | function HTMLEncode(str){ 114 | var i = str.length, 115 | aRet = []; 116 | 117 | while (i--) { 118 | var iC = str[i].charCodeAt(); 119 | if (iC < 65 || iC > 127 || (iC>90 && iC<97)) { 120 | if(iC==65533) iC=176; 121 | aRet[i] = '&#'+iC+';'; 122 | } else { 123 | aRet[i] = str[i]; 124 | } 125 | } 126 | return aRet.join(''); 127 | } 128 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'), 2 | jshint = require('gulp-jshint'), 3 | gulpif = require('gulp-if'), 4 | concat = require('gulp-concat'), 5 | uglify = require('gulp-uglify'), 6 | cleanCSS = require('gulp-clean-css'), 7 | removeCode = require('gulp-remove-code'), 8 | merge = require('merge-stream'), 9 | del = require('del'), 10 | zip = require('gulp-zip'), 11 | gzip = require('gulp-gzip'), 12 | htmlmin = require('gulp-htmlmin'), 13 | replace = require('gulp-replace'), 14 | fs = require('fs'), 15 | smoosher = require('gulp-smoosher'); 16 | 17 | var demoMode = false; 18 | var testMode = false; 19 | 20 | function clean() { 21 | return del(['dist']); 22 | } 23 | 24 | function clean2() { 25 | return del(['dist/js', 'dist/css']); 26 | } 27 | function lint() { 28 | return gulp.src('www/js/**/app.js') 29 | .pipe(jshint()) 30 | .pipe(jshint.reporter('default')); 31 | } 32 | 33 | function Copytest() { 34 | return merge( 35 | gulp.src(['www/index.html']) 36 | .pipe(removeCode({production: false})) 37 | .pipe(removeCode({cleanheader: true})) 38 | .pipe(gulp.dest('dist')), 39 | gulp.src(['www/images/**/*.*']) 40 | .pipe(gulp.dest('dist/images')) 41 | ) 42 | } 43 | 44 | function Copy() { 45 | return merge( 46 | gulp.src(['www/index.html']) 47 | .pipe(removeCode({production: true})) 48 | .pipe(removeCode({cleanheader: true})) 49 | .pipe(gulp.dest('dist')), 50 | gulp.src(['www/images/**/*.*']) 51 | .pipe(gulp.dest('dist/images')) 52 | ) 53 | } 54 | 55 | function concatApptest() { 56 | return merge( 57 | gulp.src([ 'www/js/**/*.js']) 58 | .pipe(concat('app.js')) 59 | .pipe(removeCode({production: false})) 60 | .pipe(removeCode({cleanheader: true})) 61 | .pipe(gulp.dest('./dist/js')), 62 | 63 | gulp.src([ 'www/css/**/*.css']) 64 | .pipe(concat('style.css')) 65 | .pipe(gulp.dest('./dist/css/')) 66 | ) 67 | } 68 | 69 | function concatApp() { 70 | return merge( 71 | gulp.src([ 'www/js/**/*.js']) 72 | .pipe(concat('app.js')) 73 | .pipe(removeCode({production: true})) 74 | .pipe(removeCode({cleanheader: true})) 75 | .pipe(gulp.dest('./dist/js')), 76 | 77 | gulp.src([ 'www/css/**/*.css']) 78 | .pipe(concat('style.css')) 79 | .pipe(gulp.dest('./dist/css/')) 80 | ) 81 | } 82 | 83 | function replaceSVG() { 84 | return gulp.src('dist/index.html') 85 | .pipe(replace(/(.*?)/g, function (match, p1) { 86 | return fs.readFileSync('dist/images/jogdial.svg', 'utf8'); 87 | })) 88 | .pipe(gulp.dest('dist')) 89 | } 90 | 91 | function minifyApp() { 92 | return merge( 93 | gulp.src(['dist/js/app.js']) 94 | .pipe(uglify({mangle: true})) 95 | .pipe(gulp.dest('./dist/js/')), 96 | 97 | gulp.src('dist/css/style.css') 98 | .pipe(cleanCSS({debug: true}, function(details) { 99 | console.log(details.name + ': ' + details.stats.originalSize); 100 | console.log(details.name + ': ' + details.stats.minifiedSize); 101 | })) 102 | .pipe(gulp.dest('./dist/css/')), 103 | 104 | gulp.src('dist/index.html') 105 | .pipe(htmlmin({collapseWhitespace: true, minifyCSS: true})) 106 | .pipe(gulp.dest('dist')) 107 | ) 108 | } 109 | 110 | function includehtml() { 111 | return merge( 112 | gulp.src('dist/index.html') 113 | .pipe(replace(/<\/file-include>/g, function (match, p1) { 114 | return fs.readFileSync('www/sub/' + p1, 'utf8'); 115 | })) 116 | .pipe(gulp.dest('dist/')) 117 | ) 118 | } 119 | 120 | function smoosh() { 121 | return gulp.src('dist/index.html') 122 | .pipe(smoosher()) 123 | .pipe(gulp.dest('dist')) 124 | } 125 | 126 | function compress() { 127 | return gulp.src('dist/index.html') 128 | .pipe(gzip()) 129 | .pipe(gulp.dest('.')); 130 | } 131 | 132 | gulp.task(clean); 133 | gulp.task(lint); 134 | gulp.task(Copy); 135 | gulp.task(Copytest); 136 | gulp.task(replaceSVG); 137 | gulp.task(concatApp); 138 | gulp.task(concatApptest); 139 | gulp.task(minifyApp); 140 | gulp.task(smoosh); 141 | gulp.task(clean2); 142 | 143 | var defaultSeries = gulp.series(clean, lint, Copy, concatApp, minifyApp, includehtml, includehtml, smoosh); 144 | //var packageSeries = gulp.series(clean, lint, Copy, concatApp, minifyApp, smoosh, compress); 145 | var packageSeries = gulp.series(clean, lint, Copy, concatApp, includehtml, includehtml, replaceSVG, minifyApp, smoosh, compress, clean2); 146 | var package2Series = gulp.series(clean, lint, Copy, concatApp, includehtml, includehtml, replaceSVG, smoosh); 147 | var package2testSeries = gulp.series(clean, lint, Copytest, concatApptest, includehtml, includehtml, replaceSVG, smoosh); 148 | 149 | gulp.task('default', defaultSeries); 150 | gulp.task('package', packageSeries); 151 | gulp.task('package2', package2Series); 152 | gulp.task('package2test', package2testSeries); 153 | 154 | -------------------------------------------------------------------------------- /www/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | font-family: "Arial", sans-serif; 4 | font-size:14px; 5 | } 6 | 7 | .hide_it { 8 | display: none; 9 | } 10 | 11 | .warningmsg { 12 | color:white; 13 | } 14 | 15 | .warningmsg:hover { 16 | color:red; 17 | } 18 | .no_margin { 19 | margin: 0 !important; 20 | line-height: 0; 21 | } 22 | 23 | .noshowonlowres { 24 | display: inline-block; 25 | } 26 | 27 | .loader { 28 | border: 4px solid #f3f3f3; /* Light grey */ 29 | border-top: 4px solid #3498db; /* Blue */ 30 | border-radius: 50%; 31 | width: 50px; 32 | height: 50px; 33 | animation: spin 2s linear infinite; 34 | } 35 | 36 | .loader_centered { 37 | background-color: white; 38 | position: absolute; 39 | top:0; 40 | bottom: 0; 41 | left: 0; 42 | right: 0; 43 | margin: auto; 44 | } 45 | 46 | 47 | @-webkit-keyframes pulse { 48 | 50% { 49 | background: red; 50 | } 51 | } 52 | @keyframes pulse { 53 | 50% { 54 | background: red; 55 | } 56 | } 57 | 58 | .loader-pulse { 59 | position: relative; 60 | width: 0.25em; 61 | height: 1em; 62 | background: rgba(255, 0, 0, 0.2); 63 | -webkit-animation: pulse 750ms infinite; 64 | animation: pulse 750ms infinite; 65 | -webkit-animation-delay: 250ms; 66 | animation-delay: 250ms; 67 | } 68 | .loader-pulse:before, .loader-pulse:after { 69 | content: ''; 70 | position: absolute; 71 | display: block; 72 | height: 0.66em; 73 | width: 0.25em; 74 | background: rgba(255, 0, 0, 0.2); 75 | top: 50%; 76 | -webkit-transform: translateY(-50%); 77 | transform: translateY(-50%); 78 | -webkit-animation: pulse 750ms infinite; 79 | animation: pulse 750ms infinite; 80 | } 81 | .loader-pulse:before { 82 | left: -0.5em; 83 | } 84 | .loader-pulse:after { 85 | left: 0.5em; 86 | -webkit-animation-delay: 500ms; 87 | animation-delay: 500ms; 88 | } 89 | 90 | .panel-height { 91 | min-height: 370px; 92 | } 93 | 94 | .panel-max-height{ 95 | max-height: 370px; 96 | } 97 | 98 | .panel-height-temp { 99 | min-height: 405px; 100 | } 101 | 102 | .panel-footer-height { 103 | min-height:4em; 104 | } 105 | 106 | .panel-scroll { 107 | overflow-y: scroll; 108 | } 109 | 110 | @keyframes spin { 111 | 0% { transform: rotate(0deg); } 112 | 100% { transform: rotate(360deg); } 113 | } 114 | 115 | 116 | @-webkit-keyframes pulse { 117 | 50% { 118 | background: red; 119 | } 120 | } 121 | @keyframes pulse { 122 | 50% { 123 | background: red; 124 | } 125 | } 126 | 127 | .list-group-hover:hover { 128 | background-color: #f5f5f5; 129 | } 130 | 131 | .table-borderless tbody tr td, 132 | .table-borderless tbody tr th, 133 | .table-borderless thead tr td, 134 | .table-borderless thead tr th, 135 | .table-borderless tfoot tr th, 136 | .table-borderless tfoot tr td { 137 | border: none; 138 | } 139 | 140 | input[type="file"]::-webkit-file-upload-button{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer; 141 | background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px; 142 | * -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none; color: #ffffff;background-color: #5bc0de;border-color: #46b8da;} 143 | input[type="file"]::-webkit-file-upload-button:focus{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer; 144 | background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px; 145 | * -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none; color: #ffffff;background-color: #31b0d5;border-color: #1b6d85;} 146 | input[type="file"]::-webkit-file-upload-button:hover{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer; 147 | background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px; 148 | * -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none; color: #ffffff;background-color: #31b0d5;border-color: #269abc;} 149 | 150 | .panel-footer1{padding:10px 15px;color:#31708f;background-color:#f5f5f5;border-color:#dddddd;border-top:1px solid #dddddd;} 151 | 152 | .w4 { 153 | width:4em; 154 | } 155 | .w5 { 156 | width:5em; 157 | } 158 | .w6 { 159 | width:6em; 160 | } 161 | 162 | .w50 { 163 | width:50em; 164 | } 165 | 166 | @media (max-width: 360px) { 167 | .container-fluid{ 168 | min-width:350px; 169 | margin-left: -10px; 170 | margin-right: -10px; 171 | } 172 | .panel{ 173 | margin-left: -17px; 174 | margin-right: -13px; 175 | } 176 | .pull-left, 177 | .pull-right 178 | { 179 | float: unset!important; 180 | } 181 | .noshowonlowres { 182 | display: none; 183 | } 184 | } 185 | @media (min-width: 361px) and (max-width: 640px) { 186 | .container-fluid{ 187 | min-width:350px; 188 | margin-left: -10px; 189 | margin-right: -10px; 190 | } 191 | .panel{ 192 | margin-left: -17px; 193 | margin-right: -13px; 194 | } 195 | .noshowonlowres { 196 | display: none; 197 | } 198 | } 199 | @media (min-width: 641px) and (max-width: 840px) { 200 | .container-fluid{ 201 | min-width:350px; 202 | } 203 | 204 | } 205 | 206 | -------------------------------------------------------------------------------- /www/docs/modal.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 114 | 115 | 116 | 117 |

Bottom Modal

118 | 119 | 120 | 121 | 122 | 123 | 148 | 149 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /www/sub/setupdlg.html: -------------------------------------------------------------------------------- 1 | 2 | 87 | 88 | -------------------------------------------------------------------------------- /www/sub/files.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 | 10 | 19 | 20 | 21 | 22 | 23 | 24 |
SD Files   11 | 18 |     
25 |
26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
Uploading   %
37 |
38 |
39 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
56 |
57 |
58 |
59 |
60 |
61 |
    62 |
63 |
64 | 91 |
92 | -------------------------------------------------------------------------------- /www/sub/settingstab.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | ESP3D Settings 5 |

6 | 7 | 8 |
9 | 16 | 17 | 24 | 25 | 32 | 33 | 40 | 41 | 48 |
49 |
50 | 51 |
52 |
53 |
54 | 55 |
56 | 60 |
61 |
62 | 66 |
67 |
68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
LabelValue
77 |
78 |
79 |
80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP3D-WEBUI 2 | ![Build Status](https://travis-ci.org/luc-github/ESP3D-WEBUI.svg?branch=master) 3 | 4 | ## What is that ? 5 | A web configuration tool for ESP3D 6 | Originaly based on great UI from Jarek Szczepanski (imrahil): [smoothieware-webui](http://imrahil.github.io/smoothieware-webui/) to get a multi firmware support for [Repetier](https://github.com/repetier/Repetier-Firmware), [Repetier for Davinci printer](https://github.com/luc-github/Repetier-Firmware-0.92), [Marlin](https://github.com/MarlinFirmware), [Marlin Kimbra](https://github.com/MagoKimbra/MarlinKimbra) and of course [Smoothieware](https://github.com/Smoothieware/Smoothieware) 7 | 8 | ## Why doing it ? 9 | Original I ported [smoothieware-webui](http://imrahil.github.io/smoothieware-webui/) to support [ESP3D firmware](https://github.com/luc-github/ESP3D) and it was working pretty well and gave :[smoothieware-webui-for-ESP3D](https://github.com/luc-github/smoothieware-webui-for-ESP3D) 10 | But this UI has a 2 big limitations: 11 | 1 - you need internet access to get all libraries available to download, which may not happen when ESP is in AP mode for configuration if you do not have all js/css in your browser cache, or if you want to use in local environement, in that case not only ESP AP mode is not displaying UI properly but also STA mode - so it make the ESP useless 12 | 13 | 2 - it rely on server availability and certificat check, I got several certificat failure for unknown reason that made the UI not working 14 | 15 | So the solution was to make all resources available - easy no ? 16 | 17 | Yes but... 18 | ESP webserver is a convenient but it is also a very light webserver, allowing no more than 5 active connections at once and with a pretty limited filesystem space, so even concatenated all resources like bootstrap icon, angular and others libraries do not work as expected and do not fit the available space. 19 | 20 | So I came with a full rewrite using pure javascript and resized resources: 21 | 1 - a compressed css based on [bootstrap](http://getbootstrap.com/css/) 22 | 2 - a local limited version of svg based of [Glyphicons Halflings](http://glyphicons.com/) to get a small footprint. 23 | 3 - a customized version of [smoothiecharts](http://smoothiecharts.org/) is used to display temperatures charts, it is simple and perfectly sized for the current purpose 24 | 25 | and the result is a monolitic file with a size less than 70Kb allowing almost full control of ESP3D board and your 3D printer 26 | 27 | ## Features 28 | - It supports several firmwares based on Repetier, Marlin and Smoothieware. 29 | - It allows to fully configure ESP wifi 30 | - It has a macro support to add custom commands in UI by adding buttons launching some GCODE files from SD or ESP 31 | - It supports currently English, French, German (thanks @leseaw) and Spanish languages 32 | - It allows to display a web camera in UI or detached 33 | - It allows to edit the Repetier EEPROM and Smoothieware config file 34 | - It allows to update the ESP3D by uploading the FW 35 | - it allows to control and monitor your 3D printer in every aspect (position, temperature, print, SD card content, custom command 36 | 37 | Please look at screenshots: 38 | Main tab and menu: 39 | 40 | 41 | Control panel: 42 | 43 | Macro dialog: 44 | 45 | Temperatures panel: 46 | 47 | Extruder panel: 48 | 49 | SD card panel: 50 | 51 | 52 | 53 | 54 | Camera Tab: 55 | 56 | Repetier EEPROM Editor tab: 57 | 58 | Smoothieware config Editor tab: 59 | 60 | ESP3D settings Editor: 61 | 62 | ESP3D Status: 63 | 64 | ESP3D SPIFFS: 65 | 66 | 67 | 68 | ## Installation 69 | For [ESP3D 1.X](https://github.com/luc-github/ESP3D) Please use the latest [ESP3D-WEBUI 1.X](https://github.com/luc-github/ESP3D-WEBUI/tree/master) and copy the index.html.gz file on root of SPIFFS, in theory ESP3D have a version of web-ui but it may not be the latest one 70 | 71 | For [For ESP3D 2.X](https://github.com/luc-github/ESP3D/tree/2.0) Please use the latest [ESP3D-WEBUI 2.X](https://github.com/luc-github/ESP3D-WEBUI/tree/2.0) 72 | 73 | ## Contribution / development 74 | Check wiki section [Contribution/Development](https://github.com/luc-github/ESP3D-WEBUI/wiki/Compilation---Development) 75 | 76 | ## Issues / Questions 77 | You can submit ticket [here](https://github.com/luc-github/ESP3D-WEBUI/issues) 78 | 79 | ## Donate 80 | Every support is welcome: [PayPal – The safer, easier way to pay online.](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y8FFE7NA4LJWQ) 81 | Especially if need to buy new modules for testing. 82 | -------------------------------------------------------------------------------- /www/docs/files.htm: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Files 5 |
6 | 7 | 8 | 9 | 14 |
Uploading    10 | 11 | 12 | 13 |
15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 |
27 |
    28 |
  • 29 |
    30 |
    31 |
    32 |
    33 |
    34 |
    35 | 36 | 37 |
    38 |
    39 |
    40 |
  • 41 |
42 |
43 | 63 |
64 |
65 | 66 | -------------------------------------------------------------------------------- /www/tools/includes.js: -------------------------------------------------------------------------------- 1 | /* W3Data ver 1.31 by W3Schools.com */ 2 | var w3DataObject = {}; 3 | function w3DisplayData(id, data) { 4 | var htmlObj, htmlTemplate, html, arr = [], a, l, rowClone, x, j, i, ii, cc, repeat, repeatObj, repeatX = ""; 5 | htmlObj = document.getElementById(id); 6 | htmlTemplate = w3InitTemplate(id, htmlObj); 7 | html = htmlTemplate.cloneNode(true); 8 | arr = w3GetElementsByAttribute(html, "w3-repeat"); 9 | l = arr.length; 10 | for (j = (l - 1); j >= 0; j -= 1) { 11 | cc = arr[j].getAttribute("w3-repeat").split(" "); 12 | if (cc.length == 1) { 13 | repeat = cc[0]; 14 | } else { 15 | repeatX = cc[0]; 16 | repeat = cc[2]; 17 | } 18 | arr[j].removeAttribute("w3-repeat"); 19 | repeatObj = data[repeat]; 20 | if (repeatObj && typeof repeatObj == "object" && repeatObj.length != "undefined") { 21 | i = 0; 22 | for (x in repeatObj) { 23 | i += 1; 24 | rowClone = arr[j]; 25 | rowClone = w3NeedleInHaystack(rowClone, "element", repeatX, repeatObj[x]); 26 | a = rowClone.attributes; 27 | for (ii = 0; ii < a.length; ii += 1) { 28 | a[ii].value = w3NeedleInHaystack(a[ii], "attribute", repeatX, repeatObj[x]).value; 29 | } 30 | (i === repeatObj.length) ? arr[j].parentNode.replaceChild(rowClone, arr[j]) : arr[j].parentNode.insertBefore(rowClone, arr[j]); 31 | } 32 | } else { 33 | console.log("w3-repeat must be an array. " + repeat + " is not an array."); 34 | continue; 35 | } 36 | } 37 | html = w3NeedleInHaystack(html, "element"); 38 | htmlObj.parentNode.replaceChild(html, htmlObj); 39 | function w3InitTemplate(id, obj) { 40 | var template; 41 | template = obj.cloneNode(true); 42 | if (w3DataObject.hasOwnProperty(id)) {return w3DataObject[id];} 43 | w3DataObject[id] = template; 44 | return template; 45 | } 46 | function w3GetElementsByAttribute(x, att) { 47 | var arr = [], arrCount = -1, i, l, y = x.getElementsByTagName("*"), z = att.toUpperCase(); 48 | l = y.length; 49 | for (i = -1; i < l; i += 1) { 50 | if (i == -1) {y[i] = x;} 51 | if (y[i].getAttribute(z) !== null) {arrCount += 1; arr[arrCount] = y[i];} 52 | } 53 | return arr; 54 | } 55 | function w3NeedleInHaystack(elmnt, typ, repeatX, x) { 56 | var value, rowClone, pos1, haystack, pos2, needle = [], needleToReplace, i, cc, r; 57 | rowClone = elmnt.cloneNode(true); 58 | pos1 = 0; 59 | while (pos1 > -1) { 60 | haystack = (typ == "attribute") ? rowClone.value : rowClone.innerHTML; 61 | pos1 = haystack.indexOf("{{", pos1); 62 | if (pos1 === -1) {break;} 63 | pos2 = haystack.indexOf("}}", pos1 + 1); 64 | needleToReplace = haystack.substring(pos1 + 2, pos2); 65 | needle = needleToReplace.split("||"); 66 | value = undefined; 67 | for (i = 0; i < needle.length; i += 1) { 68 | needle[i] = needle[i].replace(/^\s+|\s+$/gm, ''); //trim 69 | //value = ((x && x[needle[i]]) || (data && data[needle[i]])); 70 | if (x) {value = x[needle[i]];} 71 | if (value == undefined && data) {value = data[needle[i]];} 72 | if (value == undefined) { 73 | cc = needle[i].split("."); 74 | if (cc[0] == repeatX) {value = x[cc[1]]; } 75 | } 76 | if (value == undefined) { 77 | if (needle[i] == repeatX) {value = x;} 78 | } 79 | if (value == undefined) { 80 | if (needle[i].substr(0, 1) == '"') { 81 | value = needle[i].replace(/"/g, ""); 82 | } else if (needle[i].substr(0,1) == "'") { 83 | value = needle[i].replace(/'/g, ""); 84 | } 85 | } 86 | if (value != undefined) {break;} 87 | } 88 | if (value != undefined) { 89 | r = "{{" + needleToReplace + "}}"; 90 | if (typ == "attribute") { 91 | rowClone.value = rowClone.value.replace(r, value); 92 | } else { 93 | w3ReplaceHTML(rowClone, r, value); 94 | } 95 | } 96 | pos1 = pos1 + 1; 97 | } 98 | return rowClone; 99 | } 100 | function w3ReplaceHTML(a, r, result) { 101 | var b, l, i, a, x, j; 102 | if (a.hasAttributes()) { 103 | b = a.attributes; 104 | l = b.length; 105 | for (i = 0; i < l; i += 1) { 106 | if (b[i].value.indexOf(r) > -1) {b[i].value = b[i].value.replace(r, result);} 107 | } 108 | } 109 | x = a.getElementsByTagName("*"); 110 | l = x.length; 111 | a.innerHTML = a.innerHTML.replace(r, result); 112 | } 113 | } 114 | function w3IncludeHTML() { 115 | var z, i, elmnt, file, xhttp; 116 | z = document.getElementsByTagName("*"); 117 | for (i = 0; i < z.length; i++) { 118 | elmnt = z[i]; 119 | file = elmnt.getAttribute("w3-include-html"); 120 | if (file) { 121 | xhttp = new XMLHttpRequest(); 122 | xhttp.onreadystatechange = function() { 123 | if (this.readyState == 4 && this.status == 200) { 124 | elmnt.innerHTML = this.responseText; 125 | elmnt.removeAttribute("w3-include-html"); 126 | w3IncludeHTML(); 127 | } 128 | } 129 | xhttp.open("GET", file, true); 130 | xhttp.send(); 131 | return; 132 | } 133 | } 134 | } 135 | function w3Http(target, readyfunc, xml, method) { 136 | var httpObj; 137 | if (!method) {method = "GET"; } 138 | if (window.XMLHttpRequest) { 139 | httpObj = new XMLHttpRequest(); 140 | } else if (window.ActiveXObject) { 141 | httpObj = new ActiveXObject("Microsoft.XMLHTTP"); 142 | } 143 | if (httpObj) { 144 | if (readyfunc) {httpObj.onreadystatechange = readyfunc;} 145 | httpObj.open(method, target, true); 146 | httpObj.send(xml); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /www/sub/controlspanel.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | Controls 7 |
8 |
9 |
10 |
11 |
12 | 16 |
17 | 18 | sec 19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 31 |
32 |
33 | 34 | 35 | 61 | 67 | 68 |
36 | 37 | 38 | 39 | 55 | 56 | 57 | 58 | 59 |
40 | 54 |
60 |
62 | 63 | 64 | 65 |
66 |
69 |
70 |
71 |
72 |
73 |
74 |

    75 | X: 76 |    77 | Y: 78 |    79 | Z: 80 |

81 |
82 |
83 |
84 |
85 | 107 |
108 | -------------------------------------------------------------------------------- /www/js/controls.js: -------------------------------------------------------------------------------- 1 | var interval_position=-1; 2 | var control_macrolist = []; 3 | 4 | function init_controls_panel(){ 5 | var value = get_localdata('autocheck_position'); 6 | if (value == 'true'){ 7 | document.getElementById('autocheck_position').checked =true; 8 | on_autocheck_position(); 9 | } 10 | loadmacrolist(); 11 | } 12 | 13 | function loadmacrolist() { 14 | control_macrolist = []; 15 | var url = "/macrocfg.json"; 16 | //removeIf(production) 17 | var response= "[{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":0},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":1},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":2},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":3},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":4},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":5},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":6},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":7},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":8}]"; 18 | processMacroGetSuccess(response); 19 | return; 20 | //endRemoveIf(production) 21 | SendGetHttp(url, processMacroGetSuccess, processMacroGetFailed); 22 | } 23 | 24 | function Macro_build_list(response_text){ 25 | var response = []; 26 | try { 27 | var response = JSON.parse(response_text); 28 | } 29 | catch (e) { 30 | console.error("Parsing error:", e); 31 | } 32 | for (var i = 0; i < 9 ; i++) { 33 | var entry; 34 | if ((response.length != 0) && (typeof(response[i].name ) !== 'undefined' && typeof(response[i].glyph ) !== 'undefined' && typeof(response[i].filename ) !== 'undefined' && typeof(response[i].target ) !== 'undefined' && typeof(response[i].class ) !== 'undefined' && typeof(response[i].index ) !== 'undefined' )) { 35 | entry = {name : response[i].name, glyph: response[i].glyph, filename : response[i].filename, target : response[i].target, class : response[i].class, index: response[i].index}; 36 | } 37 | else { 38 | entry = {name :'', glyph: '', filename : '', target : '', class : '', index: i}; 39 | } 40 | control_macrolist.push(entry); 41 | } 42 | control_build_macro_ui(); 43 | } 44 | 45 | function processMacroGetSuccess(response){ 46 | Macro_build_list(response); 47 | } 48 | 49 | function processMacroGetFailed(errorcode, response){ 50 | console.log("Error " + errorcode + " : " + response); 51 | Macro_build_list(response); 52 | } 53 | 54 | function on_autocheck_position(){ 55 | if (document.getElementById('autocheck_position').checked) { 56 | store_localdata('autocheck_position', true); 57 | var interval = parseInt(document.getElementById('posInterval_check').value); 58 | if (!isNaN(interval) && interval > 0 && interval < 100) { 59 | if (interval_position != -1 )clearInterval(interval_position); 60 | interval_position = setInterval(function(){ get_Position() }, interval * 1000); 61 | } 62 | else { 63 | document.getElementById('autocheck_position').checked = false; 64 | store_localdata('autocheck_position', false); 65 | document.getElementById('posInterval_check').value = 0; 66 | if (interval_position != -1 )clearInterval(interval_position); 67 | interval_position = -1; 68 | } 69 | } 70 | else { 71 | store_localdata('autocheck_position', false); 72 | if (interval_position != -1 )clearInterval(interval_position); 73 | interval_position = -1; 74 | } 75 | } 76 | 77 | function onPosIntervalChange(){ 78 | var interval = parseInt(document.getElementById('posInterval_check').value); 79 | if (!isNaN(interval) && interval > 0 && interval < 100 ) { 80 | on_autocheck_position(); 81 | } 82 | else { 83 | document.getElementById('autocheck_position').checked = false; 84 | document.getElementById('posInterval_check').value = 0; 85 | if (interval != 0)alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of auto-check must be between 0s and 99s !!")); 86 | on_autocheck_position(); 87 | } 88 | } 89 | 90 | function get_Position(){ 91 | var command = "M114"; 92 | //removeIf(production) 93 | var response = "ok C: X:0.0000 Y:0.0000 Z:0.0000 E:0.0000 "; 94 | process_Position(response); 95 | return; 96 | //endRemoveIf(production) 97 | SendPrinterCommand(command, false, process_Position); 98 | } 99 | 100 | function Control_get_position_value(label, result_data) { 101 | var result = ""; 102 | var pos1 = result_data.indexOf(label, 0); 103 | if (pos1 > -1){ 104 | pos1 += label.length; 105 | var pos2 = result_data.indexOf(" ", pos1); 106 | if (pos2 > -1){ 107 | result = result_data.substring(pos1,pos2); 108 | } else result = result_data.substring(pos1); 109 | } 110 | return result.trim(); 111 | } 112 | 113 | function process_Position(response){ 114 | document.getElementById('control_x_position').innerHTML = Control_get_position_value("X:", response); 115 | document.getElementById('control_y_position').innerHTML = Control_get_position_value("Y:", response); 116 | document.getElementById('control_z_position').innerHTML = Control_get_position_value("Z:", response); 117 | } 118 | 119 | function control_motorsOff(){ 120 | var command = "M84"; 121 | SendPrinterCommand(command, true); 122 | } 123 | 124 | function SendHomecommand (cmd){ 125 | SendPrinterCommand(cmd, true, get_Position); 126 | } 127 | 128 | function SendJogcommand(cmd, feedrate){ 129 | var feedratevalue = ""; 130 | var command =""; 131 | if (feedrate == "XYfeedrate") { 132 | feedratevalue = parseInt(document.getElementById('control_xy_velocity').value); 133 | if (feedratevalue < 1 || feedratevalue > 9999 || isNaN(feedratevalue) || (feedratevalue === null)) { 134 | alertdlg (translate_text_item("Out of range"), translate_text_item( "XY feedrate value must be between 1 mm/min and 9999 mm/min !")); 135 | document.getElementById('control_xy_velocity').value = get_localdata('xy_velocity'); 136 | return; 137 | } 138 | } else { 139 | feedratevalue = parseInt(document.getElementById('control_z_velocity').value); 140 | if (feedratevalue < 1 || feedratevalue > 999 || isNaN(feedratevalue) || (feedratevalue === null)) { 141 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Z feedrate value must be between 1 mm/min and 999 mm/min !")); 142 | document.getElementById('control_z_velocity').value = get_localdata('z_velocity'); 143 | return; 144 | } 145 | } 146 | command = "G91\nG1 " + cmd + " F" + feedratevalue + "\nG90"; 147 | SendPrinterCommand(command, true, get_Position); 148 | } 149 | 150 | function onXYvelocityChange () { 151 | var feedratevalue = parseInt(document.getElementById('control_xy_velocity').value); 152 | if (feedratevalue < 1 || feedratevalue > 9999 || isNaN(feedratevalue) || (feedratevalue === null)) { 153 | } 154 | else store_localdata('xy_velocity', feedratevalue); 155 | } 156 | 157 | function onZvelocityChange () { 158 | var feedratevalue = parseInt(document.getElementById('control_z_velocity').value); 159 | if (feedratevalue < 1 || feedratevalue > 999 || isNaN(feedratevalue) || (feedratevalue === null)) { 160 | } 161 | else store_localdata('z_velocity', feedratevalue); 162 | } 163 | 164 | 165 | function processMacroSave(answer){ 166 | if (answer == "ok"){ 167 | //console.log("now rebuild list"); 168 | control_build_macro_ui(); 169 | } 170 | } 171 | 172 | function control_build_macro_button(index){ 173 | var content = ""; 174 | var entry = control_macrolist[index]; 175 | content+=""; 190 | 191 | return content; 192 | } 193 | 194 | function control_build_macro_ui(){ 195 | var content = ""; 196 | for (var i = 0; i < 4 ; i++) { 197 | content+="" + control_build_macro_button(i) + ""; 198 | } 199 | document.getElementById('Macro_col1').innerHTML=content; 200 | content = ""; 201 | for (var i = 4; i <9 ; i++) { 202 | content+="" + control_build_macro_button(i) + ""; 203 | } 204 | document.getElementById('Macro_col2').innerHTML=content; 205 | } 206 | 207 | function macro_command (target, filename) { 208 | var cmd = "" 209 | if (target == "ESP") { 210 | cmd = "[ESP700]"+filename; 211 | } else if (target == "SD") { 212 | cmd = "play " + filename; 213 | if (target_firmware != "smoothieware"){ 214 | cmd = "M23 " + filename + "\nM24"; 215 | } 216 | } else return; 217 | //console.log(cmd); 218 | SendPrinterCommand(cmd); 219 | } 220 | 221 | -------------------------------------------------------------------------------- /www/sub/temperaturepanel.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | Temperatures 7 |
8 |
9 |
10 |
11 |
12 | 16 |
17 | 18 | sec 19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 63 | 64 | 65 | 66 | 67 | 91 | 92 | 93 | 94 | 95 | 119 | 120 | 121 | 122 |
NameOptionsValue | Target
Heater T0 40 |
41 |
42 |    49 |
50 | 51 | °C   52 |
53 | 60 |
61 |
62 |
Heater T1 68 |
69 |
70 |    77 |
78 | 79 | °C   80 |
81 | 88 |
89 |
90 |
Bed 96 |
97 |
98 |    105 |
106 | 107 | °C   108 |
109 | 116 |
117 |
118 |
123 |
    124 |
  • 125 |
    126 |
    127 | 128 |    129 |
    130 |
    131 | 132 |
    133 |
    134 |
  • 135 |
136 |
137 |
138 | -------------------------------------------------------------------------------- /www/js/temperatures.js: -------------------------------------------------------------------------------- 1 | var interval_temperature=-1; 2 | 3 | var smoothieextuder = new SmoothieChart( { 4 | millisPerPixel:200, 5 | maxValueScale:1.1, 6 | minValueScale: 1.1, 7 | enableDpiScaling: false, 8 | interpolation: 'linear', 9 | grid:{ 10 | fillStyle:'#ffffff', 11 | strokeStyle:'rgba(128,128,128,0.5)', 12 | verticalSections:5., 13 | millisPerLine:0, 14 | borderVisible: false 15 | }, 16 | labels:{ 17 | fillStyle:'#000000', 18 | precision:1 19 | } 20 | }); 21 | var smoothiebed = new SmoothieChart( { 22 | millisPerPixel:200, 23 | interpolation: 'linear', 24 | maxValueScale:1.1, 25 | minValueScale: 1.1, 26 | enableDpiScaling: false, 27 | grid:{ 28 | fillStyle:'#ffffff', 29 | strokeStyle:'rgba(128,128,128,0.5)', 30 | verticalSections:5., 31 | millisPerLine:0, 32 | borderVisible: false 33 | }, 34 | labels:{ 35 | fillStyle:'#000000', 36 | precision:1 37 | } 38 | }); 39 | var extruder_0_line = new TimeSeries(); 40 | var extruder_1_line = new TimeSeries(); 41 | var bed_line = new TimeSeries(); 42 | 43 | function init_temperature_panel(){ 44 | var value = get_localdata('autocheck_temperature'); 45 | if (value == 'true'){ 46 | document.getElementById('autocheck_temperature').checked =true; 47 | on_autocheck_temperature(); 48 | } 49 | smoothiebed.addTimeSeries(bed_line,{lineWidth:1,strokeStyle:'#808080',fillStyle:'rgba(128,128,128,0.3)'}); 50 | smoothieextuder.addTimeSeries(extruder_0_line,{lineWidth:1,strokeStyle:'#ff8080',fillStyle:'rgba(255,128,128,0.3)'}); 51 | smoothieextuder.streamTo(document.getElementById("extruderTempgraph"),3000 /*delay*/); 52 | smoothiebed.streamTo(document.getElementById("bedTempgraph"),3000 /*delay*/); 53 | } 54 | 55 | function temperature_second_extruder(enabled){ 56 | if (enabled){ 57 | smoothieextuder.addTimeSeries(extruder_1_line,{lineWidth:1,strokeStyle:'#000080'}); 58 | } 59 | else { 60 | smoothieextuder.removeTimeSeries(extruder_1_line); 61 | } 62 | } 63 | 64 | function start_graph_output(){ 65 | document.getElementById('temperatures_output').style.display='block'; 66 | smoothieextuder.start(); 67 | smoothiebed.start(); 68 | } 69 | 70 | function stop_graph_output(){ 71 | smoothieextuder.stop(); 72 | smoothiebed.stop(); 73 | } 74 | 75 | function on_autocheck_temperature(){ 76 | if (document.getElementById('autocheck_temperature').checked) { 77 | store_localdata('autocheck_temperature', true); 78 | var interval = parseInt(document.getElementById('tempInterval_check').value); 79 | if (!isNaN(interval) && interval > 0 && interval < 100) { 80 | if (interval_temperature != -1 )clearInterval(interval_temperature); 81 | interval_temperature = setInterval(function(){ get_Temperatures() }, interval * 1000); 82 | start_graph_output(); 83 | } 84 | else { 85 | document.getElementById('autocheck_temperature').checked = false; 86 | store_localdata('autocheck_temperature', false); 87 | document.getElementById('tempInterval_check').value = 0; 88 | if (interval_temperature != -1 )clearInterval(interval_temperature); 89 | interval_temperature = -1; 90 | stop_graph_output(); 91 | } 92 | } 93 | else { 94 | store_localdata('autocheck_temperature', false); 95 | if (interval_temperature != -1 )clearInterval(interval_temperature); 96 | interval_temperature = -1; 97 | stop_graph_output(); 98 | } 99 | } 100 | 101 | function onTempIntervalChange(){ 102 | var interval = parseInt(document.getElementById('tempInterval_check').value); 103 | if (!isNaN(interval) && interval > 0 && interval < 100 ) { 104 | on_autocheck_temperature(); 105 | } 106 | else { 107 | document.getElementById('autocheck_temperature').checked = false; 108 | document.getElementById('tempInterval_check').value = 0; 109 | if (interval != 0)alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of auto-check must be between 0s and 99s !!")); 110 | on_autocheck_temperature(); 111 | } 112 | } 113 | 114 | function get_Temperatures(){ 115 | var command = "M105"; 116 | //removeIf(production) 117 | var response = ""; 118 | if (document.getElementById('autocheck_temperature').checked ) response = "ok T:26.4 /0.0 T1:26.4 /0.0 @0 B:24.9 /0.0 @0 \n"; 119 | else response = "ok T:26.4 /0.0 @0 B:24.9 /0.0 @0\n "; 120 | process_Temperatures(response); 121 | return; 122 | //endRemoveIf(production) 123 | SendPrinterCommand(command, false, process_Temperatures); 124 | } 125 | 126 | function process_Temperatures(response){ 127 | Monitor_output_Update(response); 128 | var regex_temp = /(B|T(\d*)):\s*([+]?[0-9]*\.?[0-9]+)? (\/)([+]?[0-9]*\.?[0-9]+)?/gi; 129 | var result; 130 | var timedata = new Date().getTime(); 131 | while ((result = regex_temp.exec(response)) !== null) { 132 | var tool = result[1]; 133 | var value = parseFloat(result[3]).toFixed(2).toString()+ "°C"; 134 | var value2; 135 | if (isNaN(parseFloat(result[5]))) value2 = "0.00"; 136 | else value2 = parseFloat(result[5]).toFixed(2).toString(); 137 | value += " | " + value2 + "°C"; 138 | if (tool == "T") { 139 | //to push to graph 140 | extruder_0_line.append(timedata, parseFloat(result[3])); 141 | //test for second extruder 142 | //extruder_1_line.append(timedata, parseFloat(result[3])+Math.random()); 143 | document.getElementById('heaterT0DisplayTemp').innerHTML = value; 144 | //to see if heating or not 145 | if (Number(value2) >0)document.getElementById('heaterT0TargetTemp_anime').style.display="block"; 146 | else document.getElementById('heaterT0TargetTemp_anime').style.display="none"; 147 | } 148 | else if (tool == "T1") { 149 | extruder_1_line.append(timedata, parseFloat(result[3])); 150 | document.getElementById('heaterT1DisplayTemp').innerHTML = value; 151 | if (Number(value2) >0)document.getElementById('heaterT1TargetTemp_anime').style.display="block"; 152 | else document.getElementById('heaterT1TargetTemp_anime').style.display="none"; 153 | } 154 | if (tool == "B") { 155 | bed_line.append(timedata, parseFloat(result[3])); 156 | document.getElementById('bedDisplayTemp').innerHTML = value; 157 | if (Number(value2) >0)document.getElementById('bedTargetTemp_anime').style.display="block"; 158 | else document.getElementById('bedTargetTemp_anime').style.display="none"; 159 | } 160 | } 161 | } 162 | 163 | function temperature_heatOff(target){ 164 | switch (target) { 165 | case 'T0': 166 | document.getElementById('heaterT0SelectedTemp').value = 0; 167 | document.getElementById('heaterT0TargetTemp_anime').style.display="none"; 168 | break; 169 | case 'T1': 170 | document.getElementById('heaterT1SelectedTemp').value = 0; 171 | document.getElementById('heaterT1TargetTemp_anime').style.display="none"; 172 | break; 173 | case 'bed': 174 | document.getElementById('bedSelectedTemp').value = 0; 175 | document.getElementById('bedTargetTemp_anime').style.display="none"; 176 | break; 177 | } 178 | var type = (target == 'bed')? 140 : 104; 179 | var command = "M" + type + " S0"; 180 | if (target != 'bed'){ 181 | command+= " " + target; 182 | } 183 | SendPrinterCommand(command, true, get_Temperatures); 184 | } 185 | 186 | function temperature_handleKeyUp(event, target){ 187 | if (event.keyCode == 13) { 188 | temperature_heatSet(target); 189 | } 190 | return true; 191 | } 192 | 193 | function temperature_heatSet(target){ 194 | var selectedTemp = 0; 195 | switch (target) { 196 | case 'T0': 197 | selectedTemp = parseInt(document.getElementById('heaterT0SelectedTemp').value); 198 | if (selectedTemp < 0 || selectedTemp > 999 || isNaN(selectedTemp) || (selectedTemp === null)) { 199 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0 degres and 999 degres !")); 200 | return; 201 | } 202 | break; 203 | case 'T1': 204 | selectedTemp = parseInt(document.getElementById('heaterT1SelectedTemp').value); 205 | if (selectedTemp < 0 || selectedTemp > 999 || isNaN(selectedTemp) || (selectedTemp === null)) { 206 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0 degres and 999 degres !")); 207 | return; 208 | } 209 | break; 210 | case 'bed': 211 | selectedTemp = parseInt(document.getElementById('bedSelectedTemp').value); 212 | if (selectedTemp < 0 || selectedTemp > 999 || isNaN(selectedTemp) || (selectedTemp === null)) { 213 | alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0 degres and 999 degres !")); 214 | return; 215 | } 216 | break; 217 | } 218 | 219 | var type = (target == 'bed')? 140 : 104; 220 | var command = "M" + type + " S" + selectedTemp; 221 | if (target != 'bed'){ 222 | command+= " " + target; 223 | } 224 | SendPrinterCommand(command, true, get_Temperatures); 225 | } 226 | -------------------------------------------------------------------------------- /www/images/jogdial.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 53 | 54 | 55 | 56 | 57 | HomeIcon - house 58 | 59 | 60 | 61 | 62 | X 63 | Y 64 | Z 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 0.1 88 | 89 | 90 | 91 | 1 92 | 93 | 94 | 95 | 10 96 | 97 | 98 | 99 | 100 100 | 101 | 102 | +Y -Y -X +X 103 | 104 | JogBar - Z jogging bar 105 | +Z 106 | -Z 107 | 108 | 109 | 110 | 10 111 | 112 | 113 | 114 | 115 | 116 | 1 117 | 118 | 119 | 120 | 121 | 122 | 0.1 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | --------------------------------------------------------------------------------