-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(site): design, perf and a11y with Boosted 🟧
- Loading branch information
Showing
186 changed files
with
188 additions
and
58,757 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,20 @@ | ||
<!doctype html><!-- | ||
This file is part of Orange Confort+ | A centralized Javascript application to enable users to customize display and behaviour of websites to suit their advanced accessibility needs | ||
Copyright (C) 2014 - 2017 Orange SA | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!-- | ||
This file is part of Orange Confort+ | A centralized Javascript application to enable users to customize display and behaviour of websites to suit their advanced accessibility needs | ||
Orange Confort+ is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. | ||
Copyright (C) 2014 - 2023 Orange SA | ||
Orange Confort+ is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details (LICENSE.txt file). | ||
--> <html lang="en"> <head> <meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Standalone cookie toolbar</title> <body> <script type="text/javascript">var namePref = 'UCI42'; | ||
var nameBlacklist = 'uci-bl'; | ||
var valueBlacklist = '0'; | ||
var date = '5020'; | ||
// Default cookie value first bit set toolbar enable, second one set default lang, third one set to no profile | ||
var defaultValuePref = '0|0|0'; | ||
/*! | ||
* src : http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript#answer-901144 | ||
* | ||
*/ | ||
function getParameterByName(name, url) { | ||
if (!url) { | ||
url = window.location.href; | ||
} | ||
name = name.replace(/[\[\]]/g, "\\$&"); | ||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | ||
results = regex.exec(url); | ||
if (!results) return null; | ||
if (!results[2]) return ''; | ||
return decodeURIComponent(results[2].replace(/\+/g, " ")); | ||
} | ||
Orange Confort+ is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. | ||
function saveCookie(name, value, days) { | ||
if (days) { | ||
var date = new Date(); | ||
date.setTime(date.getTime()+(days*24*60*60*1000)); | ||
var expires = "; expires="+date.toGMTString(); | ||
} | ||
else var expires = ""; | ||
document.cookie = name+"="+value+"; expires="+expires+";domain="+document.location.hostname+"; path=/"; | ||
} | ||
|
||
function readCookies() { | ||
var namePrefEQ = namePref + "="; | ||
var valuePref = null; | ||
var nameBlacklistEQ = nameBlacklist + "="; | ||
var ca = document.cookie.split(';'); | ||
for(var i=0;i < ca.length;i++) { | ||
var c = ca[i]; | ||
while (c.charAt(0)==' ') c = c.substring(1,c.length); | ||
if (c.indexOf(namePrefEQ) == 0) { | ||
valuePref = c.substring(namePrefEQ.length,c.length); | ||
} | ||
if (c.indexOf(nameBlacklistEQ) == 0) { | ||
// get blacklisted domain | ||
var listValueBlacklist = c.substring(nameBlacklistEQ.length,c.length); | ||
// explode on | separator | ||
var arrayValueBlacklist = listValueBlacklist.split('|'); | ||
if(arrayValueBlacklist.indexOf(hostname)>=0) { | ||
valueBlacklist = '1'; | ||
} | ||
} | ||
} | ||
if(valuePref === null) { | ||
valuePref = defaultValuePref; | ||
saveCookie(namePref, defaultValuePref,date); | ||
console.log("test"); | ||
} | ||
return valueBlacklist+"|"+valuePref; | ||
} | ||
|
||
function updateBlackList(hostname) { | ||
var nameBlacklistEQ = nameBlacklist + "="; | ||
var valueBlacklist = null; | ||
// if it's the first time, set the blacklist cookie | ||
if(!document.cookie.match(nameBlacklist)) { | ||
saveCookie(nameBlacklistEQ,''); | ||
} | ||
var ca = document.cookie.split(';'); | ||
for(var i=0;i < ca.length;i++) { | ||
var c = ca[i]; | ||
while (c.charAt(0)==' ') c = c.substring(1,c.length); | ||
if (c.indexOf(nameBlacklistEQ) == 0) { | ||
// get blacklisted domain | ||
var listValueBlacklist = c.substring(nameBlacklistEQ.length,c.length); | ||
// explode on | separator | ||
var arrayValueBlacklist = listValueBlacklist.split('|'); | ||
// domain is present in blacklist array then remove it and update cookie value | ||
if(arrayValueBlacklist.indexOf(hostname)>=0) { | ||
arrayValueBlacklist.splice(arrayValueBlacklist.indexOf(hostname),1); | ||
} else { | ||
// domain not present in blacklist so add it and update cookie value | ||
arrayValueBlacklist.push(hostname); | ||
} | ||
saveCookie(nameBlacklist, arrayValueBlacklist.join('|')); | ||
} | ||
} | ||
} | ||
|
||
// if hostname + origin = read cookie value | ||
// if UsageConfort + origin = set cookie value | ||
// if hostname only = update blacklist | ||
// get input param | ||
var origin = getParameterByName('origin'); | ||
var UsageConfort = getParameterByName('UsageConfort'); | ||
var hostname = getParameterByName('hostname'); | ||
if(hostname && origin && window && window.parent && window.parent.postMessage) { | ||
window.parent.postMessage(readCookies(), origin); | ||
} | ||
else if((UsageConfort || UsageConfort==="") && origin) { | ||
saveCookie(namePref, UsageConfort, date); | ||
} else if(hostname) { | ||
updateBlackList(hostname); | ||
}</script> | ||
Orange Confort+ is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details (LICENSE.txt file). | ||
--> <html lang="en"> <head> <meta charset="utf-8"> <meta content="width=device-width,initial-scale=1" name="viewport"> <title>Standalone cookie toolbar</title> </head> <body> <script type="text/javascript">var namePref="UCI42",nameBlacklist="uci-bl",valueBlacklist="0",date="5020",defaultValuePref="0|0|0"; | ||
/*! | ||
* src : http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript#answer-901144 | ||
* | ||
*/ | ||
function getParameterByName(e,a){a||(a=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var t=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(a);return t?t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):"":null}function saveCookie(e,a,t){if(t){var n=new Date;n.setTime(n.getTime()+24*t*60*60*1e3);var o=n.toGMTString()}else o="";document.cookie=e+"="+a+"; expires="+o+";domain="+document.location.hostname+"; path=/"}function readCookies(){for(var e=namePref+"=",a=null,t=nameBlacklist+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(e)&&(a=i.substring(e.length,i.length)),0==i.indexOf(t))i.substring(t.length,i.length).split("|").indexOf(hostname)>=0&&(valueBlacklist="1")}return null===a&&(a=defaultValuePref,saveCookie(namePref,defaultValuePref,date)),valueBlacklist+"|"+a}function updateBlackList(e){var a=nameBlacklist+"=";document.cookie.match(nameBlacklist)||saveCookie(a,"");for(var t=document.cookie.split(";"),n=0;n<t.length;n++){for(var o=t[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(a)){var i=o.substring(a.length,o.length).split("|");i.indexOf(e)>=0?i.splice(i.indexOf(e),1):i.push(e),saveCookie(nameBlacklist,i.join("|"))}}}var origin=getParameterByName("origin"),UsageConfort=getParameterByName("UsageConfort"),hostname=getParameterByName("hostname");hostname&&origin&&window&&window.parent&&window.parent.postMessage?window.parent.postMessage(readCookies(),origin):(UsageConfort||""===UsageConfort)&&origin?saveCookie(namePref,UsageConfort,date):hostname&&updateBlackList(hostname)</script> |
Oops, something went wrong.