@mjhls/mjh-framework 1.0.503 → 1.0.505

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.503
2
+ # mjh-framework v. 1.0.505
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -737,11 +737,13 @@ var ArticleQueue = function ArticleQueue(props) {
737
737
  setQueueData = _useState6[1];
738
738
 
739
739
  var refreshAD = function refreshAD(path) {
740
+ var activeArticle = queueData.find(function (item) {
741
+ return item.url.current === path;
742
+ });
743
+ var targeting = getTargeting(activeArticle);
744
+
740
745
  if (!main.main_36) {
741
- var activeArticle = queueData.find(function (item) {
742
- return item.url.current === path;
743
- });
744
- var targeting = getTargeting(activeArticle);
746
+
745
747
  index.lib_3.getGoogletag().then(function (googletag) {
746
748
  if (window.googletag && googletag.pubadsReady) {
747
749
  var slots = googletag.pubads().getSlots();
@@ -757,6 +759,28 @@ var ArticleQueue = function ArticleQueue(props) {
757
759
  }
758
760
  });
759
761
  }
762
+ //Refresh leaderboard ad on mobile
763
+ if (main.main_36) {
764
+ var leaderboardSlotId = '';
765
+ index.lib_3.getGoogletag().then(function (googletag) {
766
+ if (window.googletag && googletag.pubadsReady) {
767
+ var slots = googletag.pubads().getSlots();
768
+ slots.forEach(function (slot) {
769
+ var pos = slot.getTargeting('pos');
770
+ if (pos == 'top-mobile') {
771
+ //gets the slotId of the leaderboard ad to refresh
772
+ leaderboardSlotId = slot.getSlotId().getDomId();
773
+ slot.clearTargeting();
774
+ keys._Object$keys(targeting).forEach(function (key) {
775
+ slot.setTargeting(key, targeting[key]);
776
+ });
777
+ slot.setTargeting('pos', pos);
778
+ }
779
+ });
780
+ index.lib_3.refresh(leaderboardSlotId);
781
+ }
782
+ });
783
+ }
760
784
  };
761
785
 
762
786
  var checkSponseredArticle = function checkSponseredArticle(article) {
@@ -20,7 +20,7 @@ var getQuery = function getQuery(type) {
20
20
  case 'issue':
21
21
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n && dateTime(published) <= dateTime($currentDate)\n && references(^._id)] {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
22
22
  case 'externalResources':
23
- return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '] | order(displayDate desc),\n \'recent\': *[_type == "external" && !archived && isVisible ' + conditions + '] | order(displayDate desc)\n }';
23
+ return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '] | order(displayDate desc),\n \'recent\': *[_type == "external" && archived != true && isVisible ' + conditions + '] | order(displayDate asc)\n }';
24
24
  }
25
25
  };
26
26
 
@@ -732,11 +732,13 @@ var ArticleQueue = function ArticleQueue(props) {
732
732
  setQueueData = _useState6[1];
733
733
 
734
734
  var refreshAD = function refreshAD(path) {
735
+ var activeArticle = queueData.find(function (item) {
736
+ return item.url.current === path;
737
+ });
738
+ var targeting = getTargeting(activeArticle);
739
+
735
740
  if (!main_36) {
736
- var activeArticle = queueData.find(function (item) {
737
- return item.url.current === path;
738
- });
739
- var targeting = getTargeting(activeArticle);
741
+
740
742
  lib_3.getGoogletag().then(function (googletag) {
741
743
  if (window.googletag && googletag.pubadsReady) {
742
744
  var slots = googletag.pubads().getSlots();
@@ -752,6 +754,28 @@ var ArticleQueue = function ArticleQueue(props) {
752
754
  }
753
755
  });
754
756
  }
757
+ //Refresh leaderboard ad on mobile
758
+ if (main_36) {
759
+ var leaderboardSlotId = '';
760
+ lib_3.getGoogletag().then(function (googletag) {
761
+ if (window.googletag && googletag.pubadsReady) {
762
+ var slots = googletag.pubads().getSlots();
763
+ slots.forEach(function (slot) {
764
+ var pos = slot.getTargeting('pos');
765
+ if (pos == 'top-mobile') {
766
+ //gets the slotId of the leaderboard ad to refresh
767
+ leaderboardSlotId = slot.getSlotId().getDomId();
768
+ slot.clearTargeting();
769
+ _Object$keys(targeting).forEach(function (key) {
770
+ slot.setTargeting(key, targeting[key]);
771
+ });
772
+ slot.setTargeting('pos', pos);
773
+ }
774
+ });
775
+ lib_3.refresh(leaderboardSlotId);
776
+ }
777
+ });
778
+ }
755
779
  };
756
780
 
757
781
  var checkSponseredArticle = function checkSponseredArticle(article) {
@@ -18,7 +18,7 @@ var getQuery = function getQuery(type) {
18
18
  case 'issue':
19
19
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n && dateTime(published) <= dateTime($currentDate)\n && references(^._id)] {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
20
20
  case 'externalResources':
21
- return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '] | order(displayDate desc),\n \'recent\': *[_type == "external" && !archived && isVisible ' + conditions + '] | order(displayDate desc)\n }';
21
+ return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '] | order(displayDate desc),\n \'recent\': *[_type == "external" && archived != true && isVisible ' + conditions + '] | order(displayDate asc)\n }';
22
22
  }
23
23
  };
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.503",
3
+ "version": "1.0.505",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",