Skip to content

Commit

Permalink
params share #55
Browse files Browse the repository at this point in the history
  • Loading branch information
voischev committed Apr 20, 2015
1 parent 4946e88 commit be07349
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
5 changes: 4 additions & 1 deletion common.blocks/share/_service/share_service_blogger.bemhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
block('share').mod('service', 'blogger')(
js()(function() {
return this.extend(applyNext(), this.ctx.params);
}),
attrs()(function() {
var ctx = this.ctx,
params = ctx.js,
params = ctx.params,
uri = 'https://www.blogger.com/blog_this.pyra?';

params.url && (uri += '&u=' + encodeURIComponent(params.url));
Expand Down
5 changes: 4 additions & 1 deletion common.blocks/share/_service/share_service_facebook.bemhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
block('share').mod('service', 'facebook')(
js()(function() {
return this.extend(applyNext(), this.ctx.params);
}),
attrs()(function() {
var ctx = this.ctx,
params = ctx.js,
params = ctx.params,
uri = 'https://www.facebook.com/sharer.php?s=100';

params.url && (uri += '&p[url]=' + encodeURIComponent(params.url));
Expand Down
5 changes: 4 additions & 1 deletion common.blocks/share/_service/share_service_gplus.bemhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
block('share').mod('service', 'gplus')(
js()(function() {
return this.extend(applyNext(), this.ctx.params);
}),
attrs()(function() {
var ctx = this.ctx,
params = ctx.js,
params = ctx.params,
uri = 'https://plus.google.com/share?';

params.url && (uri += 'url=' + encodeURIComponent(params.url));
Expand Down
5 changes: 4 additions & 1 deletion common.blocks/share/_service/share_service_twitter.bemhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
block('share').mod('service', 'twitter')(
js()(function() {
return this.extend(applyNext(), this.ctx.parans);
}),
attrs()(function() {
var ctx = this.ctx,
params = ctx.js,
params = ctx.params,
uri = 'https://twitter.com/share?';

params.title && (uri += 'text=' + encodeURIComponent(params.title));
Expand Down
5 changes: 4 additions & 1 deletion common.blocks/share/_service/share_service_vkontakte.bemhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
block('share').mod('service', 'vkontakte')(
js()(function() {
return this.extend(applyNext(), this.ctx.params);
}),
attrs()(function() {
var ctx = this.ctx,
params = ctx.js,
params = ctx.params,
uri = 'http://vkontakte.ru/share.php?';

params.url && (uri += 'url=' + encodeURIComponent(params.url));
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/share/_service/share_service_vkontakte.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
block : 'share',
mods : { service : 'vkontakte' },
js : {
params : {
url : 'http://factory.mn', // Обязательно
title : 'Привет мир',
description : 'Описание',
Expand Down
30 changes: 15 additions & 15 deletions desktop.bundles/index/index.bemjson.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
block : 'share',
mods : { service : 'vkontakte', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -44,7 +44,7 @@
{
block : 'share',
mods : { service : 'facebook', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -57,7 +57,7 @@
{
block : 'share',
mods : { service : 'twitter', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubaror.github.io/bem-social/',
title : 'BEM Social Components Library #b_',
description : 'Fork me on GitHub'
Expand All @@ -68,7 +68,7 @@
{
block : 'share',
mods : { service : 'gplus', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/'
},
text : 'Google',
Expand All @@ -77,7 +77,7 @@
{
block : 'share',
mods : { service : 'blogger', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -93,7 +93,7 @@
{
block : 'share',
mods : { service : 'vkontakte', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -105,7 +105,7 @@
{
block : 'share',
mods : { service : 'facebook', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -117,7 +117,7 @@
{
block : 'share',
mods : { service : 'twitter', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library #b_',
description : 'Fork me on GitHub'
Expand All @@ -127,15 +127,15 @@
{
block : 'share',
mods : { service : 'gplus', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/'
},
icon : { block : 'icon', mods : { service : 'gplus' } }
},
{
block : 'share',
mods : { service : 'blogger', theme : 'normal', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -151,7 +151,7 @@
{
block : 'share',
mods : { service : 'vkontakte', theme : 'simple', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -163,7 +163,7 @@
{
block : 'share',
mods : { service : 'facebook', theme : 'simple', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand All @@ -175,7 +175,7 @@
{
block : 'share',
mods : { service : 'twitter', theme : 'simple', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library #b_',
description : 'Fork me on GitHub'
Expand All @@ -185,15 +185,15 @@
{
block : 'share',
mods : { service : 'gplus', theme : 'simple', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/'
},
text : 'Google'
},
{
block : 'share',
mods : { service : 'blogger', theme : 'simple', size : 'm' },
js : {
params : {
url : 'http://bem-incubator.github.io/bem-social/',
title : 'BEM Social Components Library',
description : 'Fork me on GitHub',
Expand Down

0 comments on commit be07349

Please sign in to comment.