sr-npm 1.7.511 → 1.7.512

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.511",
3
+ "version": "1.7.512",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,7 +1,8 @@
1
1
  const {
2
- htmlToText
2
+ htmlToText,
3
+ appendQueryParams
3
4
  } = require('../public/utils');
4
- const { query,queryParams,to } = require("wix-location-frontend");
5
+ const { query } = require("wix-location-frontend");
5
6
 
6
7
  async function positionPageOnReady(_$w) {
7
8
 
@@ -16,12 +17,7 @@ const {
16
17
 
17
18
  handleReferFriendButton(_$w,item);
18
19
 
19
- _$w('#applyButton').target="_blank";//so it can open in new tab
20
- // _$w('#applyButton').onClick(()=>handleApplyButton(_$w,item));
21
- const url=appendQueryParams(item.applyLink);
22
- console.log("url is: ", url);
23
- _$w('#applyButton').link=url;
24
- console.log("applyButton.target is: ", _$w('#applyButton').target);
20
+ handleApplyButton(_$w,item);
25
21
 
26
22
  _$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
27
23
  _$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
@@ -45,18 +41,13 @@ const {
45
41
  }
46
42
 
47
43
  function handleApplyButton(_$w,item) {
48
- const applyLinkWithQueryParams=appendQueryParams(item.applyLink);
49
- console.log("applyLinkWithQueryParams is: ", applyLinkWithQueryParams);
50
- to(applyLinkWithQueryParams);
44
+ _$w('#applyButton').target="_blank";//so it can open in new tab
45
+ console.log("query is: ", query);
46
+ const url=appendQueryParams(item.applyLink,query);
47
+ _$w('#applyButton').link=url; //so it can be clicked
48
+ console.log("url is: ", url);
51
49
  }
52
50
 
53
- function appendQueryParams(url){
54
- const urlObj=new URL(url);
55
- Object.entries(query).forEach(([key,value])=>{
56
- urlObj.searchParams.set(key,value);
57
- });
58
- return urlObj.toString();
59
- }
60
51
  module.exports = {
61
52
  positionPageOnReady,
62
53
  };
package/public/utils.js CHANGED
@@ -39,7 +39,16 @@ function filterBrokenMarkers(items) {
39
39
  }
40
40
 
41
41
 
42
+ function appendQueryParams(url,query){
43
+ const urlObj=new URL(url);
44
+ Object.entries(query).forEach(([key,value])=>{
45
+ urlObj.searchParams.set(key,value);
46
+ });
47
+ return urlObj.toString();
48
+ }
49
+
42
50
  module.exports = {
43
51
  htmlToText,
44
- filterBrokenMarkers
52
+ filterBrokenMarkers,
53
+ appendQueryParams
45
54
  };