From c953e71a1891e14c97b08551e2e2828c580bde27 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Fri, 4 Aug 2017 15:06:58 +0200 Subject: [PATCH] better class generation and remove duplicate class --- customize.dist/pages.js | 16 ++++++++-------- customize.dist/template.js | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index d3b512f65..27a114c16 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -94,7 +94,7 @@ define([ }; Pages['/about.html'] = function () { - return h('div#cp-main.cp-page-about', [ + return h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('center', [ @@ -143,7 +143,7 @@ define([ }; Pages['/privacy.html'] = function () { - return h('div#cp-main.cp-page-privacy', [ + return h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('center', h('h1', Msg.policy_title)), @@ -172,7 +172,7 @@ define([ }; Pages['/terms.html'] = function () { - return h('div#cp-main.cp-page-terms', [ + return h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('center', h('h1', Msg.tos_title)), @@ -187,7 +187,7 @@ define([ }; Pages['/contact.html'] = function () { - return h('div#cp-main.cp-page-contact', [ + return h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('center', h('h1', Msg.contact)), @@ -198,7 +198,7 @@ define([ }; Pages['/what-is-cryptpad.html'] = function () { - return h('div#cp-main.cp-page-what-is-cryptpad', [ + return h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('center', h('h1', Msg.whatis_title)), @@ -234,7 +234,7 @@ define([ Pages['/'] = Pages['/index.html'] = function () { var showingMore = false; return [ - h('div#cp-main.cp-page-index', [ + h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('div.row', [ @@ -310,7 +310,7 @@ define([ }; Pages['/register/'] = Pages['/register/index.html'] = function () { - return [h('div#cp-main.cp-page-register', [ + return [h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('div.row.align-items-center', [ @@ -362,7 +362,7 @@ define([ }; Pages['/login/'] = Pages['/login/index.html'] = function () { - return [h('div#cp-main.cp-page-login', [ + return [h('div#cp-main', [ infopageTopbar(), h('div.container.cp-container', [ h('div.row.align-items-center', [ diff --git a/customize.dist/template.js b/customize.dist/template.js index 7dc666ec4..a9067f35f 100644 --- a/customize.dist/template.js +++ b/customize.dist/template.js @@ -80,8 +80,9 @@ $(function () { } } else { // add class on info-pages - var css = location.pathname.replace(/(\/$|^\/|.html$)/gm, "") - .replace(/[^a-zA-Z]/gi, "-"); + var css = location.pathname.replace(/(index)?\.html$/gi, "") // .html + .replace(/[^a-zA-Z]+/gi, '-') // any non-alpha character + .replace(/^-|-$/g, ''); // starting/trailing dashes if (css === '') { css = 'index';