Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
- Prevent JS asset rendering on frontend outside CP
  • Loading branch information
reganlawton committed Dec 6, 2018
1 parent da0219c commit f64944b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Simple Sharing Changelog

## 1.0.1 - 2018-12-07

### Updated
- Prevent JS asset rendering on frontend

## 1.0.0 - 2018-11-14

### Added
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": "wrav/simplesharing",
"description": "Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.",
"type": "craft-plugin",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [
"craft",
"cms",
Expand Down
10 changes: 9 additions & 1 deletion releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"version": "1.0.1",
"downloadUrl": "https://github.com/wrav/simple-sharing/archive/master.zip",
"date": "2018-12-07:00:00+10:30",
"notes": [
"[Updated] Prevent JS asset rendering on frontend"
]
}.
{
"version": "1.0.0",
"downloadUrl": "https://github.com/wrav/simple-sharing/archive/master.zip",
Expand All @@ -7,4 +15,4 @@
"[Added] Initial release and migration from previous project"
]
}
]
]
6 changes: 4 additions & 2 deletions src/SimpleSharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ function (PluginEvent $event) {
View::class,
View::EVENT_END_PAGE,
function(Event $event) {
$url = Craft::$app->assetManager->getPublishedUrl('@wrav/simplesharing/assetbundles/simplesharing/dist/js/SimpleSharing.js', true);
if (Craft::$app->getRequest()->getIsCpRequest()) {
$url = Craft::$app->assetManager->getPublishedUrl('@wrav/simplesharing/assetbundles/simplesharing/dist/js/SimpleSharing.js', true);

echo "<script src='$url'></script>";
echo "<script src='$url'></script>";
}
}
);

Expand Down

0 comments on commit f64944b

Please sign in to comment.