Skip to content

Commit

Permalink
Fix #41
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmrtn committed Jun 2, 2021
1 parent 2da36d4 commit e536f6c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# craftagram Changelog

## 1.4.5 - 2021-06-02
### Fixed
- Don't output video with the image tag (#41)

## 1.4.4 - 2021-02-17
### Changed
- Add basic auth to headless endpoint. Existing installations will remain unsecured until the option is enabled.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "scaramangagency/craftagram",
"description": "Grab Instagram content through the Instagram Basic Display API",
"type": "craft-plugin",
"version": "1.4.4",
"version": "1.4.5",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function actionHandleAuth($site_id, $client_id) {
* @return Response|null
*/
public function actionAuth() {
$url = parse_url(Craft::parseEnv(Craft::$app->sites->primarySite->baseUrl) . $_SERVER['REQUEST_URI']);
$url = parse_url(rtrim(Craft::parseEnv(Craft::$app->sites->primarySite->baseUrl), '/') . $_SERVER['REQUEST_URI']);
parse_str($url['query'], $params);
$code = $params['code'];
$siteId = $params['state'];
Expand Down
6 changes: 4 additions & 2 deletions src/templates/settings/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<h2>Preview</h2>

<div data-js="insta-wrapper" class="insta-preview-wrapper">
{% for item in craftagram.data %}
{% for item in craftagram.data if item.media_type == "IMAGE" %}
<img src={{item.media_url}} class="insta-preview" />
{% endfor %}
</div>
Expand Down Expand Up @@ -162,7 +162,9 @@
data = $.parseJSON(res);

$.each(data["data"], function() {
$("[data-js='insta-wrapper']").append("<img src="+$(this)[0]["media_url"]+" width=150 class='insta-preview' />");
if ($(this)[0]["media_type"] == "IMAGE") {
$("[data-js='insta-wrapper']").append("<img src="+$(this)[0]["media_url"]+" width=150 class='insta-preview' />");
}
});

$("[data-js=load-more]").data("after", data["paging"]["cursors"]["after"]);
Expand Down

0 comments on commit e536f6c

Please sign in to comment.