├── COPYING ├── README.md └── src ├── Makefile ├── icon.png ├── manifest.json ├── popup.html ├── popup.js └── transform.js /COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is basically Cloud2Butt in French. 2 | 3 | # DTCloud # 4 | 5 | *Le vrai visage du Cloud* 6 | 7 | Vous en avez marre de lire « dans le cloud » toutes les trois phrases ? Remplacez 8 | facilement cette expression agaçante par « dans ton cul » sur toutes les pages que 9 | vous visitez grâce à cette extension ! 10 | 11 | Pour Firefox : https://addons.mozilla.org/fr-FR/firefox/addon/dtcloud/ 12 | 13 | Pour Chrome : https://chrome.google.com/webstore/detail/dtcloud/ojmedhcbgjeopeclmpfifmhdbiiggflh 14 | 15 | Signaler un souci : sam@hocevar.net ou https://twitter.com/samhocevar 16 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TARGETS = dtcloud-firefox.xpi dtcloud-chrome.zip dtcloud-chrome.crx 3 | 4 | SRC = manifest.json \ 5 | transform.js \ 6 | popup.html \ 7 | icon.png 8 | 9 | 10 | PARENT = $(shell cd .. ; pwd | xargs cygpath -w) 11 | 12 | all: $(TARGETS) 13 | 14 | clean: 15 | rm -f $(TARGETS) 16 | 17 | dtcloud-firefox.xpi: $(SRC) 18 | zip -r $@ $^ 19 | 20 | dtcloud-chrome.zip: $(SRC) 21 | zip -r $@ $^ 22 | 23 | dtcloud-chrome.crx: $(SRC) 24 | "/c/Program Files (x86)/Google/Chrome/Application/chrome.exe" --pack-extension="$(PARENT)\src" --pack-extension-key="$(PARENT)\dtcloud.pem" 25 | mv "$(PARENT)\src.crx" $@ 26 | 27 | -------------------------------------------------------------------------------- /src/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samhocevar/dtcloud/ab8cb3368de825009b434ee93b47e93784497285/src/icon.png -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | 4 | "name": "DTCloud", 5 | "description": "Le vrai visage du cloud", 6 | "version": "1.0", 7 | 8 | "applications": { 9 | "gecko": { 10 | "id": "dtcloud@github.com", 11 | "strict_min_version": "45.0" 12 | } 13 | }, 14 | 15 | "icons": { 16 | "48": "icon.png" 17 | }, 18 | 19 | "browser_action": { 20 | "default_icon": "icon.png", 21 | "default_popup": "popup.html" 22 | }, 23 | 24 | "content_scripts": [ { 25 | "matches": ["*://*/*"], 26 | "js": ["transform.js"], 27 | "run_at": "document_end" 28 | } ], 29 | 30 | "permissions": [ 31 | "activeTab" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /src/popup.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | DTCloud 5 | 6 | 7 | 8 |

Visit Webpage

9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/popup.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samhocevar/dtcloud/ab8cb3368de825009b434ee93b47e93784497285/src/popup.js -------------------------------------------------------------------------------- /src/transform.js: -------------------------------------------------------------------------------- 1 | 2 | // Some stats to detect whether we’re dealing with French 3 | var is_french = false; 4 | 5 | var words = [ 'de', 'des', 'du', 'en', 'et', 'le', 'la', 'les', 'un', 'une' ]; 6 | var letters = [ 'é', 'è', 'à', 'ù', 'ė' ]; 7 | 8 | var word_count = {}; 9 | var letter_count = {}; 10 | 11 | for (var i in words) 12 | word_count[words[i]] = 0; 13 | 14 | for (var i in letters) 15 | letter_count[letters[i]] = 0; 16 | 17 | 18 | 19 | function walk(node, fun) 20 | { 21 | switch (node.nodeType) 22 | { 23 | case Node.TEXT_NODE: 24 | fun(node); 25 | break; 26 | case Node.ELEMENT_NODE: 27 | case Node.DOCUMENT_NODE: 28 | case Node.DOCUMENT_FRAGMENT_NODE: 29 | for (var n = node.firstChild; n; n = n.nextSibling) 30 | walk(n, fun); 31 | break; 32 | default: 33 | // Do nothing with unknown nodes 34 | break; 35 | } 36 | } 37 | 38 | function stats(node) 39 | { 40 | var v = node.nodeValue.toLowerCase(); 41 | 42 | for (var i in words) 43 | word_count[words[i]] += (v.match(new RegExp('\\b' + words[i] + '\\b', 'g')) || []).length; 44 | 45 | for (var i in letters) 46 | letter_count[letters[i]] += (v.match(new RegExp(letters[i], 'g')) || []).length; 47 | } 48 | 49 | function transform(node) 50 | { 51 | var v = node.nodeValue; 52 | 53 | v = v.replace(/\b([cC])loud ([cC])omputing\b/g, "$2omputing de ton $1ul"); 54 | 55 | v = v.replace(/\ble ([cC])loud\b/g, "ton $1ul"); 56 | v = v.replace(/\bLe ([cC])loud\b/g, "Ton $1ul"); 57 | 58 | v = v.replace(/\b([dD])u ([cC])loud\b/g, "$1e ton $2ul"); 59 | 60 | v = v.replace(/\b([cC])loud\b/g, "ton $1ul"); 61 | 62 | if (v != node.nodeValue) 63 | node.nodeValue = v; 64 | } 65 | 66 | walk(document.body, stats); 67 | 68 | var good_words = 0; 69 | var good_letters = 0; 70 | for (var i in Object.keys(word_count)) 71 | if (word_count[words[i]] > 5) 72 | ++good_words; 73 | for (var i in Object.keys(letter_count)) 74 | if (letter_count[letters[i]] > 5) 75 | ++good_letters; 76 | 77 | if (good_words * 2 > words.length || good_letters * 2 > letters.length) 78 | walk(document.body, transform); 79 | 80 | --------------------------------------------------------------------------------