Skip to content
Browse files

Revert "Changed radio button design to better fit in with the Bootsra…

…p UI"

This reverts commit d41ccec.
  • Loading branch information...
1 parent d41ccec commit 7f4a81ab3f92a762fda27b4a54be2591f0985e4d @Stankec committed Apr 22, 2012
Showing with 15 additions and 27 deletions.
  1. +15 −27 main.html
View
42 main.html
@@ -84,16 +84,13 @@
<button type="button" class="btn btn-primary" id="frisc-clear"><i class="icon-remove-sign icon-white"></i> Clear</button>
</div>
<div id="cpuout" style="font-size: 10pt; font-family: courier new; background-color: #D4CDCF; width: 650px; height: 150px; overflow: auto; border: 1px solid #666; padding: 8px; margin-top: 15px; color: black;"></div>
- <div id="frisc-memcontrols" class="form-inline" style="width: 666px; margin-top: 15px;">
+ <div id="frisc-memcontrols" class="form-inline" style="width: 650px; margin-top: 15px;">
<label>Lower memory bound:</label>
<input type="text" class="input-mini" id="frisc-mem-lower" value="0" />
<label>Upper memory bound:</label>
<input type="text" class="input-mini" id="frisc-mem-upper" value="100" />
- <div class="btn-group" data-toggle-name="dec_or_hex" style="display:inline-block; vertical-align: middle;" data-toggle="buttons-radio">
- <button type="button" value="10" class="btn" data-toggle="button" id="skrBaseRadioDec">DEC</button>
- <button type="button" value="16" class="btn" data-toggle="button" id="skrBaseRadioHex">HEX</button>
- </div>
- <input type="hidden" name="dec_or_hex" value="16" id="skrBaseHolder" />
+ <label class="radio"> <input type="radio" name="optionsRadios" id="skrBaseRadioDec" value="option1" checked=""> DEC </label>
+ <label class="radio"> <input type="radio" name="optionsRadios" id="skrBaseRadioHex" value="option2"> HEX </label>
<button type="button" class="btn" id="frisc-mem-refresh">Show memory state</button>
</div>
<div id="memout" style="font-size: 10pt; font-family: courier new; background-color: #D4CDCF; width: 650px; height: 150px; overflow: auto; border: 1px solid #666; padding: 8px; margin-top: 15px; color: black;"></div>
@@ -180,9 +177,17 @@
$("#memout").html(text);
}
+ function getBase () {
+ if ($("#skrBaseRadioDec").is(':checked')) {
+ return 10;
+ } else {
+ return 16;
+ }
+ }
+
function getMemState(lower, upper) {
var memStateString = "";
- var base = $("#skrBaseHolder").val();
+ var base = getBase();
for (var i=lower; i>=0 && i<simulator.MEM._memory.length && i<upper; i+=4) {
var decoded = simulator.CPU._decode(simulator.MEM.read(i));
@@ -330,31 +335,14 @@
var lower = parseInt($("#frisc-mem-lower").val());
var higher = parseInt($("#frisc-mem-upper").val());
- if($("#skrBaseHolder").val() === 16) { //If HEX
+ if(getBase() === 16) { //If HEX
lower = parseInt($("#frisc-mem-lower").val(), 16);
higher = parseInt($("#frisc-mem-upper").val(), 16);
}
memLog(getMemState(lower, higher));
});
-
- //Enables segmented buttons
- $('div.btn-group[data-toggle-name=*]').each(function(){
- var group = $(this);
- var form = group.parents().eq(0);
- var name = group.attr('data-toggle-name');
- var hidden = $('input[name="' + name + '"]', form);
- $('button', group).each(function(){
- var button = $(this);
- button.click(function(){
- hidden.val($(this).val());
- $('button', group).each(function(){
- $(this).removeClass('active');
- });
- button.addClass('active');
- });
- //Initial setup
- if(button.val() == hidden.val()) button.addClass('active');
- });
+ $("#skrBaseRadioDec, #skrBaseRadioHex").click(function() {
+ // $("#frisc-mem-refresh").click();
});
</script>
</script>

0 comments on commit 7f4a81a

Please sign in to comment.
Something went wrong with that request. Please try again.