From b764434c222d60342237cd0ee2b0ace5e864d1ae Mon Sep 17 00:00:00 2001 From: Maxim Lihachev Date: Thu, 12 Jan 2017 22:55:13 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=20=D0=BC=D0=B5=D1=85=D0=B0=D0=BD=D0=B8=D0=B7=D0=BC?= =?UTF-8?q?=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D1=81?= =?UTF-8?q?=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20=D0=BD=D0=B0=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=83=20=D0=B2=20vk.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/feminitives.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/feminitives.js b/js/feminitives.js index 133eca6..0cf95e8 100644 --- a/js/feminitives.js +++ b/js/feminitives.js @@ -239,7 +239,12 @@ function construct_feminitive(stem, ending, gap) { //Отправка адреса страницы в vk.com function share_page() { - var new_tab = window.open("http://vk.com/share.php?url=" + URL.opt.href,'_blank'); + let vk_url = "http://vk.com/share.php" + + "?url=" + URL.opt.href + + "&title=" + URL.opt.title + + "&description=" + URL.opt.description; + + let new_tab = window.open(vk_url,'_blank'); new_tab.focus(); } @@ -365,6 +370,7 @@ function tr(word) { //Изменение адреса window.history.pushState({}, null, window.location.href.split('?')[0]+'?word='+wd); URL.opt.href = encodeURIComponent(window.location.href); + URL.opt.description = 'Как феминистки пишут слово "' + wd + '".'; } //------------------------------------------------------------------------------ @@ -379,7 +385,9 @@ URL.parse = function() { this.opt[ft[0]] = this.opt[ft[0]] || decodeURIComponent(ft[1]); }); - this.opt.href = encodeURIComponent(window.location.href); + this.opt.title = document.title; + this.opt.href = encodeURIComponent(window.location.href); + this.opt.description = 'Как феминистки пишут слово "' + this.opt.word + '".'; }; //Инициализация с разбором адресной строки