Add https support to odnoklassniki using yandex as proxy
parent
4188218acc
commit
b5b02ca883
|
@ -95,22 +95,22 @@
|
||||||
popupHeight: 330
|
popupHeight: 330
|
||||||
},
|
},
|
||||||
odnoklassniki: {
|
odnoklassniki: {
|
||||||
// connect.ok.ru works on mobiles but doesn’t work with HTTPS
|
counterUrl: 'https://share.yandex.net/counter/odnoklassniki/?url={url}',
|
||||||
// www.ok.ru works with HTTPS but redirects to HTML page on mobiles
|
|
||||||
counterUrl: (isHttps ? 'https://www' : 'http://connect') + '.ok.ru/dk?st.cmd=extLike&ref={url}&uid={index}',
|
|
||||||
counter: function(jsonUrl, deferred) {
|
counter: function(jsonUrl, deferred) {
|
||||||
var options = services.odnoklassniki;
|
var options = services.odnoklassniki;
|
||||||
if (!options._) {
|
if (options._) {
|
||||||
options._ = [];
|
// Reject all counters except the first because this counter doesn’t neither return URL nor accept callback
|
||||||
if (!window.ODKL) window.ODKL = {};
|
deferred.reject();
|
||||||
window.ODKL.updateCount = function(idx, number) {
|
return;
|
||||||
options._[idx].resolve(number);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var index = options._.length;
|
if (!window.ODKL) window.ODKL = {};
|
||||||
options._.push(deferred);
|
window.ODKL.updateCount = function(idx, number) {
|
||||||
$.getScript(makeUrl(jsonUrl, {index: index}))
|
deferred.resolve(number);
|
||||||
|
};
|
||||||
|
|
||||||
|
options._ = deferred;
|
||||||
|
$.getScript(makeUrl(jsonUrl))
|
||||||
.fail(deferred.reject);
|
.fail(deferred.reject);
|
||||||
},
|
},
|
||||||
popupUrl: 'http://connect.ok.ru/dk?st.cmd=WidgetSharePreview&service=odnoklassniki&st.shareUrl={url}',
|
popupUrl: 'http://connect.ok.ru/dk?st.cmd=WidgetSharePreview&service=odnoklassniki&st.shareUrl={url}',
|
||||||
|
|
Loading…
Reference in New Issue