space compression in buttons to fix safari bug. Improved console debugging in JS.

This commit is contained in:
KeyserSosa
2009-02-03 11:15:13 -08:00
parent f0583ecb17
commit 70c7cc1652
2 changed files with 14 additions and 8 deletions

View File

@@ -28,6 +28,7 @@ from r2.lib.utils import tup
from pylons import c, request
from validator import *
from pylons.i18n import _
from r2.lib.filters import spaceCompress
class ButtonsController(RedditController):
def buttontype(self):
@@ -102,11 +103,12 @@ class ButtonsController(RedditController):
else:
target = "_parent"
c.response.content = page_handler(button=bt, css=css,
score_fmt = score_fmt, link = l,
url=url, title=title,
vote = vote, target = target,
bgcolor=c.bgcolor, width=width).render()
res = page_handler(button=bt, css=css,
score_fmt = score_fmt, link = l,
url=url, title=title,
vote = vote, target = target,
bgcolor=c.bgcolor, width=width).render()
c.response.content = spaceCompress(res)
return c.response

View File

@@ -10,8 +10,12 @@
/* utility functions */
$.log = function(message) {
if (window.console)
console.debug(message);
if (window.console) {
if (window.console.debug)
window.console.debug(message);
else if (window.console.log)
window.console.log(message);
}
else
alert(message);
};
@@ -169,7 +173,7 @@ $.fn.vote = function(vh, callback) {
var things = $(this).all_things_by_id();
/* find all arrows of things on the page */
var arrows = things.children().not(".child").find('.arrow');
/* set the new arrow states */
var u_before = (dir == 1) ? up_cls : upmod_cls;
var u_after = (dir == 1) ? upmod_cls : up_cls;