niryariv / opentaba-client

BSD 3-Clause "New" or "Revised" License
8 stars 15 forks source link

use github's JSONP support for the gushim.js load #33

Closed niryariv closed 10 years ago

niryariv commented 10 years ago

http://developer.github.com/v3/#json-p-callbacks

florpor commented 10 years ago

I have semi-working code with this, but do we really want this? As far as I can see, besides supporting some future hypothetic setup where the site and the gush json files are not in the same domain this has no advantage over the current code, and for disatvantages - it requires setting the root for the gush files in the js code (which are only loaded with relative paths currently). @niryariv ?

niryariv commented 10 years ago

is the code on some branch I can see?

basically the motivation is only code cleanliness. also, it allows us to store the geojson on github as is, meaning we can make some use of GH's geojson rendering (mostly for debug purposes). it's not a critical feature, but nice to have.

niryariv commented 10 years ago

the point is to make the geoJson files cleaner. implementation example here: https://github.com/niryariv/yuvalim/blob/master/index.html#L94

florpor commented 10 years ago

i could not use the example above because github would error: "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size." even after the decimal-digit reduction the file is still 2.3M and it's not the smallest one we have. it is possible to use their "Git Data API" to get the blob, but from what i see only using the blob's sha hash, which will change every time we edit the file.

i did manage to do this (use pure json in data file and load asynchronously) by requesting the normal file from our site using jquery and not through github's api : https://github.com/niryariv/opentaba-client/commit/677d463632d2c03589d62b34fc8e394fde63d65d @niryariv is that good enough?

niryariv commented 10 years ago

Yes, it's actually better. I can't remember why I didn't do it like that originally..

florpor commented 10 years ago

closed, then