mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Issue #745 - Add https support
This commit is contained in:
parent
d1156954ca
commit
d502d3416b
@ -63,6 +63,6 @@ var Constants = {
|
||||
|
||||
// SERVICE URLS
|
||||
APPENGINE_SAVE_URL : 'save',
|
||||
IMAGE_SERVICE_UPLOAD_URL : 'http://piskel-imgstore-b.appspot.com/__/upload',
|
||||
IMAGE_SERVICE_GET_URL : 'http://piskel-imgstore-b.appspot.com/img/'
|
||||
IMAGE_SERVICE_UPLOAD_URL : '{{protocol}}://piskel-imgstore-b.appspot.com/__/upload',
|
||||
IMAGE_SERVICE_GET_URL : '{{protocol}}://piskel-imgstore-b.appspot.com/img/'
|
||||
};
|
||||
|
@ -15,10 +15,17 @@
|
||||
data : imageData
|
||||
};
|
||||
|
||||
var protocol = pskl.utils.Environment.isHttps() ? 'https' : 'http';
|
||||
var wrappedSuccess = function (response) {
|
||||
success(Constants.IMAGE_SERVICE_GET_URL + response.responseText);
|
||||
var getUrl = pskl.utils.Template.replace(Constants.IMAGE_SERVICE_GET_URL, {
|
||||
protocol: protocol
|
||||
});
|
||||
success(getUrl + response.responseText);
|
||||
};
|
||||
|
||||
pskl.utils.Xhr.post(Constants.IMAGE_SERVICE_UPLOAD_URL, data, wrappedSuccess, error);
|
||||
var uploadUrl = pskl.utils.Template.replace(Constants.IMAGE_SERVICE_UPLOAD_URL, {
|
||||
protocol: protocol
|
||||
});
|
||||
pskl.utils.Xhr.post(uploadUrl, data, wrappedSuccess, error);
|
||||
};
|
||||
})();
|
||||
|
@ -27,7 +27,11 @@
|
||||
|
||||
isDebug : function () {
|
||||
return window.location.href.indexOf('debug') !== -1;
|
||||
}
|
||||
},
|
||||
|
||||
isHttps : function () {
|
||||
return window.location.href.indexOf('https://') === 0;
|
||||
},
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -39,7 +39,7 @@
|
||||
<script type="text/template" id="save-gallery-unavailable-partial">
|
||||
<div class="settings-title">Save online</div>
|
||||
<div class="settings-item">
|
||||
<div class="save-status">Login to <a href="http://piskelapp.com" target="_blank">piskelapp.com</a> to save and share your sprites online.</div>
|
||||
<div class="save-status">Login to <a href="https://www.piskelapp.com" target="_blank">piskelapp.com</a> to save and share your sprites online.</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user