Skip to content

Commit

Permalink
still wip, fix appTop html-validate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
j-paquette committed Jan 23, 2024
1 parent ca42889 commit b00fd1a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
3 changes: 2 additions & 1 deletion TestFileGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function searchFunctionCalls(content) {

function validateBuilderFunctions(content, theme, version) {
const htmlValidate = new HtmlValidate(require('./htmlvalidator.conf.js')); //config path relative
const htmlValidateFormatReport = formatterFactory('stylish'); //possible formatters: checkstyle, codeframe, json, stylish, text
//const htmlValidateFormatReport = formatterFactory('stylish'); //possible formatters: checkstyle, codeframe, json, stylish, text
const htmlValidateFormatReport = formatterFactory('codeframe'); //possible formatters: checkstyle, codeframe, json, stylish, text

function validateHTML(functionName, htmlContent) {
const report = htmlValidate.validateStringSync(htmlContent);
Expand Down
12 changes: 6 additions & 6 deletions src/gcintranet/appFooter.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
const footerSection=pr.footerSections[sectionIndex];-%>
<%_ if (footerSection.customFooterLinks != null) { -%>
<%_ if (sectionIndex < 3) { -%>
<section class="col-md-3 col-sm-6 col-lg-3" aria-labelledby="cdts-footerSectionLinks">
<section class="col-md-3 col-sm-6 col-lg-3" aria-labelledby="<%= footerSection.sectionName %>">
<%_ if (footerSection.sectionName != null) { -%>
<h3 id="cdts-footerSectionLinks"><%= footerSection.sectionName %></h3>
<h3 id="<%= footerSection.sectionName %>"><%= footerSection.sectionName %></h3>
<%_ } -%>
<ul class="list-unstyled">
<%_ for (var linkIndex=0; linkIndex<footerSection.customFooterLinks.length; linkIndex++) {
Expand All @@ -32,9 +32,9 @@
</section>
<%_ } -%>
<%_ } else if (sectionIndex == 0) { /*For backward compatibility */ -%>
<section class="col-md-3 col-sm-6 col-lg-3">
<section class="col-md-3 col-sm-6 col-lg-3" aria-labelledby="<%= footerSection.sectionName %>">
<%_ if (footerSection.sectionName != null) { -%>
<h3><%= footerSection.sectionName %></h3>
<h3 id="<%= footerSection.sectionName %>"><%= footerSection.sectionName %></h3>
<%_ } -%>
<ul class="list-unstyled">
<%_ for (var linkIndex=0; linkIndex<pr.footerSections.length; linkIndex++) {
Expand All @@ -46,8 +46,8 @@
<%_ } -%>
<%_ } -%>
<%_ if (pr.subTheme == 'esdc' || pr.subTheme == 'labour') { -%>
<section class="col-md-3 col-sm-6 col-lg-3">
<h3><^- msg('Corporate') ^></h3>
<section class="col-md-3 col-sm-6 col-lg-3" aria-labelledby="cdts-customSection3">
<h3 id="cdts-customSection3"><^- msg('Corporate') ^></h3>
<ul class="list-unstyled">
<li><a href="<^- msg('https://esdc.prv/en/branches_regions/index.shtml') ^>"><^- msg('ESDC/SC Intranet') ^></a></li>
<li><a href="<^- msg('https://esdc.prv/en/news/index.shtml') ^>"><^- msg('News') ^></a></li>
Expand Down
12 changes: 6 additions & 6 deletions src/gcintranet/top.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if (pr.subTheme === 'eccc') {
<%_ } -%>
</ul>
</nav>
<header role="banner">
<header role="banner" aria-label="Intranet Banner">
<div id="wb-bnr">
<div id="app-brand">
<div class="container">
Expand All @@ -80,8 +80,8 @@ if (pr.subTheme === 'eccc') {
</div>
</section>
<%_ if (pr.GCToolsModal == true) { -%>
<section id="gctoolsSection" class="<%- (pr.intranetTitle != null)? 'col-lg-2': 'col-lg-6' %><%- (pr.search == false)? ' col-md-offset-3': ''%> col-md-1 hidden-sm hidden-xs text-right" aria-labelledby="cdts-hiddenGcToolsLinks">
<h2 class="wb-inv" id="cdts-hiddenGcToolsLinks"><^- msg('GCTools links') ^></h2>
<section id="gctoolsSection" class="<%- (pr.intranetTitle != null)? 'col-lg-2': 'col-lg-6' %><%- (pr.search == false)? ' col-md-offset-3': ''%> col-md-1 hidden-sm hidden-xs text-right" aria-labelledby="cdts-gcToolsLinks">
<h2 class="wb-inv" id="cdts-gcToolsLinks"><^- msg('GCTools links') ^></h2>
<div class="row">
<div class="col-md-12">
<ul class="list-inline margin-bottom-none gcbarlng">
Expand All @@ -90,8 +90,8 @@ if (pr.subTheme === 'eccc') {
</div>
</div>
<section id="gctools" class="mfp-hide modal-dialog modal-content overlay-def" aria-label="<^- msg('GC Tools') ^>">
<header class="modal-header">
<h2 class="modal-title"><^- msg('<span class="bold-gc">GC</span>Tools') ^></h2>
<header class="modal-header" aria-labelledby="cdts-gcToolsModal">
<h2 class="modal-title" id="cdts-gcToolsModal"><^- msg('<span class="bold-gc">GC</span>Tools') ^></h2>
</header>
<div class="modal-body">
<ul class="list-unstyled lst-spcd">
Expand Down Expand Up @@ -210,7 +210,7 @@ if (pr.subTheme === 'eccc') {
</div>
<%_ if (pr.siteMenu != false) { -%>
<%_ if (pr.subTheme == 'esdc' || pr.subTheme == 'labour') { -%>
<nav role="navigation" id="wb-sm" data-wb-ajax='{"url": "<%- (pr.menuPath != null)? pr.menuPath: '/app/cls/WET/global/<^- msg('esdcmenu-eng.html') ^>' %>", "type": "replace", "nocache": true }' data-trgt="mb-pnl" class="wb-menu visible-md visible-lg" typeof="SiteNavigationElement" aria-label="cdts-esdcLabourMenu" aria-label="<^- msg('Topics menu') ^>">
<nav role="navigation" id="wb-sm" data-wb-ajax='{"url": "<%- (pr.menuPath != null)? pr.menuPath: '/app/cls/WET/global/<^- msg('esdcmenu-eng.html') ^>' %>", "type": "replace", "nocache": true }' data-trgt="mb-pnl" class="wb-menu visible-md visible-lg" typeof="SiteNavigationElement" aria-label="<^- msg('Topics menu') ^>">
<div class="container nvbar">
<h2><^- msg('Topics menu') ^></h2>
<div class="row">
Expand Down
18 changes: 9 additions & 9 deletions src/gcweb/appTop.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
</div>
<%_ if (pr.customSearch != null && pr.customSearch.length > 0) {
const item=pr.customSearch[0]; -%>
<section id="wb-srch" class="col-lg-offset-4 col-md-offset-4 col-sm-offset-2 col-xs-12 col-sm-5 col-md-4 visible-md visible-lg" aria-labell="<^- msg('Search') ^>">
<h2><^- msg('Search') ^><%= item.placeholder != null? ' ' + item.placeholder: '' %></h2>
<form action="<%= item.action %>" method="<%= item.method %>" name="cse-search-box" role="search" aria-label="<^- msg('Search') ^>">
<section id="wb-srch" class="col-lg-offset-4 col-md-offset-4 col-sm-offset-2 col-xs-12 col-sm-5 col-md-4 visible-md visible-lg" aria-labelledby="cdts-webSearch">
<h2 id="cdts-webSearch"><^- msg('Search') ^><%= item.placeholder != null? ' ' + item.placeholder: '' %></h2>
<form action="<%= item.action %>" method="<%= item.method %>" name="cse-search-box" role="search" aria-label="<^- msg('Search') ^><%= item.placeholder != null? ' ' + item.placeholder: '' %>">
<div class="form-group wb-srch-qry">
<label for="<%= item.id != null? item.id: 'wb-srch-q' %>" class="wb-inv"><^- msg('Search') ^><%= item.placeholder != null? ' ' + item.placeholder: '' %></label>
<input id="<%= item.id != null? item.id: 'wb-srch-q' %>" class="wb-srch-q form-control" name="<%= item.name != null? item.name: 'q' %>" type="search" value="" size="34" maxlength="170" placeholder="<^- msg('Search') ^><%= item.placeholder != null? ' ' + item.placeholder: '' %>">
Expand Down Expand Up @@ -138,8 +138,8 @@
</nav>
<%_ } -%>
<%_ if (pr.appSettings != null || pr.signOut != null || pr.signIn != null) { -%>
<nav class="col-sm-5 hidden-xs hidden-print" aria-label="<^- msg('Account menu') ^>">
<h2 class="wb-inv"><^- msg('Account menu') ^></h2>
<nav class="col-sm-5 hidden-xs hidden-print" aria-labelledby="cdts-hiddenAccountMenu">
<h2 class="wb-inv" id="cdts-hiddenAccountMenu"><^- msg('Account menu') ^></h2>
<ul class="app-list-account list-unstyled">
<%_ if (pr.appSettings != null && pr.appSettings.length > 0) {
const item=pr.appSettings[0]; -%>
Expand All @@ -165,8 +165,8 @@
<%_ if (pr.customSearch != null || pr.menuPath != null || pr.menuLinks != null || pr.topSecMenu == true || pr.appSettings != null || pr.signOut != null || pr.signIn != null) { -%>
<div class="app-bar-mb container visible-xs-block hidden-print">
<%_ if (pr.customSearch != null || pr.menuPath != null || pr.menuLinks != null || pr.topSecMenu == true) { -%>
<nav aria-label="<^- msg('and search') ^>">
<h2 class="wb-inv"><%_ if (pr.menuPath != null || pr.menuLinks != null || pr.topSecMenu == true) { -%>Menu<%= (pr.customSearch != null)? ' <^- msg('and search') ^>': ''%><%_ } else { -%><^- msg('Search') ^><%_ } -%></h2>
<nav aria-labelledby="cdts-menuAndSearch">
<h2 class="wb-inv" id="cdts-menuAndSearch"><%_ if (pr.menuPath != null || pr.menuLinks != null || pr.topSecMenu == true) { -%>Menu<%= (pr.customSearch != null)? ' <^- msg('and search') ^>': ''%><%_ } else { -%><^- msg('Search') ^><%_ } -%></h2>
<ul class="app-list-main list-unstyled">
<%_ if (pr.menuPath != null || pr.menuLinks != null || pr.topSecMenu == true) { -%><li class="wb-mb-links" id="wb-glb-mn"><a href="#mb-pnl" aria-controls="mb-pnl" class="btn overlay-lnk" role="button"><^- msg('Menu') ^></a><h2><^- msg('Menu') ^></h2></li><%_ } -%>
<%_ if (pr.customSearch != null) { -%><li><a href="#app-srch-mb" title="<^- msg('Search') ^>" aria-controls="app-srch-mb" class="btn overlay-lnk" role="button"><span class="glyphicon-search glyphicon" aria-hidden="true"></span><span class="wb-inv"><^- msg('Search') ^></span></a></li><%_ } -%>
Expand Down Expand Up @@ -198,8 +198,8 @@
</nav>
<%_ } -%>
<%_ if (pr.appSettings != null || pr.signOut != null || pr.signIn != null) { -%>
<nav aria-label="<^- msg('Account menu') ^>">
<h2 class="wb-inv"><^- msg('Account menu') ^></h2>
<nav aria-labelledby="cdts-accountMenu">
<h2 class="wb-inv" id="cdts-accountMenu"><^- msg('Account menu') ^></h2>
<ul class="app-list-account list-unstyled">
<%_ if (pr.appSettings != null && pr.appSettings.length > 0) {
const item=pr.appSettings[0]; -%>
Expand Down

0 comments on commit b00fd1a

Please sign in to comment.