aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2015-11-23 12:10:10 +0300
committerGravatar Vitaly Takmazov2015-11-23 12:10:10 +0300
commit73efc0facea38f5b59b56ffe43fba428b2d2a9ae (patch)
tree582125ea3bab3c35d71934d9cdd70e01d29f6094 /src
parent8f3627dd218f618201d093f7a83ed9ff4f332a98 (diff)
scripts.js: make remained links protocol-relative
Diffstat (limited to 'src')
-rw-r--r--src/main/webapp/scripts.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/webapp/scripts.js b/src/main/webapp/scripts.js
index 8c3b46af..17dce6f9 100644
--- a/src/main/webapp/scripts.js
+++ b/src/main/webapp/scripts.js
@@ -4,10 +4,11 @@ var pageTitle;
function initWS() {
if(typeof(pageMID)!="undefined" && pageMID>0) {
var url;
+ var protocolPrefix = (window.location.protocol === 'https:') ? 'wss:' : 'ws:';
if(typeof(juickDebug)!="undefined") {
- url="ws://ws.juick.com/_replies";
+ url= protocolPrefix + "//ws.juick.com/_replies";
} else {
- url="ws://ws.juick.com/"+pageMID;
+ url= protocolPrefix + "//ws.juick.com/"+pageMID;
}
if(typeof(hash)!="undefined" && hash) {
url+="?hash="+hash;
@@ -238,7 +239,7 @@ function unfoldReply() {
}
function showMessageLinksDialog(mid,rid) {
- var hlink="http://juick.com/"+mid;
+ var hlink="//juick.com/"+mid;
var mlink="#"+mid;
if(rid>0) {
hlink+="#"+rid;
@@ -296,7 +297,7 @@ function openSocialWindow(a) {
function checkUsername() {
var uname=$('#username').val();
- $.ajax('http://api.juick.com/users?uname='+uname).done(function() {
+ $.ajax('//api.juick.com/users?uname='+uname).done(function() {
$('#username').css('background','#FFCCCC');
}).fail(function() {
$('#username').css('background','#CCFFCC');
@@ -323,7 +324,7 @@ function openDialogLogin() {
function likeMessage(e,mid) {
$.ajax({
- url: 'http://juick.com/like?mid='+mid,
+ url: '//juick.com/like?mid='+mid,
type: 'POST'
}).done(function() {
$(e).closest("article").append("<p>OK!</p>");
@@ -336,7 +337,7 @@ function likeMessage(e,mid) {
/******************************************************************************/
function setPopular(e,mid,popular) {
- $.ajax('http://api.juick.com/messages/set_popular?mid='+mid+'&popular='+popular+'&hash='+hash).done(function() {
+ $.ajax('//api.juick.com/messages/set_popular?mid='+mid+'&popular='+popular+'&hash='+hash).done(function() {
var a=$(e).closest("article");
a.append("<p>OK!</p>");
});
@@ -344,7 +345,7 @@ function setPopular(e,mid,popular) {
}
function setPrivacy(e,mid) {
- $.ajax('http://api.juick.com/messages/set_privacy?mid='+mid+'&hash='+hash).done(function() {
+ $.ajax('//api.juick.com/messages/set_privacy?mid='+mid+'&hash='+hash).done(function() {
var a=$(e).closest("article");
a.append("<p>OK!</p>");
});