-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdic.html
143 lines (136 loc) · 7.07 KB
/
dic.html
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="dict.js"></script>
<link rel="stylesheet" href="style.css">
<title>ՈՐՈՆՈՒՄ</title>
<link rel="shortcut icon" type="x-icon" href="icon.png">
</head>
<body>
<div class="title">
<h1 >ՀԱՅԵՐԵՆ ԲԱՌԵՐԻ ՈՐՈՆՈՒՄ | v2 (08.2024)</h1>
<!-- <h4>© MillKeny 2023</h4> -->
<h2 id="hed"></h2>
<a href="dict.js" download target="_blank">Ներբեռնել Բառերի Ցանկը</a>
<br>
<input type="text" id="rifmi" placeholder="Պարունակում է․․․" style="width: 350px;" class="search" onchange="voronel(document.getElementById('rifmi').value, document.getElementById('start').value, document.getElementById('end').value)">
<br>
<input type="text" id="start" placeholder="Սկսվում է․․․" style="width: 250px;" class="startl" onchange="voronel(document.getElementById('rifmi').value, document.getElementById('start').value, document.getElementById('end').value)">
<input type="text" id="end" placeholder="Վերջանում է․․․" style="width: 250px;" class="startl" onchange="voronel(document.getElementById('rifmi').value, document.getElementById('start').value, document.getElementById('end').value)">
<br>
</div>
<h2 id="findc" class="ftitle">-</h2>
<h2 id="finded" class="ftitle">-</h2>
<script>
function setid(id, txt){
document.getElementById(id).innerHTML = txt;
}
function getid(id){
return document.getElementById(id).value
}
function knowid(id){
return document.getElementById(id)
}
bars = window.bars;
verbs = window.verbs;
nouns = window.nouns;
adjs = window.adjs;
bars.push(...verbs);
bars.push(...nouns);
bars.push(...adjs);
texts = window.texts;
setid("hed", "Պարունակում է " + bars.length + " Բառ");
var rnda = [];
var rndw = "";
function randome(arr){
return arr[Math.floor(Math.random()*arr.length)]
}
function replaceCharacter(string, index, replacement) {
return (
string.slice(0, index) +
replacement +
string.slice(index + replacement.length)
);
}
function voronel(substring, start, end){
substring = substring.toLowerCase()
start = start.toLowerCase()
end = end.toLowerCase()
//console.log(substring, start, end)
if(substring.length > 0 || start.length > 0 || end.length > 0){
var finded = "";
var findc = 0;
for(var i = 0; i < bars.length; i++){
if(end != "" && start != ""){
if(bars[i].substring(0, start.length) == start && bars[i].slice(-end.length) == end ){
if (substring != "") {
if(bars[i].indexOf(substring) >= 0){
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
} else {
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
}
}
else if(start != "" && bars[i].substring(0, start.length) == start){
if (substring != "") {
if(bars[i].indexOf(substring) >= 0){
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
} else {
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
}
else if(end != "" && bars[i].slice(-end.length) == end){
if (substring != "") {
if(bars[i].indexOf(substring) >= 0){
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
} else {
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
}
else if(end == "" && start == "") {
if (substring != "") {
if(bars[i].indexOf(substring) >= 0){
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
} else {
findc++;
finded += '<a class="wiki" target="_blank" href="https://hy.wiktionary.org/wiki/' + bars[i].toLowerCase() + '">' + bars[i].toLowerCase() + '</a><br>'
}
}
}
setid("findc", "Գտնվեց " + findc + " բառ")
if(finded != "") setid("finded", finded);
else setid("finded", "-");
} else {
setid("findc", "Դաշտը դատարկ է")
setid("finded", "-")
};
$('.wiki').map(function() {
var id = this
getwiki(this.text, function(data) {
var out = '';
for(var y = 0; y < data.length; y++){
if(y != data.length-1) out += data[y] + " | ";
else out += data[y]
}
if(out != '') id.title = out;
else id.title = "Կտցրեք բառին, որպեսզի նայեք նրա էջը Wiktionary-ում";
});
});
}
</script>
</body>
</html>