From 32e255c2f0e993a99411af11c1cde8a273593090 Mon Sep 17 00:00:00 2001 From: Jens Date: Sat, 3 Sep 2016 19:45:05 +0200 Subject: [PATCH 1/4] added ability for users to change image dimensions --- MMM-Instagram.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/MMM-Instagram.js b/MMM-Instagram.js index d99f336..9d83197 100644 --- a/MMM-Instagram.js +++ b/MMM-Instagram.js @@ -18,6 +18,8 @@ Module.register('MMM-Instagram', { access_token: '', count: 200, min_timestamp: 0, + instaMaxWidth: '100%', + instaMaxHeight: '100%', loadingText: 'Loading...' }, @@ -77,12 +79,15 @@ Module.register('MMM-Instagram', { var tempimage = this.images.photo[this.activeItem]; // image - var imageLink = document.createElement('div'); //imageLink.innerHTML = ""; - imageLink.id = "MMM-Instagram-image"; - imageLink.innerHTML = ""; + + var imageWrapper = document.createElement("img"); + imageWrapper.src = tempimpage.photolink; + imageWrapper.id = "MMM-Instagram-image" + imageWrapper.style.maxWidth = this.config.instaMaxWidth; + imageWrapper.style.maxHeight = this.config.instaMaxHeight; + imageDisplay.appendChild(imageWrapper); - imageDisplay.appendChild(imageLink); wrapper.appendChild(imageDisplay); return wrapper; From b9e32dccdc2011f632dbcdf9c2b5f98f700939d5 Mon Sep 17 00:00:00 2001 From: Jens Date: Sat, 3 Sep 2016 19:48:51 +0200 Subject: [PATCH 2/4] updated README.md to include image dimensions --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f0cf1a9..9db066b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ The entry in `config.js` can include the following options: |`min_timestamp`|Set to 0 to pull images from when you created the account.

This value is **REQUIRED**| |`animationSpeed`|How long the fade out and fade in of photos should take.

This value is **REQUIRED**| |`updateInterval`|How long before refreshing image list.

This value is **REQUIRED**| +|`instaMaxWidth`|Specify maximum width of the retrieved images.

This value is **OPTIONAL**| +|`instaMaxHeight`|Specify maximum height of the retrieved images.

This value is **OPTIONAL**| Here is an example of an entry in `config.js` ``` @@ -39,7 +41,9 @@ Here is an example of an entry in `config.js` count: 200, min_timestamp: 0, animationSpeed: 2500, - updateInterval: 12500 + updateInterval: 12500, + instaMaxWidth: '20%', // Optional parameter + instaMaxHeight: '200px' // Optional parameter } }, ``` From 06a61173e695e19f0259ea26705ea2699e354679 Mon Sep 17 00:00:00 2001 From: Jens Date: Sat, 3 Sep 2016 22:20:34 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9db066b..2f00e38 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ The entry in `config.js` can include the following options: |`min_timestamp`|Set to 0 to pull images from when you created the account.

This value is **REQUIRED**| |`animationSpeed`|How long the fade out and fade in of photos should take.

This value is **REQUIRED**| |`updateInterval`|How long before refreshing image list.

This value is **REQUIRED**| -|`instaMaxWidth`|Specify maximum width of the retrieved images.

This value is **OPTIONAL**| -|`instaMaxHeight`|Specify maximum height of the retrieved images.

This value is **OPTIONAL**| +|`instaMaxWidth`|Specify maximum width of the retrieved images. Can be absolute (e.g. '200px') or relative (e.g. '50%').

This value is **OPTIONAL**| +|`instaMaxHeight`|Specify maximum height of the retrieved images. Can only be absolute (e.g. '100px').

This value is **OPTIONAL**| Here is an example of an entry in `config.js` ``` From f32a68dc280334f00f3162bad65dd3fe216c0020 Mon Sep 17 00:00:00 2001 From: Jens Date: Sat, 3 Sep 2016 22:21:40 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f00e38..13b418f 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ Here is an example of an entry in `config.js` min_timestamp: 0, animationSpeed: 2500, updateInterval: 12500, - instaMaxWidth: '20%', // Optional parameter - instaMaxHeight: '200px' // Optional parameter + instaMaxWidth: '20%', // Optional parameter, can be relative (percentage) or absolute (px) + instaMaxHeight: '200px' // Optional parameter, can be absolute only (px) } }, ```