Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
* release/2.0.0:
  release 2.0.0
  fix external jquery in shariff.min.js
  fix IE 11 bug (#253)
  Update README-de.md
  Update README.md
  Add documentation of JavaScript constructor arguments.
  delete build artifacts
  • Loading branch information
pmb0 committed Oct 25, 2017
2 parents 8d81b7e + 1131d57 commit ad3107c
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 2,709 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!dist
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v2.0.0, 2017-10-25

- Fixed IE 11 issues. ([#253](https://github.com/heiseonline/shariff/issues/253))

This release contains breaking changes:

- Build artifacts were deleted from the repository. Instead, they get published to the npm registry in the `./dist` folder.

## v1.26.1, 2017-07-28

* Added missing `./build` directory.([#246](https://github.com/heiseonline/shariff/issues/246))
Expand Down
13 changes: 13 additions & 0 deletions README-de.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ Für den Aufruf von `grunt demo` muss [Grunt CLI](http://gruntjs.com/getting-sta
| `data-twitter-via` | User von dem der Tweet ursprünglich stammt. | `null` |
| `data-url` | URL, die geteilt werden soll. | Wenn `data-url` nicht gesetzt ist, wird `link[rel="canonical"]`, `meta[property="og:url"]` oder `location.href` verwendet. |

## Konstruktor-Argumente

Alle data-Attribute von oben sind auch als Konstruktor-Argumente in JavaScript verwendbar. Dabei wird das `data-` am Anfang weggestrichen und camelCase statt kebab-case verwendet:

```js
var buttonsContainer = $('.some-selector');
new Shariff(buttonsContainer, {
backendUrl: '/my/backend/url',
orientation: 'vertical',
mailUrl: 'mailto:[email protected]',
});
```

## Unterstützte Browser

Expand Down Expand Up @@ -162,6 +174,7 @@ Bekannte Shariff-Integrationen für Drittanbieter-Systeme:
* [Kirby-CMS Shariff-Plugin](https://github.com/SpicyWeb-de/kirby-plugin-shariff)
* [MediaWiki Extension](https://github.com/vonloxley/Shariff-Mediawiki/)
* [Open Monograph Press-Plugin](https://github.com/langsci/shariff)
* [Pagekit Extension](https://pagekit.com/marketplace/package/spqr/shariff)
* [Serendipity Plugin](https://github.com/s9y/additional_plugins/tree/master/serendipity_event_social)
* [SilverStripe-Modul](https://github.com/andrelohmann/silverstripe-shariff)
* [Symfony ShariffBundle](https://github.com/core23/ShariffBundle)
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ Make sure you have installed the [Grunt CLI](http://gruntjs.com/getting-started#
| `data-twitter-via` | Screen name of the user to attribute the Tweet to | `null` |
| `data-url` | The canonical URL of the page to check. | page's canonical URL or `og:url` or current URL |

## Constructor arguments

All data attributes above are also available as constructor arguments in JavaScript. However, the
leading `data-` is omitted and the name is in camelCase instead of kebab-case:

```js
var buttonsContainer = $('.some-selector');
new Shariff(buttonsContainer, {
backendUrl: '/my/backend/url',
orientation: 'vertical',
mailUrl: 'mailto:[email protected]',
});
```

## Supported browsers

Expand Down Expand Up @@ -162,6 +175,7 @@ This is a list of integrations for third-party systems:
* [Kirby-CMS Shariff-Plugin](https://github.com/SpicyWeb-de/kirby-plugin-shariff)
* [MediaWiki Extension](https://github.com/vonloxley/Shariff-Mediawiki/)
* [Open Monograph Press Plugin](https://github.com/langsci/shariff)
* [Pagekit Extension](https://pagekit.com/marketplace/package/spqr/shariff)
* [Serendipity](https://github.com/s9y/additional_plugins/tree/master/serendipity_event_social)
* [SilverStripe Module](https://github.com/andrelohmann/silverstripe-shariff)
* [Symfony ShariffBundle](https://github.com/core23/ShariffBundle)
Expand Down
Binary file removed build/fontawesome-webfont.eot
Binary file not shown.
2,671 changes: 0 additions & 2,671 deletions build/fontawesome-webfont.svg

This file was deleted.

Binary file removed build/fontawesome-webfont.ttf
Binary file not shown.
Binary file removed build/fontawesome-webfont.woff
Binary file not shown.
Binary file removed build/fontawesome-webfont.woff2
Binary file not shown.
10 changes: 0 additions & 10 deletions build/shariff.complete.css

This file was deleted.

7 changes: 0 additions & 7 deletions build/shariff.complete.js

This file was deleted.

7 changes: 0 additions & 7 deletions build/shariff.min.css

This file was deleted.

7 changes: 0 additions & 7 deletions build/shariff.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shariff",
"version": "1.26.1",
"version": "2.0.0",
"description": "Shariff enables website users to share their favorite content without compromising their privacy.",
"main": "src/js/shariff.js",
"scripts": {
Expand Down
7 changes: 6 additions & 1 deletion src/js/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ DOMQuery.prototype.prepend = function(html) {
* @returns {DOMQuery}
*/
DOMQuery.prototype.addClass = function(names) {
return this.each(function() { this.classList.add(...names.split(' ')) })
return this.each(function() {
// Workaround: IE only supports a single parameter to classList.add()
names.split(' ').forEach(className => {
this.classList.add(className)
})
})
}

/**
Expand Down
22 changes: 17 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ const webpack = require('webpack')

const extractLess = new ExtractTextPlugin({filename: '[name].css'})

module.exports = {
entry: {
'shariff.complete': './src/js/shariff.complete',
'shariff.min': './src/js/shariff.min'
},
const baseConf = {
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
Expand Down Expand Up @@ -69,3 +65,19 @@ Licensed under the ${license} license`
})
],
}

module.exports = [
Object.assign({}, baseConf, {
entry: {
'shariff.complete': './src/js/shariff.complete',
}
}),
Object.assign({}, baseConf, {
entry: {
'shariff.min': './src/js/shariff.min'
},
externals: {
'./dom': 'jQuery',
},
}),
]

0 comments on commit ad3107c

Please sign in to comment.