Last active
August 16, 2021 21:48
Revisions
-
doublejosh revised this gist
Aug 16, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ const fields = [{ name: "email", value: "" }]; const hiddenFields = [ { name: "lists", value: "waitlist" }, { name: "source", value: "twitter" }, { name: "medium", value: "social" }, { name: "campaign", value: "header" }, -
doublejosh revised this gist
Aug 16, 2021 . 1 changed file with 16 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,22 @@ const fields = [{ name: "email", value: "" }]; const hiddenFields = [ { name: "lists", value: "uncommon" }, { name: "source", value: "twitter" }, { name: "medium", value: "social" }, { name: "campaign", value: "header" }, { name: "campaign_type", value: "website" }, ]; const urlParams = new URLSearchParams(window.location.search); console.log( fields.concat(hiddenFields).reduce( (obj, field) => Object.assign({}, obj, { [field.name]: urlParams.has(field.name) ? urlParams.get(field.name) : field.value || "", }), {} ) ); -
doublejosh revised this gist
Aug 16, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const urlParams = new URLSearchParams(window.location.search); console.log( fields.concat(hiddenFields).reduce((obj, field) => Object.assign({}, obj, { [field.name]: urlParams.has(field.name) ? urlParams.get(field.name) -
doublejosh revised this gist
Aug 16, 2021 . 1 changed file with 1 addition and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,12 +17,4 @@ console.log( : field.value || "", }) ) ); -
doublejosh revised this gist
Aug 16, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const urlParams = new URLSearchParams(window.location.search); console.log( fields.concat(hiddenFields).reduce(({}, obj, field) => Object.assign({}, obj, { [field.name]: urlParams.has(field.name) ? urlParams.get(field.name) -
doublejosh revised this gist
Aug 16, 2021 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ const fields = [{ name: "email", value: "" }]; const hiddenFields = [ { name: "lists", value: "uncommon" }, { name: "source", value: "twitter" }, { name: "medium", value: "social" }, { name: "campaign", value: "header" }, { name: "campaign_type", value: "website" }, ]; @@ -19,10 +19,10 @@ console.log( ) ); campaign: "header" campaign_type: "website" lists: "uncommon" medium: "website" name: "email" source: "website" value: "" -
doublejosh revised this gist
Aug 16, 2021 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,12 @@ console.log( : field.value || "", }) ) ); // campaign: "header" // campaign_type: "website" // lists: "uncommon" // medium: "website" // name: "email" // source: "website" // value: "" -
doublejosh created this gist
Aug 16, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ const fields = [{ name: "email", value: "" }]; const hiddenFields = [ { name: "lists", value: "uncommon" }, { name: "source", value: "website" }, { name: "medium", value: "website" }, { name: "campaign", value: "header" }, { name: "campaign_type", value: "website" }, ]; const urlParams = new URLSearchParams(window.location.search); console.log( fields.concat(hiddenFields).reduce((obj, field) => Object.assign({}, obj, { [field.name]: urlParams.has(field.name) ? urlParams.get(field.name) : field.value || "", }) ) );