forked from FOSS/BangleApps
Allow hiding the description
parent
57e25085dc
commit
fd8c1c237f
|
@ -3,8 +3,8 @@
|
|||
<link rel="stylesheet" href="../../css/spectre.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<input type="radio" id="useURL" name="mode" checked/>
|
||||
<label for="useURL">Use URL:</label>
|
||||
<input type="radio" id="useURL" name="mode" checked/>
|
||||
<label for="useURL">Use URL:</label>
|
||||
<input type="text" id="url" class="form-input" value="http://espruino.com">
|
||||
<hr>
|
||||
<input type="radio" id="useWIFI" name="mode"/>
|
||||
|
@ -25,6 +25,14 @@
|
|||
<input type="checkbox" id="hidden" name="hidden"/>
|
||||
<label for="hidden">Wifi is hidden</label>
|
||||
</div>
|
||||
<hr>
|
||||
<p>Additional options:</p>
|
||||
<input type="checkbox" id="hideDescription" name="minimize"/>
|
||||
<label for="hideDescription">Hide Description</label></br>
|
||||
<label for="description">Replace default description:</label>
|
||||
<input type="text" id="description" class="form-input" value="">
|
||||
|
||||
<hr>
|
||||
<p>Try your QR Code: <div id="qrcode"></div></p>
|
||||
<p>Click <button id="upload" class="btn btn-primary">Upload</button></p>
|
||||
|
||||
|
@ -101,14 +109,18 @@
|
|||
if(document.getElementById("useWIFI").checked){
|
||||
content = document.getElementById("ssid").value
|
||||
}
|
||||
if(!(document.getElementById("description").value === "")){
|
||||
content = document.getElementById("description").value;
|
||||
}
|
||||
var img = imageconverter.canvastoString(document.getElementsByTagName("canvas")[0],{mode:"1bit",output:"string",compression:true});
|
||||
var app = `var img = ${img};
|
||||
var content = ${JSON.stringify(content)};
|
||||
${ document.getElementById("hideDescription").checked ? '' : `var content = ${JSON.stringify(content)};`}
|
||||
g.clear(1).setColor(1,1,1).setBgColor(0,0,0);
|
||||
g.fillRect(0,0,g.getWidth()-1,g.getHeight()-1);
|
||||
g.drawImage(img,(g.getWidth()-img[0])/2,(g.getHeight()-img[1])/2);
|
||||
g.setFontAlign(0,0).setFont("6x8").setColor(0,0,0);
|
||||
g.drawString(content,g.getWidth()/2,g.getHeight()-(g.getHeight()-img[1])/4);
|
||||
${ document.getElementById("hideDescription").checked ? '' : `g.setFontAlign(0,0).setFont("6x8").setColor(0,0,0);
|
||||
g.drawString(content,g.getWidth()/2,g.getHeight()-(g.getHeight()-img[1])/4));
|
||||
`}
|
||||
g.setColor(1,1,1);
|
||||
`;
|
||||
sendCustomizedApp({
|
||||
|
|
Loading…
Reference in New Issue