Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Небольшой рефакторинг существующего кода #11

Merged
merged 7 commits into from
Oct 26, 2015
4 changes: 0 additions & 4 deletions frontend/common.blocks/avatar/_size/_avatar-creator.styl

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/common.blocks/avatar/_size/avatar_size_l.styl

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/common.blocks/avatar/_size/avatar_size_m.styl

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/common.blocks/avatar/_size/avatar_size_s.styl

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/common.blocks/avatar/_size/avatar_size_xl.styl

This file was deleted.

Empty file.
14 changes: 0 additions & 14 deletions frontend/common.blocks/avatar/avatar.bemtree

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/common.blocks/avatar/avatar.deps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
({
shouldDeps : [
{elem : 'image'},
{ block: 'image'}
{ elem : 'image' },
{ block : 'image' }
]
});
11 changes: 11 additions & 0 deletions frontend/common.blocks/avatar/avatar.styl
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.avatar
display inline-block

// @stylint off
$sizeList = (16 24 32 48 72);

for $sizeVal, i in xs s m l xl
&.avatar_size_{$sizeVal}
line-height: $sizeList[i]px
width: $sizeList[i]px
height: $sizeList[i]px

// @stylint on

14 changes: 3 additions & 11 deletions frontend/common.blocks/chat-input/chat-input.deps.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
({
mustDeps : [],
shouldDeps : [
{
elems : ['emoji-button', 'emoji-icon', 'popup']
},
{
block : 'emoji-icon'
},
{
block : 'i-bem',
elems : ['dom']
}
{ elems : ['emoji-button', 'emoji-icon', 'popup'] },
{ block : 'emoji-icon' },
{ block : 'i-bem', elems : ['dom'] }
]
});
12 changes: 2 additions & 10 deletions frontend/common.blocks/dialog-controls/dialog-controls.deps.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
({
mustDeps : [
],
shouldDeps : [
{
block : 'button',
mods : { theme : 'islands', size : 'm', view : 'plain' },
},
{
block: 'icon',
mods: {name: true}
},
{ block : 'button', mods : { theme : 'islands', size : 'm', view : 'plain' }, },
{ block : 'icon', mods : { name : true } },
{ block : 'i-chat-api' }
]
});
5 changes: 3 additions & 2 deletions frontend/common.blocks/dialog-controls/dialog-controls.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
justify-content center
height 100%

&_type_channels
display none

&__call
padding-right 13px

&_type_channels
display none
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ block('dialog').elem('console')(
{
block : 'textarea',
mods : {
focused : false
focused : false,
theme: 'shriming'
},
mix : {
block : 'chat-input',
Expand Down
2 changes: 1 addition & 1 deletion frontend/common.blocks/dialog/dialog.deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
shouldDeps : [
{ elems : ['message', 'container', 'spin', 'name', 'title', 'info', 'blank'] },
{ block : 'keyboard', elems : ['codes'] },
{ block : 'textarea', mods : { theme : 'islands', size : 'm', focused : true, name : 'msg' } },
{ block : 'textarea', mods : { theme : 'shriming', size : 'm', focused : true, name : 'msg' } },
{ block : 'message', elem : 'avatar' },
{ block : 'message' },
{ block : 'i-chat-api' },
Expand Down
5 changes: 1 addition & 4 deletions frontend/common.blocks/emoji-icon/emoji-icon.deps.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
({
mustDeps : [],
shouldDeps : [
{
block : 'image'
}
{ block : 'image' }
]
});
4 changes: 2 additions & 2 deletions frontend/common.blocks/header/header.bemtree
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ block('header')(
return applyCtx({
block : 'header',
mods : { logged : isLogged },
js: true,
js : true,
content : [
{
elem : 'menu',
mods : { closed : true }
},
{
block : 'logo',
mods : { white : isLogged }
mods : { theme : isLogged ? 'light' : 'dark' }
},
{
elem : 'title',
Expand Down
2 changes: 1 addition & 1 deletion frontend/common.blocks/header/header.deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
{
block : 'logo',
mods : { white : true }
mods : { theme : 'light'}
},
{
block: 'notify'
Expand Down
14 changes: 14 additions & 0 deletions frontend/common.blocks/landing/__content/landing__content.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.landing__content
display flex
height 100%
max-width 80%
margin 0 auto
flex-direction row
align-items center
justify-content flex-start

&__container
display flex
flex-direction column
align-items flex-start
justify-content center
13 changes: 6 additions & 7 deletions frontend/common.blocks/landing/landing.bemhtml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
block('landing')(
def()(function(){
var FOOTER_LINKS = [
content()(function(){
var footerLinks = [
{ title : 'Github', url : 'https://github.com/shriming/chat' },
{ title : 'ШРИ Яндекс', url : 'https://academy.yandex.ru/events/shri/' },
{ title : 'Heroku', url : 'https://shriming.herokuapp.com/' }
];

return applyCtx([
return [
{
block : 'landing',
elem : 'content',
content : [
{
elem : 'container',
Expand Down Expand Up @@ -41,9 +41,8 @@ block('landing')(
]
},
{
block : 'landing',
elem : 'footer',
content : FOOTER_LINKS.map(function(link){
content : footerLinks.map(function(link){
return {
block : 'link',
target : '_black',
Expand All @@ -53,6 +52,6 @@ block('landing')(
};
})
}
]);
];
})
);
9 changes: 2 additions & 7 deletions frontend/common.blocks/landing/landing.deps.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
({
mustDeps : [
{ elems : ['title', 'description', 'image', 'footer', 'login', 'link'] }
],
shouldDeps : [
{
block : 'link',
mods : { theme : 'islands', size : 'm' }
}
{ elems : ['content', 'title', 'description', 'image', 'footer', 'login', 'link'] },
{ block : 'link', mods : { theme : 'islands', size : 'm' } }
]
});
14 changes: 0 additions & 14 deletions frontend/common.blocks/landing/landing.styl
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
.landing
display flex
height 100%
max-width 80%
margin 0 auto
flex-direction row
align-items center
justify-content flex-start

&__container
display flex
flex-direction column
align-items flex-start
justify-content center
10 changes: 7 additions & 3 deletions frontend/common.blocks/link/_theme/link_theme_shriming.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
$link-color = #fff

.link_theme_shriming
color #fff
color $link-color

&:hover, &:active, &:focus
color #fff
&.link_focused,
&.link_hovered
border-bottom 1px solid $link-color
color $link-color
5 changes: 0 additions & 5 deletions frontend/common.blocks/login/__provider/login__provider.css

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/common.blocks/login/login.bemhtml

This file was deleted.

73 changes: 0 additions & 73 deletions frontend/common.blocks/login/login.bemtree

This file was deleted.

25 changes: 0 additions & 25 deletions frontend/common.blocks/login/login.deps.js

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/common.blocks/login/login.styl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.logo_white
background url(logo_white.svg)
.logo_theme_light
background url(logo_white.svg)
5 changes: 2 additions & 3 deletions frontend/common.blocks/logo/logo.deps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(
{
({
shouldDeps : [
{ block : 'logo', mods : 'white' }
{ block : 'logo', mods : { theme : 'light' } }
]
});
Loading