summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/sdk/sdk.js
blob: 1a1a03e067deecbef86ef1821e0a049ef5ef3d70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var sdk = (function(){
  var sdk = {}

  var endpoint = "https://secure.api.yoox.biz/"
  
  sdk.path = function(api, path){
    return endpoint + api + "/STONEISLAND_US/" + path
  }
  
  sdk.fetch_collection = function(opt){
    $.ajax({
      method: "GET",
      url: sdk.path("Search.API/1.2", "search.json"),
      data: { format: "full", gallery: opt.gallery_id },
      success: opt.success,
//      dataType: "jsonp",
      cache: true,
    })
  }
  
  sdk.image = function(code){
    return "http://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_11_f.jpg"
  }
  
  return sdk
})()