/
books.html
245 lines (237 loc) · 16.9 KB
/
books.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Книги для чтения, описания книг и авторов">
<meta name="keywords" content="книги, романы, проза, литература для чтения">
<meta name="author" content="Grigoriy Eremin, Григорий Еремин, egax@bk.ru">
<meta name="robots" content="all">
<meta name="yandex-verification" content="bf07f0af8e739c66">
<meta name="google-site-verification" content="eWwGSnvveM7GniusD-nYN2KXBDPtXBHmhKRezn_TBg8">
<title>Книги / Сайт egax</title>
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/static/css/main.css">
<link rel="stylesheet" href="/static/css/books.css">
<script src="/static/js/metrics.js" data-floor="1"></script>
<script src="/static/js/3rdparty/showdown.min.js"></script>
<script src="/static/js/updater.js"></script>
<script src="/static/js/template.js"></script>
</head>
<body>
<div id="root" class="main">
<div id="header" class="main scroll">
<a title="Записки и сообщения" href="/"><img src="/static/img/vesti.svg" alt="Записки"></a>
<a title="Заметки и посты" href="/posts.html"><img src="/static/img/posts.svg" alt="Заметки"></a>
<a title="Фотки и картинки" href="/foto.html"><img src="/static/img/fotki.svg" alt="Фотки"></a>
<a title="Аккорды, песни, стихи" href="/songs.html"><img src="/static/img/songs.svg" alt="Аккорды"></a>
<a title="Книги для чтения" href="/books.html"><img src="/static/img/books_b.svg" alt="Книги"></a>
<a title="Мои карты" href="/dbcartajs"><img src="/static/img/dbcartajs.svg" onload="this.scrollIntoView()" alt="Карты"></a>
</div>
<div id="yandex_rtb_hd" class="main mw mh_hd"></div>
<div id="page_header" class="main"></div>
<div id="page_content" class="main"></div>
<div id="page_footer" class="main"></div>
<p class="tcenter smaller gray hspace">
<i>P.S.</i> Все тексты, представленные на сайте, взяты из свободных источников или являются авторским творчеством.
</p>
<table id="footer" class="main"><tr>
<td align="right" width="25%"><a href="//metrika.yandex.ru/stat/?id=65044687&from=informer" target="_blank" rel="nofollow"><img src="//informer.yandex.ru/informer/65044687/3_1_FFFFFFFF_EFEFEFFF_0_pageviews" alt="Яндекс.Метрика" title="Яндекс.Метрика: данные за сегодня (просмотры)" class="ym-advanced-informer" data-cid="65044687" data-lang="ru" /></a></td>
<td align="center"><a title="Исходный код" href="//github.com/egaxegax/egaxegax.github.io">Source</a></td>
<td class="smaller" width="25%">2014-24</td></tr>
</table>
</div>
<script>
var GENRES={
adv_animal:"Природа и животные",adv_geo:"Путешествия и география",adv_history:"Исторические приключения",adv_indian:"Приключения про индейцев",adv_maritime:"Морские приключения",adventure:"Приключения",antique:"Старинная литература",antique_east:"Древневосточная литература",biogr_leaders:"Биографии",child_adv:"Детские приключения",child_prose:"Детская проза",children:"Детская литература",child_sf:"Детская фантастика",child_tale:"Сказка",city_fantasy:"Городское фэнтези",det_action:"Боевик",det_classic:"Классический детектив",det_crime:"Криминальный детектив",det_espionage:"Шпионский детектив",det_hard:"Крутой детектив",det_history:"Исторический детектив",det_police:"Полицейский детектив",detective:"Детектив",dramaturgy:"Драматургия",economics:"Экономика",fantasy_fight:"Боевое фэнтези",foreign_adventure:"Зарубежные приключения",foreign_contemporary:"Современная зарубежная литература",foreign_detective:"Зарубежные детективы",foreign_fantasy:"Зарубежное фэнтези",foreign_love:"Зарубежные любовные романы",foreign_sf:"Иностранная фантастика",home_cooking:"Домашняя кухня",home_crafts:"Хобби и ремёсла",home_diy:"Сделай сам",home_garden:"Садоводство",home_health:"Здоровое питание",home_pets:"Домашние животные",home_sex:"Эротика, Секс",home_sport:"Спорт, фитнес",humor_prose:"Юмористическая проза",literature_adv:"Приключения",literature_classics:"Классическая литература",literature_drama:"Драма",literature_history:"История",literature_political:"Политика",literature_western:"Вестерн",love_contemporary:"Современные любовные романы",love_detective:"Остросюжетные любовные романы",love_erotica:"Эротика ",love_hard:"Страстная эротика",love_history:"Исторические любовные романы",love_sf:"Любовная фантастика",love_short:"Короткие любовные романы",magician_book:"Магия, волшебство",nonf_biography:"Биографии и Мемуары",nonf_publicism:"Непубличная литература",other:"Прочее",poetry:"Поэзия",prose:"Проза",prose_classic:"Классическая проза",prose_contemporary:"Современная проза",prose_counter:"Контркультура",prose_history:"Историческая проза",prose_military:"Военная проза",prose_rus_classic:"Русская классическая проза",prose_su_classics:"Советская классическая проза",ref_dict:"Словари",ref_encyc:"Энциклопедии",reference:"Справочная литература",religion_esoterics:"Эзотерика",religion_orthodoxy:"Ортодоксальные учения",religion_rel:"Религия",religion_self:"Самосовершенствование",religion:"Религиозная литература",romance_fantasy:"Рыцарское фэнтези",romance_sf:"Рыцарская фантастика",romance:"Рыцарский роман",russian_fantasy:"Русское фэнтези",science:"Наука",sci_culture:"Научная культура",sci_history:"История",sci_linguistic:"Языкознание",sci_philosophy:"Философия",sci_phys:"Научная физика",sf_action:"Боевая фантастика",sf_cyberpunk:"Киберпанк",sf_detective:"Детективная фантастика",sf_epic:"Эпическая фантастика",sf_etc:"Разная фантастика",sf_fantasy:"Фэнтези",sf_fantasy_city:"Городское фэнтези",sf_heroic:"Героическая фантастика",sf_history_avant:"Историческая авантюра",sf_history:"Альтернативная история",sf_horror:"Ужасы и Мистика",sf_humor:"Юмористическая фантастика",sf_mystic:"Мистика",sf_social:"Социально-психологическая фантастика",sf_space:"Космическая фантастика",sf:"Научная Фантастика ",thriller:"Триллер",vampire_book:"Вампиры",unrecognised:"Без рубрики"
};
document.getElementById('page_header').innerHTML =
'<div class="large table">'+
'<div class="tcell vmid"><h1>'+'Подборка описаний книг разных авторов из свободных источников '+'</h1></div>'+
'</div>';
document.getElementById('page_content').innerHTML = addLoader(1);
function strToUtc(dt){
var dt = dt.split(' ');
var d = dt[0].split('-'),
t = dt[1].split(':');
return Date.UTC(Number(d[0]),Number(d[1])-1,Number(d[2]),Number(t[0]),Number(t[1]),Number(t[2]))/1000.0;
}
function find(){
if(!document.getElementById('tfind').value){
document.getElementById('tfind').setCustomValidity("Заполните пустое поле");
}else{
window.location = '/books.html?find='+ document.getElementById('tfind').value;
}
}
function addLast(r,p,ci){
updateMetaTag('description', p.subj+', '+p.title[2]+ ' ,'+ r.slice(0,1024));
updateMetaTag('keywords', p.subj+', '+p.title[2]+', описания книг, авторы, жанры');
document.getElementById(p.id).innerHTML =
'<div class="msgtext inlbl vmid tcenter" style="min-width:110px; max-width:110px">'+
'<a class="nodecor" href="/books.html?'+tr(p.subj)+'/'+tr(p.title[2])+'">'+
'<img class="smaller gray rounded4" style="max-width:100px" alt="'+p.subj+', '+p.title[2]+'" src="'+buildURL('books')+'/'+p.root+'/'+p.subj+'/'+p.title[2]+'.jpg">'+
'</a>'+
'</div>'+
'<div class="msgtext large inlbl vmid '+ (window.innerWidth<800 ? 'mw_1' : 'mnw_a') +'">'+
'<a class="nodecor dark" href="/books.html?'+tr(p.subj)+'/'+tr(p.title[2])+'"> '+p.title[2]+'</a>'+
'<p class="smaller gray">Автор <a class="nodecor" href="/books.html?'+tr(p.subj)+'">'+p.subj+'</a></p>'+
'<p class="smaller gray">Жанр <a class="nodecor" href="/books.html?'+tr(p.root)+'">'+(GENRES[p.root]||p.root)+'</a></p>'+
'</div>'+
'<div id="yandex_rtb_'+p.i+'" class="hspace inlbl vmid mw_a mh_sm"> </div>'+
'<div class="msgtext large mw_8">'+
'<div class="smaller hspace"> '+
(!isNaN(ci) && r.split(' ').length>14 ? r.slice(0,r.split(' ').slice(0,14).join(' ').length)+'... '+
'<a class="nodecor" href="/books.html?'+tr(p.subj)+'/'+tr(p.title[2])+'"> Читать ещё </a></div>'
: r+
'<a class="nodecor" href="//yandex.ru/search/?text='+p.subj+' '+p.title[2]+' скачать читать "> Найти и читать... </a></div>')+
'</div>'+
'<div class="msgfooter">'+
'<a class="hspace nodecor" href="/books.html?'+tr(p.subj)+'/'+tr(p.title[2])+'"> #'+((p.i+(ci||0)))+'</a>'+
'<span class="gray"><i>'+buildDate(p.title[3])+'</i></span>'+
'</div>';
if(window.addYaRTB_Block && (p.if||!ci)) addYaRTB_Block(p.i, false, YA_RTB[5]);
}
function addAbout(r,p){
var converter = new showdown.Converter(), // to markdown
text = r,
html = converter.makeHtml(text);
updateMetaTag('description', p.subj+', '+text.replace(/(<([^>]+)>)/gi, ''));
updateMetaTag('keywords', p.subj+', книги');
document.getElementById(p.id).innerHTML =
'<table class="msgtext collapse"><tr>'+
'<td class="about"><img class="rounded" src="'+buildURL('books')+'/img/'+tr(p.subj)+'.jpg'+'" alt=""></td>'+
'<td>'+html+'</td></tr>'+
'</table>';
}
function addPageContent(roots, wrts, books, page, iinit){
PAGE.lock = 1;
if(!books.length){
document.getElementById('page_content').innerHTML += addNotFound();
return 1;
}
// if(window.addYaRTB_Block && iinit) addYaRTB_Block('hd', false, YA_RTB[5]);
page.bottom = (page.num)*page.per;
page.top = page.bottom+page.per;
page.titles = books.slice(page.bottom, page.top);
for(var i=0; i<page.titles.length; i++){
var subj = wrts[page.titles[i][0]][0],
root = roots[page.titles[i][4]][0],
title = page.titles[i][2];
document.getElementById('page_content').innerHTML +=
'<div id="book'+(i+page.bottom)+'">'+addLoader(i==0)+'</div>';
upfunc({id: 'book'+(i+page.bottom), if: i==1, i: (i+page.bottom), root: root, subj: subj, title: page.titles[i], url: buildURL('books')+'/'+root+'/'+subj+'/'+title+'.md'}, function(r,p,st){
var wrap = document.getElementById(p.id);
wrap.innerHTML = '';
if(st == 200) { // skip Not Found pages
wrap.className = 'wrap';
(p.title[2] == 'about') ? addAbout(r,p) :
page.view == 'book' ? addLast(r,p) :
page.view == 'list' ? addLast(r,p,0) : addLast(r,p,1);
}
});
}
if(page.titles.length){
document.getElementById('page_footer').innerHTML = addPaginator(books, page,
'<button onclick="this.disabled = addPageContent(ROOTS, SUBJ, BOOKS, PAGE)" class="rounded nopad hmarg bigger" title="Загрузить ещё">↺</button>');
}
page.num++;
setTimeout(function(){ PAGE.lock = (page.titles.length == 0); }, 500);
return (page.titles.length == 0);
}
upfunc({url: buildURL('books')+'/index.js'}, function(s){
eval(s);
window.PAGE = {};
PAGE.per = 3;
PAGE.view = 'last';
PAGE.num = urlParams().page||0; // start num page
window.BOOKS = TITLES;
var page_header =
'<div class="large table">'+
'<div class="tcell vmid"><h1>Описаний <b><i>$COUNT</i></b> по '+
'<a href="/bwrts.html">Авторам</a> '+
'<a href="/bgenres.html">Жанрам</a></h1>'+
'</div>'+
'<div class="tcell tright vmid" style="width:30%">'+addFinder()+'</div>'+
'</div>';
for(var p in urlParams()){
var pp = p.split('/');
if(p == 'page' && urlParams().page){ // ?page
// skip paginate
document.title += ' - ' + urlParams().page;
}else if(p == 'ysclid' && urlParams().ysclid){ // ?ysclid
// skip ya.ru search
}else if(p == 'find' && urlParams().find){ // ?find
BOOKS = BOOKS.filter(function(tit){
return SUBJ[tit[0]][0].search(eval("/"+decodeURI(urlParams().find)+"/i"))>-1 ||
tit[2].search(eval("/"+decodeURI(urlParams().find)+"/i"))>-1;
});
BOOKS = BOOKS.sort(function(a,b){ return arraySort(a[2],b[2]); });
if(BOOKS.length){
PAGE.view = 'last';
page_header =
'<div class="large table">'+
'<div class="tcell vmid">Поиск: <i>'+decodeURI(urlParams().find)+'</i>   <i class="counter">('+BOOKS.length+')</i></div>'+
'<div class="tcell tright vmid" style="width:30%">'+addFinder()+'</div>'+
'</div>';
document.title = SUBJ[BOOKS[0][0]][0] + ' - ' + document.title;
}
PAGE.per = 10;
}else if(pp.length>1){ // ?wrt/book
BOOKS = BOOKS.filter(function(tit){ return (tr(SUBJ[tit[0]][0])==pp[0] && tr(tit[2])==pp[1]); });
if(BOOKS.length){
PAGE.view = 'book';
page_header =
'<div class="table bigger1">'+
'<div class="tcell vmid">'+
'<a class="nodecor" href="/books.html?'+tr(SUBJ[BOOKS[0][0]][0])+'">'+SUBJ[BOOKS[0][0]][0]+'</a> '+
'<h1>'+BOOKS[0][2]+'</h1>'+
'</div>'+
'<div class="tcell tright vmid" style="width:30%">'+addFinder()+'</div>'+
'</div>';
document.title = SUBJ[BOOKS[0][0]][0] + ', ' + BOOKS[0][2] + ' - ' + document.title;
BOOKS = [[BOOKS[0][0],BOOKS[0][1],'about',0,BOOKS[0][4]]].concat(BOOKS); // +about page
}
}else if(pp.length>0){ // ?wrt ?genre
var gnr, wrt;
BOOKS = [].concat(
gnr = BOOKS.filter(function(tit){ return (tr(ROOTS[tit[4]][0]) == pp[0]); }), // filter by genres
wrt = BOOKS.filter(function(tit){ return (tr(SUBJ[tit[0]][0]) == pp[0]); }) // filter by writer
);
BOOKS = BOOKS.sort(function(a,b){ return arraySort(a[2],b[2]); });
if(BOOKS.length){
PAGE.view = 'list';
page_header =
'<div class="table bigger1">'+
'<div class="tcell vmid">'+
'<h1><a class="nodecor" href="'+
(wrt.length>0 ? '/books.html?'+tr(SUBJ[BOOKS[0][0]][0]) : '') + '">'+
(wrt.length>0 ? SUBJ[BOOKS[0][0]][0] : GENRES[ROOTS[BOOKS[0][4]][0]]||ROOTS[BOOKS[0][4]][0]) +
'</a> '+
'<i class="hspaced counter"> ('+ BOOKS.length+')</i>'+
'</h1>'+
'</div>'+
'<div class="tcell tright vmid" style="width:30%">'+addFinder()+'</div>'+
'</div>';
if(gnr.length>0){
document.title = (GENRES[ROOTS[BOOKS[0][4]][0]]||ROOTS[BOOKS[0][4]][0]) + ' - ' + document.title;
}
if(wrt.length>0){
document.title = SUBJ[BOOKS[0][0]][0] + ' - ' + document.title;
BOOKS = [[BOOKS[0][0],BOOKS[0][1],'about',0,BOOKS[0][4]]].concat(BOOKS); // +about page
}
}
}
}
document.getElementById('page_header').innerHTML = page_header.replace('$COUNT', TITLES.length);
document.getElementById('page_content').innerHTML = '';
addPageContent(ROOTS, SUBJ, BOOKS, PAGE, 1);
// infinite scroll
document.addEventListener('scroll', function() {
if(!PAGE.lock && (window.pageYOffset + window.innerHeight) > document.getElementById('root').offsetHeight-10){
addPageContent(ROOTS, SUBJ, BOOKS, PAGE);
}
});
});
</script>
</body>
</html>