From 54d915704971589dc3a2271c2a5fa7b706d9842c Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 11 Mar 2015 00:54:10 +0100 Subject: [PATCH] Display hostname instead of full uri --- css/tarteaucitron.css | 3 +-- tarteaucitron.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/css/tarteaucitron.css b/css/tarteaucitron.css index 763bb8e..03c8e38 100644 --- a/css/tarteaucitron.css +++ b/css/tarteaucitron.css @@ -372,7 +372,6 @@ display: inline-block; font-size: 11px !important; padding: 8px 10px 5px; - vertical-align: bottom; } #tarteaucitronAlertSmall #tarteaucitronManager:hover { @@ -416,7 +415,7 @@ cursor: pointer; display: inline-block; font-size: 34px; - padding: 2px 10px 0; + padding: 3px 10px 0; } #tarteaucitronAlertSmall #tarteaucitronCookiesNumber:hover { diff --git a/tarteaucitron.js b/tarteaucitron.js index 0370ac6..1e9a106 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -898,7 +898,8 @@ var tarteaucitron = { d, s = (nb > 1) ? 's' : '', savedname, - host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : tarteaucitron.cdn; + regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, + host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : tarteaucitron.cdn.match(regex)[1]; cookies = cookies.sort(function (a, b) { namea = a.split('=', 1).toString().replace(/ /g, '');