Skip to content

Commit

Permalink
Merge pull request #44 from voischev/v0.2.0
Browse files Browse the repository at this point in the history
release v0.2.0
  • Loading branch information
voischev committed Nov 6, 2014
2 parents 7f39602 + 7afc782 commit 812b71d
Show file tree
Hide file tree
Showing 19 changed files with 207 additions and 99 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
block('github').mod('button', 'download')(
tag()('a'),
cls()('github-button'),
block('github-button').mod('type', 'download')(
attrs()(function() {
var mods = this.ctx.mods;
var user = this.ctx.user;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
block('github').mod('button', 'follow')(
tag()('a'),
cls()('github-button'),
block('github-button').mod('type', 'follow')(
attrs()(function() {
var mods = this.ctx.mods;
var user = this.ctx.user;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
block('github').mod('button', 'fork')(
tag()('a'),
cls()('github-button'),
block('github-button').mod('type', 'fork')(
attrs()(function() {
var mods = this.ctx.mods;
var user = this.ctx.user;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
block('github').mod('button', 'issue')(
tag()('a'),
cls()('github-button'),
block('github-button').mod('type', 'issue')(
attrs()(function() {
var mods = this.ctx.mods;
var user = this.ctx.user;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
block('github').mod('button', 'star')(
tag()('a'),
cls()('github-button'),
block('github-button').mod('type', 'star')(
attrs()(function() {
var mods = this.ctx.mods;
var user = this.ctx.user;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
block('github').mod('button', 'watch')(
tag()('a'),
cls()('github-button'),
block('github-button').mod('type', 'watch')(
attrs()(function() {
var mods = this.ctx.mods;
var user = this.ctx.user;
Expand Down
3 changes: 3 additions & 0 deletions common.blocks/github-button/github-button.bemhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
block('github-button')(
tag()('a')
);
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global modules:false */

modules.require([], function() {
(function(d, s, id){
var js,
Expand Down
17 changes: 17 additions & 0 deletions common.blocks/github-ribbon/github-ribbon.bemhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
block('github-ribbon')(
tag()('a'),
attrs()(function() {
return {
href : this.ctx.url
};
}),
content()(function() {
return {
tag : 'img',
attrs : {
src : this.ctx.image,
alt : this.ctx.alt || 'Fork me on GitHub'
}
};
})
);
30 changes: 30 additions & 0 deletions common.blocks/github-ribbon/github-ribbon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#github-ribbon

## Моды

`url` — ссылка на страницу репозитория

`image` — если указан подгружает кастомную картинку

## Модификаторы
- `left` {true}

Ribbon прижат вправо

- `right` {true}

Ribbon прижат вправо

- `theme` : {Имя темы} (опционально)

Переопределяет моду `image` на одну из тем https://github.com/blog/273-github-ribbons
Нужен уровень переопределения `bem-social/design/common.blocks`

## Пример
```js
{
block : 'github-ribbon',
mods : { theme : 'red', right : true },
url : 'https://github.com/voischev/bem-social'
}
```
18 changes: 18 additions & 0 deletions common.blocks/github-ribbon/github-ribbon.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.github-ribbon
{
position: absolute;
top: 0;

.image {
margin: 0;
padding: 0;
border: none;
}

&.github-ribbon_left{
left: 0;
}
&.github-ribbon_right{
right: 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
block('github-ribbon').mod('theme', 'darkblue').def()(function() {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png';
if(this.mods.right) {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png';
}
applyNext();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
block('github-ribbon').mod('theme', 'gray').def()(function() {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_gray_6d6d6d.png';
if(this.mods.right) {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png';
}
applyNext();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
block('github-ribbon').mod('theme', 'green').def()(function() {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png';
if(this.mods.right) {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png';
}
applyNext();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
block('github-ribbon').mod('theme', 'orange').def()(function() {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png';
if(this.mods.right) {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png';
}
applyNext();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
block('github-ribbon').mod('theme', 'red').def()(function() {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png';
if(this.mods.right) {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png';
}
applyNext();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
block('github-ribbon').mod('theme', 'white').def()(function() {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_left_white_ffffff.png';
if(this.mods.right) {
this.ctx.image = 'https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png';
}
applyNext();
});
62 changes: 0 additions & 62 deletions desktop.bundles/github/github.bemjson.js

This file was deleted.

Loading

0 comments on commit 812b71d

Please sign in to comment.