From 8403fdf888da36e6ce68e9d8cf7efcd7f5555936 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 16 Nov 2010 08:50:01 -0500 Subject: [PATCH 1/2] fix wardrobe overlaps: search+swf, search+footer --- app/stylesheets/outfits/_edit.sass | 2 +- app/views/layouts/application.html.haml | 6 +++--- public/javascripts/outfits/edit.js | 4 ++++ public/stylesheets/compiled/screen.css | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/stylesheets/outfits/_edit.sass b/app/stylesheets/outfits/_edit.sass index bd429cbb..0938605c 100644 --- a/app/stylesheets/outfits/_edit.sass +++ b/app/stylesheets/outfits/_edit.sass @@ -273,7 +273,7 @@ body.outfits-edit height: auto max-height: 100% #preview-search-form - bottom: 1em + bottom: 1.5em left: 0 overflow: auto padding: .5em 1em diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e3d9a636..37e10162 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -49,16 +49,16 @@ %li %a{:href => "http://forum.openneo.net/", :target => "_blank"} Forum %li - %a{:href => "http://github.com/matchu/openneo-impress"} The Source Code + %a{:href => "http://github.com/matchu/openneo-impress-rails"} Source Code %li %a{:href => terms_path} Terms of Use %div Contact: %ul %li - %a{:href => "http://openneo.uservoice.com/forums/40720-dress-to-impress"} Feedback + %a{:href => "http://openneo.uservoice.com/forums/40720-dress-to-impress"} Suggestions %li - %a{:href => "mailto:webmaster@openneo.net"} Questions, comments, bug reports + %a{:href => "mailto:webmaster@openneo.net"} Questions, comments, bugs %p Images © 2000-2010 Neopets, Inc. All Rights Reserved. Used With Permission diff --git a/public/javascripts/outfits/edit.js b/public/javascripts/outfits/edit.js index a2f880b0..0b4545c6 100644 --- a/public/javascripts/outfits/edit.js +++ b/public/javascripts/outfits/edit.js @@ -209,6 +209,10 @@ View.Fullscreen = function (wardrobe) { $('#preview').data('fit', fit); win.resize(fit).load(fit); + // run fit after search updates select fields + function fitSoon() { setTimeout(fit, 0) } + wardrobe.item_zone_sets.bind('update', fitSoon); + wardrobe.pet_attributes.bind('update', fitSoon); fit(); var Konami=function(){var a={addEvent:function(b,c,d,e){if(b.addEventListener)b.addEventListener(c,d,false);else if(b.attachEvent){b["e"+c+d]=d;b[c+d]=function(){b["e"+c+d](window.event,e)};b.attachEvent("on"+c,b[c+d])}},input:"",pattern:"3838404037393739666513",load:function(b){this.addEvent(document,"keydown",function(c,d){if(d)a=d;a.input+=c?c.keyCode:event.keyCode;if(a.input.indexOf(a.pattern)!=-1){a.code(b);a.input=""}},this);this.iphone.load(b)},code:function(b){window.location=b},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:false,capture:false,keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP","TAP"],code:function(b){a.code(b)},load:function(b){a.addEvent(document,"touchmove",function(c){if(c.touches.length==1&&a.iphone.capture==true){c=c.touches[0];a.iphone.stop_x=c.pageX;a.iphone.stop_y=c.pageY;a.iphone.tap=false;a.iphone.capture=false;a.iphone.check_direction()}});a.addEvent(document,"touchend",function(){a.iphone.tap==true&&a.iphone.check_direction(b)},false);a.addEvent(document,"touchstart",function(c){a.iphone.start_x=c.changedTouches[0].pageX;a.iphone.start_y=c.changedTouches[0].pageY;a.iphone.tap=true;a.iphone.capture=true})},check_direction:function(b){x_magnitude=Math.abs(this.start_x-this.stop_x);y_magnitude=Math.abs(this.start_y-this.stop_y);x=this.start_x-this.stop_x<0?"RIGHT":"LEFT";y=this.start_y-this.stop_y<0?"DOWN":"UP";result=x_magnitude>y_magnitude?x:y;result=this.tap==true?"TAP":result;if(result==this.keys[0])this.keys=this.keys.slice(1,this.keys.length);this.keys.length==0&&this.code(b)}}};return a}; diff --git a/public/stylesheets/compiled/screen.css b/public/stylesheets/compiled/screen.css index 23af4cda..b006fa18 100644 --- a/public/stylesheets/compiled/screen.css +++ b/public/stylesheets/compiled/screen.css @@ -1097,7 +1097,7 @@ body.outfits-edit.fullscreen #preview-sidebar.viewing-saving-outfit { } /* line 275, ../../../app/stylesheets/outfits/_edit.sass */ body.outfits-edit.fullscreen #preview-search-form { - bottom: 1em; + bottom: 1.5em; left: 0; overflow: auto; padding: 0.5em 1em; From 06c3150ad0cf3336d6b377fd0a07c7307981a1df Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 16 Nov 2010 10:55:01 -0500 Subject: [PATCH 2/2] fix outfit loading only setting correct pet state on the first try --- public/javascripts/outfits/edit.js | 2 +- public/javascripts/wardrobe.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/javascripts/outfits/edit.js b/public/javascripts/outfits/edit.js index 0b4545c6..5a2871b8 100644 --- a/public/javascripts/outfits/edit.js +++ b/public/javascripts/outfits/edit.js @@ -695,7 +695,7 @@ View.PetStateForm = function (wardrobe) { label.appendTo(li); li.appendTo(ul); } - updatePetState(wardrobe.outfit.pet_state); + updatePetState(wardrobe.outfit.getPetState()); } }); diff --git a/public/javascripts/wardrobe.js b/public/javascripts/wardrobe.js index 4e2de5ce..0391bcfa 100644 --- a/public/javascripts/wardrobe.js +++ b/public/javascripts/wardrobe.js @@ -745,8 +745,8 @@ function Wardrobe() { function setFullOutfit(new_outfit) { outfit = new_outfit; controller.in_transaction = true; - controller.setPetTypeByColorAndSpecies(outfit.color_id, outfit.species_id); controller.setPetStateById(outfit.pet_state_id); + controller.setPetTypeByColorAndSpecies(outfit.color_id, outfit.species_id); controller.setClosetItemsByIds(outfit.getClosetItemIds()); controller.setWornItemsByIds(outfit.getWornItemIds()); controller.events.trigger('setOutfit', outfit); @@ -774,6 +774,10 @@ function Wardrobe() { return outfit; } + this.getPetState = function () { + return outfit.pet_state; + } + this.getPetType = function () { return outfit.pet_type; }