1
0
Fork 0

Hide player for unauthorized users, ad place

This commit is contained in:
magnolia-fan 2011-09-18 19:14:34 +04:00
parent c726d1ca44
commit dffc5bf735
7 changed files with 29 additions and 7 deletions

View File

@ -35,3 +35,13 @@ class window.Session
_session.setUser ar.user _session.setUser ar.user
false false
false false
displayAuthorizedContent: ->
$('.playlist, .player').show()
$('.ad_here, #login').hide()
$('#authorized').css display: 'block'
hideAuthorizedContent: ->
$('.playlist, .player, #authorized').hide()
$('.ad_here').show()
$('#login').css display: 'block'

View File

@ -36,16 +36,14 @@ class window.Vkontakte
.html (if _session.getUser().name then _session.getUser().name else '%username%') .html (if _session.getUser().name then _session.getUser().name else '%username%')
window._session = _session window._session = _session
_ajax.detectPage() _ajax.detectPage()
$('.fullscreen').hide(); _session.displayAuthorizedContent()
$('#login').hide()
$('#authorized').css display: 'block' $('#authorized').css display: 'block'
else else
_session.setUser ar.user _session.setUser ar.user
$('#username') $('#username')
.html (if _session.getUser().name then _session.getUser().name else '%username%') .html (if _session.getUser().name then _session.getUser().name else '%username%')
$('#login').hide() _session.displayAuthorizedContent()
$('#authorized').css display: 'block'
window._session = _session window._session = _session
_ajax.detectPage() _ajax.detectPage()
$('.fullscreen').hide(); $('.fullscreen').hide();
@ -58,8 +56,7 @@ class window.Vkontakte
else else
_session = new Session({}) _session = new Session({})
_session.setUser {} _session.setUser {}
$('#login').css display: 'block' _session.hideAuthorizedContent()
$('#authorized').hide()
window._session = _session window._session = _session
_ajax.detectPage() _ajax.detectPage()
$('.fullscreen').hide(); $('.fullscreen').hide();

View File

@ -8,7 +8,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #ffffff; background-color: #ffffff;
@include opacity(0.9); //@include opacity(0.9);
.inner { .inner {
position: relative; position: relative;
top: 50%; top: 50%;

View File

@ -12,4 +12,16 @@
top: 45px; top: 45px;
width: 210px; width: 210px;
height: 200px; height: 200px;
}
.player, .playlist {
display: none;
}
.ad_here {
display: block;
border: #e0e0e0 1px solid;
padding: 200px 20px;
font-size: 20px;
text-align: center;
} }

View File

@ -50,6 +50,7 @@
   
.span5.columns .span5.columns
.ad_here= (I18n.t 'global.your_ad_here').html_safe
.player .player
%h5.now-playing= I18n.t 'global.do_add' %h5.now-playing= I18n.t 'global.do_add'
.progress .progress

View File

@ -12,6 +12,7 @@ en:
do_empty: "Empty playlist" do_empty: "Empty playlist"
hello: "Hi there" hello: "Hi there"
settings: "Settings" settings: "Settings"
your_ad_here: "Your ad couldn't<br/>be here"
search: search:
fail: "Something very bad happened while we tried out to load some info about this artist. How about some other one?" fail: "Something very bad happened while we tried out to load some info about this artist. How about some other one?"

View File

@ -12,6 +12,7 @@ ru:
do_empty: "Очистить" do_empty: "Очистить"
hello: "Привет" hello: "Привет"
settings: "Настройки" settings: "Настройки"
your_ad_here: "Здесь не могла бы<br/>быть Ваша реклама"
search: search:
fail: "Что-то ужасное произошло пока мы собирали информацию об этом исполнителе. Может пока поищем другого?" fail: "Что-то ужасное произошло пока мы собирали информацию об этом исполнителе. Может пока поищем другого?"