Install

Works with Drupal: 7.x

Using Composer to manage Drupal site dependencies

Downloads

Download addthis-7.x-4.0-alpha6.tar.gztar.gz 31.52 KB
MD5: ae0bb9c244ebdc3ead35e4a5bcf25975
SHA-1: f7b80d3fd38cca816ba617b253da706d96632659
SHA-256: acaf61db447c20854e345ac8ccc430e2cfdd7383e2e547b0f40317b1ae0ab262
Download addthis-7.x-4.0-alpha6.zipzip 44.03 KB
MD5: 5c3b36c6574ce103fb7b86dfe07f0c19
SHA-1: b105a279db7640ad9234fbe1541f2d5a941f2cc5
SHA-256: 4b9b9d3d3b3d255055fbd356b91852d2f204accc51d2b7ee268cb66741040aaa

Release notes

- Issue #2333231 by matglas86, DamienMcKenna: Only insert the same addthis JS once per page #2333231: Only insert the same addthis JS once per page

Use update.php to rebuild the registry because of class changes.
If that does not work use the rebuild_registry module.

More importantly classes have been restructured and javascript loading
has been redesigned.

- Restructured test classes.
- Restructured the way widget.js is included, how loading is done and
how the addthis.js behaves.
- The addthis.js is always loaded but is used as a library instead of
executing everything directly like it was before.
- The include of AddThisJson and AddThisWidgetJs in AddThis::getInstance()
where removed because they should be autoloaded from the register.

Restructuring classes.
- In general the AddThis class has become a sort of module file that contains
all kinds of addthis related functions. This is bad design and therefore step
by step things are refactored. This breaks API but no official rc or release
has been given out yet.
- Classes are structured now in folders in a way namespace could be organised.
Because PHP 5.2 does not support namespaces we only use classes but the
structure is already there for future portability.
- AddThisScriptManager is added as a Service. This handles the attachment of
js and settings when needing addthis or widgets on your page. The AddThis->addWidgetJs,
AddThis->includeWidgetJs and AddThis->addConfigurationOptionsJs where
removed in favor of the AddThisScriptManager functionality.
- AddThisJson is moved to the Util directory.
- AddThisWidgetJs is renamed to AddThisWidgetJsUrl and moved to the Util
directory. The name changed because it better displays the purpose of the
class.
- AddThis->getServiceNamesAsCommaSeparatedString was made public to be usable
inside the AddThisScriptManager.
- getWidgetJsLoadType was renamed to getWidgetJsInclude because it displays
the type of information better.
- Related to the previous the WIDGET_JS_LOAD_TYPE was removed and split into
WIDGET_JS_LOAD_DOMREADY, WIDGET_JS_LOAD_ASYNC and WIDGET_JS_INCLUDE. The
reason beeing that the old way was misinterpreted. The DOMREADY and ASYNC
type of loading are two different things but where not possible separately.

Examples
- Expanded the example with a hook_page_build to run the attach functionality
on the whole page.

Test
- A test module was added to be able to test extra things but seperate it from
the main module.
- addthis.test contained two test classes. These where split into two sperate
files.

Created by: matglas86
Created on: 15 Jun 2015 at 11:41 UTC
Last updated: 15 Jun 2015 at 11:43 UTC
New features

Other releases