Browse Source

Доработан механизм отправки ссылки на страницу в vk.com

master
Maxim Lihachev 9 years ago
parent
commit
b764434c22
  1. 12
      js/feminitives.js

12
js/feminitives.js

@ -239,7 +239,12 @@ function construct_feminitive(stem, ending, gap) {
//Отправка адреса страницы в vk.com //Отправка адреса страницы в vk.com
function share_page() { 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(); new_tab.focus();
} }
@ -365,6 +370,7 @@ function tr(word) {
//Изменение адреса //Изменение адреса
window.history.pushState({}, null, window.location.href.split('?')[0]+'?word='+wd); window.history.pushState({}, null, window.location.href.split('?')[0]+'?word='+wd);
URL.opt.href = encodeURIComponent(window.location.href); 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[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 + '".';
}; };
//Инициализация с разбором адресной строки //Инициализация с разбором адресной строки

Loading…
Cancel
Save