PageSourceSearch

https://www.pontchateau.fr/wp-content/themes/noyau/assets/js/class_externe_svg.js

js pontchateau.fr collected 2026-10-02 18:56:31 UTC 3,520 bytes, 68 lines download raw bytes

1jQuery(function($) {
2
3	$('.entry-content a, .ensavoirplu a').each( function(){
4
5		if($(this).hasClass('cboxElement') || $(this).hasClass('miniature-pdf')){
6
7
8		} else {
9
10			// Regex de lien posté
11			var HREFLien = $(this).attr("href");
12
13			if(HREFLien != null){
14				if (HREFLien.substr(0,6) != "mailto" ){
15					var sReg =  new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_\+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?");
16					if(HREFLien != undefined){
17						var URLien = HREFLien.match(sReg);
18					} else {
19						var URLien = "";
20					}
21
22					// Regex de l'url du site
23					var HREFSite = document.location.href;
24					var sReg2 = new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_\+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?");
25					if(HREFSite != undefined){
26						var URLSite = HREFSite.match(sReg2);
27					} else {
28						var URLSite = "";
29					}
30				} else {
31					URLien = "mailto";
32					URLSite = "mailto";
33				}
34
35
36				if((URLien != "" && URLSite != "") && (URLien != null)){
37					if (HREFLien.substr(0,6) == "mailto" ){
38						$(this).addClass("email-mailto");
39						$(this).append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="81.6px" height="62.2px" viewBox="0 0 81.6 62.2" style="overflow:scroll;enable-background:new 0 0 81.6 62.2;" xml:space="preserve"><path d="M71.4,0H10.2C4.6,0,0,4.6,0,10.2V52c0,5.6,4.6,10.2,10.2,10.2h61.2c5.6,0,10.2-4.6,10.2-10.2V10.2 C81.6,4.6,77,0,71.4,0z M71.4,52.5c-0.5,0.5-1.2,0.8-1.8,0.8c-0.6,0-1.2-0.2-1.7-0.7L48,33.9l-5.6,4.7c-0.5,0.4-1,0.6-1.6,0.6 s-1.2-0.2-1.6-0.6l-5.6-4.7L13.7,52.6c-0.5,0.5-1.1,0.7-1.7,0.7c-0.7,0-1.3-0.3-1.8-0.8c-0.9-1-0.9-2.6,0.1-3.5l19.5-18.4L10.4,14.2 c-1.1-0.9-1.2-2.5-0.3-3.5c0.9-1.1,2.5-1.2,3.5-0.3l27.2,23l27.2-23c1.1-0.9,2.6-0.8,3.5,0.3c0.9,1.1,0.8,2.6-0.3,3.5L51.8,30.6 l19.5,18.3C72.3,49.9,72.3,51.5,71.4,52.5z"/></svg>');
40
41					} else {
42						// Récupère les premières lettres des variables
43						if(URLien[2] != null) var urlTWL = URLien[2].substr(0,4);
44						else if(URLien[2] == null) var urlTWL = "";
45						if(URLSite[2] != null) var urlTWS = URLSite[2].substr(0,4);
46						else if(URLSite[2] == null) var urlTWS = "";
47
48						// Test si les variables commencent ou pas par www.
49						if(urlTWL == "www." && urlTWS != "www."){
50							URLSite[2] = "www.";
51						} else if(urlTWS == "www." && urlTWL != "www."){
52							URLien[2] = "www.";
53						}
54
55						// Test si le lien posté est le même que l'URL du site
56						if(URLien[2]+URLien[3]+URLien[4]+URLien[5] != URLSite[2]+URLSite[3]+URLSite[4]+URLSite[5]){
57							$(this).addClass("link-external");
58							$(this).append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="12.1px" height="12.1px" viewBox="0 0 12.1 12.1" style="overflow:scroll;enable-background:new 0 0 12.1 12.1;" xml:space="preserve"><path d="M11.5,0H7.6C7.3,0,7.1,0.3,7.1,0.6s0.3,0.6,0.6,0.6h2.6L4.7,6.6c-0.2,0.2-0.2,0.6,0,0.8 C4.8,7.5,5,7.6,5.1,7.6s0.3-0.1,0.4-0.2L10.9,2v2.4c0,0.3,0.3,0.6,0.6,0.6c0.3,0,0.6-0.3,0.6-0.6V0.6C12.1,0.3,11.8,0,11.5,0z  M9.6,5.6C9.3,5.6,9,5.9,9,6.2v4.4C9,10.8,8.8,11,8.6,11H1.5c-0.2,0-0.4-0.2-0.4-0.4V3.5c0-0.2,0.2-0.4,0.4-0.4h4.4 c0.3,0,0.6-0.3,0.6-0.6S6.2,2,5.9,2H1.5C0.7,2,0,2.7,0,3.5v7.1c0,0.8,0.7,1.5,1.5,1.5h7.1c0.8,0,1.5-0.7,1.5-1.5V6.2 C10.1,5.9,9.9,5.6,9.6,5.6z"/></svg>');
59							$(this).attr('target','_blank');
60						}
61					}
62				}
63			}
64		}
65
66	});
67	
68});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.