diff options
Diffstat (limited to '_templates/site.mako')
-rw-r--r-- | _templates/site.mako | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/_templates/site.mako b/_templates/site.mako index cac66d5..1d47b0d 100644 --- a/_templates/site.mako +++ b/_templates/site.mako @@ -24,6 +24,34 @@ <div id="footer" class="footer"> ${self.footer()} </div> <!-- End Footer --> + <script type="text/javascript"> + window.onload = function(){ + + var i, rm, rh, + read_mores = document.getElementsByClassName("post_more"), + read_hides = document.getElementsByClassName("post_hide"), + read_sum = document.getElementsByClassName("post_sum"), + read_all = document.getElementsByClassName("post_all"); + for(i=0;i<read_mores.length;i++){ + + rh = read_hides[i], + rm = read_mores[i]; + rm.href = "javascript:void(0);"; + rm.data = rh.data = {}; + rm.data.related_s = rh.data.related_s = read_sum[i]; + rm.data.related_a = rh.data.related_a = read_all[i]; + rm.onclick = rh.onclick = function(){ + + var sum = this.data.related_s, + all = this.data.related_a; + sum.className = (sum.className.indexOf("post_shown")!==-1) ? "post_hidden" : "post_shown"; + sum.className += " post_sum"; + all.className = (all.className.indexOf("post_shown")!==-1) ? "post_hidden" : "post_shown"; + all.className += " post_all"; + }; + } + }; + </script> </body> </html> <%def name="head()"> |