Browse Source

Display hostname instead of full uri

Amauri CHAMPEAUX 10 years ago
parent
commit
54d9157049
2 changed files with 3 additions and 3 deletions
  1. 1 2
      css/tarteaucitron.css
  2. 2 1
      tarteaucitron.js

+ 1 - 2
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 {

+ 2 - 1
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, '');