mod-build 4.0.102 → 4.0.104

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/package.json +1 -1
  3. package/src/scripts/globals.js +1 -3
  4. package/src/scripts/plugins.js +0 -3
  5. package/tasks/templates.js +2 -4
  6. package/gulp-tasks/add-path-subdirectories.js +0 -34
  7. package/gulp-tasks/build-stat.js +0 -9
  8. package/gulp-tasks/build.js +0 -28
  9. package/gulp-tasks/cache-bust.js +0 -19
  10. package/gulp-tasks/check-seasonal-variations.js +0 -21
  11. package/gulp-tasks/clean.js +0 -10
  12. package/gulp-tasks/combine-files.js +0 -7
  13. package/gulp-tasks/compile.js +0 -44
  14. package/gulp-tasks/copy-files-to-build-path.js +0 -8
  15. package/gulp-tasks/copy-fonts.js +0 -6
  16. package/gulp-tasks/copy-json.js +0 -6
  17. package/gulp-tasks/copy-resources-to-dist.js +0 -6
  18. package/gulp-tasks/copy-videos.js +0 -6
  19. package/gulp-tasks/extras.js +0 -22
  20. package/gulp-tasks/grab-cdn.js +0 -74
  21. package/gulp-tasks/grab-form-helpers.js +0 -55
  22. package/gulp-tasks/grab-global-images.js +0 -121
  23. package/gulp-tasks/grab-images.js +0 -79
  24. package/gulp-tasks/grab-shared-components.js +0 -46
  25. package/gulp-tasks/grab-shared-scripts.js +0 -275
  26. package/gulp-tasks/grab-theme-json.js +0 -24
  27. package/gulp-tasks/grab-tooltips-json.js +0 -33
  28. package/gulp-tasks/js-lint-husky.js +0 -35
  29. package/gulp-tasks/js-lint.js +0 -24
  30. package/gulp-tasks/minify.js +0 -131
  31. package/gulp-tasks/sass-lint.js +0 -15
  32. package/gulp-tasks/serve.js +0 -74
  33. package/gulp-tasks/settings.js +0 -22
  34. package/gulp-tasks/styles.js +0 -42
  35. package/gulp-tasks/tasks.js +0 -475
  36. package/gulp-tasks/templates.js +0 -288
  37. package/src/data/footer.js +0 -119
  38. package/src/resources/data/tcpa.json +0 -4
  39. package/src/resources/templates/modals/about/index.hbs +0 -9
  40. package/src/resources/templates/modals/about/index.html +0 -9
  41. package/src/resources/templates/modals/contact-us/index.hbs +0 -348
  42. package/src/resources/templates/modals/contact-us/index.html +0 -348
  43. package/src/resources/templates/modals/e-sign-consent/index.hbs +0 -35
  44. package/src/resources/templates/modals/e-sign-consent/index.html +0 -35
  45. package/src/resources/templates/modals/faq/index.hbs +0 -9
  46. package/src/resources/templates/modals/faq/index.html +0 -9
  47. package/src/resources/templates/modals/privacy/index.hbs +0 -238
  48. package/src/resources/templates/modals/privacy/index.html +0 -238
  49. package/src/resources/templates/modals/terms/index.hbs +0 -166
  50. package/src/resources/templates/modals/terms/index.html +0 -166
  51. package/src/scripts/default/additional-assets.js +0 -60
  52. package/src/scripts/default/rage-clicking.js +0 -54
  53. package/src/scripts/default/show-utility-providers.js +0 -28
  54. package/src/scripts/url-cleaner.js +0 -8
  55. package/src/scripts/vendor/google-tag-manager-head.js +0 -6
  56. package/src/scripts/vendor/heap-addeventproperties-identify.js +0 -262
  57. package/src/scripts/vendor/heap-tracking.js +0 -9
  58. package/src/styles/partials/_contact-us.scss +0 -196
  59. package/src/styles/partials/_google-address-autocomplete.scss +0 -52
  60. package/src/styles/partials/_mixins.scss +0 -39
  61. package/src/styles/partials/_modal-pages.scss +0 -125
  62. package/src/styles/partials/_modernize-colors.scss +0 -128
  63. package/src/styles/partials/_qs-footer.scss +0 -68
  64. package/src/styles/partials/_quote-footer-v1.scss +0 -79
  65. package/src/styles/partials/_quote-footer-v2.scss +0 -64
  66. package/src/styles/partials/_quote-footer-v3.scss +0 -65
  67. package/src/templates/_partials/scripts/deferred-styles.html +0 -16
  68. package/src/templates/_partials/scripts/heap-bundle.html +0 -5
  69. package/src/templates/_partials/scripts/heap.html +0 -4
  70. package/src/templates/_partials/scripts/utm-params.html +0 -9
  71. package/src/templates/components/qs-footer.html +0 -55
  72. package/src/templates/components/quote-footer-v1.html +0 -148
  73. package/src/templates/components/quote-footer-v2.html +0 -169
  74. /package/tasks/{addSeasonalchanges.js → add-seasonal-changes.js} +0 -0
  75. /package/tasks/{setupDevOpsTrackingId.js → setup-dev-ops-tracking-id.js} +0 -0
@@ -1,288 +0,0 @@
1
- /* globals Promise */
2
- var merge = require('lodash.merge');
3
- var request = require('request');
4
-
5
- module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
6
- // Merge site's data with shared data
7
- /* eslint brace-style: 0 */
8
- const { isLocal, nodeEnv, buildPath } = siteSettings;
9
- const { isWhiteLabel } = siteData;
10
-
11
- var commonData = require('../src/data/common.js');
12
-
13
- var assetsPath = isLocal ? '/temp/assets' : 'https://' + nodeEnv + '/quote/resources/assets';
14
- assetsPath = isWhiteLabel ? '' : assetsPath;
15
-
16
- var qsFooterData = require('../src/data/components/qs-footer.js');
17
- var quoteFooterData = require('../src/data/components/quote-footer.js');
18
-
19
- // Checking for seasonal variations in the template.js + updating content
20
- var checkSeasonalVariations = require('./check-seasonal-variations.js');
21
- const activeSeason = checkSeasonalVariations();
22
- if (activeSeason.length !== 0) {
23
- if (siteData.seasonalVariations) {
24
- activeSeason.forEach(season => {
25
- if (season in siteData.seasonalVariations) {
26
- siteData = merge(siteData, siteData.seasonalVariations[season]);
27
- }
28
- });
29
- }
30
- }
31
-
32
- var templatesData = Object.assign(commonData(), qsFooterData(siteData), quoteFooterData(siteData), siteData, { isLocal, nodeEnv, assetsPath, buildPath });
33
-
34
- // This is helper function to evaluate JS expressions
35
- // in Handlebars, e.g. for conditions
36
- var handlebarsX = function(expression, context) {
37
- var result = (function() {
38
- try {
39
- return eval(expression);
40
- }
41
- catch (e) {
42
- console.warn(
43
- '• Expression: {{x \'' + expression + '\'}}\n'
44
- + '• JS-Error: ', e, '\n'
45
- + '• Context: ',
46
- context
47
- );
48
- }
49
- }).call(context);
50
-
51
- return result;
52
- };
53
-
54
- // Support helper functions
55
- var handlebarsHelpers = [
56
- // Run any js line
57
- {
58
- name: 'x',
59
- fn: function(expression, options) {
60
- return handlebarsX(expression, this, options);
61
- }
62
- },
63
- // Run any js line and check if it is true
64
- {
65
- name: 'xif',
66
- fn: function(expression, options) {
67
- return handlebarsX(expression, this, options) ? options.fn(this) : options.inverse(this);
68
- }
69
- },
70
- // Reverse array
71
- {
72
- name: 'reverseArray',
73
- fn: function(expression) {
74
- expression.reverse();
75
- }
76
- },
77
- // Check if one var equals to another
78
- {
79
- name: 'equals',
80
- fn: function(v1, v2, block) {
81
- if (v1 === v2) {
82
- return block.fn(this);
83
- }
84
- }
85
- },
86
- // Convert string to uppercase
87
- {
88
- name: 'uppercase',
89
- fn: function(expression) {
90
- return 'string' === typeof expression ? expression.toUpperCase() : '';
91
- }
92
- },
93
- // Convert deferred styles string to links
94
- {
95
- name: 'deferredStyles',
96
- fn: function(str) {
97
- var urls = str.split(';'),
98
- links = [];
99
-
100
- urls.forEach(function(url) {
101
- links.push('<link href="' + url + '" rel="stylesheet" type="text/css" />');
102
- });
103
-
104
- return links.join('');
105
- }
106
- },
107
- // Format Phone number like type1 : xxx-xxx-xxxx OR type2 : (xxx) xxx-xxxx
108
- {
109
- name: 'formatPhoneNo',
110
- fn: function(expression, type) {
111
- var mask = /(\d{3})(\d{3})(\d{,4})?/;
112
- if (type === 'type1') {
113
- newValues = '$1-$2-$3';
114
- } else {
115
- newValues = '($1) $2-$3';
116
- }
117
- return expression.replace(mask, newValues);
118
- }
119
- },
120
- // It will take the json object & variable name to assign the object & return it in the script tag
121
- {
122
- name: 'jsonVarScriptTag',
123
- fn: function(json, variable) {
124
- var check = (typeof json === 'object') && (typeof variable === 'string' && variable);
125
- return check ? '<script>' + 'var ' + variable + '=' + JSON.stringify(json) + '</script>' : '';
126
- }
127
- },
128
- // It will take & return json object
129
- {
130
- name: 'json',
131
- fn: function(json) {
132
- return JSON.stringify(json);
133
- }
134
- },
135
- // Adding increment of 1 to value
136
- {
137
- name: 'inc',
138
- fn: function(index) {
139
- index++;
140
- return index;
141
- }
142
- },
143
- // Loop to go through and add each attribute defined in the attributes: {} object
144
- {
145
- name: 'addAttributes',
146
- fn: function(obj) {
147
- var output = '';
148
- var ignoreKeys = Array.prototype.slice.call(arguments, 1, -1);
149
-
150
- for (var key in obj.attributes) {
151
- if (ignoreKeys.indexOf(key) === -1) {
152
- if (typeof obj.attributes[key] !== 'object') {
153
- output += key + '="' + obj.attributes[key] + '" ';
154
- } else if (key === 'data') {
155
- for (var dataKey in obj.attributes[key]) {
156
- output += 'data-' + dataKey + '="' + obj.attributes[key][dataKey] + '" ';
157
- }
158
- } else if (key === 'aria') {
159
- for (var ariaKey in obj.attributes[key]) {
160
- output += 'aria-' + ariaKey + '="' + obj.attributes[key][ariaKey] + '" ';
161
- }
162
- }
163
- }
164
- }
165
- return output.trim();
166
- }
167
- }
168
- ];
169
-
170
- var mergeDefaultFormFieldConfig = function(steps, defaultConfig) {
171
- if (!steps.items) {
172
- console.error('No items[ ] found in steps{}!');
173
- return steps;
174
- }
175
- if (templatesData.siteData && templatesData.siteData.useAccessibleConfig) {
176
- steps.items.forEach(item => {
177
- if (item.stepContent.fields) {
178
- item.stepContent.fields = item.stepContent.fields.map(field => {
179
- if (field.attributes && field.attributes.name && defaultConfig[field.attributes.name]) {
180
- field = merge(defaultConfig[field.attributes.name], field);
181
- }
182
- return field;
183
- });
184
- }
185
- });
186
- } else {
187
- steps.items.forEach(item => {
188
- if (item.fields) {
189
- item.fields = item.fields.map(field => {
190
- if (field.name && defaultConfig[field.name]) {
191
- field = Object.assign(defaultConfig[field.name], field);
192
- }
193
- return field;
194
- });
195
- }
196
- });
197
- }
198
-
199
- return steps;
200
- };
201
-
202
- var getDefaultFormFieldConfig = async function(folder) {
203
- console.time('Finished fetch-default-form-config after');
204
- console.log('Starting fetch-default-form-config: ');
205
- await new Promise((resolve) => {
206
- request(`https://${siteSettings.nodeEnv}/quote/resources/mod-site/${folder}/steps/defaultFormFieldConfig.json`, async function(_err, xhr, response) {
207
- if (xhr.statusCode !== 200) {
208
- throw new Error(`${xhr.statusCode}: Error while fetching ${folder}/defaultFormFieldConfig.json`);
209
- }
210
-
211
- const defaultConfig = await JSON.parse(response);
212
-
213
- if (templatesData.steps) {
214
- templatesData.steps = await mergeDefaultFormFieldConfig(templatesData.steps, defaultConfig);
215
- }
216
- if (templatesData.qsSteps) {
217
- templatesData.qsSteps = await mergeDefaultFormFieldConfig(templatesData.qsSteps, defaultConfig);
218
- }
219
- if (templatesData.modSteps) {
220
- templatesData.modSteps = await mergeDefaultFormFieldConfig(templatesData.modSteps, defaultConfig);
221
- }
222
-
223
- templatesData.defaultConfigCompleted = true;
224
-
225
- resolve();
226
- });
227
- });
228
- console.timeEnd('Finished fetch-default-form-config after');
229
- };
230
-
231
- var fetchTcpaFromSitegenie = async function() {
232
- const company = templatesData.company_name;
233
- const website = templatesData.website_name;
234
- const c_level = templatesData.cLevel ? templatesData.cLevel : 'default';
235
- const affiliateKey = templatesData.affiliateKey ? templatesData.affiliateKey : 0;
236
- const service = templatesData.service ? templatesData.service.toLowerCase().replace(' ', '_') : templatesData.primary_trade.toLowerCase().replace(' ', '_');
237
- const apiEnv = 'https://' + (templatesData.nodeEnv === 'modernize.com' ? 'hs.leadpost.net/' : 'hsleadpost1.quinstage.com/');
238
- const url = `${apiEnv}coreg/getTCPAConsent?website=${website}&service=${service}&affiliateKey=${affiliateKey}&c_level=${c_level}`;
239
- console.time('Finished fetch-tcpa-from-sitegenie after');
240
- console.log('Starting fetch-tcpa-from-sitegenie: ',url);
241
- await new Promise(function(resolve) {
242
- request(url, async function(_err, xhr, response) {
243
- if (xhr.statusCode !== 200) {
244
- throw new Error(`${xhr.statusCode}: Error while fetching TCPA`);
245
- }
246
- const responseJson = await JSON.parse(response);
247
- let finalTCPA = await (company === 'Modernize' || templatesData.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
248
- const removeInlineStyleRegex = / style="[^"]*"/g;
249
- finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
250
- templatesData.tcpaText = await finalTCPA;
251
-
252
- resolve();
253
- });
254
- });
255
- console.timeEnd('Finished fetch-tcpa-from-sitegenie after');
256
- };
257
-
258
- return async function() {
259
- if (Object.keys(siteData).length > 0) {
260
- if (!templatesData.doNotUseDefaultFieldConfig && !templatesData.defaultConfigCompleted) {
261
- if (templatesData.siteData && templatesData.siteData.useAccessibleConfig) {
262
- await getDefaultFormFieldConfig('accessible-components');
263
- } else {
264
- await getDefaultFormFieldConfig('shared-components');
265
- }
266
- }
267
-
268
- if (!templatesData.tcpaText && templatesData.primary_trade) {
269
- await fetchTcpaFromSitegenie();
270
- }
271
- }
272
-
273
- return new Promise(function(resolve) {
274
- return gulp.src([
275
- siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/**/*.html',
276
- '!' + siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/_partials/**/*.html'
277
- ])
278
- .pipe(gulpPlugins.handlebarsFileInclude(templatesData, {
279
- maxRecursion: siteData.fileIncludeMaxRecursion ? siteData.fileIncludeMaxRecursion : 500,
280
- handlebarsHelpers: handlebarsHelpers
281
- }))
282
- .pipe(gulp.dest(siteSettings.tmpFolder))
283
- .on('finish', function() {
284
- resolve();
285
- });
286
- });
287
- };
288
- };
@@ -1,119 +0,0 @@
1
- /* contains data for qs-footer and quote-footer */
2
- export default function(siteData) {
3
- const { isQSPage } = siteData;
4
-
5
- let trade = '';
6
- if (siteData?.contractor_trade) {
7
- trade = `&trade=${siteData.contractor_trade}`;
8
- } else if (siteData?.primary_trade) {
9
- trade = `&trade=${siteData.primary_trade.replace(/[\s]+|_/g, '-').toLowerCase()}`;
10
- }
11
-
12
- const footerKey = isQSPage ? 'qsFooterData' : 'quoteFooterData';
13
-
14
- const qsLinks = [
15
- {
16
- name: 'About',
17
- url: '/about/',
18
- modal: true,
19
- company: true
20
- },
21
- {
22
- name: 'Privacy Notice',
23
- url: '/privacy/',
24
- modal: true
25
- },
26
- {
27
- name: 'Affiliates',
28
- url: 'https://modernize.com/contact?publisher',
29
- modal: false
30
- },
31
- {
32
- name: 'Terms of Use',
33
- url: '/terms/',
34
- modal: true
35
- },
36
- {
37
- name: 'Contact Us',
38
- url: '/contact-us/',
39
- modal: true
40
- },
41
- {
42
- name: 'California - Do not sell my info',
43
- url: 'https://privacy-central.securiti.ai/#/dsr/983cfd4b-c36a-4601-89e9-b651e5a05708',
44
- modal: false
45
- }
46
- ]
47
-
48
- const quoteLinks = [
49
- {
50
- url: 'about',
51
- text: 'About Us',
52
- modal: true
53
- },
54
- {
55
- url: 'terms',
56
- text: 'Terms of Use',
57
- modal: true
58
- },
59
- {
60
- url: 'privacy',
61
- text: 'Privacy Policy',
62
- modal: true
63
- },
64
- {
65
- url: 'https://modernize.com/contact?publisher',
66
- text: 'I\'m a publisher',
67
- modal: false,
68
- target: '_blank'
69
- }
70
- ]
71
-
72
- const quoteSpecific = {
73
- capchaDisclosure: {
74
- text: 'This site is protected by reCAPTCHA and the Google',
75
- privacy: {
76
- text: 'Privacy Policy',
77
- url: 'https://policies.google.com/privacy'
78
- },
79
- terms: {
80
- text: 'Terms&nbsp;of&nbsp;Service',
81
- url: 'https://policies.google.com/terms'
82
- }
83
- },
84
- privacyLinks: [
85
- {
86
- text: 'California&nbsp;Privacy',
87
- anchor: 'ccpa',
88
- modal: true
89
- },
90
- {
91
- text: 'New&nbsp;York&nbsp;Privacy',
92
- anchor: 'nyna',
93
- modal: true
94
- },
95
- {
96
- text: 'Do&nbsp;Not&nbsp;Sell&nbsp;My&nbsp;Personal&nbsp;Information',
97
- anchor: 'uspi',
98
- modal: true
99
- }
100
- ],
101
- }
102
-
103
- const data = {
104
- [footerKey]: {
105
- links: [
106
- isQSPage ? qsLinks : quoteLinks,
107
- ],
108
- copyright: `${isQSPage ? 'QuinStreet, Inc.' : ''} All&nbsp;Rights&nbsp;Reserved.`,
109
- contractor: {
110
- text: 'Are you a contractor?',
111
- linkText: 'Join Our Contractor Network',
112
- link: 'https://modernize.com/pro/register/leads/?utm_campaign=quinstreet-referral' + trade
113
- },
114
- ...isQSPage ? null : quoteSpecific,
115
- }
116
- }
117
-
118
- return data;
119
- }
@@ -1,4 +0,0 @@
1
- {
2
- "tcpaText": "We respect your privacy and want to make you aware of a few things. By submitting, you authorize QuinStreet and up to <a href=\"http://hsleadpost1.quinstage.com/clientList.jsp?c_level=default&aff=0\" target=\"_blank\" id=\"clientList\" style=\"color: inherit !important;\">four companies<\/a> to call you on the mobile or landline phone number provided. You understand that some may use automated dialing, prerecorded messages or SMS messages to contact you and that you are in no way required to purchase any products or services from them. It's entirely your choice."
3
- }
4
-
@@ -1,9 +0,0 @@
1
- <p>
2
- {{company_name}} is a place to gather ideas and see how other homeowners have transformed their houses. It's for those who've just begun to think about what they want their new kitchen to look like, those who wonder what kind of siding and color will add the most value, those who want to know if running their home on solar energy is even a possibility.
3
- </p>
4
- <p>
5
- {{company_name}} is where you come to get inspired, see what's possible, and connect with a professional who will make your dream home a reality.
6
- </p>
7
- <p>
8
- We&rsquo;re based in Austin, Texas, right in the heart of downtown where we get to enjoy everything this wonderful city has to offer - SXSW, live music, fantastic restaurants, and best of all, friendly folks. We&rsquo;re constantly inspired by the many different types of design and architecture in this city, from the contemporary new homes peppered throughout Travis Heights, to historic mansions beautifully restored all over downtown and Old West Austin. We&rsquo;re proud to feature lots of Austin architects and contractors on {{company_name}} along with countless talented contractors from all over the country, so no matter where you live, you&rsquo;ll be able to connect with someone who can make your home design ideas a reality.
9
- </p>
@@ -1,9 +0,0 @@
1
- <p>
2
- {{company_name}} is a place to gather ideas and see how other homeowners have transformed their houses. It's for those who've just begun to think about what they want their new kitchen to look like, those who wonder what kind of siding and color will add the most value, those who want to know if running their home on solar energy is even a possibility.
3
- </p>
4
- <p>
5
- {{company_name}} is where you come to get inspired, see what's possible, and connect with a professional who will make your dream home a reality.
6
- </p>
7
- <p>
8
- We&rsquo;re based in Austin, Texas, right in the heart of downtown where we get to enjoy everything this wonderful city has to offer - SXSW, live music, fantastic restaurants, and best of all, friendly folks. We&rsquo;re constantly inspired by the many different types of design and architecture in this city, from the contemporary new homes peppered throughout Travis Heights, to historic mansions beautifully restored all over downtown and Old West Austin. We&rsquo;re proud to feature lots of Austin architects and contractors on {{company_name}} along with countless talented contractors from all over the country, so no matter where you live, you&rsquo;ll be able to connect with someone who can make your home design ideas a reality.
9
- </p>