Skip to content

Commit

Permalink
Version 1.2.0-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
dzatoah committed Mar 12, 2020
1 parent 5bc46e2 commit bae0b17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 88 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "makrotastatur",
"productName": "Makrotastatur",
"version": "1.1.23-alpha",
"version": "1.2.0-alpha",
"description": "Programmiere deine Makrotastatur mit diesem Programm.",
"main": "src/main.js",
"scripts": {
Expand Down
17 changes: 9 additions & 8 deletions src/programButton.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3 id="titleText" class="text-right">Makrotastatur - Taster bearbeiten</h3>
</tr>
</table>
<div id="commandNavbar" class="m-0 mt-3 btn-group fixed-bottom row w-100">
<input type="submit" class="btn btn-success" onclick="sendButton()"></input>
<input type="submit" class="btn btn-success"></input>
<!-- TODO: We have the data to precudurally generate buttons... Commandid needs to be replaced with cmnd_idstr -->
<button type="button" class="btn btn-danger">Record</button> <!-- TODO: open modal and record key combination -->
</div>
Expand Down Expand Up @@ -158,6 +158,7 @@ <h3 id="titleText" class="text-right">Makrotastatur - Taster bearbeiten</h3>

$('#programForm').submit(function( event ) {
//submitForm(event, this);
sendButton();
event.preventDefault(true);
});

Expand Down Expand Up @@ -268,8 +269,8 @@ <h3 id="titleText" class="text-right">Makrotastatur - Taster bearbeiten</h3>
switch (cmnd['cmnd_str']) {
case 'CMND_STRING': {
commandSpecificElement = `
<!-- pattern='[\\w,.!?+\\-#*\\s]+' -->
<input value="`+cmnd['value']+`" name="string" class='p-1 m-0 mt-2 mx-2 form-control d-inline-block' type='text' wrap='off' pattern='[\\w,.!?+\\-#*\\s]+' style='max-width:95%; width:95%;'></input>
<!-- pattern='[\\w!?.,:;\"$%&/\\()=ßÖÄÜöäü_-'#*+\`^\\s]+' -->
<input value="`+cmnd['value']+`" name="string" class='p-1 m-0 mt-2 mx-2 form-control d-inline-block' type='text' wrap='off' pattern='[\\w!?\\.,:;\"$%&/\\()=ßÖÄÜöäü_\\-#*+\`^\\s]+' style='max-width:95%; width:95%;'></input>
<p class='text-muted text-right mr-3 pb-0 mb-0' style='font-size: 80%;'>do not use special characters except punctuation marks</p>
`;
break;
Expand Down Expand Up @@ -353,11 +354,11 @@ <h3 id="titleText" class="text-right">Makrotastatur - Taster bearbeiten</h3>

switch (cmnd_idstr) {
case 'CMND_STRING': {
html_tablerow = html_tablerow.replace("<VALUE>",
`<!-- pattern='[\\w,.!?+\\-#*\\s]+' -->
<input name="string" class='p-1 m-0 mt-2 mx-2 form-control d-inline-block' type='text' wrap='off' pattern='[\\w,.!?+\\-#*\\s]+' style='max-width:95%; width:95%;'></input>
<p class='text-muted text-right mr-3 pb-0 mb-0' style='font-size: 80%;'>do not use special characters except punctuation marks</p>
`);
html_tablerow = html_tablerow.replace("<VALUE>",`
<!-- pattern='[\\w!?.,:;\"$%&/\\()=ßÖÄÜöäü_-'#*+\`^\\s]+' -->
<input name="string" class='p-1 m-0 mt-2 mx-2 form-control d-inline-block' type='text' wrap='off' pattern='[\\w!?\\.,:;\"$%&/\\()=ßÖÄÜöäü_\\-#*+\`^\\s]+' style='max-width:95%; width:95%;'></input>
<p class='text-muted text-right mr-3 pb-0 mb-0' style='font-size: 80%;'>do not use special characters except punctuation marks</p>
`);
break;
}
case 'CMND_DELAY': {
Expand Down
79 changes: 0 additions & 79 deletions src/selectButton.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,85 +307,6 @@ <h5>Technische Informationen</h5>

console.warn(buttonCommands);
}

function addCommand(commandid) {
var html_tablerow = `
<tr commandid="<CMNDID>" style="width: 75%; border-top: 1px solid gray;" class='p-0 pl-2 pr-2 pt-2 m-0'>
<td id="commandlabel" class='m-0 p-0' style="border-right: 1px solid gray;">
<img src="imgs/movable.png" alt="::" style="max-width: 20px; filter: opacity(50%);" class="m-0 p-0 d-inline-block float-left"></img> <COMMAND>
</td>
<td id="value">
<VALUE>
</td>
</tr>`;

if (commandid == 1) {
html_tablerow = html_tablerow.replace("<COMMAND>", "String");
html_tablerow = html_tablerow.replace("<VALUE>",
`<!-- pattern='[\\w,.!?+\\-#*\\s]+' -->
<input name="string" class='p-1 m-0 mt-2 mx-2 form-control d-inline-block' type='text' wrap='off' pattern='[\\w,.!?+\\-#*\\s]+' style='max-width:95%; width:95%;'></input>
<p class='text-muted text-right mr-3 pb-0 mb-0' style='font-size: 80%;'>do not use special characters except punctuation marks</p>
`);
} else if (commandid == 2) {
html_tablerow = html_tablerow.replace("<COMMAND>", "Delay");
html_tablerow = html_tablerow.replace("<VALUE>",
`<input name="time" class="p-1 my-3 mx-2 form-control d-inline-block" min="0" style="max-width: 95%; width: 95%;" max="65536" type="number"></input>
`);
} else if (commandid == 3) {
html_tablerow = html_tablerow.replace("<COMMAND>", "Mod Key Press");
} else if (commandid == 4) {
html_tablerow = html_tablerow.replace("<COMMAND>", "Mod Key Release");
} else {
return false;
}

if (commandid == 3 || commandid == 4) {
html_tablerow = html_tablerow.replace("<VALUE>",`
<select class="form-control p-0 my-3 mx-2 d-inline-block selectList" style="max-width: 95%; width: 95%;">
<option>128 - LEFT CTRL</option>
<option>129 - LEFT SHIFT</option>
<option>130 - LEFT ALT</option>
<option>131 - LEFT GUI</option>
<option>132 - RIGHT CTRL</option>
<option>133 - RIGHT SHIFT</option>
<option>134 - RIGHT ALT</option>
<option>135 - RIGHT GUI</option>
<option>176 - RETURN</option>
<option>177 - ESC</option>
<option>178 - BACKSPACE</option>
<option>179 - TAB</option>
<option>215 - RIGHT ARROW</option>
<option>216 - LEFT ARROW</option>
<option>217 - DOWN ARROW</option>
<option>218 - UP ARROW</option>
<option>209 - INSERT</option>
<option>212 - DELETE</option>
<option>211 - PAGE UP</option>
<option>214 - PAGE DOWN</option>
<option>210 - HOME</option>
<option>213 - END</option>
<option>193 - CAPS LOCK</option>
<option>194 - F1</option>
<option>195 - F2</option>
<option>196 - F3</option>
<option>197 - F4</option>
<option>198 - F5</option>
<option>199 - F6</option>
<option>200 - F7</option>
<option>201 - F8</option>
<option>202 - F9</option>
<option>203 - F10</option>
<option>204 - F11</option>
<option>205 - F12</option>
</select>`
);
}

html_tablerow = html_tablerow.replace("<CMNDID>", commandid);
$("#programList").append(html_tablerow);

return true;
}
</script>

<style>
Expand Down

0 comments on commit bae0b17

Please sign in to comment.