Add https support to gplus using yandex as proxy

Btw, migrate from old api endpoint to new one
master
im-denisenko 2015-02-12 20:24:00 +03:00
parent 4188218acc
commit fd885d1e44
1 changed files with 3 additions and 20 deletions

View File

@ -118,26 +118,9 @@
popupHeight: 360 popupHeight: 360
}, },
plusone: { plusone: {
// HTTPS not supported yet: http://clubs.ya.ru/share/1499 counterUrl: 'https://share.yandex.net/counter/gpp/?url={url}&callback=?',
counterUrl: isHttps ? undefined : 'http://share.yandex.ru/gpp.xml?url={url}', convertNumber: function(data) {
counter: function(jsonUrl, deferred) { return parseInt(data, 10);
var options = services.plusone;
if (options._) {
// Reject all counters except the first because Yandex Share counter doesnt return URL
deferred.reject();
return;
}
if (!window.services) window.services = {};
window.services.gplus = {
cb: function(number) {
options._.resolve(number);
}
};
options._ = deferred;
$.getScript(makeUrl(jsonUrl))
.fail(deferred.reject);
}, },
popupUrl: 'https://plus.google.com/share?url={url}', popupUrl: 'https://plus.google.com/share?url={url}',
popupWidth: 700, popupWidth: 700,