diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/mapspecs.js | 56 |
1 files changed, 22 insertions, 34 deletions
diff --git a/js/mapspecs.js b/js/mapspecs.js index 3e649fd..0f9be4a 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -330,12 +330,14 @@ function animatePath(path, mapid, start, pathNumber) { }
function animatePathDone(mapid) {
- if (typeof(currentPage) == "object")
- scoresRequestPage(mapid, currentPage[mapid]);
document.getElementById(mapid+',btn').disabled = false;
if (isChallenge == true) {
challengeGo(mapid);
+ }
+ if (typeof(currentPage) == "object") {
+ scoresRequestPage(mapid, currentPage[mapid]);
}
+
//Mark off challenges
//TODO: This hack is stupidd :(
if(isChallenge && isTutorial == false)
@@ -355,7 +357,7 @@ function animatePathDone(mapid) { }
function checkSound(mapid) {
- if (document.getElementById(mapid+',mute').checked) {
+ if (getCookie('pref_mute') == 'true') {
return false;
}
if (typeof(soundManager) != 'object') {
@@ -901,22 +903,22 @@ function mapAsHTML(map, targetWidth, mapEditor) { }
}
}
- mapgrid += '</div>';
+ mapgrid += '</div><div style="clear:both"></div>';
if (mapEditor == true) return mapgrid;
var r = '';
//TODO: Track down where that 1 pixel is comingfrom, width-1 is a hack.
- r += "<div id='"+map.ID+",outer' class='grid_outer' style='width:"+(width)+"px;height:"+(height+60)+"px;'>";
+ r += "<div id='"+map.ID+",outer' class='grid_outer' style='width:"+(width)+"px;height:"+(height+45)+"px;'>";
- r += " <div class='grid_dsp_left dsp_60'>";
+ r += " <div class='grid_dsp_left' style='width:60%;'>";
r += " <div id='"+map.ID+",dspID' title='MapID: "+map.ID+"'>";
r += " MapID: "+map.ID;
r += " </div>";
r += " </div>";
- r += " <div id='"+map.ID+",dsptr' class='grid_dsp_right dsp_33'>";
+ r += " <div id='"+map.ID+",dsptr' class='grid_dsp_right' style='width:38%;'>";
r += " <span id='"+map.ID+",dspWalls' class='grid_dsp_data'> ";
r += " "+map.walls+" walls";
r += " </span>";
@@ -928,19 +930,17 @@ function mapAsHTML(map, targetWidth, mapEditor) { r += mapgrid;
- r += " <div id='"+map.ID+",dspbl' class='grid_dsp_left dsp_49'> ";
+ r += " <div id='"+map.ID+",dspbl' class='grid_dsp_left' style='width:60%;'> ";
r += " <input id='"+map.ID+",btn' type='button' onclick='doSend("+map.ID+")' value='Go!' />";
r += " Speed:";
r += getSpeedOptions(map.ID);
r += " </div>";
- // stopped here, mute button next
-
- r += " <div class='grid_dsp_mid dsp_16'>";
+ r += " <div class='grid_dsp_mid' style='width:5%;'>";
r += getMuteOption(map.ID);
r += " </div>";
- r += " <div id='"+map.ID+",dspbr' class='grid_dsp_right dsp_33'> ";
+ r += " <div id='"+map.ID+",dspbr' class='grid_dsp_right' style='width:34%;'> ";
r += " <div id='"+map.ID+",dspCount' class='grid_dsp_data'> ";
r += " 0 moves";
r += " </div>";
@@ -981,36 +981,24 @@ function mapThumbnailHTML(map, targetWidth, isActive) { return r;
}
-
-
-var ignoreMuteChecks = false;
function setMute(value)
{
- if(!ignoreMuteChecks)
- {
- //Prevent changes to other checkboxes from calling this function:
- ignoreMuteChecks = true;
-
- //Set all other checkboxes
- var muteButtons = document.getElementsByClassName("checkbox_mute");
- for(var i=0; i < muteButtons.length; i++)
- {
- muteButtons[i].checked = value;
- }
- savePref('mute', value);
-
- ignoreMuteChecks = false;
- }
+ var value = getCookie('pref_mute');
+ $('.mapMute').removeClass("mapMute_"+value);
+ if (value == 'true') value = 'false';
+ else value = 'true';
+ savePref('mute', value);
+ $('.mapMute').addClass("mapMute_"+value);
+
}
function getMuteOption(mapID) {
- var selectedSpeed = 2;
var r = '';
- var checked = '';
+ var muted = 'false';
if (getCookie('pref_mute') == 'true') {
- checked = "checked='checked' ";
+ muted = "true";
}
- r += "<label><input onclick='setMute(this.checked)' type='checkbox' id='"+mapID+",mute' class='checkbox_mute' "+checked+"/>Mute</label>";
+ r += "<a title='Mute sound?' class='mapMute mapMute_"+muted+" unselectable' href='javascript:setMute()' id='mapMute'/></a>";
return r;
}
|