diff --git a/README.md b/README.md
index 5b1bf04..06600dd 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,43 @@
# Instagram widget #
-Magento module 2 that displays last photos from an instagram account. More information here https://www.bitbull.it/blog/sviluppare-un-widget-con-magento2-e-requirejs/
+Magento module 2 that displays last photos from an Instagram account. More information here https://www.bitbull.it/blog/sviluppare-un-widget-con-magento2-e-requirejs/
Installation Instructions
--------------------------
Add these lines to the composer.json of your project
```
-"require":{
+"require": {
...
- "bitbull/magento2-module-instagramwidget": "4.2.0"
+ "bitbull/magento2-module-instagramwidget": "5.0.0"
}
```
```
- "repositories":[
+ "repositories": [
...
- {"type": "vcs", "url":"https://github.com/bitbull-team/magento2-module-instagramwidget.git"}
+ {
+ "type": "vcs",
+ "url":"https://github.com/bitbull-team/magento2-module-instagramwidget.git"
+ }
]
```
Settings
--------
-After install go to M2 admin configuration and in the instagram widget tab add:
+After install go to M2 admin configuration and in the Bitbull > Instagram widget tab add:
* Instagram Token Credentials
* Instagram Userid Credentials
* Channel name to display
* Numbers of photo
-To retrieve the data of your channel follow the official instagram doc: https://www.instagram.com/developer/authentication/
+To retrieve the data of your channel follow the official Instagram doc: https://www.instagram.com/developer/authentication/
Changelog
----------
+* 5.0.0 - Moved module under Bitbull tab and moved img getter in a separate function
* 4.3.1 - Fix on comparison operator
* 4.3.0 - Fix squared images url
* 4.2.0 - Squared image configuration
@@ -56,7 +60,8 @@ Licence
Developers
---------
-Irene Iaccio(@nuovecode): http://www.bitbull.it
+Irene Iaccio(@nuovecode): http://www.bitbull.it
+Lorena Ramonda (@loreenaramonda): http://www.bitbull.it
Rodrigo Acuna: https://github.com/rodde177
diff --git a/composer.json b/composer.json
index 048881e..29c7abc 100644
--- a/composer.json
+++ b/composer.json
@@ -6,10 +6,21 @@
{
"name": "Irene Iaccio",
"email": "irene.iaccio@bitbull.it"
+ },
+ {
+ "name": "Lorena Ramonda",
+ "email": "lorena.ramonda@bitbull.it"
+ }
+ ],
+ "repositories":[
+ {
+ "type": "vcs",
+ "url":"git@github.com:bitbull-team/magento2-module-bitbull-common.git"
}
],
"require": {
- "php": "~5.5.0|~5.6.0|~7.0.0"
+ "php": "~5.5.0|~5.6.0|~7.0.0",
+ "bitbull/common": "*"
},
"type": "magento2-module",
"autoload": {
diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml
index ba62f48..0fe2014 100644
--- a/etc/adminhtml/system.xml
+++ b/etc/adminhtml/system.xml
@@ -1,13 +1,12 @@
-
-
+
+
-
-
\ No newline at end of file
diff --git a/view/frontend/layout/cms_index_index.xml b/view/frontend/layout/cms_index_index.xml
index ff43eea..0aec250 100644
--- a/view/frontend/layout/cms_index_index.xml
+++ b/view/frontend/layout/cms_index_index.xml
@@ -12,7 +12,7 @@
+ ifconfig="bitbull_instagramwidget/settings/enabled_homepage">
Instagram
diff --git a/view/frontend/web/css/source/_module.less b/view/frontend/web/css/source/_module.less
index b87157b..b2ec5a7 100644
--- a/view/frontend/web/css/source/_module.less
+++ b/view/frontend/web/css/source/_module.less
@@ -26,6 +26,7 @@
padding: 15px;
width: 50%;
float: left;
+ box-sizing: border-box;
a {
cursor: pointer;
&:hover {
diff --git a/view/frontend/web/js/InstagramWidget.js b/view/frontend/web/js/InstagramWidget.js
index eb3a45f..6f143b4 100644
--- a/view/frontend/web/js/InstagramWidget.js
+++ b/view/frontend/web/js/InstagramWidget.js
@@ -28,13 +28,9 @@ define([
that = this;
$.each(data.data, function () {
- var img = this.images.low_resolution.url,
+ var img = that._getImg(this),
url = this.link;
- if (that.options.cropped_images == 1) {
- img = that._getSquaredPhoto(this.images.thumbnail.url);
- }
-
html += '' +
'' +
''+
@@ -61,6 +57,26 @@ define([
},
+ /**
+ * Get Photo
+ *
+ * @param data
+ * @returns {*}
+ * @private
+ */
+
+
+ _getImg: function (data) {
+ var that = this,
+ image = data.images.low_resolution.url;
+
+ if (that.options.cropped_images == 1) {
+ image = that._getSquaredPhoto(data.images.thumbnail.url);
+ }
+
+ return image;
+ },
+
/**
* Get Squared Photo if config
*