Auth bug fixed
This commit is contained in:
@@ -10,13 +10,14 @@ _settings = null;
|
||||
$(function() {
|
||||
var l, _ref;
|
||||
l = document.location;
|
||||
if ((_ref = l.host) !== 'beathaven.org' && _ref !== 'local.beathaven.org') {
|
||||
if ((_ref = l.host) !== 'beathaven.org' && _ref !== 'dev.beathaven.org') {
|
||||
l.href = 'http://beathaven.org/' + l.hash;
|
||||
}
|
||||
_beathaven = new BeatHaven();
|
||||
_beathaven.init();
|
||||
$(window).resize(function() {
|
||||
_beathaven.adjustSizes();
|
||||
_beathaven.redrawScrollbar();
|
||||
return false;
|
||||
});
|
||||
return window.setTimeout(function() {
|
||||
@@ -57,9 +58,9 @@ BeatHaven = (function() {
|
||||
focused_id = document.activeElement.id;
|
||||
}
|
||||
outer_height = $('.data-container > div').outerHeight();
|
||||
if (outer_height > 300 && outer_height !== this.last_height) {
|
||||
this.last_height = outer_height;
|
||||
this.redrawScrollbar();
|
||||
if (outer_height > 300 && outer_height !== _beathaven.last_height) {
|
||||
_beathaven.last_height = outer_height;
|
||||
_beathaven.redrawScrollbar();
|
||||
}
|
||||
if (focused_id) {
|
||||
document.getElementById(focused_id).focus();
|
||||
@@ -76,16 +77,19 @@ BeatHaven = (function() {
|
||||
$('.data-container').scrollbar();
|
||||
return false;
|
||||
};
|
||||
BeatHaven.prototype.localizeHTML = function(obj) {
|
||||
BeatHaven.prototype.localizeHTML = function(obj, lang) {
|
||||
if (obj == null) {
|
||||
obj = $('body');
|
||||
}
|
||||
if (lang == null) {
|
||||
lang = _beathaven.lang;
|
||||
}
|
||||
$(obj).find('[data-ls]').each(function() {
|
||||
if ((_locale[$(this).attr('data-ls')] != null) && (_locale[$(this).attr('data-ls')][_beathaven.lang] != null)) {
|
||||
if ((_locale[$(this).attr('data-ls')] != null) && (_locale[$(this).attr('data-ls')][lang] != null)) {
|
||||
if (this.nodeName === 'INPUT') {
|
||||
return $(this).val(_locale[$(this).attr('data-ls')][_beathaven.lang]);
|
||||
return $(this).val(_locale[$(this).attr('data-ls')][lang]);
|
||||
} else {
|
||||
return $(this).text(_locale[$(this).attr('data-ls')][_beathaven.lang]);
|
||||
return $(this).text(_locale[$(this).attr('data-ls')][lang]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@ Session = (function() {
|
||||
}
|
||||
Session.prototype.setUser = function(user) {
|
||||
this.user = user;
|
||||
_beathaven.lang = this.user.lang;
|
||||
_beathaven.lang = this.user.lang || 'ru';
|
||||
_beathaven.localizeHTML();
|
||||
return false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user