Skip to content

Commit

Permalink
chore(cleanup): setup redirections to drop duplicated files everywhre,
Browse files Browse the repository at this point in the history
…fix #87
  • Loading branch information
ffoodd committed Apr 26, 2023
1 parent 214c273 commit 7bcf81a
Show file tree
Hide file tree
Showing 381 changed files with 419 additions and 89,626 deletions.
20 changes: 10 additions & 10 deletions cookie.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><!--
<!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
Expand All @@ -12,11 +12,11 @@
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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Standalone cookie toolbar</title> <body> <script type="text/javascript">var namePref = 'UCI42';
--> <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
// 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
Expand Down Expand Up @@ -71,15 +71,15 @@
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];
Expand All @@ -93,8 +93,8 @@
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);
// domain not present in blacklist so add it and update cookie value
arrayValueBlacklist.push(hostname);
}
saveCookie(nameBlacklist, arrayValueBlacklist.join('|'));
}
Expand All @@ -108,11 +108,11 @@
var origin = getParameterByName('origin');
var UsageConfort = getParameterByName('UsageConfort');
var hostname = getParameterByName('hostname');
if(hostname && origin && window && window.parent && window.parent.postMessage) {
if(hostname && origin && window && window.parent && window.parent.postMessage) {
window.parent.postMessage(readCookies(), origin);
}
else if((UsageConfort || UsageConfort==="") && origin) {
else if((UsageConfort || UsageConfort==="") && origin) {
saveCookie(namePref, UsageConfort, date);
} else if(hostname) {
updateBlackList(hostname);
}</script>
}</script>
339 changes: 0 additions & 339 deletions crossdom/COPYING.txt

This file was deleted.

129 changes: 11 additions & 118 deletions crossdom/cookie.html
Original file line number Diff line number Diff line change
@@ -1,118 +1,11 @@
<!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
Copyright (C) 2014 - 2017 Orange SA
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.
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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <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, " "));
}

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>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>https://confort-plus.orange.com/cookie.html</title>
<link rel="canonical" href="https://confort-plus.orange.com/cookie.html">
<meta name="robots" content="noindex">
<meta http-equiv="refresh" content="0; url=https://confort-plus.orange.com/cookie.html">
</head>
</html>
Loading

0 comments on commit 7bcf81a

Please sign in to comment.