summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/index.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js4
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/etc/push.js9
-rwxr-xr-xStoneIsland/platforms/ios/www/js/sdk/_sdk.js5
4 files changed, 14 insertions, 6 deletions
diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js
index 43b55b04..a28faabf 100755
--- a/StoneIsland/platforms/ios/www/js/index.js
+++ b/StoneIsland/platforms/ios/www/js/index.js
@@ -4,7 +4,7 @@ var app = (function(){
app.init = function(){
console.log("init")
- if (window.location.hostname === 'lvh.me' || window.location.hostname === 'stone.giraffe.life') {
+ if (window.location.hostname === 'lvh.me' || window.location.hostname === 'stone.giraffe.life' || window.location.hostname === 'dev.stone.giraffe.life') {
console.log('launching in test mode')
sdk.init({ env: "test" })
}
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
index 598a0241..fd7b5212 100755
--- a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
@@ -9,8 +9,8 @@ var BlogView = View.extend({
fetch: function(fn){
$.ajax({
method: "GET",
- url: sdk.env === 'test' ? '/db.json' : "https://stone.sup.land/db.json",
- // url: "https://stone.sup.land/db.json",
+ url: sdk.env === 'test' ? '/db.json' : sdk.cms() + '/db.json',
+ // url: "https://stone.giraffe.life/db.json",
success: function(data){
this.success(data)
fn && fn()
diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js
index 6a1dfa5b..1606199f 100755
--- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js
+++ b/StoneIsland/platforms/ios/www/js/lib/etc/push.js
@@ -70,7 +70,7 @@ var push = (function(){
})
$.ajax({
method: "POST",
- url: "https://stone.sup.land/_services/push/add",
+ url: push.url('add'),
data: data,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
success: function(){
@@ -91,7 +91,7 @@ var push = (function(){
}
$.ajax({
method: "POST",
- url: "https://stone.sup.land/_services/push/remove",
+ url: push.url('remove'),
data: data,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
success: function(){
@@ -101,8 +101,11 @@ var push = (function(){
error: push.error,
})
}
+ push.url = function(key){
+ return sdk.cms() + '/_services/push/' + key
+ }
push.got_push_notification = function(push_obj) {
- // alert('We received this push notification: ' + JSON.stringify(push_obj));
+ console.log('We received this push notification: ' + JSON.stringify(push_obj));
app.blog.refresh()
try {
diff --git a/StoneIsland/platforms/ios/www/js/sdk/_sdk.js b/StoneIsland/platforms/ios/www/js/sdk/_sdk.js
index 705ca002..c251e364 100755
--- a/StoneIsland/platforms/ios/www/js/sdk/_sdk.js
+++ b/StoneIsland/platforms/ios/www/js/sdk/_sdk.js
@@ -29,6 +29,11 @@ var sdk = (function(){
return "https://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_" + size + ".jpg"
}
+ sdk.cms = function(){
+ return "http://staging.stone.giraffe.life"
+ // return "https://stone.giraffe.life"
+ }
+
$.ajaxSetup({
// possibly: application/json; charset=utf-8"
contentType: "application/json",