diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/jquery.hashchange.min.js | 9 | ||||
-rw-r--r-- | js/mapspecs.js | 6 | ||||
-rw-r--r-- | js/scores.js | 11 |
3 files changed, 20 insertions, 6 deletions
diff --git a/js/jquery.hashchange.min.js b/js/jquery.hashchange.min.js new file mode 100644 index 0000000..3c607ba --- /dev/null +++ b/js/jquery.hashchange.min.js @@ -0,0 +1,9 @@ +/* + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
\ No newline at end of file diff --git a/js/mapspecs.js b/js/mapspecs.js index 6ab7286..7c74a92 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -755,7 +755,11 @@ function contains(a, obj) { //Shows a solution temporarly
-function useSolution(mapid, inputSolution, moves, tempWallColor, tempWallEmblem) {
+function useSolution(mapid, inputSolution, moves, tempWallColor, tempWallEmblem, solutionID) {
+
+ $('.solutionSelected').removeClass('solutionSelected');
+ $('#solution_'+solutionID).addClass('solutionSelected');
+
solution[mapid] = inputSolution;
var animateA = "showTempSolution(\""+mapid+"\", \""+inputSolution+"\", \""+moves+"\", \""+tempWallColor+"\", \""+tempWallEmblem+"\");";
var animateB = "showTempSolution(\""+mapid+"\", \""+inputSolution+"\", \""+moves+"\", false, false);";
diff --git a/js/scores.js b/js/scores.js index e384831..7d91576 100644 --- a/js/scores.js +++ b/js/scores.js @@ -153,16 +153,17 @@ function scoresFormatPage(JO) { if (u.ID == userObj.ID) {
rowclass = 'scoreRowSelf';
}
- if (typeof(pointerUserID) != 'undefined' && u.ID == pointerUserID) {
- setTimeout("useSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\");", 400);
- pointerUserID = '';
+ if (typeof pointerSolutionID != 'undefined' && u.solutionID == pointerSolutionID && goToScorePointer) {
+ goToScorePointer = false;
+ setTimeout("useSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\", \""+u.solutionID+"\");", 400);
+ rowclass += ' solutionSelected';
}
if (u.solution) {
rowclass += ' scoreRowSolutionAvailable';
- p += "<tr class='"+rowclass+"' ";
+ p += "<tr class='"+rowclass+"' id='solution_"+u.solutionID+"'";
p += "onmouseover='showTempSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\")'";
- p += "onclick='useSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\");saveScoreLocation("+JO.page+", "+u.ID+");'";
+ p += "onclick='useSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\", \""+u.solutionID+"\");saveScoreLocation("+JO.page+", "+u.solutionID+");'";
p += "onmouseout='restoreSolution(\""+JO.mapid+"\")' ";
p += " style='"+styleClass+";' title='Last improved "+scoredTimeStr+"'>";
} else {
|