1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/**
* GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript.
* *
* Copyright (C) 2011, 2012, 2014 Loic J. Duros
* Copyright (C) 2014, 2015 Nik Nyby
*
* This file is part of GNU LibreJSXUL.
*
* GNU LibreJSXUL 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 3 of the License, or
* (at your option) any later version.
*
* GNU LibreJSXUL 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.
*
* You should have received a copy of the GNU General Public License
* along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>.
*/
// email address regexp
var reEmail = /^mailto\:(admin|feedback|webmaster|info|contact|support|comments|team|help)\@[a-z0-9.\-]+\.[a-z]{2,4}$/i;
var reAnyEmail = /^mailto\:.*?\@[a-z0-9\.\-]+\.[a-z]{2,4}$/i;
// twitter address regexp
var reTwitter = /twitter\.com\/(\!?#\/)?[a-z0-9]*/i;
// identi.ca address regexp
var reIdentiCa = /identi\.ca\/(?!notice\/)[a-z0-9]*/i;
/**
* contactSearchStrings
* Contains arrays of strings classified by language
* and by degree of certainty.
*/
var contactStr = {
'da': {
'certain': [
'^[\\s]*Kontakt os[\\s]*$',
'^[\\s]*Email Os[\\s]*$',
'^[\\s]*Kontakt[\\s]*$'
],
'probable': ['^[\\s]Kontakt', '^[\\s]*Email'],
'uncertain': [
'^[\\s]*Om Us',
'^[\\s]*Om',
'Hvem vi er'
]
},
'en': {
'certain': [
'^[\\s]*Contact Us[\\s]*$',
'^[\\s]*Email Us[\\s]*$',
'^[\\s]*Contact[\\s]*$',
'^[\\s]*Feedback[\\s]*$',
'^[\\s]*Web.?site Feedback[\\s]*$'
],
'probable': ['^[\\s]Contact', '^[\\s]*Email'],
'uncertain': [
'^[\\s]*About Us',
'^[\\s]*About',
'Who we are',
'Who I am',
'Company Info',
'Customer Service'
]
},
'es': {
'certain': [
'^[\\s]*contáctenos[\\s]*$',
'^[\\s]*Email[\\s]*$'
],
'probable': ['^[\\s]contáctenos', '^[\\s]*Email'],
'uncertain': [
'Acerca de nosotros'
]
},
'fr': {
'certain': [
'^[\\s]*Contactez nous[\\s]*$',
'^[\\s]*(Nous )?contacter[\\s]*$',
'^[\\s]*Email[\\s]*$',
'^[\\s]*Contact[\\s]*$',
'^[\\s]*Commentaires[\\s]*$'
],
'probable': ['^[\\s]Contact', '^[\\s]*Email'],
'uncertain': [
'^[\\s]*(A|À) propos',
'Qui nous sommes',
'Qui suis(-| )?je',
'Info',
'Service Client(e|è)le'
]
}
};
var usaPhoneNumber =
/(?:\+ ?1 ?)?\(?[2-9]{1}[0-9]{2}\)?(?:\-|\.| )?[0-9]{3}(?:\-|\.| )[0-9]{4}(?:[^0-9])/mg;
|