mod-build 3.6.89-beta.1 → 3.6.89-beta.3
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/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 3.6.89
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Updated the `add-path-subdirectories` task to include path replacements for `../` or any variation of `../` in the attribute replacement values.
|
|
6
6
|
|
|
7
7
|
## 3.6.88
|
|
8
8
|
|
|
@@ -6,35 +6,25 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
6
6
|
if (isPathSubdirectory) {
|
|
7
7
|
const pathSubdirectory = isPathSubdirectory;
|
|
8
8
|
|
|
9
|
+
const replacePath = (match, path, attribute) => {
|
|
10
|
+
if (new RegExp(`^${attribute}="(\.\.\/)+`).test(path)) {
|
|
11
|
+
const subdirectoryLevels = (path.match(/\.\.\//g) || []).length;
|
|
12
|
+
const correctedPath = `${pathSubdirectory}${path.slice((attribute.length + 2) + 3 * subdirectoryLevels)}`;
|
|
13
|
+
return `${attribute}="${correctedPath}`;
|
|
14
|
+
} else {
|
|
15
|
+
return `${attribute}="${pathSubdirectory}${path.slice((attribute.length + 2))}`;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
9
19
|
return gulp.src(siteSettings.distFolder + '/**/*.html')
|
|
10
20
|
.pipe(replace(/(href="favicon.ico")/g, function(match, path) {
|
|
11
21
|
return `href="${pathSubdirectory}favicon.ico"`;
|
|
12
22
|
}))
|
|
13
|
-
.pipe(replace(/((src=")(resources|images|scripts|videos|shared-components|accessible-components)\/[^"]+")/g,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return match;
|
|
18
|
-
}))
|
|
19
|
-
.pipe(replace(/((srcset="images)\/[^"]+")/g, function(match, path) {
|
|
20
|
-
if (path.startsWith('srcset="images')) {
|
|
21
|
-
return `srcset="${pathSubdirectory}${path.slice(8)}`;
|
|
22
|
-
}
|
|
23
|
-
return match;
|
|
24
|
-
}))
|
|
25
|
-
.pipe(replace(/((poster="images)\/[^"]+")/g, function(match, path) {
|
|
26
|
-
if (path.startsWith('poster="images')) {
|
|
27
|
-
return `poster="${pathSubdirectory}${path.slice(8)}`;
|
|
28
|
-
}
|
|
29
|
-
return match;
|
|
30
|
-
}))
|
|
31
|
-
.pipe(replace(/((href=")(images|styles|shared-components|accessible-components)\/[^"]+")/g, function(match, path) {
|
|
32
|
-
if (path.startsWith('href="images') || path.startsWith('href="styles') || path.startsWith('href="shared-components') || path.startsWith('src="accessible-components')) {
|
|
33
|
-
return `href="${pathSubdirectory}${path.slice(6)}`;
|
|
34
|
-
}
|
|
35
|
-
return match;
|
|
36
|
-
}))
|
|
23
|
+
.pipe(replace(/((src="(\.\.\/)*)(resources|images|scripts|videos|shared-components|accessible-components)\/[^"]+")/g, (match, path) => replacePath(match, path, 'src')))
|
|
24
|
+
.pipe(replace(/((srcset="(\.\.\/)*images)\/[^"]+")/g, (match, path) => replacePath(match, path, 'srcset')))
|
|
25
|
+
.pipe(replace(/((poster="(\.\.\/)*images)\/[^"]+")/g, (match, path) => replacePath(match, path, 'poster')))
|
|
26
|
+
.pipe(replace(/((href="(\.\.\/)*)(images|styles|shared-components|accessible-components)\/[^"]+")/g, (match, path) => replacePath(match, path, 'href')))
|
|
37
27
|
.pipe(gulp.dest(siteSettings.distFolder));
|
|
38
28
|
}
|
|
39
|
-
}
|
|
29
|
+
};
|
|
40
30
|
};
|
|
@@ -24,13 +24,13 @@ var componentFolderPath = '';
|
|
|
24
24
|
|
|
25
25
|
function replaceModalyticsSrc(gulp, gulpPlugins, siteSettings, siteData) {
|
|
26
26
|
const doNotIncludeSrc = siteData.siteData && siteData.siteData.isPathSubdirectory || siteData && siteData.isPathSubdirectory;
|
|
27
|
-
const resourcePath = isQuotePageOrUseRelativePath ? `${
|
|
27
|
+
const resourcePath = isQuotePageOrUseRelativePath ? `${doNotIncludeSrc ? '' : '{{#if this.src}}{{this.src}}{{/if}}'}resources/scripts/mod-alytics/` : '/resources/scripts/mod-alytics/';
|
|
28
28
|
return gulp.src(`${siteSettings.srcFolder}/${componentFolderPath}/head/head.html`)
|
|
29
29
|
.pipe(replace(/".*(modalytics).*"/, `"${resourcePath}${fileNames.modAlyticsFileName}"`))
|
|
30
30
|
.pipe(gulp.dest(`${siteSettings.srcFolder}/${componentFolderPath}/head`));
|
|
31
31
|
}
|
|
32
32
|
function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
|
|
33
|
-
const resourcePath = isQuotePageOrUseRelativePath ?
|
|
33
|
+
const resourcePath = isQuotePageOrUseRelativePath ? '{{#if this.nodeModulesPath}}{{this.nodeModulesPath}}{{/if}}resources/scripts' : '/resources/scripts';
|
|
34
34
|
return gulp.src(`${siteSettings.srcFolder}/${componentFolderPath}/foot-assets/foot-assets.html`)
|
|
35
35
|
.pipe(replace(/"(?:(?!"|js")[\s\S])+(modutils|mod-utils.*?)js"|"(?:(?!"|")[\s\S])+(callrail.*?)js"|"(?:(?!"|")[\s\S])+(footer\/footer-component.*?)js"|"(?:(?!"|")[\s\S])+(mod-form\/form.*?)js"/g, function(match) {
|
|
36
36
|
if (match.includes('mod-form/form')) {
|
|
@@ -51,8 +51,8 @@ function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
51
51
|
function replaceAbandonmentJsCssSrc(gulp, gulpPlugins, siteSettings, siteData) {
|
|
52
52
|
const includeAccessibleFolder = useAccessibleComponents ? 'accessible/' : '';
|
|
53
53
|
const abandonmentJsRegex = useAccessibleComponents ? /"(?:(?!"|")[\s\S])+(abandonment\/accessible\/abandonment.*?)js"/ : /"(?:(?!"|")[\s\S])+(abandonment\/abandonment.*?)js"/;
|
|
54
|
-
const jsResourcePath = isQuotePageOrUseRelativePath ?
|
|
55
|
-
const cssResourcePath = isQuotePageOrUseRelativePath ?
|
|
54
|
+
const jsResourcePath = (isQuotePageOrUseRelativePath ? '' : '/') + 'resources/scripts/abandonment/';
|
|
55
|
+
const cssResourcePath = (isQuotePageOrUseRelativePath ? '' : '/') + 'resources/styles/components/abandonment/';
|
|
56
56
|
return gulp.src(siteSettings.srcFolder + '/templates/abandonment/*.html')
|
|
57
57
|
.pipe(replace(abandonmentJsRegex, `"${jsResourcePath}${includeAccessibleFolder}${fileNames.abandonmentJsFileName}"`))
|
|
58
58
|
.pipe(replace(/"(?:(?!"|")[\s\S])+(components\/abandonment\/abandonment.*?)css"/, `"${cssResourcePath}${fileNames.abandonmentStylesFileName}"`))
|
package/gulp-tasks/templates.js
CHANGED
|
@@ -240,6 +240,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
var fetchTcpaFromSitegenie = async function() {
|
|
243
|
+
const company = templatesData.company_name;
|
|
243
244
|
const website = templatesData.website_name;
|
|
244
245
|
const c_level = templatesData.cLevel ? templatesData.cLevel : 'default';
|
|
245
246
|
const affiliateKey = templatesData.affiliateKey ? templatesData.affiliateKey : 0;
|
|
@@ -258,7 +259,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
258
259
|
throw new Error(`${xhr.statusCode}: Error while fetching TCPA`);
|
|
259
260
|
}
|
|
260
261
|
const responseJson = await JSON.parse(response);
|
|
261
|
-
let finalTCPA = await responseJson.tcpa.replace(/QuinStreet/g, 'Modernize');
|
|
262
|
+
let finalTCPA = await (company === 'Modernize' || templatesData.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
|
|
262
263
|
const removeInlineStyleRegex = / style="[^"]*"/g;
|
|
263
264
|
finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
|
|
264
265
|
templatesData.tcpaText = await finalTCPA;
|