├── .bowerrc ├── common.blocks ├── twitter │ ├── twitter.bemhtml │ ├── _widget │ │ ├── twitter_widget.deps.js │ │ ├── twitter_widget_tweet.bh.js │ │ ├── twitter_widget_tweet.bemhtml │ │ ├── twitter_widget_share.bh.js │ │ └── twitter_widget_share.bemhtml │ ├── twiter.md │ ├── twitter.bh.js │ ├── twitter.tmpl-specs │ │ ├── 02-widget_tweet.html │ │ ├── 02-widget_tweet.bemjson.js │ │ ├── 01-widget_share.html │ │ └── 01-widget_share.bemjson.js │ ├── twitter.deps.js │ └── twitter.browser.js ├── vk │ ├── _widget │ │ ├── vk_widget_like.md │ │ ├── vk_widget_like.browser.js │ │ ├── vk_widget_like.bh.js │ │ └── vk_widget_like.bemhtml │ ├── __config │ │ └── vk__config.browser.js │ ├── vk.browser.js │ ├── vk.deps.js │ └── vk.tmpl-specs │ │ ├── 01-widget_like.bemjson.js │ │ └── 01-widget_like.html ├── share │ ├── share.styl │ ├── _service │ │ ├── share_service.deps.js │ │ ├── share_service_vkontakte.md │ │ ├── share_service_gplus.bh.js │ │ ├── share_service_vkontakte.browser.js │ │ ├── share_service_gplus.bemhtml │ │ ├── share_service_twitter.bh.js │ │ ├── share_service_blogger.bh.js │ │ ├── share_service_twitter.bemhtml │ │ ├── share_service_blogger.bemhtml │ │ ├── share_service_facebook.bh.js │ │ ├── share_service_vkontakte.bh.js │ │ ├── share_service_facebook.bemhtml │ │ └── share_service_vkontakte.bemhtml │ ├── share.tmpl-specs │ │ ├── 06-service-notext.html │ │ ├── 06-service-notext.bemjson.js │ │ ├── 03-service_gplus.bemjson.js │ │ ├── 04-service_twitter.bemjson.js │ │ ├── 01-service_blogger.bemjson.js │ │ ├── 02-service_facebook.bemjson.js │ │ ├── 05-service_vkontakte.bemjson.js │ │ ├── 03-service_gplus.html │ │ ├── 04-service_twitter.html │ │ ├── 01-service_blogger.html │ │ ├── 05-service_vkontakte.html │ │ └── 02-service_facebook.html │ ├── share.md │ ├── share.bemhtml │ ├── share.deps.js │ ├── share.bh.js │ └── share.browser.js ├── icon │ └── _service │ │ ├── icon_service.deps.js │ │ ├── icon_service_facebook.bemhtml │ │ ├── icon_service.bemhtml │ │ ├── icon_service.bh.js │ │ ├── icon_service_facebook.svg │ │ ├── icon_service_facebook.bh.js │ │ ├── icon_service_blogger.bemhtml │ │ ├── icon_service_blogger.svg │ │ ├── icon_service_twitter.bemhtml │ │ ├── icon_service_blogger.bh.js │ │ ├── icon_service_twitter.svg │ │ ├── icon_service_twitter.bh.js │ │ ├── icon_service_gplus.bemhtml │ │ ├── icon_service_gplus.svg │ │ ├── icon_service_gplus.bh.js │ │ ├── icon_service_vkontakte.bemhtml │ │ ├── icon_service_vkontakte.svg │ │ └── icon_service_vkontakte.bh.js ├── disqus │ ├── disqus.tmpl-specs │ │ ├── 01-plain.bemjson.js │ │ ├── 02-shortname.bemjson.js │ │ ├── 01-plain.html │ │ └── 02-shortname.html │ ├── disqus.deps.js │ ├── disqus.bh.js │ ├── disqus.bemhtml │ └── disqus.browser.js ├── github-button │ ├── github-button.bemhtml │ ├── github-button.bh.js │ ├── github-button.tmpl-specs │ │ ├── 02-type_follow.bemjson.js │ │ ├── 03-type_download.bemjson.js │ │ ├── 04-type_issue.bemjson.js │ │ ├── 05-type_star.bemjson.js │ │ ├── 06-type_watch.bemjson.js │ │ ├── 01-type_fork.bemjson.js │ │ ├── 02-type_follow.html │ │ ├── 03-type_download.html │ │ ├── 04-type_issue.html │ │ ├── 05-type_star.html │ │ ├── 06-type_watch.html │ │ └── 01-type_fork.html │ ├── github-button.deps.js │ ├── github-button.browser.js │ └── _type │ │ ├── github-button_type_download.bh.js │ │ ├── github-button_type_download.bemhtml │ │ ├── github-button_type_follow.bh.js │ │ ├── github-button_type_issue.bh.js │ │ ├── github-button_type_follow.bemhtml │ │ ├── github-button_type_issue.bemhtml │ │ ├── github-button_type_fork.bh.js │ │ ├── github-button_type_star.bh.js │ │ ├── github-button_type_watch.bh.js │ │ ├── github-button_type_star.bemhtml │ │ ├── github-button_type_fork.bemhtml │ │ └── github-button_type_watch.bemhtml ├── github-ribbon │ ├── github-ribbon.deps.js │ ├── github-ribbon.tmpl-specs │ │ ├── 01-plain.html │ │ └── 01-plain.bemjson.js │ ├── github-ribbon.styl │ ├── github-ribbon.bemhtml │ ├── github-ribbon.bh.js │ └── github-ribbon.md └── og │ ├── og.deps.js │ ├── og.tmpl-specs │ ├── 01-plain.bemjson.js │ └── 01-plain.html │ ├── og.bh.js │ ├── og.bemhtml │ └── og.ru.md ├── promo.blocks ├── vk │ └── vk.styl ├── share │ └── share.styl ├── page │ ├── image │ │ └── bem.png │ ├── page.deps.js │ ├── page.styl │ └── page.bemhtml ├── variables │ └── variables.styl └── link │ └── link.styl ├── desktop.blocks └── yashare │ ├── yashare.deps.js │ ├── yashare.tmpl-specs │ ├── 01-plain.bemjson.js │ └── 01-plain.html │ ├── yashare.bemhtml │ ├── yashare.browser.js │ └── yashare.bh.js ├── .gitignore ├── design └── common.blocks │ ├── github-ribbon │ └── _theme │ │ ├── github-ribbon_theme_red.bemhtml │ │ ├── github-ribbon_theme_gray.bemhtml │ │ ├── github-ribbon_theme_green.bemhtml │ │ ├── github-ribbon_theme_white.bemhtml │ │ ├── github-ribbon_theme_orange.bemhtml │ │ ├── github-ribbon_theme.deps.js │ │ ├── github-ribbon_theme_darkblue.bemhtml │ │ ├── github-ribbon_theme_gray.bh.js │ │ ├── github-ribbon_theme_red.bh.js │ │ ├── github-ribbon_theme_green.bh.js │ │ ├── github-ribbon_theme_white.bh.js │ │ ├── github-ribbon_theme_orange.bh.js │ │ ├── github-ribbon_theme_darkblue.bh.js │ │ └── github-ribbon_theme.tmpl-specs │ │ ├── 01-theme.bemjson.js │ │ └── 01-theme.html │ └── share │ └── _theme │ ├── share_theme_simple.styl │ └── share_theme_normal.styl ├── .editorconfig ├── bower.json ├── git_hooks └── pre-commit │ └── lint ├── .travis.yml ├── utils └── update-gh-pages.sh ├── package.json ├── .jscs.json ├── README.md ├── .jshint-groups.js ├── .enb └── make.js ├── .csscomb.json └── desktop.bundles └── index └── index.bemjson.js /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "libs" 3 | } 4 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.bemhtml: -------------------------------------------------------------------------------- 1 | block('twitter').tag()('a'); 2 | -------------------------------------------------------------------------------- /common.blocks/vk/_widget/vk_widget_like.md: -------------------------------------------------------------------------------- 1 | Doc https://vk.com/dev/widget_like -------------------------------------------------------------------------------- /promo.blocks/vk/vk.styl: -------------------------------------------------------------------------------- 1 | .vk 2 | { 3 | display: inline-block; 4 | } 5 | -------------------------------------------------------------------------------- /common.blocks/share/share.styl: -------------------------------------------------------------------------------- 1 | .share 2 | { 3 | display: inline-block; 4 | } 5 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | mustDeps : 'i-bem' 3 | }] 4 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service.deps.js: -------------------------------------------------------------------------------- 1 | ({ 2 | mustDeps : 'share' 3 | }) 4 | -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.tmpl-specs/01-plain.bemjson.js: -------------------------------------------------------------------------------- 1 | ({ 2 | block : 'disqus' 3 | }) 4 | -------------------------------------------------------------------------------- /common.blocks/twitter/_widget/twitter_widget.deps.js: -------------------------------------------------------------------------------- 1 | ({ 2 | mustDeps : 'twitter' 3 | }) 4 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-button')( 2 | tag()('a') 3 | ); 4 | -------------------------------------------------------------------------------- /promo.blocks/share/share.styl: -------------------------------------------------------------------------------- 1 | .share + .share 2 | { 3 | margin-left: 10px 4 | margin-bottom: 10px; 5 | } 6 | -------------------------------------------------------------------------------- /common.blocks/github-ribbon/github-ribbon.deps.js: -------------------------------------------------------------------------------- 1 | ({ 2 | mustDeps : [{ block : 'i-bem', elems : 'dom' }] 3 | }) 4 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/06-service-notext.html: -------------------------------------------------------------------------------- 1 | 2 | I'm an icon 3 | -------------------------------------------------------------------------------- /common.blocks/twitter/twiter.md: -------------------------------------------------------------------------------- 1 | doc [https://dev.twitter.com/web/tweet-button](https://dev.twitter.com/web/tweet-button) -------------------------------------------------------------------------------- /promo.blocks/page/image/bem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bem-contrib/bem-social/HEAD/promo.blocks/page/image/bem.png -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.tmpl-specs/02-shortname.bemjson.js: -------------------------------------------------------------------------------- 1 | ({ 2 | block : 'disqus', 3 | shortname : 'foo' 4 | }) 5 | -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.deps.js: -------------------------------------------------------------------------------- 1 | ({ 2 | mustDeps : [{ block : 'i-bem', elems : 'dom' }], 3 | shouldDeps : [] 4 | }) 5 | -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.tmpl-specs/01-plain.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /desktop.blocks/yashare/yashare.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | mustDeps : [ 3 | { block : 'i-bem', elem : 'dom' } 4 | ] 5 | }] 6 | -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.tmpl-specs/02-shortname.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('twitter', function(ctx) { 4 | ctx.tag('a'); 5 | }); 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | bh.match('github-button', function(ctx) { 3 | ctx.tag('a'); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /common.blocks/github-ribbon/github-ribbon.tmpl-specs/01-plain.html: -------------------------------------------------------------------------------- 1 | Fork me please 2 | -------------------------------------------------------------------------------- /common.blocks/github-ribbon/github-ribbon.tmpl-specs/01-plain.bemjson.js: -------------------------------------------------------------------------------- 1 | ({ 2 | block : 'github-ribbon', 3 | url : 'http://frk.me/', 4 | image : 'http://frk.me/i.svg', 5 | alt : 'Fork me please' 6 | }) 7 | -------------------------------------------------------------------------------- /desktop.blocks/yashare/yashare.tmpl-specs/01-plain.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'yashare' 3 | }, { 4 | block : 'yashare', 5 | quickServices : ['a,b,c'], 6 | theme : 'yoloswag', 7 | l10n : 'en' 8 | }] 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .settings/ 3 | .DS_Store 4 | .idea 5 | .svn 6 | node_modules/ 7 | libs 8 | npm-debug.log 9 | 10 | # bem 11 | .enb/tmp/ 12 | *bundles*/*/*.* 13 | !*bundles*/*/*.bemjson.js 14 | *.tmpl-specs/** 15 | -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | bh.match('disqus', function(ctx, json) { 3 | ctx.js({ shortname : json.shortname }); 4 | ctx.attr('id', 'disqus_thread'); 5 | }); 6 | }; 7 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.tmpl-specs/02-widget_tweet.html: -------------------------------------------------------------------------------- 1 |
2 |
Custom content
3 | -------------------------------------------------------------------------------- /common.blocks/vk/__config/vk__config.browser.js: -------------------------------------------------------------------------------- 1 | modules.define('vk__config', function(provide) { 2 | provide(/** @exports */{ 3 | url : '//vk.com/js/api/openapi.js?115', 4 | apiId : 4551828, 5 | onlyWidgets : true 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /promo.blocks/page/page.deps.js: -------------------------------------------------------------------------------- 1 | ({ 2 | mustDeps : [ 3 | { 4 | block : 'font', 5 | elem : 'pt-sans', 6 | mods : { face : ['regular', 'bold', 'italic'] } 7 | } 8 | ], 9 | shouldDeps : [] 10 | }) 11 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/06-service-notext.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'share', 3 | params : { url : 'http://w3c' }, 4 | text : false 5 | }, { 6 | block : 'share', 7 | params : { url : 'http://w3c' }, 8 | icon : 'I\'m an icon' 9 | }] 10 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.tmpl-specs/02-widget_tweet.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'twitter', 3 | mods : { widget : 'tweet' }, 4 | }, { 5 | block : 'twitter', 6 | mods : { widget : 'tweet' }, 7 | lang : 'en', 8 | content : 'Custom content', 9 | }] 10 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | mustDeps : [ 3 | { block : 'i-bem', elems : ['dom'] } 4 | ] 5 | }, { 6 | tech : 'tmpl-spec.js', 7 | mustDeps : [ 8 | { mods : { widget : 'share' } }, 9 | { mods : { widget : 'tweet' } } 10 | ] 11 | }] 12 | -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.bemhtml: -------------------------------------------------------------------------------- 1 | block('disqus')( 2 | js()(function() { 3 | return { shortname : this.ctx.shortname }; 4 | }), 5 | attrs()(function() { 6 | return this.extend(applyNext(), { 7 | id : 'disqus_thread' 8 | }); 9 | }) 10 | ); 11 | -------------------------------------------------------------------------------- /promo.blocks/variables/variables.styl: -------------------------------------------------------------------------------- 1 | // CONTENT ===================================================================== 2 | page_width = 1000px; 3 | 4 | // GRID ======================================================================== 5 | total_columns = 12; 6 | row_padding = 0; 7 | col_padding = 0; 8 | -------------------------------------------------------------------------------- /common.blocks/share/share.md: -------------------------------------------------------------------------------- 1 | url1 http://habrahabr.ru/post/156185/ 2 | 3 | Счетчики 4 | url2 http://habrahabr.ru/company/sports_ru/blog/130702/ 5 | 6 | 7 | Некоторые цвета соцсетей подобранны с помощью [сервиса](http://findguidelin.es) 8 | 9 | Пример шар 10 | [1](http://arttechz.com/types-of-programmers/) 11 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/03-service_gplus.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'share', 3 | mods : { service : 'gplus' }, 4 | params : { url : 'http://w3c' } 5 | }, { 6 | block : 'share', 7 | mods : { service : 'gplus' }, 8 | params : { url : 'http://w3c' }, 9 | text : 'Custom share!' 10 | }] 11 | -------------------------------------------------------------------------------- /common.blocks/vk/vk.browser.js: -------------------------------------------------------------------------------- 1 | modules.define( 2 | 'vk', 3 | ['loader_type_js', 'vk__config'], 4 | function(provide, loader, cfg) { 5 | 6 | /* global VK */ 7 | loader(cfg.url, function() { 8 | VK.init({ apiId : cfg.apiId, onlyWidgets : cfg.onlyWidgets }); 9 | provide(VK); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /common.blocks/vk/vk.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | mustDeps : [{ block : 'i-bem', elem : 'dom' }], 3 | shouldDeps : [ 4 | { block : 'loader', mods : { type : 'js' } }, 5 | { elem : 'config' } 6 | ] 7 | }, { 8 | tech : 'tmpl-spec.js', 9 | mustDeps : [ 10 | { mods : { widget : 'like' } }, 11 | ] 12 | }] 13 | -------------------------------------------------------------------------------- /common.blocks/twitter/_widget/twitter_widget_tweet.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('twitter_widget_tweet', function(ctx, json) { 4 | ctx.cls('twitter-tweet'); 5 | ctx.tag('blockquote'); 6 | ctx.attrs({ 7 | 'lang' : json.lang || 'ru' 8 | }); 9 | }); 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/02-type_follow.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'github-button', 3 | mods : { type : 'follow' }, 4 | user : 'bem-incubator' 5 | }, { 6 | block : 'github-button', 7 | mods : { type : 'follow', large : true, count : true }, 8 | user : 'bem-incubator', 9 | text : 'Custom' 10 | }] 11 | -------------------------------------------------------------------------------- /common.blocks/github-ribbon/github-ribbon.styl: -------------------------------------------------------------------------------- 1 | .github-ribbon 2 | { 3 | position: absolute; 4 | top: 0; 5 | 6 | .image { 7 | margin: 0; 8 | padding: 0; 9 | border: none; 10 | } 11 | 12 | &.github-ribbon_left{ 13 | left: 0; 14 | } 15 | &.github-ribbon_right{ 16 | right: 0; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common.blocks/og/og.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | mustDeps : [ 3 | { block : 'i-bem', elem : 'dom' } 4 | ], 5 | shouldDeps : [ 6 | { 7 | block : 'page', 8 | elem : 'meta' 9 | } 10 | ] 11 | }, { 12 | tech : 'tmpl-spec.js', 13 | shouldDeps : [ 14 | { block : 'page', elem : 'meta' } 15 | ] 16 | }] 17 | -------------------------------------------------------------------------------- /common.blocks/share/share.bemhtml: -------------------------------------------------------------------------------- 1 | block('share')( 2 | tag()('a'), 3 | content()(function() { 4 | var ctx = this.ctx, 5 | content = [ctx.icon]; 6 | (!ctx.icon && ctx.text !== false) && content.push({ elem : 'text', content : ctx.text || 'Share' }); 7 | return content; 8 | }), 9 | elem('text').tag()('span') 10 | ); 11 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_vkontakte.md: -------------------------------------------------------------------------------- 1 | # Параметры 2 | ```js 3 | { 4 | block : 'share', 5 | mods : { service : 'vkontakte' }, 6 | params : { 7 | url : 'http://factory.mn', // Обязательно 8 | title : 'Привет мир', 9 | description : 'Описание', 10 | image : '/sdf/' 11 | }, 12 | text : 'vkontakte' 13 | } 14 | ``` 15 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_red.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-ribbon').mod('theme', 'red').def()(function() { 2 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png'; 3 | if(this.mods.right) { 4 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png'; 5 | } 6 | applyNext(); 7 | }); 8 | -------------------------------------------------------------------------------- /desktop.blocks/yashare/yashare.tmpl-specs/01-plain.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/04-service_twitter.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'share', 3 | mods : { service : 'twitter' }, 4 | params : { url : 'http://w3c' } 5 | }, { 6 | block : 'share', 7 | mods : { service : 'twitter' }, 8 | params : { 9 | title : 'bem-social', 10 | url : 'https://bem-social' 11 | }, 12 | text : 'Custom share!' 13 | }] 14 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_gray.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-ribbon').mod('theme', 'gray').def()(function() { 2 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_gray_6d6d6d.png'; 3 | if(this.mods.right) { 4 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png'; 5 | } 6 | applyNext(); 7 | }); 8 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_green.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-ribbon').mod('theme', 'green').def()(function() { 2 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png'; 3 | if(this.mods.right) { 4 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png'; 5 | } 6 | applyNext(); 7 | }); 8 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_white.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-ribbon').mod('theme', 'white').def()(function() { 2 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_white_ffffff.png'; 3 | if(this.mods.right) { 4 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png'; 5 | } 6 | applyNext(); 7 | }); 8 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/03-type_download.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'github-button', 3 | mods : { type : 'download' }, 4 | user : 'bem-incubator', 5 | repo : 'bem-social' 6 | }, { 7 | block : 'github-button', 8 | mods : { type : 'download', large : true }, 9 | user : 'bem-incubator', 10 | repo : 'bem-social', 11 | text : 'Custom' 12 | }] 13 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_orange.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-ribbon').mod('theme', 'orange').def()(function() { 2 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png'; 3 | if(this.mods.right) { 4 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png'; 5 | } 6 | applyNext(); 7 | }); 8 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/04-type_issue.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'github-button', 3 | mods : { type : 'issue' }, 4 | user : 'bem-incubator', 5 | repo : 'bem-social' 6 | }, { 7 | block : 'github-button', 8 | mods : { type : 'issue', large : true, count : true }, 9 | user : 'bem-incubator', 10 | repo : 'bem-social', 11 | text : 'Custom' 12 | }] 13 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/05-type_star.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'github-button', 3 | mods : { type : 'star' }, 4 | user : 'bem-incubator', 5 | repo : 'bem-social' 6 | }, { 7 | block : 'github-button', 8 | mods : { type : 'star', large : true, count : true }, 9 | user : 'bem-incubator', 10 | repo : 'bem-social', 11 | text : 'Custom' 12 | }] 13 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/06-type_watch.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'github-button', 3 | mods : { type : 'watch' }, 4 | user : 'bem-incubator', 5 | repo : 'bem-social' 6 | }, { 7 | block : 'github-button', 8 | mods : { type : 'watch', large : true, count : true }, 9 | user : 'bem-incubator', 10 | repo : 'bem-social', 11 | text : 'Custom' 12 | }] 13 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | tech : 'tmpl-spec.js', 3 | mustDeps : [ 4 | { mods : { theme : 'darkblue' } }, 5 | { mods : { theme : 'gray' } }, 6 | { mods : { theme : 'green' } }, 7 | { mods : { theme : 'orange' } }, 8 | { mods : { theme : 'red' } }, 9 | { mods : { theme : 'white' } }, 10 | ] 11 | }] 12 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_darkblue.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-ribbon').mod('theme', 'darkblue').def()(function() { 2 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png'; 3 | if(this.mods.right) { 4 | this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png'; 5 | } 6 | applyNext(); 7 | }); 8 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/01-type_fork.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'github-button', 3 | mods : { type : 'fork' }, 4 | user : 'bem-incubator', 5 | repo : 'bem-social' 6 | }, { 7 | block : 'github-button', 8 | mods : { type : 'fork', large : true, count : true }, 9 | user : 'bem-incubator', 10 | repo : 'bem-social', 11 | text : 'Fork me now!' 12 | }] 13 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_facebook.bemhtml: -------------------------------------------------------------------------------- 1 | block('icon').mod('service', 'facebook')( 2 | content()('') 3 | ); 4 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.tmpl-specs/01-widget_share.html: -------------------------------------------------------------------------------- 1 | Tweet 2 | Custom content 3 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service.bemhtml: -------------------------------------------------------------------------------- 1 | block('icon').match(function() { return !!(this.ctx.mods && this.ctx.mods.service); })( 2 | tag()('svg'), 3 | attrs()(function() { 4 | return this.extend({ 5 | xmlns : 'http://www.w3.org/2000/svg', 6 | width : '415', 7 | height : '415', 8 | viewBox : '0 0 415 415' 9 | }, applyNext()); 10 | }) 11 | ); 12 | -------------------------------------------------------------------------------- /desktop.blocks/yashare/yashare.bemhtml: -------------------------------------------------------------------------------- 1 | block('yashare')( 2 | js()(true), 3 | cls()('yashare-auto-init'), 4 | attrs()(function() { 5 | var ctx = this.ctx; 6 | return { 7 | 'data-yashareQuickServices' : (ctx.quickServices || []).join(','), 8 | 'data-yashareTheme' : ctx.theme || 'counter', 9 | 'data-yashareL10n' : ctx.l10n || 'ru' 10 | }; 11 | }) 12 | ); 13 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/02-type_follow.html: -------------------------------------------------------------------------------- 1 | Follow @bem-incubator 2 | Custom 3 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('icon', function(ctx) { 4 | if(!ctx.mod('service')) return; 5 | 6 | ctx.tag('svg'); 7 | ctx.attrs({ 8 | xmlns : 'http://www.w3.org/2000/svg', 9 | width : '415', 10 | height : '415', 11 | viewBox : '0 0 415 415' 12 | }, true); 13 | }); 14 | 15 | }; 16 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_facebook.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /desktop.blocks/yashare/yashare.browser.js: -------------------------------------------------------------------------------- 1 | modules.define( 2 | 'yashare', 3 | ['i-bem__dom', 'loader_type_js'], 4 | function(provide, BEMDOM, Loader) { 5 | provide(BEMDOM.decl('yashare', { 6 | onSetMod : { 7 | js : { 8 | inited : function() { 9 | Loader('//yandex.st/share/share.js'); 10 | } 11 | } 12 | } 13 | })); 14 | }); 15 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/03-type_download.html: -------------------------------------------------------------------------------- 1 | Download 2 | Custom 3 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/01-service_blogger.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'share', 3 | mods : { service : 'blogger' }, 4 | params : { url : 'http://w3c' } 5 | }, { 6 | block : 'share', 7 | mods : { service : 'blogger' }, 8 | params : { 9 | url : 'https://bem-social', 10 | title : 'bem-social', 11 | description : 'from incubator with love' 12 | }, 13 | text : 'Custom share!' 14 | }] 15 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | mustDeps : [{ block : 'i-bem', elems : 'dom' }], 3 | }, { 4 | tech : 'tmpl-spec.js', 5 | mustDeps : [ 6 | { mods : { type : 'download' } }, 7 | { mods : { type : 'follow' } }, 8 | { mods : { type : 'fork' } }, 9 | { mods : { type : 'issue' } }, 10 | { mods : { type : 'star' } }, 11 | { mods : { type : 'watch' } }, 12 | ] 13 | }] 14 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.tmpl-specs/01-widget_share.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'twitter', 3 | mods : { widget : 'share' }, 4 | }, { 5 | block : 'twitter', 6 | mods : { widget : 'share' }, 7 | url : 'url', 8 | text : 'text', 9 | via : 'via', 10 | related : 'related', 11 | hashtags : 'hashtags', 12 | count : 'count', 13 | lang : 'lang', 14 | size : 'size', 15 | content : 'Custom content' 16 | }] 17 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_gray.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-ribbon_theme_gray', function(ctx) { 4 | var img = ctx.mod('right')? 5 | 'https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png' 6 | : 'https://s3.amazonaws.com/github/ribbons/forkme_left_gray_6d6d6d.png'; 7 | 8 | ctx.param('image', img); 9 | }); 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_red.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-ribbon_theme_red', function(ctx) { 4 | var img = ctx.mod('right')? 5 | 'https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png' 6 | : 'https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png'; 7 | 8 | ctx.param('image', img); 9 | }); 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_green.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-ribbon_theme_green', function(ctx) { 4 | var img = ctx.mod('right')? 5 | 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png' 6 | : 'https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png'; 7 | 8 | ctx.param('image', img); 9 | }); 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_white.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-ribbon_theme_white', function(ctx) { 4 | var img = ctx.mod('right')? 5 | 'https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png' 6 | : 'https://s3.amazonaws.com/github/ribbons/forkme_left_white_ffffff.png'; 7 | 8 | ctx.param('image', img); 9 | }); 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_orange.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-ribbon_theme_orange', function(ctx) { 4 | var img = ctx.mod('right')? 5 | 'https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png' 6 | : 'https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png'; 7 | 8 | ctx.param('image', img); 9 | }); 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /desktop.blocks/yashare/yashare.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('yashare', function(ctx, json) { 4 | ctx.js(true); 5 | ctx.cls('yashare-auto-init'); 6 | ctx.attrs({ 7 | 'data-yashareQuickServices' : (json.quickServices || []).join(','), 8 | 'data-yashareTheme' : json.theme || 'counter', 9 | 'data-yashareL10n' : json.l10n || 'ru' 10 | }); 11 | }); 12 | 13 | }; 14 | -------------------------------------------------------------------------------- /common.blocks/share/share.deps.js: -------------------------------------------------------------------------------- 1 | [{ 2 | mustDeps : [ 3 | { block : 'i-bem', elems : ['dom'] } 4 | ], 5 | shouldDeps : [] 6 | }, { 7 | tech : 'tmpl-spec.js', 8 | mustDeps : [ 9 | { mods : { service : 'blogger' } }, 10 | { mods : { service : 'facebook' } }, 11 | { mods : { service : 'gplus' } }, 12 | { mods : { service : 'twitter' } }, 13 | { mods : { service : 'vkontakte' } }, 14 | ] 15 | }] 16 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_gplus.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('share_service_gplus', function(ctx, json) { 4 | var params = json.params, 5 | uri = 'https://plus.google.com/share?'; 6 | 7 | ctx.js(params); 8 | 9 | params.url && (uri += 'url=' + encodeURIComponent(params.url)); 10 | 11 | ctx.attrs({ href : uri, title : json.title || 'Google Plus' }); 12 | }); 13 | 14 | }; 15 | -------------------------------------------------------------------------------- /common.blocks/share/share.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('share', function(ctx, json) { 4 | ctx.tag('a'); 5 | 6 | var content = [json.icon]; 7 | 8 | (!json.icon && json.text !== false) && content.push({ elem : 'text', content : json.text || 'Share' }); 9 | 10 | ctx.content(content); 11 | }); 12 | 13 | bh.match('share__text', function(ctx) { 14 | ctx.tag('span'); 15 | }); 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme_darkblue.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-ribbon_theme_darkblue', function(ctx) { 4 | var img = ctx.mod('right')? 5 | 'https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png' 6 | : 'https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png'; 7 | 8 | ctx.param('image', img); 9 | }); 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /common.blocks/github-ribbon/github-ribbon.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-ribbon')( 2 | tag()('a'), 3 | attrs()(function() { 4 | return { 5 | href : this.ctx.url 6 | }; 7 | }), 8 | content()(function() { 9 | return { 10 | tag : 'img', 11 | attrs : { 12 | src : this.ctx.image, 13 | alt : this.ctx.alt || 'Fork me on GitHub' 14 | } 15 | }; 16 | }) 17 | ); 18 | -------------------------------------------------------------------------------- /common.blocks/github-ribbon/github-ribbon.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-ribbon', function(ctx, json) { 4 | ctx.tag('a'); 5 | ctx.attrs({ 6 | href : json.url 7 | }); 8 | ctx.content({ 9 | tag : 'img', 10 | attrs : { 11 | src : json.image, 12 | alt : json.alt || 'Fork me on GitHub' 13 | } 14 | }); 15 | }); 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/02-service_facebook.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'share', 3 | mods : { service : 'facebook' }, 4 | params : { url : 'http://w3c' } 5 | }, { 6 | block : 'share', 7 | mods : { service : 'facebook' }, 8 | params : { 9 | url : 'https://bem-social', 10 | title : 'bem-social', 11 | description : 'from incubator with love', 12 | image : 'fb.png' 13 | }, 14 | text : 'Custom share!' 15 | }] 16 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/05-service_vkontakte.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'share', 3 | mods : { service : 'vkontakte' }, 4 | params : { url : 'http://w3c' } 5 | }, { 6 | block : 'share', 7 | mods : { service : 'vkontakte' }, 8 | params : { 9 | url : 'https://bem-social', 10 | title : 'bem-social', 11 | description : 'from incubator with love', 12 | image : 'fb.png' 13 | }, 14 | text : 'Custom share!' 15 | }] 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs. 2 | # More information at http://EditorConfig.org 3 | 4 | # No .editorconfig files above the root directory 5 | root = true 6 | 7 | [*] 8 | charset = utf-8 9 | indent_size = 4 10 | end_of_line = lf 11 | indent_style = space 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [*.{bemjson.js,deps.js}] 16 | indent_size = 4 17 | 18 | [*.md] 19 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/04-type_issue.html: -------------------------------------------------------------------------------- 1 | Issue 2 | Custom 3 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_facebook.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('icon_service_facebook', function(ctx) { 4 | ctx.content(''); 5 | }); 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_vkontakte.browser.js: -------------------------------------------------------------------------------- 1 | /* global modules:false */ 2 | 3 | modules.define('share', function(provide, Share) { 4 | 5 | provide(Share.decl({ modName : 'service', modVal : 'vkontakte' }, { 6 | onSetMod : { 7 | 'js' : { 8 | 'inited' : function() { 9 | this.__base.apply(this, arguments); 10 | // При желании кастомная обработка 11 | } 12 | } 13 | } 14 | })); 15 | 16 | }); 17 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/05-type_star.html: -------------------------------------------------------------------------------- 1 | Star 2 | Custom 3 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/06-type_watch.html: -------------------------------------------------------------------------------- 1 | Watch 2 | Custom 3 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.tmpl-specs/01-type_fork.html: -------------------------------------------------------------------------------- 1 | Fork 2 | Fork me now! 3 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/03-service_gplus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /common.blocks/github-button/github-button.browser.js: -------------------------------------------------------------------------------- 1 | modules.require([], function() { 2 | (function(d, s, id){ 3 | var js, 4 | fjs = d.getElementsByTagName(s)[0]; 5 | if(d.getElementById(id)) { 6 | return; 7 | } 8 | js = d.createElement(s); 9 | js.async = true; 10 | js.defer = true; 11 | js.id = id; 12 | js.src = 'https://buttons.github.io/buttons.js'; 13 | fjs.parentNode.insertBefore(js, fjs); 14 | }(document, 'script', 'github-bjs')); 15 | }); 16 | -------------------------------------------------------------------------------- /common.blocks/vk/vk.tmpl-specs/01-widget_like.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'vk', 3 | mods : { widget : 'like' }, 4 | id : '123', 5 | pageId : '456' 6 | }, { 7 | block : 'vk', 8 | mods : { widget : 'like' }, 9 | id : 'my-id', 10 | type : 'my-type', 11 | title : 'my-title', 12 | description : 'my-description', 13 | url : 'my-url', 14 | image : 'my-image', 15 | text : 'my-text', 16 | verb : 'my-verb', 17 | width : 'my-width', 18 | height : 'my-height', 19 | pageId : 'my-pageId', 20 | }] 21 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_gplus.bemhtml: -------------------------------------------------------------------------------- 1 | block('share').mod('service', 'gplus')( 2 | js()(function() { 3 | return this.extend(applyNext(), this.ctx.params); 4 | }), 5 | attrs()(function() { 6 | var ctx = this.ctx, 7 | params = ctx.params, 8 | uri = 'https://plus.google.com/share?'; 9 | 10 | params.url && (uri += 'url=' + encodeURIComponent(params.url)); 11 | 12 | return this.extend(applyNext(), { href : uri, title : ctx.title || 'Google Plus' }); 13 | }) 14 | ); 15 | -------------------------------------------------------------------------------- /promo.blocks/link/link.styl: -------------------------------------------------------------------------------- 1 | .link_github_ribbon 2 | { 3 | background-color: #121621; 4 | top: 3.2em; 5 | right: -3.7em; 6 | transform: rotate(45deg); 7 | box-shadow: 0 0 0 1px #1d212e inset, 0 0 2px 1px #fff inset, 0 0 1em #888; 8 | color: rgba(255, 255, 255, 0.90) !important; 9 | display: block; 10 | padding: .6em 3.5em; 11 | position: absolute; 12 | font: bold .82em sans-serif; 13 | text-align: center; 14 | text-decoration: none; 15 | text-shadow: 1px -1px 8px rgba(0, 0, 0, 0.60); 16 | user-select: none; 17 | } 18 | -------------------------------------------------------------------------------- /common.blocks/vk/_widget/vk_widget_like.browser.js: -------------------------------------------------------------------------------- 1 | modules.define( 2 | 'vk_widget_like', 3 | ['i-bem__dom', 'vk', 'vk__config'], 4 | function(provide, BEMDOM, VK) { 5 | 6 | provide(BEMDOM.decl({ block : 'vk', modName : 'widget', modVal : 'like' }, { 7 | onSetMod : { 8 | js : { 9 | inited : function() { 10 | var params = this.params; 11 | VK.Widgets.Like(params.element_id, params, params.page_id || ''); 12 | } 13 | } 14 | } 15 | })); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /promo.blocks/page/page.styl: -------------------------------------------------------------------------------- 1 | .page 2 | { 3 | padding: 10px; 4 | .heading { 5 | font-family: 'PT Sans'; 6 | font-weight: normal; 7 | text-transform: uppercase; 8 | 9 | .link { 10 | color: #121212; 11 | } 12 | } 13 | 14 | &__footer { 15 | margin-top: 20px; 16 | padding-top: 20px; 17 | border-top: 1px solid; 18 | 19 | font-family: 'PT Sans'; 20 | } 21 | } 22 | .page__ribbon { 23 | position : relative; 24 | .github-ribbon { 25 | position : relative; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_download.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-button_type_download', function(ctx, json) { 4 | var mods = ctx.mods(); 5 | var user = json.user; 6 | var repo = json.repo; 7 | 8 | ctx.attrs({ 9 | href : 'https://github.com/' + user + '/' + repo + '/archive/master.zip', 10 | 'data-style' : mods.large && 'mega', 11 | 'data-icon' : 'octicon-cloud-download' 12 | }); 13 | ctx.content(json.text || 'Download'); 14 | }); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /common.blocks/share/share.browser.js: -------------------------------------------------------------------------------- 1 | /* global modules:false */ 2 | 3 | modules.define('share', ['i-bem__dom', 'control'], function(provide, BEMDOM, Control) { 4 | 5 | provide(BEMDOM.decl({ block : this.name, baseBlock : Control }, { 6 | onSetMod : { 7 | 'js' : { 8 | 'inited' : function() { 9 | this.bindTo('click', this._openPopup); 10 | } 11 | } 12 | }, 13 | _openPopup : function() { 14 | window.open(this.domElem.attr('href'), '', 'toolbar=0,status=0,width=626,height=436'); 15 | return false; 16 | } 17 | })); 18 | }); 19 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_download.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-button').mod('type', 'download')( 2 | attrs()(function() { 3 | var mods = this.ctx.mods; 4 | var user = this.ctx.user; 5 | var repo = this.ctx.repo; 6 | 7 | return this.extend(applyNext(), { 8 | href : 'https://github.com/' + user + '/' + repo + '/archive/master.zip', 9 | 'data-style' : mods.large && 'mega', 10 | 'data-icon' : 'octicon-cloud-download' 11 | }); 12 | }), 13 | content()(function() { 14 | return this.ctx.text || 'Download'; 15 | }) 16 | ); 17 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_follow.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-button_type_follow', function(ctx, json) { 4 | var mods = ctx.mods(); 5 | var user = json.user; 6 | 7 | ctx.attrs({ 8 | href : 'https://github.com/' + user, 9 | 'data-style' : mods.large && 'mega', 10 | 'data-count-href' : mods.count && ('/' + user + '/followers'), 11 | 'data-count-api' : mods.count && ('/users/' + user + '#followers') 12 | }); 13 | ctx.content(json.text || 'Follow @' + json.user); 14 | }); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_twitter.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('share_service_twitter', function(ctx, json) { 4 | var params = json.params, 5 | uri = 'https://twitter.com/share?'; 6 | 7 | ctx.js(params); 8 | 9 | params.title && (uri += 'text=' + encodeURIComponent(params.title)); 10 | params.url && (uri += '&url=' + encodeURIComponent(params.url)); 11 | params.url && (uri += '&counturl=' + encodeURIComponent(params.url)); 12 | 13 | ctx.attrs({ href : uri, title : json.title || 'Twitter' }); 14 | }); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_blogger.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('share_service_blogger', function(ctx, json) { 4 | var params = json.params, 5 | uri = 'https://www.blogger.com/blog_this.pyra?'; 6 | 7 | ctx.js(params); 8 | 9 | params.url && (uri += '&u=' + encodeURIComponent(params.url)); 10 | params.title && (uri += '&n=' + encodeURIComponent(params.title)); 11 | params.description && (uri += '&t=' + encodeURIComponent(params.description)); 12 | 13 | ctx.attrs({ href : uri, title : json.title || 'Blogger' }); 14 | }); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/04-service_twitter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /common.blocks/twitter/_widget/twitter_widget_tweet.bemhtml: -------------------------------------------------------------------------------- 1 | block('twitter').mod('widget', 'tweet')( 2 | cls()('twitter-tweet'), 3 | tag()('blockquote'), 4 | attrs()(function() { 5 | return this.extend(applyNext(), { 6 | 'lang' : this.ctx.lang || 'ru' 7 | }); 8 | }) 9 | ); 10 | 11 | // 12 | -------------------------------------------------------------------------------- /common.blocks/vk/_widget/vk_widget_like.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('vk_widget_like', function(ctx, json) { 4 | ctx.js({ 5 | element_id : json.id, 6 | type : json.type, 7 | pageTitle : json.title, 8 | pageDescription : json.description, 9 | pageUrl : json.url, 10 | pageImage : json.image, 11 | text : json.text, 12 | verb : json.verb, 13 | width : json.width, 14 | height : json.height, 15 | page_id : json.pageId 16 | }); 17 | ctx.attrs({ id : json.id }); 18 | }); 19 | 20 | }; 21 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_issue.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-button_type_issue', function(ctx, json) { 4 | var mods = ctx.mods(); 5 | var user = json.user; 6 | var repo = json.repo; 7 | 8 | ctx.attrs({ 9 | href : 'https://github.com/' + user + '/' + repo + '/issues', 10 | 'data-style' : mods.large && 'mega', 11 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#open_issues_count'), 12 | 'data-icon' : 'octicon-issue-opened' 13 | }); 14 | ctx.content(json.text || 'Issue'); 15 | }); 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_follow.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-button').mod('type', 'follow')( 2 | attrs()(function() { 3 | var mods = this.ctx.mods; 4 | var user = this.ctx.user; 5 | 6 | return this.extend(applyNext(), { 7 | href : 'https://github.com/' + user, 8 | 'data-style' : mods.large && 'mega', 9 | 'data-count-href' : mods.count && ('/' + user + '/followers'), 10 | 'data-count-api' : mods.count && ('/users/' + user + '#followers') 11 | }); 12 | }), 13 | content()(function() { 14 | return this.ctx.text || 'Follow @' + this.ctx.user; 15 | }) 16 | ); 17 | -------------------------------------------------------------------------------- /common.blocks/twitter/_widget/twitter_widget_share.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('twitter_widget_share', function(ctx, json) { 4 | ctx.cls('twitter-share-button'); 5 | ctx.attrs({ 6 | href : 'https://twitter.com/share', 7 | 'data-url' : json.url, 8 | 'data-text' : json.text, 9 | 'data-via' : json.via, 10 | 'data-related' : json.related, 11 | 'data-hashtags' : json.hashtags, 12 | 'data-count' : json.count, 13 | 'data-lang' : json.lang, 14 | 'data-size' : json.size 15 | }); 16 | ctx.content('Tweet'); 17 | }); 18 | 19 | }; 20 | -------------------------------------------------------------------------------- /common.blocks/og/og.tmpl-specs/01-plain.bemjson.js: -------------------------------------------------------------------------------- 1 | [ 2 | { block : 'og', title : 'Passing title!' }, 3 | { block : 'og', description : 'Passing description!' }, 4 | { block : 'og', type : 'Passing type!' }, 5 | { block : 'og', keywords : 'Passing keywords!' }, 6 | { block : 'og', url : 'Passing url!' }, 7 | { block : 'og', image : 'Passing image!' }, 8 | 9 | { 10 | block : 'og', 11 | title : 'Altogether: title!', 12 | description : 'Altogether: description!', 13 | type : 'Altogether: type!', 14 | keywords : 'Altogether: keywords!', 15 | url : 'Altogether: url!', 16 | image : 'Altogether: image!' 17 | }, 18 | ] 19 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_issue.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-button').mod('type', 'issue')( 2 | attrs()(function() { 3 | var mods = this.ctx.mods; 4 | var user = this.ctx.user; 5 | var repo = this.ctx.repo; 6 | 7 | return this.extend(applyNext(), { 8 | href : 'https://github.com/' + user + '/' + repo + '/issues', 9 | 'data-style' : mods.large && 'mega', 10 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#open_issues_count'), 11 | 'data-icon' : 'octicon-issue-opened' 12 | }); 13 | }), 14 | content()(function() { 15 | return this.ctx.text || 'Issue'; 16 | }) 17 | ); 18 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/01-service_blogger.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /common.blocks/github-ribbon/github-ribbon.md: -------------------------------------------------------------------------------- 1 | #github-ribbon 2 | 3 | ## Моды 4 | 5 | `url` — ссылка на страницу репозитория 6 | 7 | `image` — если указан подгружает кастомную картинку 8 | 9 | ## Модификаторы 10 | - `left` {true} 11 | 12 | Ribbon прижат вправо 13 | 14 | - `right` {true} 15 | 16 | Ribbon прижат вправо 17 | 18 | - `theme` : {Имя темы} (опционально) 19 | 20 | Переопределяет моду `image` на одну из тем https://github.com/blog/273-github-ribbons 21 | Нужен уровень переопределения `bem-social/design/common.blocks` 22 | 23 | ## Пример 24 | ```js 25 | { 26 | block : 'github-ribbon', 27 | mods : { theme : 'red', right : true }, 28 | url : 'https://github.com/voischev/bem-social' 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bem-social", 3 | "version": "0.3.1", 4 | "description": "BEM Social Components Library", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/bem-contrib/bem-social" 8 | }, 9 | "keywords": [ 10 | "bem", 11 | "stylus", 12 | "social", 13 | "buttons", 14 | "widgets" 15 | ], 16 | "bugs": "https://github.com/bem-contrib/bem-social/issues", 17 | "ignore": [ 18 | ".bem/cache", 19 | "node_modules", 20 | "libs" 21 | ], 22 | "authors": [ 23 | "Mitya Teryaew ", 24 | "Ivan Voischev " 25 | ], 26 | "dependencies": { 27 | "bem-components": "2.3.0" 28 | }, 29 | "license": "MIT" 30 | } 31 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_twitter.bemhtml: -------------------------------------------------------------------------------- 1 | block('share').mod('service', 'twitter')( 2 | js()(function() { 3 | return this.extend(applyNext(), this.ctx.params); 4 | }), 5 | attrs()(function() { 6 | var ctx = this.ctx, 7 | params = ctx.params, 8 | uri = 'https://twitter.com/share?'; 9 | 10 | params.title && (uri += 'text=' + encodeURIComponent(params.title)); 11 | params.url && (uri += '&url=' + encodeURIComponent(params.url)); 12 | params.url && (uri += '&counturl=' + encodeURIComponent(params.url)); 13 | 14 | return this.extend(applyNext(), { href : uri, title : ctx.title || 'Twitter' }); 15 | }) 16 | ); 17 | -------------------------------------------------------------------------------- /common.blocks/vk/vk.tmpl-specs/01-widget_like.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_fork.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-button_type_fork', function(ctx, json) { 4 | var mods = ctx.mods(); 5 | var user = json.user; 6 | var repo = json.repo; 7 | 8 | ctx.attrs({ 9 | href : 'https://github.com/' + user + '/' + repo, 10 | 'data-style' : mods.large && 'mega', 11 | 'data-count-href' : mods.count && ('/' + user + '/' + repo + '/network'), 12 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#forks_count'), 13 | 'data-icon' : 'octicon-git-branch' 14 | }); 15 | ctx.content(json.text || 'Fork'); 16 | }); 17 | 18 | }; 19 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_star.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-button_type_star', function(ctx, json) { 4 | var mods = ctx.mods(); 5 | var user = json.user; 6 | var repo = json.repo; 7 | 8 | ctx.attrs({ 9 | href : 'https://github.com/' + user + '/' + repo, 10 | 'data-style' : mods.large && 'mega', 11 | 'data-count-href' : mods.count && ('/' + user + '/' + repo + '/stargazers'), 12 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#stargazers_count'), 13 | 'data-icon' : 'octicon-star' 14 | }); 15 | ctx.content(json.text || 'Star'); 16 | }); 17 | 18 | }; 19 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_blogger.bemhtml: -------------------------------------------------------------------------------- 1 | block('share').mod('service', 'blogger')( 2 | js()(function() { 3 | return this.extend(applyNext(), this.ctx.params); 4 | }), 5 | attrs()(function() { 6 | var ctx = this.ctx, 7 | params = ctx.params, 8 | uri = 'https://www.blogger.com/blog_this.pyra?'; 9 | 10 | params.url && (uri += '&u=' + encodeURIComponent(params.url)); 11 | params.title && (uri += '&n=' + encodeURIComponent(params.title)); 12 | params.description && (uri += '&t=' + encodeURIComponent(params.description)); 13 | 14 | return this.extend(applyNext(), { href : uri, title : ctx.title || 'Blogger' }); 15 | }) 16 | ); 17 | -------------------------------------------------------------------------------- /common.blocks/twitter/twitter.browser.js: -------------------------------------------------------------------------------- 1 | modules.require([], function() { 2 | window.twttr = (function(d, s, id){ 3 | var t, 4 | js, 5 | fjs = d.getElementsByTagName(s)[0]; 6 | if(d.getElementById(id)) { 7 | return; 8 | } 9 | js = d.createElement(s); 10 | js.id = id; 11 | js.src = 'https://platform.twitter.com/widgets.js'; 12 | fjs.parentNode.insertBefore(js, fjs); 13 | return window.twttr || ( 14 | t = { 15 | _e : [], 16 | ready : function(f){ 17 | t._e.push(f); 18 | } 19 | } 20 | ); 21 | }(document, 'script', 'twitter-wjs')); 22 | }); 23 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_watch.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('github-button_type_watch', function(ctx, json) { 4 | var mods = ctx.mods(); 5 | var user = json.user; 6 | var repo = json.repo; 7 | 8 | ctx.attrs({ 9 | href : 'https://github.com/' + user + '/' + repo, 10 | 'data-style' : mods.large && 'mega', 11 | 'data-count-href' : mods.count && ('/' + user + '/' + repo + '/watchers'), 12 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#subscribers_count'), 13 | 'data-icon' : 'octicon-eye' 14 | }); 15 | ctx.content(json.text || 'Watch'); 16 | }); 17 | 18 | }; 19 | -------------------------------------------------------------------------------- /common.blocks/twitter/_widget/twitter_widget_share.bemhtml: -------------------------------------------------------------------------------- 1 | block('twitter').mod('widget', 'share')( 2 | cls()('twitter-share-button'), 3 | attrs()(function() { 4 | return this.extend(applyNext(), { 5 | href : 'https://twitter.com/share', 6 | 'data-url' : this.ctx.url, 7 | 'data-text' : this.ctx.text, 8 | 'data-via' : this.ctx.via, 9 | 'data-related' : this.ctx.related, 10 | 'data-hashtags' : this.ctx.hashtags, 11 | 'data-count' : this.ctx.count, 12 | 'data-lang' : this.ctx.lang, 13 | 'data-size' : this.ctx.size 14 | }); 15 | }), 16 | content()(function() { 17 | return this.ctx.content || 'Tweet'; 18 | }) 19 | ); 20 | -------------------------------------------------------------------------------- /common.blocks/og/og.tmpl-specs/01-plain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_star.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-button').mod('type', 'star')( 2 | attrs()(function() { 3 | var mods = this.ctx.mods; 4 | var user = this.ctx.user; 5 | var repo = this.ctx.repo; 6 | 7 | return this.extend(applyNext(), { 8 | href : 'https://github.com/' + user + '/' + repo, 9 | 'data-style' : mods.large && 'mega', 10 | 'data-count-href' : mods.count && ('/' + user + '/' + repo + '/stargazers'), 11 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#stargazers_count'), 12 | 'data-icon' : 'octicon-star' 13 | }); 14 | }), 15 | content()(function() { 16 | return this.ctx.text || 'Star'; 17 | }) 18 | ); 19 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_facebook.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('share_service_facebook', function(ctx, json) { 4 | var params = json.params, 5 | uri = 'https://www.facebook.com/sharer.php?s=100'; 6 | 7 | ctx.js(params); 8 | 9 | params.url && (uri += '&p[url]=' + encodeURIComponent(params.url)); 10 | params.title && (uri += '&p[title]=' + encodeURIComponent(params.title)); 11 | params.description && (uri += '&p[summary]=' + encodeURIComponent(params.description)); 12 | params.image && (uri += '&p[images][0]=' + encodeURIComponent(params.image)); 13 | 14 | ctx.attrs({ href : uri, title : json.title || 'Facebook' }); 15 | }); 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_fork.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-button').mod('type', 'fork')( 2 | attrs()(function() { 3 | var mods = this.ctx.mods; 4 | var user = this.ctx.user; 5 | var repo = this.ctx.repo; 6 | 7 | return this.extend(applyNext(), { 8 | href : 'https://github.com/' + user + '/' + repo, 9 | 'data-style' : mods.large && 'mega', 10 | 'data-count-href' : mods.count && ('/' + user + '/' + repo + '/network'), 11 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#forks_count'), 12 | 'data-icon' : 'octicon-git-branch' 13 | }); 14 | }), 15 | content()(function() { 16 | return this.ctx.text || 'Fork'; 17 | }) 18 | 19 | ); 20 | -------------------------------------------------------------------------------- /common.blocks/github-button/_type/github-button_type_watch.bemhtml: -------------------------------------------------------------------------------- 1 | block('github-button').mod('type', 'watch')( 2 | attrs()(function() { 3 | var mods = this.ctx.mods; 4 | var user = this.ctx.user; 5 | var repo = this.ctx.repo; 6 | 7 | return this.extend(applyNext(), { 8 | href : 'https://github.com/' + user + '/' + repo, 9 | 'data-style' : mods.large && 'mega', 10 | 'data-count-href' : mods.count && ('/' + user + '/' + repo + '/watchers'), 11 | 'data-count-api' : mods.count && ('/repos/' + user + '/' + repo + '#subscribers_count'), 12 | 'data-icon' : 'octicon-eye' 13 | }); 14 | }), 15 | content()(function() { 16 | return this.ctx.text || 'Watch'; 17 | }) 18 | ); 19 | -------------------------------------------------------------------------------- /common.blocks/og/og.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('og', function(ctx, json) { 4 | var og = []; 5 | 6 | function wrap(prop, value) { 7 | return { block : 'page', elem : 'meta', attrs : { property : prop, content : value } }; 8 | } 9 | 10 | json.title && og.push(wrap('og:title', json.title)); 11 | json.description && og.push(wrap('og:description', json.description)); 12 | json.type && og.push(wrap('og:type', json.type)); 13 | json.keywords && og.push(wrap('og:article:tag', json.keywords)); 14 | json.url && og.push(wrap('og:url', json.url)); 15 | json.image && og.push(wrap('og:image', json.image)); 16 | 17 | return og; 18 | }); 19 | 20 | }; 21 | -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/05-service_vkontakte.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /git_hooks/pre-commit/lint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Check changed js files using jshint and jscs 4 | # 5 | 6 | PATCH_FILE="working-tree.patch" 7 | NPM_BIN="./node_modules/.bin" 8 | 9 | function cleanup { 10 | exit_code=$? 11 | if [ -f "$PATCH_FILE" ]; then 12 | patch -p0 < "$PATCH_FILE" 13 | rm "$PATCH_FILE" 14 | fi 15 | exit $exit_code 16 | } 17 | 18 | trap cleanup EXIT SIGINT SIGHUP 19 | 20 | # Cancel any changes to the working tree that are not going to be committed 21 | git diff --no-prefix > "$PATCH_FILE" 22 | git checkout -- . 23 | 24 | git_cached_files=$(git diff --cached --name-only --diff-filter=ACMR | xargs echo) 25 | if [ "$git_cached_files" ]; then 26 | $NPM_BIN/jshint-groups $git_cached_files || exit 1 27 | $NPM_BIN/jscs $git_cached_files || exit 1 28 | fi -------------------------------------------------------------------------------- /common.blocks/share/share.tmpl-specs/02-service_facebook.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_vkontakte.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('share_service_vkontakte', function(ctx, json) { 4 | var params = json.params, 5 | uri = 'http://vkontakte.ru/share.php?'; 6 | 7 | ctx.js(params); 8 | 9 | params.url && (uri += 'url=' + encodeURIComponent(params.url)); 10 | params.title && (uri += '&title=' + encodeURIComponent(params.title)); 11 | params.description && (uri += '&description=' + encodeURIComponent(params.description)); 12 | params.image && (uri += '&image=' + encodeURIComponent(params.image)); 13 | true && (uri += '&noparse=true'); 14 | 15 | ctx.attrs({ href : uri, title : json.title || 'ВКонтакте' }); 16 | }); 17 | 18 | }; 19 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_blogger.bemhtml: -------------------------------------------------------------------------------- 1 | block('icon').mod('service', 'blogger')( 2 | content()('') 3 | ); 4 | -------------------------------------------------------------------------------- /design/common.blocks/share/_theme/share_theme_simple.styl: -------------------------------------------------------------------------------- 1 | .share_theme_simple 2 | { 3 | font-weight: bold; 4 | padding: 0.2em 0.6em; 5 | text-decoration: none; 6 | color: #FFF; 7 | 8 | &.share_size_s 9 | { 10 | font-size: 14px; 11 | } 12 | &.share_size_m 13 | { 14 | font-size: 16px; 15 | } 16 | &.share_size_l 17 | { 18 | font-size: 18px; 19 | } 20 | &.share_size_xl 21 | { 22 | font-size: 20px; 23 | } 24 | 25 | &.share_service_blogger { background-color: #f26300; } 26 | &.share_service_facebook { background-color: #3B5998; } 27 | &.share_service_gplus { background-color: #CC3732; } 28 | &.share_service_twitter { background-color: #00ACED; } 29 | &.share_service_vkontakte { background-color: #4D75A3; } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /common.blocks/vk/_widget/vk_widget_like.bemhtml: -------------------------------------------------------------------------------- 1 | block('vk').mod('widget', 'like')( 2 | js()(function() { 3 | var ctx = this.ctx; 4 | return this.extend( 5 | applyNext(), 6 | { 7 | element_id : ctx.id, 8 | type : ctx.type, 9 | pageTitle : ctx.title, 10 | pageDescription : ctx.description, 11 | pageUrl : ctx.url, 12 | pageImage : ctx.image, 13 | text : ctx.text, 14 | verb : ctx.verb, 15 | width : ctx.width, 16 | height : ctx.height, 17 | page_id : ctx.pageId 18 | } 19 | ); 20 | }), 21 | attrs()(function() { 22 | return this.extend(applyNext(), { id : this.ctx.id }); 23 | }) 24 | ); 25 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_blogger.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.10' 4 | branches: 5 | only: 6 | - master 7 | before_script: 8 | - chmod +x ./utils/update-gh-pages.sh 9 | after_success: 10 | - git config credential.helper "store --file=.git/credentials" 11 | - echo "https://${GH_TOKEN}:@github.com" > .git/credentials 12 | - ./utils/update-gh-pages.sh 13 | env: 14 | global: 15 | - GH_REF: github.com/bem-contrib/bem-social.git 16 | - secure: GR67HlGjAXHyy6HGYJHwX8CIG6G0wHr+gQtO2sK+5raK0deJN+0wXACiXiIQ+x5bTHBfnKHAsZmt0yr7s4gvKU0D3D3zwUXzJlSCFtVFrL7mKjRzZM/uKJ4lqpCUqpyx3nzc7ohELh5F3iCJgcygJ72yrzoVWCouksEipGVIRUg= 17 | - secure: J6L6ZO6WVvzSFL0Iiw2xSkY3LSlJ1K/85Op0fEUZaKuhXmws1eGdG7nfl2KODIyA4fCMWzu04tJym7bovu3jpmQCjsMlKH96eXauUo6Zf1+ozKNnkwVQ9qCyqvsrBZbQM4Vv9sXqBP0YlzCUQBHEifp5U7cKSVBElp60Q9GVgnI= 18 | # matrix: 19 | # include: 20 | # - TEST_SCOPE: lint 21 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_facebook.bemhtml: -------------------------------------------------------------------------------- 1 | block('share').mod('service', 'facebook')( 2 | js()(function() { 3 | return this.extend(applyNext(), this.ctx.params); 4 | }), 5 | attrs()(function() { 6 | var ctx = this.ctx, 7 | params = ctx.params, 8 | uri = 'https://www.facebook.com/sharer.php?s=100'; 9 | 10 | params.url && (uri += '&p[url]=' + encodeURIComponent(params.url)); 11 | params.title && (uri += '&p[title]=' + encodeURIComponent(params.title)); 12 | params.description && (uri += '&p[summary]=' + encodeURIComponent(params.description)); 13 | params.image && (uri += '&p[images][0]=' + encodeURIComponent(params.image)); 14 | 15 | return this.extend(applyNext(), { href : uri, title : ctx.title || 'Facebook' }); 16 | }) 17 | ); 18 | -------------------------------------------------------------------------------- /utils/update-gh-pages.sh: -------------------------------------------------------------------------------- 1 | if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then 2 | echo "gh-pages is updating..." 3 | 4 | git config --global user.email "travis@travis-ci.org" 5 | git config --global user.name "Travis" 6 | 7 | bower cache clean 8 | bower-npm-install 9 | 10 | YENV=production enb make -n 11 | 12 | git clone -b gh-pages https://${GH_TOKEN}@github.com/bem-contrib/bem-social.git gh-pages 13 | 14 | cd gh-pages 15 | 16 | cp ../desktop.bundles/index/index.html index.html 17 | cp ../desktop.bundles/index/_index.js _index.js 18 | cp ../desktop.bundles/index/_index.css _index.css 19 | 20 | git add -A 21 | git commit -m "Travis build $TRAVIS_BUILD_NUMBER has been pushed to gh-pages" 22 | git push origin gh-pages 23 | cd .. 24 | rm -rf gh-pages 25 | 26 | echo "gh-pages has been updated successfully" 27 | fi 28 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_twitter.bemhtml: -------------------------------------------------------------------------------- 1 | block('icon').mod('service', 'twitter')( 2 | content()('') 3 | ); 4 | -------------------------------------------------------------------------------- /common.blocks/disqus/disqus.browser.js: -------------------------------------------------------------------------------- 1 | modules.define( 2 | 'disqus', 3 | ['i-bem__dom'], 4 | function(provide, BEMDOM) { 5 | 6 | provide(BEMDOM.decl(this.name, { 7 | onSetMod : { 8 | 'js' : { 9 | 'inited' : function() { 10 | var disqus_shortname = this.params.shortname; 11 | (function() { 12 | var dsq = document.createElement('script'); 13 | dsq.type = 'text/javascript'; 14 | dsq.async = true; 15 | dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; 16 | (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); 17 | })(); 18 | } 19 | } 20 | } 21 | })); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_blogger.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('icon_service_blogger', function(ctx) { 4 | ctx.content(''); 5 | }); 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /common.blocks/share/_service/share_service_vkontakte.bemhtml: -------------------------------------------------------------------------------- 1 | block('share').mod('service', 'vkontakte')( 2 | js()(function() { 3 | return this.extend(applyNext(), this.ctx.params); 4 | }), 5 | attrs()(function() { 6 | var ctx = this.ctx, 7 | params = ctx.params, 8 | uri = 'http://vkontakte.ru/share.php?'; 9 | 10 | params.url && (uri += 'url=' + encodeURIComponent(params.url)); 11 | params.title && (uri += '&title=' + encodeURIComponent(params.title)); 12 | params.description && (uri += '&description=' + encodeURIComponent(params.description)); 13 | params.image && (uri += '&image=' + encodeURIComponent(params.image)); 14 | true && (uri += '&noparse=true'); 15 | 16 | return this.extend(applyNext(), { href : uri, title : ctx.title || 'ВКонтакте' }); 17 | }) 18 | ); 19 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_twitter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common.blocks/og/og.bemhtml: -------------------------------------------------------------------------------- 1 | block('og').def()(function() { 2 | var ctx = this.ctx; 3 | var og = []; 4 | 5 | ctx.title && og.push({ block : 'page', elem : 'meta', attrs : { property : 'og:title', content : ctx.title } }); 6 | ctx.description && og.push({ block : 'page', elem : 'meta', attrs : { property : 'og:description', content : ctx.description } }); 7 | ctx.type && og.push({ block : 'page', elem : 'meta', attrs : { property : 'og:type', content : ctx.type } }); 8 | ctx.keywords && og.push({ block : 'page', elem : 'meta', attrs : { property : 'og:article:tag', content : ctx.keywords } }); 9 | ctx.url && og.push({ block : 'page', elem : 'meta', attrs : { property : 'og:url', content : ctx.url } }); 10 | ctx.image && og.push({ block : 'page', elem : 'meta', attrs : { property : 'og:image', content : ctx.image } }); 11 | 12 | return applyCtx(og); 13 | }); 14 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_twitter.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('icon_service_twitter', function(ctx) { 4 | ctx.content(''); 5 | }); 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /common.blocks/og/og.ru.md: -------------------------------------------------------------------------------- 1 | Блок для удобной вставки Open Graph meta атрибутов. 2 | Блок зависит от блока `page` и нужен для вставки в `head` моду блока. 3 | Блок вместо себя возвращает элемент `meta` блока `page` по каждому переданному полю с правильно задданными атребутами 4 | 5 | Пример: 6 | 7 | ``` 8 | ({ 9 | block : 'page', 10 | title : 'BEM Social Library Page', 11 | head : [ 12 | { elem : 'meta', attrs : { name : 'description', content : 'Библиотека социальных виджетов' } }, 13 | { elem : 'meta', attrs : { name : 'viewport', content : 'width=1000' } }, 14 | { 15 | block : 'og', 16 | title : 'BEM Social', 17 | description : 'Библиотека социальных виджетов', 18 | type : 'site', 19 | keywords : 'bem social widget', 20 | url : 'http//example.com/url', 21 | image : 'http//example.com/image.png' 22 | } 23 | ] 24 | }) 25 | ``` 26 | -------------------------------------------------------------------------------- /promo.blocks/page/page.bemhtml: -------------------------------------------------------------------------------- 1 | block('page')( 2 | content()(function() { 3 | return [ 4 | this.ctx.content, 5 | this.ctx.scripts, 6 | '' 7 | ]; 8 | }) 9 | ); 10 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme.tmpl-specs/01-theme.bemjson.js: -------------------------------------------------------------------------------- 1 | [{ 2 | block : 'github-ribbon', 3 | mods : { theme : 'darkblue' } 4 | }, { 5 | block : 'github-ribbon', 6 | mods : { theme : 'darkblue', right : true } 7 | }, { 8 | block : 'github-ribbon', 9 | mods : { theme : 'gray' } 10 | }, { 11 | block : 'github-ribbon', 12 | mods : { theme : 'gray', right : true } 13 | }, { 14 | block : 'github-ribbon', 15 | mods : { theme : 'green' } 16 | }, { 17 | block : 'github-ribbon', 18 | mods : { theme : 'green', right : true } 19 | }, { 20 | block : 'github-ribbon', 21 | mods : { theme : 'orange' } 22 | }, { 23 | block : 'github-ribbon', 24 | mods : { theme : 'orange', right : true } 25 | }, { 26 | block : 'github-ribbon', 27 | mods : { theme : 'red' } 28 | }, { 29 | block : 'github-ribbon', 30 | mods : { theme : 'red', right : true } 31 | }, { 32 | block : 'github-ribbon', 33 | mods : { theme : 'white' } 34 | }, { 35 | block : 'github-ribbon', 36 | mods : { theme : 'white', right : true } 37 | }] 38 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_gplus.bemhtml: -------------------------------------------------------------------------------- 1 | block('icon').mod('service', 'gplus')( 2 | content()('') 3 | ); 4 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_gplus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_gplus.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('icon_service_gplus', function(ctx) { 4 | ctx.content(''); 5 | }); 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_vkontakte.bemhtml: -------------------------------------------------------------------------------- 1 | block('icon').mod('service', 'vkontakte')( 2 | content()('') 3 | ); 4 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_vkontakte.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common.blocks/icon/_service/icon_service_vkontakte.bh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(bh) { 2 | 3 | bh.match('icon_service_vkontakte', function(ctx) { 4 | ctx.content(''); 5 | }); 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Ivan Voischev", 3 | "name": "bem-social", 4 | "description": "BEM Social Components Library", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/bem-contrib/bem-social" 8 | }, 9 | "keywords": [ 10 | "bem", 11 | "social", 12 | "blocks" 13 | ], 14 | "engines": { 15 | "node": ">=0.10" 16 | }, 17 | "dependencies": { 18 | "bem-environ": "^1.4.0" 19 | }, 20 | "devDependencies": { 21 | "borschik": "^1.4.1", 22 | "borschik-tech-cleancss": "^2.0.1", 23 | "bower": "^1.3.12", 24 | "enb": "^0.17.2", 25 | "enb-autoprefixer": "^0.3.0", 26 | "enb-bem-techs": "^2.0.0", 27 | "enb-bem-tmpl-specs": "^0.13.0", 28 | "enb-bemxjst": "^2.0.0", 29 | "enb-bh": "^0.5.0", 30 | "enb-borschik": "^2.0.0", 31 | "enb-diverse-js": "^0.1.0", 32 | "enb-magic-platform": "^0.5.0", 33 | "enb-modules": "^0.2.0", 34 | "enb-stylus": "^2.0.0", 35 | "bh": "^3.3.0", 36 | "ym": "^0.1.0", 37 | "csscomb": "~2.0.5", 38 | "git-hooks": "0.0.7", 39 | "jscs": "1.5.3", 40 | "jshint": "2.3.0", 41 | "jshint-groups": "0.6.0" 42 | }, 43 | "scripts": { 44 | "start": "magic server", 45 | "deps": "bower install --non-interactive", 46 | "lint": "jshint-groups && jscs . && csscomb -vl .", 47 | "tmpl-specs": "magic run tmpl-specs", 48 | "compiled": "find . -iname '*.styl' | xargs stylus" 49 | }, 50 | "private": true 51 | } 52 | -------------------------------------------------------------------------------- /.jscs.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludeFiles": [ 3 | ".bem/cache/**", 4 | ".enb/tmp/**", 5 | ".git/**", 6 | "*.examples/**", 7 | "*.specs/**", 8 | "*.tests/**", 9 | "*.pages/**", 10 | "**/*.i18n/**", 11 | "libs/**", 12 | "node_modules/**" 13 | ], 14 | "fileExtensions": [".js", ".bemtree", ".bemhtml"], 15 | "requireSpaceAfterKeywords": ["do", "else"], 16 | "disallowSpaceAfterKeywords": ["if", "for", "while", "switch"], 17 | "disallowSpacesInFunctionExpression": { 18 | "beforeOpeningRoundBrace": true 19 | }, 20 | "disallowSpacesInsideArrayBrackets": true, 21 | "requireSpacesInsideObjectBrackets": "all", 22 | "requireSpaceAfterObjectKeys": true, 23 | "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], 24 | "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], 25 | "disallowSpaceBeforeBinaryOperators": [","], 26 | "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"], 27 | "requireSpaceAfterBinaryOperators": [",", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"], 28 | "disallowKeywords": ["with"], 29 | "disallowKeywordsOnNewLine": ["else"], 30 | "requireLineFeedAtFileEnd": true, 31 | "disallowMultipleLineBreaks": true, 32 | "validateJSDoc": { 33 | "checkParamNames": true, 34 | "requireParamTypes": true 35 | } 36 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BEM Social Components Library 2 | [![Build Status](https://travis-ci.org/bem-contrib/bem-social.svg?branch=master)](https://travis-ci.org/bem-contrib/bem-social) 3 | [![Bower version](https://badge.fury.io/bo/bem-social.svg)](http://badge.fury.io/bo/bem-social) 4 | 5 | Библиотека блоков социальных виджетов для бэм проектов. Share, Like, Follow, 6 | Yandex.Share API и другие. Содержит SVG иконки социальных сетей, и несколько 7 | тем оформления. Библиотека использует некоторые блоки [bem-components](http://github.com/bem/bem-components). 8 | 9 | ## Установка 10 | 11 | Установка похожа на установку `bem-core` и `bem-components` библиотек. Используйте `bower install` для 12 | установки `bem-social` для установки из GitHub или из Bower. 13 | 14 | Нужно добавить нужные уровни в ваш `make.js` файл. 15 | 16 | ``` 17 | [ 18 | 'libs/bem-social/common.blocks', 19 | 'libs/bem-social/desktop.blocks', 20 | 'libs/bem-social/design/common.blocks' 21 | ] 22 | ``` 23 | 24 | Добавьте нужные блоки на ваши страницы. Примеры можно посмотреть в папках с блоками. 25 | 26 | ## История изменений 27 | 28 | ### 0.3.1 29 | 30 | - Теперь для сборки используется `enb` 31 | - Обновлены зависимости 32 | 33 | ### 0.3.0 34 | 35 | - Добавился блок коментариев `disqus` 36 | 37 | ### 0.2.0 38 | 39 | - Переименован блок `github` в `github-button` 40 | - Добавлен блок `github-ribbon` 41 | 42 | ### 0.1.0 43 | 44 | ##### Блоки на основе апи сервисов 45 | 46 | - Блок `github` Github Buttons 47 | - Блок `twitter` кнопки "твитнуть", виджет "твит" 48 | - Блок `vk` Лайк 49 | - Блок `yashare` "Поделиться" от Яндекса 50 | 51 | ##### Кастомизируемые блоки 52 | 53 | - Блок `share` поддерживаемые сервисы Blogger, Facebook, Google Plus, Twitter, Вконтакте 54 | 55 | ##### Темы оформления 56 | 57 | - Блок `share` Темы `simple` и `normal` 58 | 59 | ## В планах 60 | 61 | + Blocks `*-groups` 62 | + Авторизации 63 | + и другие интерфейсные решения использования социальных кнопок 64 | 65 | ### [MIT](http://en.wikipedia.org/wiki/MIT_License) Лицензия 66 | -------------------------------------------------------------------------------- /design/common.blocks/github-ribbon/_theme/github-ribbon_theme.tmpl-specs/01-theme.html: -------------------------------------------------------------------------------- 1 | Fork me on GitHub 2 | Fork me on GitHub 3 | 4 | Fork me on GitHub 5 | Fork me on GitHub 6 | 7 | Fork me on GitHub 8 | Fork me on GitHub 9 | 10 | Fork me on GitHub 11 | Fork me on GitHub 12 | 13 | Fork me on GitHub 14 | Fork me on GitHub 15 | 16 | Fork me on GitHub 17 | Fork me on GitHub 18 | -------------------------------------------------------------------------------- /.jshint-groups.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | options : { 3 | boss : true, 4 | eqeqeq : true, 5 | evil : true, 6 | expr : true, 7 | forin : true, 8 | immed : true, 9 | loopfunc : true, 10 | maxdepth : 4, 11 | noarg : true, 12 | noempty : true, 13 | onecase : true, 14 | quotmark : 'single', 15 | sub : true, 16 | supernew : true, 17 | trailing : true, 18 | undef : true, 19 | unused : true 20 | }, 21 | 22 | groups : { 23 | browserjs : { 24 | options : { 25 | browser : true, 26 | predef : ['modules'] 27 | }, 28 | includes : ['*.blocks/**/*.js'], 29 | excludes : [ 30 | '**/*.i18n/*.js', 31 | '**/*.bem/*.js', 32 | '**/_*.js', 33 | '**/*.bh.js', 34 | '**/*.spec.js', 35 | '**/*.deps.js', 36 | '**/*.bemjson.js' 37 | ] 38 | }, 39 | 40 | bemhtml : { 41 | options : { 42 | predef : [ 43 | 'apply', 44 | 'applyCtx', 45 | 'applyNext', 46 | 'attrs', 47 | 'bem', 48 | 'block', 49 | 'cls', 50 | 'content', 51 | 'def', 52 | 'elem', 53 | 'js', 54 | 'local', 55 | 'match', 56 | 'mix', 57 | 'mod', 58 | 'mode', 59 | 'tag' 60 | ] 61 | }, 62 | includes : ['*.blocks/**/*.bemhtml'] 63 | }, 64 | 65 | bhjs : { 66 | options : { 67 | node : true 68 | }, 69 | includes : [ 70 | '*.blocks/**/*.bh.js', 71 | 'design/*.blocks/**/*.bh.js' 72 | ] 73 | }, 74 | 75 | bemjsonjs : { 76 | options : { 77 | asi : true 78 | }, 79 | includes : ['*.bundles/**/*.bemjson.js'] 80 | }, 81 | 82 | nodejs : { 83 | options : { 84 | node : true 85 | }, 86 | includes : ['**/.bem/**/*.js'], 87 | excludes : [ 88 | '.bem/cache/**', 89 | 'libs/**', 90 | 'node_modules/**' 91 | ] 92 | } 93 | } 94 | }; 95 | -------------------------------------------------------------------------------- /design/common.blocks/share/_theme/share_theme_normal.styl: -------------------------------------------------------------------------------- 1 | .share_theme_normal 2 | { 3 | font-family: Arial, Helvetica, sans-serif; 4 | 5 | position: relative; 6 | 7 | display: inline-block; 8 | 9 | margin: 0; 10 | padding: 0; 11 | 12 | user-select: none; 13 | 14 | color: #fff; 15 | text-decoration: none; 16 | 17 | border: 0; 18 | border-radius: 3px; 19 | outline: 0; 20 | 21 | text-align: center; 22 | white-space: nowrap; 23 | 24 | .share__text 25 | { 26 | overflow: hidden; 27 | 28 | text-overflow: ellipsis; 29 | vertical-align: top; 30 | } 31 | 32 | .icon 33 | { 34 | // width: 1.6em; 35 | // height: 1.6em; 36 | // margin: -0.5em 0 -0.5em -0.3em; 37 | fill: #fff; 38 | } 39 | 40 | SOCIAL_NAME = vkontakte facebook twitter gplus blogger 41 | SOCIAL_COLOR = #4D75A3 #3B5998 #00ACED #CC3732 #f26300 42 | 43 | for i in 0..(length(SOCIAL_NAME) - 1) { 44 | 45 | &.share_service_{SOCIAL_NAME[i]} { 46 | background-color: SOCIAL_COLOR[i]; 47 | 48 | &.share_hovered 49 | { 50 | background-color: SOCIAL_COLOR[i] - 20%; 51 | } 52 | } 53 | 54 | } 55 | 56 | &.share_hovered 57 | { 58 | cursor: pointer; 59 | } 60 | 61 | &.share_size_s 62 | { 63 | font-size: 13px; 64 | line-height: 24px; 65 | height: 24px; 66 | 67 | .icon 68 | { 69 | width: 24px; 70 | height: 24px; 71 | } 72 | .share__text 73 | { 74 | margin: 0 10px; 75 | } 76 | } 77 | &.share_size_m 78 | { 79 | font-size: 13px; 80 | line-height: 28px; 81 | height: 28px; 82 | 83 | .icon 84 | { 85 | width: 28px; 86 | height: 28px; 87 | } 88 | .share__text 89 | { 90 | margin: 0 13px; 91 | } 92 | } 93 | &.share_size_l 94 | { 95 | font-size: 15px; 96 | line-height: 32px; 97 | height: 32px; 98 | 99 | .icon 100 | { 101 | width: 32px; 102 | height: 32px; 103 | } 104 | .share__text 105 | { 106 | margin: 0 15px; 107 | } 108 | } 109 | &.share_size_xl 110 | { 111 | font-size: 18px; 112 | line-height: 38px; 113 | height: 38px; 114 | 115 | .icon 116 | { 117 | width: 38px; 118 | height: 38px; 119 | } 120 | .share__text 121 | { 122 | margin: 0 18px; 123 | } 124 | } 125 | 126 | & .icon + .share__text 127 | { 128 | margin-left: 0; 129 | } 130 | 131 | .share__text:not(:last-child) 132 | { 133 | margin-right: 0; 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /.enb/make.js: -------------------------------------------------------------------------------- 1 | var techs = { 2 | // essential 3 | fileProvider : require('enb/techs/file-provider'), 4 | fileMerge : require('enb/techs/file-merge'), 5 | 6 | // optimization 7 | borschik : require('enb-borschik/techs/borschik'), 8 | 9 | // css 10 | stylus : require('enb-stylus/techs/stylus'), 11 | 12 | // js 13 | browserJs : require('enb-diverse-js/techs/browser-js'), 14 | prependYm : require('enb-modules/techs/prepend-modules'), 15 | 16 | // bemhtml 17 | bemhtml : require('enb-bemxjst/techs/bemhtml'), 18 | bemjsonToHtml : require('enb-bemxjst/techs/bemjson-to-html') 19 | }, 20 | enbBemTechs = require('enb-bem-techs'), 21 | levels = [ 22 | { path : 'libs/bem-core/common.blocks', check : false }, 23 | { path : 'libs/bem-core/desktop.blocks', check : false }, 24 | { path : 'libs/bem-components/common.blocks', check : false }, 25 | { path : 'libs/bem-components/desktop.blocks', check : false }, 26 | { path : 'libs/bem-components/design/common.blocks', check : false }, 27 | { path : 'libs/bem-components/design/desktop.blocks', check : false }, 28 | 'design/common.blocks', 29 | 'common.blocks', 30 | 'desktop.blocks', 31 | 'promo.blocks' 32 | ]; 33 | 34 | module.exports = function(config) { 35 | var isProd = process.env.YENV === 'production'; 36 | 37 | config.nodes('*.bundles/*', function(nodeConfig) { 38 | nodeConfig.addTechs([ 39 | // essential 40 | [enbBemTechs.levels, { levels : levels }], 41 | [techs.fileProvider, { target : '?.bemjson.js' }], 42 | [enbBemTechs.bemjsonToBemdecl], 43 | [enbBemTechs.deps], 44 | [enbBemTechs.files], 45 | 46 | // css 47 | [techs.stylus, { 48 | autoprefixer : { 49 | browser : ['last 2 versions', 'ie >= 10', 'opera 12.1'] 50 | } 51 | }], 52 | 53 | // bemtree 54 | // [techs.bemtree, { devMode: process.env.BEMTREE_ENV === 'development' }], 55 | 56 | // bemhtml 57 | [techs.bemhtml, { devMode : process.env.BEMHTML_ENV === 'development' }], 58 | [techs.bemjsonToHtml], 59 | 60 | // client bemhtml 61 | [enbBemTechs.depsByTechToBemdecl, { 62 | target : '?.bemhtml.bemdecl.js', 63 | sourceTech : 'js', 64 | destTech : 'bemhtml' 65 | }], 66 | [enbBemTechs.deps, { 67 | target : '?.bemhtml.deps.js', 68 | bemdeclFile : '?.bemhtml.bemdecl.js' 69 | }], 70 | [enbBemTechs.files, { 71 | depsFile : '?.bemhtml.deps.js', 72 | filesTarget : '?.bemhtml.files', 73 | dirsTarget : '?.bemhtml.dirs' 74 | }], 75 | [techs.bemhtml, { 76 | target : '?.browser.bemhtml.js', 77 | filesTarget : '?.bemhtml.files', 78 | devMode : process.env.BEMHTML_ENV === 'development' 79 | }], 80 | 81 | // js 82 | [techs.browserJs], 83 | [techs.fileMerge, { 84 | target : '?.pre.js', 85 | sources : ['?.browser.bemhtml.js', '?.browser.js'] 86 | }], 87 | [techs.prependYm, { source : '?.pre.js' }], 88 | 89 | // borschik 90 | [techs.borschik, { sourceTarget : '?.js', destTarget : '_?.js', freeze : true, minify : isProd }], 91 | [techs.borschik, { sourceTarget : '?.css', destTarget : '_?.css', tech : 'cleancss', freeze : true, minify : isProd }] 92 | ]); 93 | 94 | nodeConfig.addTargets(['?.html', '_?.css', '_?.js']); 95 | }); 96 | 97 | // tmpl specs 98 | config.includeConfig('enb-bem-tmpl-specs'); 99 | 100 | configureSets(['desktop'], { 101 | tmplSpecs : config.module('enb-bem-tmpl-specs').createConfigurator('tmpl-specs') 102 | }); 103 | 104 | function configureSets(platforms, sets) { 105 | platforms.forEach(function(platform) { 106 | sets.tmplSpecs.configure({ 107 | destPath : platform + '.tmpl-specs', 108 | levels : ['common.blocks', 'design/common.blocks', platform + '.blocks'], 109 | sourceLevels : levels, 110 | engines : { 111 | bh : { 112 | tech : 'enb-bh/techs/bh-server', 113 | options : { 114 | jsAttrName : 'data-bem', 115 | jsAttrScheme : 'json' 116 | } 117 | }, 118 | 'bemhtml-dev' : { 119 | tech : 'enb-bemxjst/techs/bemhtml', 120 | options : { 121 | exportName : 'BEMHTML', 122 | devMode : true 123 | } 124 | }, 125 | 'bemhtml-prod' : { 126 | tech : 'enb-bemxjst/techs/bemhtml', 127 | options : { 128 | exportName : 'BEMHTML', 129 | devMode : false 130 | } 131 | } 132 | } 133 | }); 134 | }); 135 | } 136 | }; 137 | -------------------------------------------------------------------------------- /.csscomb.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | ".git/**", 4 | "libs/**", 5 | "node_modules/**", 6 | "*.pages/*/*.css", 7 | "*.examples/**", 8 | "*.specs/**", 9 | "*.tests/**" 10 | ], 11 | "always-semicolon": true, 12 | "block-indent": 4, 13 | "colon-space": [0, 1], 14 | "color-case": "lower", 15 | "color-shorthand": true, 16 | "combinator-space": [1, 1], 17 | "element-case": "lower", 18 | "eof-newline": true, 19 | "leading-zero": true, 20 | "quotes": "single", 21 | "remove-empty-rulesets": true, 22 | "rule-indent": 4, 23 | "stick-brace": "\n", 24 | "strip-spaces": true, 25 | "unitless-zero": true, 26 | "vendor-prefix-align": true, 27 | "sort-order": [ 28 | [ 29 | "font", 30 | "font-family", 31 | "font-size", 32 | "font-weight", 33 | "font-style", 34 | "font-variant", 35 | "font-size-adjust", 36 | "font-stretch", 37 | "font-effect", 38 | "font-emphasize", 39 | "font-emphasize-position", 40 | "font-emphasize-style", 41 | "font-smooth", 42 | "line-height" 43 | ], 44 | [ 45 | "position", 46 | "z-index", 47 | "top", 48 | "right", 49 | "bottom", 50 | "left" 51 | ], 52 | [ 53 | "display", 54 | "visibility", 55 | "float", 56 | "clear", 57 | "overflow", 58 | "overflow-x", 59 | "overflow-y", 60 | "-ms-overflow-x", 61 | "-ms-overflow-y", 62 | "clip", 63 | "zoom", 64 | "flex-direction", 65 | "flex-order", 66 | "flex-pack", 67 | "flex-align" 68 | ], 69 | [ 70 | "-webkit-box-sizing", 71 | "-moz-box-sizing", 72 | "box-sizing", 73 | "width", 74 | "min-width", 75 | "max-width", 76 | "height", 77 | "min-height", 78 | "max-height", 79 | "margin", 80 | "margin-top", 81 | "margin-right", 82 | "margin-bottom", 83 | "margin-left", 84 | "padding", 85 | "padding-top", 86 | "padding-right", 87 | "padding-bottom", 88 | "padding-left" 89 | ], 90 | [ 91 | "table-layout", 92 | "empty-cells", 93 | "caption-side", 94 | "border-spacing", 95 | "border-collapse", 96 | "list-style", 97 | "list-style-position", 98 | "list-style-type", 99 | "list-style-image" 100 | ], 101 | [ 102 | "content", 103 | "quotes", 104 | "counter-reset", 105 | "counter-increment", 106 | "resize", 107 | "cursor", 108 | "-webkit-user-select", 109 | "-moz-user-select", 110 | "-ms-user-select", 111 | "user-select", 112 | "nav-index", 113 | "nav-up", 114 | "nav-right", 115 | "nav-down", 116 | "nav-left", 117 | "-webkit-transition", 118 | "-moz-transition", 119 | "-ms-transition", 120 | "-o-transition", 121 | "transition", 122 | "-webkit-transition-delay", 123 | "-moz-transition-delay", 124 | "-ms-transition-delay", 125 | "-o-transition-delay", 126 | "transition-delay", 127 | "-webkit-transition-timing-function", 128 | "-moz-transition-timing-function", 129 | "-ms-transition-timing-function", 130 | "-o-transition-timing-function", 131 | "transition-timing-function", 132 | "-webkit-transition-duration", 133 | "-moz-transition-duration", 134 | "-ms-transition-duration", 135 | "-o-transition-duration", 136 | "transition-duration", 137 | "-webkit-transition-property", 138 | "-moz-transition-property", 139 | "-ms-transition-property", 140 | "-o-transition-property", 141 | "transition-property", 142 | "-webkit-transform", 143 | "-moz-transform", 144 | "-ms-transform", 145 | "-o-transform", 146 | "transform", 147 | "-webkit-transform-origin", 148 | "-moz-transform-origin", 149 | "-ms-transform-origin", 150 | "-o-transform-origin", 151 | "transform-origin", 152 | "-webkit-animation", 153 | "-moz-animation", 154 | "-ms-animation", 155 | "-o-animation", 156 | "animation", 157 | "-webkit-animation-name", 158 | "-moz-animation-name", 159 | "-ms-animation-name", 160 | "-o-animation-name", 161 | "animation-name", 162 | "-webkit-animation-duration", 163 | "-moz-animation-duration", 164 | "-ms-animation-duration", 165 | "-o-animation-duration", 166 | "animation-duration", 167 | "-webkit-animation-play-state", 168 | "-moz-animation-play-state", 169 | "-ms-animation-play-state", 170 | "-o-animation-play-state", 171 | "animation-play-state", 172 | "-webkit-animation-timing-function", 173 | "-moz-animation-timing-function", 174 | "-ms-animation-timing-function", 175 | "-o-animation-timing-function", 176 | "animation-timing-function", 177 | "-webkit-animation-delay", 178 | "-moz-animation-delay", 179 | "-ms-animation-delay", 180 | "-o-animation-delay", 181 | "animation-delay", 182 | "-webkit-animation-iteration-count", 183 | "-moz-animation-iteration-count", 184 | "-ms-animation-iteration-count", 185 | "-o-animation-iteration-count", 186 | "animation-iteration-count", 187 | "-webkit-animation-direction", 188 | "-moz-animation-direction", 189 | "-ms-animation-direction", 190 | "-o-animation-direction", 191 | "animation-direction", 192 | "text-align", 193 | "-webkit-text-align-last", 194 | "-moz-text-align-last", 195 | "-ms-text-align-last", 196 | "text-align-last", 197 | "vertical-align", 198 | "white-space", 199 | "text-decoration", 200 | "text-emphasis", 201 | "text-emphasis-color", 202 | "text-emphasis-style", 203 | "text-emphasis-position", 204 | "text-indent", 205 | "-ms-text-justify", 206 | "text-justify", 207 | "letter-spacing", 208 | "word-spacing", 209 | "-ms-writing-mode", 210 | "text-outline", 211 | "text-transform", 212 | "text-wrap", 213 | "text-overflow", 214 | "-ms-text-overflow", 215 | "text-overflow-ellipsis", 216 | "text-overflow-mode", 217 | "-ms-word-wrap", 218 | "word-wrap", 219 | "word-break", 220 | "-ms-word-break", 221 | "-moz-tab-size", 222 | "-o-tab-size", 223 | "tab-size", 224 | "-webkit-hyphens", 225 | "-moz-hyphens", 226 | "hyphens", 227 | "pointer-events" 228 | ], 229 | [ 230 | "opacity", 231 | "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity", 232 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha", 233 | "-ms-interpolation-mode", 234 | "color", 235 | "border", 236 | "border-width", 237 | "border-style", 238 | "border-color", 239 | "border-top", 240 | "border-top-width", 241 | "border-top-style", 242 | "border-top-color", 243 | "border-right", 244 | "border-right-width", 245 | "border-right-style", 246 | "border-right-color", 247 | "border-bottom", 248 | "border-bottom-width", 249 | "border-bottom-style", 250 | "border-bottom-color", 251 | "border-left", 252 | "border-left-width", 253 | "border-left-style", 254 | "border-left-color", 255 | "-webkit-border-radius", 256 | "-moz-border-radius", 257 | "border-radius", 258 | "-webkit-border-top-left-radius", 259 | "-moz-border-radius-topleft", 260 | "border-top-left-radius", 261 | "-webkit-border-top-right-radius", 262 | "-moz-border-radius-topright", 263 | "border-top-right-radius", 264 | "-webkit-border-bottom-right-radius", 265 | "-moz-border-radius-bottomright", 266 | "border-bottom-right-radius", 267 | "-webkit-border-bottom-left-radius", 268 | "-moz-border-radius-bottomleft", 269 | "border-bottom-left-radius", 270 | "-webkit-border-image", 271 | "-moz-border-image", 272 | "-o-border-image", 273 | "border-image", 274 | "-webkit-border-image-source", 275 | "-moz-border-image-source", 276 | "-o-border-image-source", 277 | "border-image-source", 278 | "-webkit-border-image-slice", 279 | "-moz-border-image-slice", 280 | "-o-border-image-slice", 281 | "border-image-slice", 282 | "-webkit-border-image-width", 283 | "-moz-border-image-width", 284 | "-o-border-image-width", 285 | "border-image-width", 286 | "-webkit-border-image-outset", 287 | "-moz-border-image-outset", 288 | "-o-border-image-outset", 289 | "border-image-outset", 290 | "-webkit-border-image-repeat", 291 | "-moz-border-image-repeat", 292 | "-o-border-image-repeat", 293 | "border-image-repeat", 294 | "outline", 295 | "outline-width", 296 | "outline-style", 297 | "outline-color", 298 | "outline-offset", 299 | "background", 300 | "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", 301 | "background-color", 302 | "background-image", 303 | "background-repeat", 304 | "background-attachment", 305 | "background-position", 306 | "background-position-x", 307 | "-ms-background-position-x", 308 | "background-position-y", 309 | "-ms-background-position-y", 310 | "-webkit-background-clip", 311 | "-moz-background-clip", 312 | "background-clip", 313 | "background-origin", 314 | "-webkit-background-size", 315 | "-moz-background-size", 316 | "-o-background-size", 317 | "background-size", 318 | "box-decoration-break", 319 | "-webkit-box-shadow", 320 | "-moz-box-shadow", 321 | "box-shadow", 322 | "filter:progid:DXImageTransform.Microsoft.gradient", 323 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", 324 | "text-shadow" 325 | ] 326 | ] 327 | } 328 | -------------------------------------------------------------------------------- /desktop.bundles/index/index.bemjson.js: -------------------------------------------------------------------------------- 1 | ({ 2 | block : 'page', 3 | title : 'BEM Social Library Page', 4 | head : [ 5 | { elem : 'meta', attrs : { name : 'description', content : 'Библиотека социальных виджетов' } }, 6 | { elem : 'meta', attrs : { name : 'viewport', content : 'width=1000' } }, 7 | { 8 | block : 'og', 9 | title : 'BEM Social', 10 | description : 'Библиотека социальных виджетов', 11 | type : 'site', 12 | keywords : 'bem social widget', 13 | url : 'https://github.com/bem-contrib/bem-social', 14 | image : ['https://raw.githubusercontent.com/voischev/bem-social/', 15 | 'master/desktop.bundles/index/blocks/page/image/bem.png'] 16 | }, 17 | { elem : 'css', url : '_index.css' } 18 | ], 19 | scripts : [{ elem : 'js', url : '_index.js' }], 20 | content : [ 21 | { 22 | block : 'github-ribbon', 23 | mods : { theme : 'darkblue', right : true }, 24 | url : 'https://github.com/bem-contrib/bem-social' 25 | }, 26 | { 27 | tag : 'h1', 28 | content : 'BEM Social' 29 | }, 30 | { 31 | tag : 'p', 32 | content : 'Библиотека социальных виджетов' 33 | }, 34 | { 35 | elem : 'content', 36 | content : [ 37 | { 38 | tag : 'h3', 39 | content : 'Share: Theme Normal [Size: m]' 40 | }, 41 | { 42 | block : 'share', 43 | mods : { service : 'vkontakte', theme : 'normal', size : 'm' }, 44 | params : { 45 | url : 'http://bem-contrib.github.io/bem-social/', 46 | title : 'BEM Social Components Library', 47 | description : 'Fork me on GitHub', 48 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 49 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 50 | }, 51 | text : 'Вконтакте', 52 | icon : { block : 'icon', mods : { service : 'vkontakte' } } 53 | }, 54 | { 55 | block : 'share', 56 | mods : { service : 'facebook', theme : 'normal', size : 'm' }, 57 | params : { 58 | url : 'http://bem-contrib.github.io/bem-social/', 59 | title : 'BEM Social Components Library', 60 | description : 'Fork me on GitHub', 61 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 62 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 63 | }, 64 | text : 'Facebook', 65 | icon : { block : 'icon', mods : { service : 'facebook' } } 66 | }, 67 | { 68 | block : 'share', 69 | mods : { service : 'twitter', theme : 'normal', size : 'm' }, 70 | params : { 71 | url : 'http://bem-incubaror.github.io/bem-social/', 72 | title : 'BEM Social Components Library #b_', 73 | description : 'Fork me on GitHub' 74 | }, 75 | text : 'Twitter', 76 | icon : { block : 'icon', mods : { service : 'twitter' } } 77 | }, 78 | { 79 | block : 'share', 80 | mods : { service : 'gplus', theme : 'normal', size : 'm' }, 81 | params : { 82 | url : 'http://bem-contrib.github.io/bem-social/' 83 | }, 84 | text : 'Google', 85 | icon : { block : 'icon', mods : { service : 'gplus' } } 86 | }, 87 | { 88 | block : 'share', 89 | mods : { service : 'blogger', theme : 'normal', size : 'm' }, 90 | params : { 91 | url : 'http://bem-contrib.github.io/bem-social/', 92 | title : 'BEM Social Components Library', 93 | description : 'Fork me on GitHub', 94 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 95 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 96 | }, 97 | text : 'Blogger', 98 | icon : { block : 'icon', mods : { service : 'blogger' } } 99 | }, 100 | { 101 | tag : 'br' 102 | }, 103 | { 104 | block : 'share', 105 | mods : { service : 'vkontakte', theme : 'normal', size : 'm' }, 106 | params : { 107 | url : 'http://bem-contrib.github.io/bem-social/', 108 | title : 'BEM Social Components Library', 109 | description : 'Fork me on GitHub', 110 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 111 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 112 | }, 113 | icon : { block : 'icon', mods : { service : 'vkontakte' } } 114 | }, 115 | { 116 | block : 'share', 117 | mods : { service : 'facebook', theme : 'normal', size : 'm' }, 118 | params : { 119 | url : 'http://bem-contrib.github.io/bem-social/', 120 | title : 'BEM Social Components Library', 121 | description : 'Fork me on GitHub', 122 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 123 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 124 | }, 125 | icon : { block : 'icon', mods : { service : 'facebook' } } 126 | }, 127 | { 128 | block : 'share', 129 | mods : { service : 'twitter', theme : 'normal', size : 'm' }, 130 | params : { 131 | url : 'http://bem-contrib.github.io/bem-social/', 132 | title : 'BEM Social Components Library #b_', 133 | description : 'Fork me on GitHub' 134 | }, 135 | icon : { block : 'icon', mods : { service : 'twitter' } } 136 | }, 137 | { 138 | block : 'share', 139 | mods : { service : 'gplus', theme : 'normal', size : 'm' }, 140 | params : { 141 | url : 'http://bem-contrib.github.io/bem-social/' 142 | }, 143 | icon : { block : 'icon', mods : { service : 'gplus' } } 144 | }, 145 | { 146 | block : 'share', 147 | mods : { service : 'blogger', theme : 'normal', size : 'm' }, 148 | params : { 149 | url : 'http://bem-contrib.github.io/bem-social/', 150 | title : 'BEM Social Components Library', 151 | description : 'Fork me on GitHub', 152 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 153 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 154 | }, 155 | icon : { block : 'icon', mods : { service : 'blogger' } } 156 | }, 157 | { 158 | tag : 'h3', 159 | content : 'Share: Theme Simple [Size: m]' 160 | }, 161 | { 162 | block : 'share', 163 | mods : { service : 'vkontakte', theme : 'simple', size : 'm' }, 164 | params : { 165 | url : 'http://bem-contrib.github.io/bem-social/', 166 | title : 'BEM Social Components Library', 167 | description : 'Fork me on GitHub', 168 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 169 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 170 | }, 171 | text : 'Вконтакте' 172 | }, 173 | { 174 | block : 'share', 175 | mods : { service : 'facebook', theme : 'simple', size : 'm' }, 176 | params : { 177 | url : 'http://bem-contrib.github.io/bem-social/', 178 | title : 'BEM Social Components Library', 179 | description : 'Fork me on GitHub', 180 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 181 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 182 | }, 183 | text : 'Facebook' 184 | }, 185 | { 186 | block : 'share', 187 | mods : { service : 'twitter', theme : 'simple', size : 'm' }, 188 | params : { 189 | url : 'http://bem-contrib.github.io/bem-social/', 190 | title : 'BEM Social Components Library #b_', 191 | description : 'Fork me on GitHub' 192 | }, 193 | text : 'Twitter' 194 | }, 195 | { 196 | block : 'share', 197 | mods : { service : 'gplus', theme : 'simple', size : 'm' }, 198 | params : { 199 | url : 'http://bem-contrib.github.io/bem-social/' 200 | }, 201 | text : 'Google' 202 | }, 203 | { 204 | block : 'share', 205 | mods : { service : 'blogger', theme : 'simple', size : 'm' }, 206 | params : { 207 | url : 'http://bem-contrib.github.io/bem-social/', 208 | title : 'BEM Social Components Library', 209 | description : 'Fork me on GitHub', 210 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 211 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 212 | }, 213 | text : 'Blogger' 214 | }, 215 | { 216 | tag : 'h3', 217 | content : 'GitHub Buttons' 218 | }, 219 | { 220 | block : 'github-button', 221 | mods : { type : 'star', large : true, count : true }, 222 | user : 'voischev', 223 | repo : 'bem-social' 224 | }, 225 | { 226 | block : 'github-button', 227 | mods : { type : 'follow', large : true, count : true }, 228 | user : 'voischev' 229 | }, 230 | { 231 | block : 'github-button', 232 | mods : { type : 'watch', large : true, count : true }, 233 | user : 'voischev', 234 | repo : 'bem-social' 235 | }, 236 | { 237 | block : 'github-button', 238 | mods : { type : 'issue', large : true, count : true }, 239 | user : 'voischev', 240 | repo : 'bem-social' 241 | }, 242 | { 243 | block : 'github-button', 244 | mods : { type : 'fork', large : true, count : true }, 245 | user : 'voischev', 246 | repo : 'bem-social' 247 | }, 248 | { 249 | block : 'github-button', 250 | mods : { type : 'download', large : true }, 251 | user : 'voischev', 252 | repo : 'bem-social' 253 | }, 254 | { 255 | tag : 'h3', 256 | content : 'GitHub Ribbon' 257 | }, 258 | { 259 | tag : 'p', 260 | content : [ 261 | 'Реализованы все темы с ', 262 | { 263 | block : 'link', 264 | mods : { theme : 'islands' }, 265 | url : 'https://github.com/blog/273-github-ribbons', 266 | content : 'этой страницы' 267 | } 268 | ] 269 | }, 270 | { 271 | elem : 'ribbon', 272 | content : [ 273 | { 274 | block : 'github-ribbon', 275 | mods : { theme : 'red', left : true }, 276 | url : 'https://github.com/bem-contrib/bem-social' 277 | }, 278 | { 279 | block : 'github-ribbon', 280 | mods : { theme : 'orange', left : true }, 281 | url : 'https://github.com/bem-contrib/bem-social' 282 | }, 283 | { 284 | block : 'github-ribbon', 285 | mods : { theme : 'green', left : true }, 286 | url : 'https://github.com/bem-contrib/bem-social' 287 | }, 288 | { 289 | block : 'github-ribbon', 290 | mods : { theme : 'gray', left : true }, 291 | url : 'https://github.com/bem-contrib/bem-social' 292 | } 293 | ] 294 | }, 295 | { 296 | tag : 'h3', 297 | content : 'Twitter' 298 | }, 299 | { 300 | block : 'twitter', 301 | mods : { widget : 'tweet' }, 302 | content : [ 303 | '

Сделал кнопку Твиттера в либу. Социальные кнопки на БЭМ ', 304 | 'https://t.co/9hclJfMtba ', 305 | '#bem ', 306 | '#b_ ', 307 | 'с помощью @bem_ru

', 308 | '— Ваня Воищев (@voischev) 16 сентября 2014'] 309 | }, 310 | { 311 | block : 'twitter', 312 | mods : { widget : 'share' }, 313 | url : 'https://github.com/bem-contrib/bem-social', 314 | text : 'Социальные кнопки на БЭМ', 315 | via : 'voischev', 316 | related : 'bem_ru', 317 | hashtags : 'bem,b_', 318 | size : 'large', 319 | lang : 'ru' 320 | }, 321 | { 322 | block : 'twitter', 323 | mods : { widget : 'share' }, 324 | url : 'https://github.com/bem-contrib/bem-social', 325 | text : 'Социальные кнопки на БЭМ', 326 | via : 'voischev', 327 | related : 'bem_ru', 328 | count : 'vertical', 329 | hashtags : 'bem,b_', 330 | lang : 'ru' 331 | }, 332 | { 333 | block : 'twitter', 334 | mods : { widget : 'share' }, 335 | count : 'none' 336 | }, 337 | { 338 | tag : 'h3', 339 | content : 'VK' 340 | }, 341 | { 342 | block : 'vk', 343 | mods : { widget : 'like' }, 344 | type : 'button', 345 | title : 'BEM Social Components Library', 346 | description : 'Fork me on GitHub', 347 | url : 'http://bem-contrib.github.io/bem-social/', 348 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 349 | 'master/desktop.bundles/index/blocks/page/image/bem.png', 350 | text : 'Fork me on GitHub', 351 | id : 'vk_like', 352 | pageId : 1 353 | }, 354 | { 355 | block : 'vk', 356 | mods : { widget : 'like' }, 357 | type : 'mini', 358 | title : 'BEM Social Components Library', 359 | description : 'Fork me on GitHub', 360 | url : 'http://bem-contrib.github.io/bem-social/', 361 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 362 | 'master/desktop.bundles/index/blocks/page/image/bem.png', 363 | text : 'Fork me on GitHub', 364 | id : 'vk_like_mini', 365 | pageId : 2 366 | }, 367 | { 368 | tag : 'h3', 369 | content : 'API Yandex.Share' 370 | }, 371 | { 372 | block : 'yashare', 373 | quickServices : [ 374 | 'vkontakte', 375 | 'facebook', 376 | 'twitter', 377 | 'odnoklassniki', 378 | 'moimir', 379 | 'gplus' 380 | ], 381 | theme : 'counter', 382 | l10n : 'ru', 383 | url : 'http://bem-contrib.github.io/bem-social/', 384 | title : 'BEM Social Components Library', 385 | description : 'Fork me on GitHub', 386 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 387 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 388 | }, 389 | { 390 | tag : 'br' 391 | }, 392 | { 393 | block : 'yashare', 394 | quickServices : [ 395 | 'vkontakte', 396 | 'facebook', 397 | 'twitter', 398 | 'odnoklassniki', 399 | 'moimir', 400 | 'lj', 401 | 'friendfeed', 402 | 'gplus' 403 | ], 404 | theme : 'default', 405 | l10n : 'ru', 406 | url : 'http://bem-contrib.github.io/bem-social/', 407 | title : 'BEM Social Components Library', 408 | description : 'Fork me on GitHub', 409 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 410 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 411 | }, 412 | { 413 | tag : 'br' 414 | }, 415 | { 416 | attrs : { style : 'background: #212121' }, 417 | content : [ 418 | { 419 | block : 'yashare', 420 | quickServices : [ 421 | 'vkontakte', 422 | 'facebook', 423 | 'twitter', 424 | 'odnoklassniki', 425 | 'lj' 426 | ], 427 | theme : 'dark', 428 | url : 'http://bem-contrib.github.io/bem-social/', 429 | title : 'BEM Social Components Library', 430 | description : 'Fork me on GitHub', 431 | image : 'https://raw.githubusercontent.com/voischev/bem-social/' + 432 | 'master/desktop.bundles/index/blocks/page/image/bem.png' 433 | } 434 | ] 435 | } 436 | ] 437 | }, 438 | { 439 | block : 'disqus', 440 | shortname : 'bemsocial' 441 | }, 442 | { 443 | elem : 'footer', 444 | content : [ 445 | { 446 | tag : 'p', 447 | content : [ 448 | { 449 | block : 'link', 450 | mods : { theme : 'islands' }, 451 | content : 'bem-social' 452 | } 453 | ] 454 | } 455 | ] 456 | } 457 | ] 458 | }) 459 | --------------------------------------------------------------------------------