sr-npm 1.7.510 → 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 +1 -1
- package/pages/positionPage.js +11 -17
- package/public/utils.js +10 -1
package/package.json
CHANGED
package/pages/positionPage.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const {
|
|
2
|
-
htmlToText
|
|
2
|
+
htmlToText,
|
|
3
|
+
appendQueryParams
|
|
3
4
|
} = require('../public/utils');
|
|
4
|
-
const { query
|
|
5
|
+
const { query } = require("wix-location-frontend");
|
|
5
6
|
|
|
6
7
|
async function positionPageOnReady(_$w) {
|
|
7
8
|
|
|
@@ -13,9 +14,10 @@ const {
|
|
|
13
14
|
_$w('#datasetJobsItem').onReady(async () => {
|
|
14
15
|
|
|
15
16
|
const item = await _$w('#datasetJobsItem').getCurrentItem();
|
|
17
|
+
|
|
16
18
|
handleReferFriendButton(_$w,item);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
handleApplyButton(_$w,item);
|
|
19
21
|
|
|
20
22
|
_$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
|
|
21
23
|
_$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
|
|
@@ -39,21 +41,13 @@ const {
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
function handleApplyButton(_$w,item) {
|
|
42
|
-
|
|
43
|
-
console.log(query);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
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);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
function appendQueryParams(url){
|
|
50
|
-
const urlObj=new URL(url);
|
|
51
|
-
Object.entries(query).forEach(([key,value])=>{
|
|
52
|
-
urlObj.searchParams.set(key,value);
|
|
53
|
-
});
|
|
54
|
-
console.log("urlObj is: ", urlObj);
|
|
55
|
-
return urlObj.toString();
|
|
56
|
-
}
|
|
57
51
|
module.exports = {
|
|
58
52
|
positionPageOnReady,
|
|
59
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
|
};
|