Fix display issue in firefox

Fix sendcommand function to set as GET instead as POST as new ESP core
is less permissive and do not take GET argument in POST request anymore
change FW version for tracking
This commit is contained in:
luc lebosse 2016-07-12 15:03:14 +02:00
parent fda0657369
commit 25cce3a70f
3 changed files with 18 additions and 14 deletions

View File

@ -68,7 +68,7 @@
#include <Arduino.h> #include <Arduino.h>
#include "wifi.h" #include "wifi.h"
//version and sources location //version and sources location
#define FW_VERSION "0.7.8" #define FW_VERSION "0.7.81"
#define REPOSITORY "https://github.com/luc-github/ESP8266" #define REPOSITORY "https://github.com/luc-github/ESP8266"

View File

@ -154,7 +154,7 @@ var Efeedrate=$E_FEEDRATE$;
function Sendcommand(commandtxt){ function Sendcommand(commandtxt){
var xmlhttp = new XMLHttpRequest(); var xmlhttp = new XMLHttpRequest();
var url = "http://$WEB_ADDRESS$/CMD?COM="+encodeURIComponent(commandtxt);; var url = "http://$WEB_ADDRESS$/CMD?COM="+encodeURIComponent(commandtxt);;
xmlhttp.open("POST", url, true); xmlhttp.open("GET", url, true);
xmlhttp.send(); xmlhttp.send();
} }
@ -196,19 +196,22 @@ var pulse=true;
var initialization_done = false; var initialization_done = false;
var pos=0; var pos=0;
function displaytemp(temperature, target,item,factor){ function displaytemp(temperature, target,item,factor){
var displaypicture = "<svg height=\"30px \" width=\"300px \" xmlns=\"http://wwww.w3.org/2000/svg\">\n<linearGradient id=\"gradient\">\n"; var displaypicture = "<svg width='300' height='30' viewBox='0 0 300 30'>\n";
var description = String (temperature) + "/"; var description = String (temperature) + "/";
if (target>0)description += String (target); if (target>0)description += String (target);
else description += "Off "; else description += "Off ";
displaypicture+="<stop class=\"begin\" style=\"stop-color:green;\" offset=\"0%\"/>\n"; displaypicture+="<defs><linearGradient id='grad1' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:#0007FE;stop-opacity:1' />\n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"100%\"/>\n</linearGradient>\n<linearGradient id=\"gradient2\">\n"; displaypicture+="<stop offset='100%' style='stop-color:#00FAFE;stop-opacity:1' /></linearGradient>/n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"0%\"/>\n<stop class=\"end\" style=\"stop-color:red;\" offset=\"100%\"/>\n"; displaypicture+="<linearGradient id='grad2' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:#00FAFE;stop-opacity:1' />\n";
displaypicture+="</linearGradient>\n<rect x=\"10\" y=\"4\" width=\""; displaypicture+="<stop offset='100%' style='stop-color:#00FF00;stop-opacity:1' /></linearGradient>\n";
displaypicture+= String(Math.round( 24*factor )); displaypicture+="<linearGradient id='grad3' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:#00FF00;stop-opacity:1' />\n"
displaypicture+="\" height=\"21\" style=\"fill:url(#gradient)\" />\n"; displaypicture+="<stop offset='100%' style='stop-color:#FAFD00;stop-opacity:1' /></linearGradient>\n";
displaypicture+="<rect x=\""; displaypicture+="<linearGradient id='grad4' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:#FAFD00;stop-opacity:1' />\n";
displaypicture+= String(10+Math.round( 24*factor )); displaypicture+="<stop offset='100%' style='stop-color:#FE0700;stop-opacity:1' /></linearGradient></defs>\n";
displaypicture+="\" y=\"4\" width=\"280\" height=\"21\" style=\"fill:url(#gradient2)\" />\n<line x1=\""; displaypicture+="<rect x='10' y='4' width='70' height='21' fill='url(#grad1)' /><rect x='80' y='4' width='70' height='21' fill='url(#grad2)' />\n";
displaypicture+="<rect x='150' y='4' width='70' height='21' fill='url(#grad3)' /><rect x='220' y='4' width='70' height='21' fill='url(#grad4)' />\n";
displaypicture+="<rect x='10' y='4' width='280' height='21' fill='none' stroke-width='1' stroke='#C3BDB5' />\n";
displaypicture+="<line x1=\"";
displaypicture+=String(parseFloat(target)*factor+10); displaypicture+=String(parseFloat(target)*factor+10);
displaypicture+="\" y1=\"4\" x2=\""; displaypicture+="\" y1=\"4\" x2=\"";
displaypicture+=String(parseFloat(target)*factor+10); displaypicture+=String(parseFloat(target)*factor+10);
@ -226,7 +229,8 @@ displaypicture+=" 30 L";
displaypicture+=String(parseFloat(temperature)*factor+10); displaypicture+=String(parseFloat(temperature)*factor+10);
displaypicture+=" 22 Z\" stroke=\"white\" stroke-width=\"1\"/>\n<text x=\"30\" y=\"19\" fill=\"black\" style=\"font-family: calibri; font-size:10pt;\">\n"; displaypicture+=" 22 Z\" stroke=\"white\" stroke-width=\"1\"/>\n<text x=\"30\" y=\"19\" fill=\"black\" style=\"font-family: calibri; font-size:10pt;\">\n";
displaypicture+=description; displaypicture+=description;
displaypicture+=" &#176;C</text>\n</svg>"; displaypicture+=" &#176;C</text>\n";
displaypicture+=" </svg>\n";
document.getElementById(item).innerHTML=displaypicture; document.getElementById(item).innerHTML=displaypicture;
} }
function displaystatus(status){ function displaystatus(status){

View File

@ -104,7 +104,7 @@ for (var i=0;i <jsonresponse.files.length;i++){
if (String(jsonresponse.files[i].size) != "-1") if (String(jsonresponse.files[i].size) != "-1")
{ {
content +="<TR>"; content +="<TR>";
content +="<td><svg height='24' width='24' viewBox='0 0 24 24' > <path d='M1,2 L1,21 L2,22 L16,22 L17,21 L17,6 L12,6 L12,1, L2,1 z' stroke='black' fill='white' /> <line x1='12' y1='1' x2='17' y2='6' stroke='black' stroke-width='1'/>"; content +="<td><svg height='24' width='24' viewBox='0 0 24 24' > <path d='M1,2 L1,21 L2,22 L16,22 L17,21 L17,6 L12,6 L12,1 L2,1 z' stroke='black' fill='white' /><line x1='12' y1='1' x2='17' y2='6' stroke='black' stroke-width='1'/>";
content +="<line x1='5' y1='10' x2='13' y2='10' stroke='black' stroke-width='1'/> <line x1='5' y1='14' x2='13' y2='14' stroke='black' stroke-width='1'/> <line x1='5' y1='18' x2='13' y2='18' stroke='black' stroke-width='1'/></svg></td>"; content +="<line x1='5' y1='10' x2='13' y2='10' stroke='black' stroke-width='1'/> <line x1='5' y1='14' x2='13' y2='14' stroke='black' stroke-width='1'/> <line x1='5' y1='18' x2='13' y2='18' stroke='black' stroke-width='1'/></svg></td>";
content +="<TD class='btnimg' style=\"padding:0px;\"><a href=\""+jsonresponse.path+jsonresponse.files[i].name+"\" target=_blank><div class=\"blacklink\">"; content +="<TD class='btnimg' style=\"padding:0px;\"><a href=\""+jsonresponse.path+jsonresponse.files[i].name+"\" target=_blank><div class=\"blacklink\">";
content +=jsonresponse.files[i].name; content +=jsonresponse.files[i].name;