2017-06-09 11:28:36 +00:00
|
|
|
$(function() {
|
|
|
|
$('a[href="#edit"]').on('click', function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var pathname = window.location.pathname;
|
|
|
|
var url;
|
|
|
|
if (pathname.indexOf('html') >= 0) {
|
2017-06-19 11:47:37 +00:00
|
|
|
url = pathname.replace('/docs/', 'https://github.com/yandex/ClickHouse/edit/master/docs/').replace('html', 'rst');
|
2017-06-09 11:28:36 +00:00
|
|
|
} else {
|
|
|
|
if (pathname.indexOf('/single/') >= 0) {
|
|
|
|
if (pathname.indexOf('ru') >= 0) {
|
2017-06-19 11:47:37 +00:00
|
|
|
url = 'https://github.com/yandex/ClickHouse/tree/master/docs/ru';
|
2017-06-09 11:28:36 +00:00
|
|
|
} else {
|
2017-06-19 11:47:37 +00:00
|
|
|
url = 'https://github.com/yandex/ClickHouse/tree/master/docs/en';
|
2017-06-09 11:28:36 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (pathname.indexOf('ru') >= 0) {
|
2017-06-19 11:47:37 +00:00
|
|
|
url = 'https://github.com/yandex/ClickHouse/edit/master/docs/ru/index.rst';
|
2017-06-09 11:28:36 +00:00
|
|
|
} else {
|
2017-06-19 11:47:37 +00:00
|
|
|
url = 'https://github.com/yandex/ClickHouse/edit/master/docs/en/index.rst';
|
2017-06-09 11:28:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (url) {
|
|
|
|
var win = window.open(url, '_blank');
|
|
|
|
win.focus();
|
|
|
|
}
|
|
|
|
});
|
2017-06-09 16:29:23 +00:00
|
|
|
|
|
|
|
$('a[href="#en"]').on('click', function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
window.location = window.location.toString().replace('/ru/', '/en/');
|
|
|
|
});
|
|
|
|
|
|
|
|
$('a[href="#ru"]').on('click', function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
window.location = window.location.toString().replace('/en/', '/ru/');
|
|
|
|
});
|
2017-06-09 11:28:36 +00:00
|
|
|
});
|