Fossil SCM
Moved a single-use variable interpolation inline with its use point. Also improved some comments.
Commit
56db6170e8da959f39d2b9c6c9086feb4627d530090d2a145336fd68c7455df2
Parent
874a4dac8cca5ac…
1 file changed
+5
-6
+5
-6
| --- skins/default/js.txt | ||
| +++ skins/default/js.txt | ||
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | (function() { |
| 2 | - var home='$home'; | |
| 3 | 2 | var panel = document.getElementById("hbdrop"); |
| 4 | 3 | if (!panel) return; // site admin might've nuked it |
| 5 | 4 | var panelBorder = panel.style.border; |
| 6 | 5 | var animate = panel.style.hasOwnProperty('transition'); |
| 7 | 6 | var animMS = 400; |
| @@ -30,14 +29,14 @@ | ||
| 30 | 29 | |
| 31 | 30 | // Show the panel by changing the panel height, which kicks off the |
| 32 | 31 | // slide-open/closed transition set up in the XHR onload handler. |
| 33 | 32 | // |
| 34 | 33 | // Schedule the change for a near-future time in case this is the |
| 35 | - // first call, where the div was initially invisible. That causes | |
| 36 | - // the browser to consider the height change as part of the same | |
| 37 | - // state change as the visibility change, so it doesn't see a state | |
| 38 | - // *transition*, hence never kicks off the *CSS* transition: | |
| 34 | + // first call, where the div was initially invisible. If we were | |
| 35 | + // to change the panel's visibility and height at the same time | |
| 36 | + // instead, that would prevent the browser from seeing the height | |
| 37 | + // change as a state transition, so it'd skip the CSS transition: | |
| 39 | 38 | // |
| 40 | 39 | // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions#JavaScript_examples |
| 41 | 40 | function showPanel() { |
| 42 | 41 | if (animate) { |
| 43 | 42 | setTimeout(function() { |
| @@ -108,15 +107,15 @@ | ||
| 108 | 107 | panel.style.display = 'block'; |
| 109 | 108 | } |
| 110 | 109 | } |
| 111 | 110 | // else, can't parse response as HTML or XML |
| 112 | 111 | } |
| 113 | - xhr.open("POST", home + "/sitemap"); | |
| 112 | + xhr.open("POST", "$home/sitemap"); // note the TH1 substitution! | |
| 114 | 113 | xhr.responseType = "document"; |
| 115 | 114 | xhr.send("popup=1"); |
| 116 | 115 | } |
| 117 | 116 | else { |
| 118 | 117 | showPanel(); // just show what we built above |
| 119 | 118 | } |
| 120 | 119 | return false; // prevent browser from acting on <a> click |
| 121 | 120 | } |
| 122 | 121 | })(); |
| 123 | 122 |
| --- skins/default/js.txt | |
| +++ skins/default/js.txt | |
| @@ -1,7 +1,6 @@ | |
| 1 | (function() { |
| 2 | var home='$home'; |
| 3 | var panel = document.getElementById("hbdrop"); |
| 4 | if (!panel) return; // site admin might've nuked it |
| 5 | var panelBorder = panel.style.border; |
| 6 | var animate = panel.style.hasOwnProperty('transition'); |
| 7 | var animMS = 400; |
| @@ -30,14 +29,14 @@ | |
| 30 | |
| 31 | // Show the panel by changing the panel height, which kicks off the |
| 32 | // slide-open/closed transition set up in the XHR onload handler. |
| 33 | // |
| 34 | // Schedule the change for a near-future time in case this is the |
| 35 | // first call, where the div was initially invisible. That causes |
| 36 | // the browser to consider the height change as part of the same |
| 37 | // state change as the visibility change, so it doesn't see a state |
| 38 | // *transition*, hence never kicks off the *CSS* transition: |
| 39 | // |
| 40 | // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions#JavaScript_examples |
| 41 | function showPanel() { |
| 42 | if (animate) { |
| 43 | setTimeout(function() { |
| @@ -108,15 +107,15 @@ | |
| 108 | panel.style.display = 'block'; |
| 109 | } |
| 110 | } |
| 111 | // else, can't parse response as HTML or XML |
| 112 | } |
| 113 | xhr.open("POST", home + "/sitemap"); |
| 114 | xhr.responseType = "document"; |
| 115 | xhr.send("popup=1"); |
| 116 | } |
| 117 | else { |
| 118 | showPanel(); // just show what we built above |
| 119 | } |
| 120 | return false; // prevent browser from acting on <a> click |
| 121 | } |
| 122 | })(); |
| 123 |
| --- skins/default/js.txt | |
| +++ skins/default/js.txt | |
| @@ -1,7 +1,6 @@ | |
| 1 | (function() { |
| 2 | var panel = document.getElementById("hbdrop"); |
| 3 | if (!panel) return; // site admin might've nuked it |
| 4 | var panelBorder = panel.style.border; |
| 5 | var animate = panel.style.hasOwnProperty('transition'); |
| 6 | var animMS = 400; |
| @@ -30,14 +29,14 @@ | |
| 29 | |
| 30 | // Show the panel by changing the panel height, which kicks off the |
| 31 | // slide-open/closed transition set up in the XHR onload handler. |
| 32 | // |
| 33 | // Schedule the change for a near-future time in case this is the |
| 34 | // first call, where the div was initially invisible. If we were |
| 35 | // to change the panel's visibility and height at the same time |
| 36 | // instead, that would prevent the browser from seeing the height |
| 37 | // change as a state transition, so it'd skip the CSS transition: |
| 38 | // |
| 39 | // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions#JavaScript_examples |
| 40 | function showPanel() { |
| 41 | if (animate) { |
| 42 | setTimeout(function() { |
| @@ -108,15 +107,15 @@ | |
| 107 | panel.style.display = 'block'; |
| 108 | } |
| 109 | } |
| 110 | // else, can't parse response as HTML or XML |
| 111 | } |
| 112 | xhr.open("POST", "$home/sitemap"); // note the TH1 substitution! |
| 113 | xhr.responseType = "document"; |
| 114 | xhr.send("popup=1"); |
| 115 | } |
| 116 | else { |
| 117 | showPanel(); // just show what we built above |
| 118 | } |
| 119 | return false; // prevent browser from acting on <a> click |
| 120 | } |
| 121 | })(); |
| 122 |