Skip to content

Commit

Permalink
Merge pull request #160 from NikolayRys/release_2_4
Browse files Browse the repository at this point in the history
Release 2.4 and bugfixes
  • Loading branch information
NikolayRys authored Dec 3, 2019
2 parents 0de24fc + f786fca commit acd1ab4
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 77 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Likely",
"version": "2.3.1",
"version": "2.4",
"homepage": "http://ilyabirman.ru/projects/likely",
"authors": [
"Ilya Birman <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ilyabirman-likely",
"description": "The social sharing buttons that aren’t shabby",
"version": "2.3.1",
"version": "2.4.0",
"repository": {
"type": "git",
"url": "https://github.com/ilyabirman/Likely.git"
Expand Down
3 changes: 0 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ Then, create a `div` with the class `likely` and list necessary social networks
<div class="likely">
<div class="facebook">Share</div>
<div class="twitter">Tweet</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="pinterest">Pin</div>
<div class="odnoklassniki">Like</div>
Expand All @@ -79,7 +78,6 @@ Likely supports following social networks:

* `facebook` – Facebook
* `twitter` – Twitter
* `gplus` - Google+
* `vkontakte` – VK
* `pinterest` – Pinterest
* `odnoklassniki` – Odnoklassniki
Expand Down Expand Up @@ -173,7 +171,6 @@ To make buttons accessible for keyboard navigation and screen readers add `tabin
<div class="likely">
<div class="facebook" tabindex="0" role="link" aria-label="Share on Facebook">Share</div>
<div class="twitter" tabindex="0" role="link" aria-label="Tweet on Twitter">Tweet</div>
<div class="gplus" tabindex="0" role="link" aria-label="Plus One on Google Plus">+1</div>
<div class="vkontakte" tabindex="0" role="link" aria-label="Share on Vkontakte">Share</div>
<div class="pinterest" tabindex="0" role="link" aria-label="Pin on Pinterest">Pin</div>
<div class="odnoklassniki" tabindex="0" role="link" aria-label="Like on Odnoklassniki">Like</div>
Expand Down
7 changes: 4 additions & 3 deletions release/likely-commonjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/likely.css

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions release/likely.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion source/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ colorize(button, color) {
}

colorize('facebook', #425497);
colorize('gplus', #dd4241);
colorize('linkedin', #0077b5);
colorize('odnoklassniki', #f6903b);
colorize('pinterest', #bd081c);
Expand Down
2 changes: 1 addition & 1 deletion source/services/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

export default {
counterUrl: 'https://graph.facebook.com/?id={url}&fields=og_object%7Bengagement%7Bcount%7D%%7D&callback=?',
counterUrl: 'https://graph.facebook.com/?id={url}&fields=og_object%7Bengagement%7Bcount%7D%7D&callback=?',
convertNumber: (data) => data.og_object.engagement.count,
popupUrl: 'https://www.facebook.com/sharer/sharer.php?u={url}',
popupWidth: 600,
Expand Down
36 changes: 0 additions & 36 deletions source/services/gplus.js

This file was deleted.

2 changes: 0 additions & 2 deletions source/services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { each } from '../utils';

/* eslint-disable sort-imports */
import facebook from './facebook';
import gplus from './gplus';
import linkedin from './linkedin';
import odnoklassniki from './odnoklassniki';
import pinterest from './pinterest';
Expand All @@ -19,7 +18,6 @@ import whatsapp from './whatsapp';

const services = {
facebook,
gplus,
linkedin,
odnoklassniki,
pinterest,
Expand Down
2 changes: 0 additions & 2 deletions source/services/linkedin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*/

export default {
counterUrl: 'https://www.linkedin.com/countserv/count/share?url={url}&format=jsonp&callback=?',
convertNumber: (data) => data.count,
popupUrl: 'https://www.linkedin.com/shareArticle?mini=true&url={url}&title={title}',
popupWidth: 600,
popupHeight: 500,
Expand Down
1 change: 0 additions & 1 deletion test/files/autoinit.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<div class="likely">
<div class="twitter">Tweet</div>
<div class="facebook">Share</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="odnoklassniki">Like</div>
<div class="pinterest">Pin</div>
Expand Down
3 changes: 1 addition & 2 deletions test/files/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
<div class="likely" data-url="https://google.com">
<div class="twitter">Tweet</div>
<div class="facebook">Share</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="odnoklassniki">Like</div>
<div class="pinterest">Pin</div>
<div class="pinterest" data-media="http://i.imgur.com/zunNbfY.jpg">Pin</div>
<div class="telegram">Send</div>
<div class="linkedin">Share</div>
<div class="whatsapp">Send</div>
Expand Down
4 changes: 0 additions & 4 deletions test/files/no-autoinit-multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<div class="likely" id="widget1">
<div class="twitter">Tweet</div>
<div class="facebook">Share</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="odnoklassniki">Like</div>
<div class="pinterest">Pin</div>
Expand All @@ -30,7 +29,6 @@
<div class="likely" id="widget2">
<div class="twitter">Tweet</div>
<div class="facebook">Share</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="odnoklassniki">Like</div>
<div class="pinterest">Pin</div>
Expand All @@ -40,7 +38,6 @@
<div class="likely" id="widget3">
<div class="twitter">Tweet</div>
<div class="facebook">Share</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="odnoklassniki">Like</div>
<div class="pinterest">Pin</div>
Expand All @@ -50,7 +47,6 @@
<div class="likely" id="widget4">
<div class="twitter">Tweet</div>
<div class="facebook">Share</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="odnoklassniki">Like</div>
<div class="pinterest">Pin</div>
Expand Down
1 change: 0 additions & 1 deletion test/files/no-autoinit.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<div class="likely">
<div class="twitter">Tweet</div>
<div class="facebook">Share</div>
<div class="gplus">+1</div>
<div class="vkontakte">Share</div>
<div class="odnoklassniki">Like</div>
<div class="pinterest">Pin</div>
Expand Down
9 changes: 4 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,9 @@ describe('Likely', function () {

const testedServices = [
{ name: 'Facebook', likelyName: 'facebook' },
{ name: 'Google+', likelyName: 'gplus' },
{ name: 'Odnoklassniki', likelyName: 'odnoklassniki' },
{ name: 'Pinterest', likelyName: 'pinterest' },
{ name: 'VK', likelyName: 'vkontakte' },
{ name: 'LinkedIn', likelyName: 'linkedin' },
];

testedServices.forEach(({ name, likelyName }) => {
Expand All @@ -209,7 +207,6 @@ describe('Likely', function () {

const testedServices = [
{ name: 'Facebook', likelyName: 'facebook', urlRegex: /facebook\.com/ },
{ name: 'Google+', likelyName: 'gplus', urlRegex: /plus\.google\.com/ },
{ name: 'Odnoklassniki', likelyName: 'odnoklassniki', urlRegex: /ok\.ru/ },
{ name: 'Pinterest', likelyName: 'pinterest', urlRegex: /pinterest\.com/ },
{ name: 'Telegram', likelyName: 'telegram', urlRegex: /telegram\.me/ },
Expand Down Expand Up @@ -275,12 +272,14 @@ describe('Likely', function () {
});
});

it('should change the default image when the `data-media` on the Pinterest button is specified', function () {
// Temporary disabled because pinterest requires being logged in to show relevant popup, otherwise it redirects
// Actually expected regex: /pinterest\.com\/.*zunNbfY\.jpg/
it('should open popup for Pinterest', function () {
return driver.executeScript(`
document.querySelector('.pinterest').setAttribute('data-media', 'http://i.imgur.com/zunNbfY.jpg');
likely.initiate();
`).then(() => {
return expectClickToOpen(driver, '.likely__widget_pinterest', /pinterest\.com\/.*zunNbfY\.jpg/);
return expectClickToOpen(driver, '.likely__widget_pinterest', /pinterest/);
});
});
});
Expand Down
21 changes: 11 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ const packageJson = require('./package.json');
const { NODE_ENV } = process.env;
const isProduction = NODE_ENV === 'production';

const license = `
Likely $version by Ilya Birman (ilyabirman.net)
const license = `Likely $version by Ilya Birman (ilyabirman.net)
Rewritten sans jQuery by Evgeny Steblinsky (volter9.github.io)
Supported by Ivan Akulov (iamakulov.com), Viktor Karpov (vitkarpov.com), and contributors
Inspired by Social Likes by Artem Sapegin (sapegin.me)
`;
Supported by Ivan Akulov (iamakulov.com), Viktor Karpov (vitkarpov.com),
Nikolay Rys (linkedin.com/in/nikolay-rys) and contributors
Inspired by Social Likes by Artem Sapegin (sapegin.me)`;

function getLicenseComment(version) {
return license.replace(/\$version/g, version);
Expand All @@ -26,15 +25,17 @@ const plugins = [
];

if (isProduction) {
plugins.concat([
new webpack.optimize.DedupePlugin(),
new webpack.BannerPlugin(getLicenseComment(packageJson.version)),
plugins.push(
new webpack.BannerPlugin({
banner: getLicenseComment(packageJson.version),
exclude: './release/likely.css',
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),
]);
})
);
}

module.exports = {
Expand Down

0 comments on commit acd1ab4

Please sign in to comment.