1
0
Fork 0
forked from OpenNeo/impress

move item swf asset JSON routes into a /items/ subdirectory, and gitignore the contents of that and /pet_types/

This commit is contained in:
Emi Matchu 2010-06-08 18:35:39 -04:00
parent 37372544b0
commit 6d2782d9db
4 changed files with 6 additions and 4 deletions

View file

@ -2,8 +2,8 @@ OpenneoImpressItems::Application.routes.draw do |map|
match '/' => 'items#index', :as => :items match '/' => 'items#index', :as => :items
match '/:id' => 'items#show', :as => :item match '/:id' => 'items#show', :as => :item
match '/:item_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets match '/items/:item_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets
match '/:item_id/bodies/:body_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets_for_body_id match '/items/:item_id/bodies/:body_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets_for_body_id
match '/pet_types/:pet_type_id/swf_assets.json' => 'swf_assets#index', :as => :pet_type_swf_assets match '/pet_types/:pet_type_id/swf_assets.json' => 'swf_assets#index', :as => :pet_type_swf_assets
match '/species/:species_id/color/:color_id/pet_type.json' => 'pet_types#show' match '/species/:species_id/color/:color_id/pet_type.json' => 'pet_types#show'

1
public/items/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.json

View file

@ -123,7 +123,7 @@ function Item(id) {
this.assets_by_body_id = {}; this.assets_by_body_id = {};
this.load = function (pet_type) { this.load = function (pet_type) {
var url = '/' + id + '/bodies/' + pet_type.body_id + '/swf_assets.json', var url = '/items/' + id + '/bodies/' + pet_type.body_id + '/swf_assets.json',
item = this; item = this;
if(this.getAssetsForPetType(pet_type).length) { if(this.getAssetsForPetType(pet_type).length) {
pet_type.onUpdate(); pet_type.onUpdate();
@ -136,7 +136,7 @@ function Item(id) {
this.loadAllStandard = function () { this.loadAllStandard = function () {
var item = this; var item = this;
$.getJSON('/' + id + '/swf_assets.json', function (assets_by_body_id) { $.getJSON('/items/' + id + '/swf_assets.json', function (assets_by_body_id) {
$.each(assets_by_body_id, function (i) { $.each(assets_by_body_id, function (i) {
item.assets_by_body_id[parseInt(i)] = this; item.assets_by_body_id[parseInt(i)] = this;
}); });

1
public/pet_types/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.json