include share button for logged in users, too
This commit is contained in:
parent
1207e84804
commit
d7d2d5f0e5
6 changed files with 417 additions and 384 deletions
|
@ -73,7 +73,8 @@ class Outfit < ActiveRecord::Base
|
|||
Outfit.new.tap do |outfit|
|
||||
name = params.delete(:name)
|
||||
starred = params.delete(:starred)
|
||||
if user
|
||||
anonymous = params.delete(:anonymous) == "true"
|
||||
if user && !anonymous
|
||||
outfit.user = user
|
||||
outfit.name = name
|
||||
outfit.starred = starred
|
||||
|
|
|
@ -130,20 +130,22 @@ body.outfits-edit
|
|||
float: right
|
||||
button
|
||||
display: none
|
||||
#share-outfit
|
||||
display: inline-block
|
||||
&.loading
|
||||
background:
|
||||
image: image-url("loading.gif")
|
||||
position: left center
|
||||
repeat: no-repeat
|
||||
padding-left: 20px
|
||||
#save-outfit, #share-outfit, #save-outfit-not-signed-in, #save-current-outfit, #save-outfit-copy, #save-outfit-finish
|
||||
#save-outfit, #save-outfit-not-signed-in, #save-current-outfit, #save-outfit-copy, #save-outfit-finish
|
||||
+loud-awesome-button-color
|
||||
#current-outfit-permalink
|
||||
#current-outfit-permalink, #shared-outfit-permalink
|
||||
display: none
|
||||
margin-right: .25em
|
||||
img
|
||||
+icon
|
||||
#current-outfit-url
|
||||
#shared-outfit-url
|
||||
display: none
|
||||
width: 15em
|
||||
#preview
|
||||
|
@ -474,13 +476,16 @@ body.outfits-edit
|
|||
&.saving-outfit
|
||||
#save-outfit-form
|
||||
display: block
|
||||
#save-outfit, #save-current-outfit, #save-outfit-copy, #current-outfit-permalink
|
||||
#save-outfit, #save-current-outfit, #save-outfit-copy, #current-outfit-permalink, #shared-outfit-permalink, #share-outfit, #shared-outfit-url
|
||||
display: none
|
||||
|
||||
&.user-not-signed-in
|
||||
#share-outfit, #save-outfit-not-signed-in
|
||||
#save-outfit-not-signed-in
|
||||
display: inline-block
|
||||
#save-outfit-wrapper.shared-outfit
|
||||
#current-outfit-permalink, #current-outfit-url
|
||||
display: inline-block
|
||||
|
||||
#save-outfit-wrapper.shared-outfit
|
||||
#shared-outfit-permalink, #shared-outfit-url
|
||||
display: inline-block
|
||||
#current-outfit-permalink
|
||||
display: none !important
|
||||
|
||||
|
|
|
@ -16,10 +16,12 @@
|
|||
%ul
|
||||
#save-outfit-wrapper
|
||||
%a#current-outfit-permalink{:target => '_blank'}
|
||||
= image_tag 'link_go.png', :alt => 'Permalink', :title => 'Permalink'
|
||||
%input#current-outfit-url.outfit-url{:type => 'text'}
|
||||
%button#save-outfit Save outfit
|
||||
= image_tag 'link_go.png', :alt => 'Permalink', :title => 'Permalink to current outfit'
|
||||
%a#shared-outfit-permalink{:target => '_blank'}
|
||||
= image_tag 'link_go.png', :alt => 'Permalink', :title => 'Permalink to shared outfit'
|
||||
%input#shared-outfit-url.outfit-url{:type => 'text'}
|
||||
%button#share-outfit Share outfit
|
||||
%button#save-outfit Save outfit
|
||||
%button#save-outfit-not-signed-in Log in to save
|
||||
%button#save-current-outfit Save "<span>current outfit</span>"
|
||||
%button#save-outfit-copy Save a copy
|
||||
|
@ -118,3 +120,4 @@
|
|||
- content_for :javascripts do
|
||||
= include_javascript_libraries :jquery, :swfobject, :jquery_tmpl
|
||||
= include_javascripts :edit_outfit_package
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) {
|
|||
var item_set = this, ul = $(selector), items = [], setClosetItems,
|
||||
setOutfitItems, setOutfitItemsControls, no_assets_full_message = $('#no-assets-full-message'),
|
||||
container = $('#container');
|
||||
|
||||
|
||||
Partial.ItemSet.setWardrobe(wardrobe);
|
||||
|
||||
|
||||
function prepSetSpecificItems(type) {
|
||||
return function (specific_items) {
|
||||
var item, worn, li;
|
||||
|
@ -51,15 +51,15 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
setClosetItems = prepSetSpecificItems('closeted');
|
||||
|
||||
|
||||
setOutfitItemsControls = prepSetSpecificItems('worn');
|
||||
setOutfitItems = function (specific_items) {
|
||||
setOutfitItemsControls(specific_items);
|
||||
setHasAssets(specific_items);
|
||||
}
|
||||
|
||||
|
||||
function setHasAssets(specific_items) {
|
||||
var item, no_assets, li, no_assets_message;
|
||||
for(var i = 0, l = specific_items.length; i < l; i++) {
|
||||
|
@ -75,7 +75,7 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) {
|
|||
})(li);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.setItems = function (new_items) {
|
||||
var item, li, controls, info_link;
|
||||
items = new_items;
|
||||
|
@ -106,7 +106,7 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) {
|
|||
setClosetItems(wardrobe.outfit.getClosetItems());
|
||||
setOutfitItems(wardrobe.outfit.getWornItems());
|
||||
}
|
||||
|
||||
|
||||
$('span.no-assets-message').live('mouseover', function () {
|
||||
var el = $(this), o = el.offset();
|
||||
no_assets_full_message.css({
|
||||
|
@ -116,7 +116,7 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) {
|
|||
}).live('mouseout', function () {
|
||||
no_assets_full_message.removeAttr('style');
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('updateItemAssets', function () { setHasAssets(wardrobe.outfit.getWornItems()) });
|
||||
wardrobe.outfit.bind('updateWornItems', setOutfitItems);
|
||||
wardrobe.outfit.bind('updateClosetItems', setClosetItems);
|
||||
|
@ -139,7 +139,7 @@ Partial.ItemSet.setWardrobe = function (wardrobe) {
|
|||
href: '#',
|
||||
text: verb_set[toggle ? 0 : 1]
|
||||
}).wrap('<li/>').parent().attr('class', full_class);
|
||||
|
||||
|
||||
(function (type, toggle) {
|
||||
$('li.' + live_class + ' a').live('click', function (e) {
|
||||
var el = $(this), item = el.closest('.object').data('item');
|
||||
|
@ -149,7 +149,7 @@ Partial.ItemSet.setWardrobe = function (wardrobe) {
|
|||
})(type, toggle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
toggle_fn.closeted = {};
|
||||
toggle_fn.closeted[true] = $.proxy(wardrobe.outfit, 'closetItem');
|
||||
toggle_fn.closeted[false] = $.proxy(wardrobe.outfit, 'unclosetItem');
|
||||
|
@ -157,13 +157,13 @@ Partial.ItemSet.setWardrobe = function (wardrobe) {
|
|||
toggle_fn.worn = {};
|
||||
toggle_fn.worn[true] = $.proxy(wardrobe.outfit, 'wearItem');
|
||||
toggle_fn.worn[false] = $.proxy(wardrobe.outfit, 'unwearItem');
|
||||
|
||||
|
||||
Partial.ItemSet.setWardrobe = $.noop;
|
||||
}
|
||||
|
||||
View.Closet = function (wardrobe) {
|
||||
var item_set = new Partial.ItemSet(wardrobe, '#preview-closet ul');
|
||||
|
||||
|
||||
wardrobe.outfit.bind('updateClosetItems', $.proxy(item_set, 'setItems'));
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ View.Fullscreen = function (wardrobe) {
|
|||
preview_el = $('#preview'), search_el = $('#preview-search-form'),
|
||||
preview_swf = $('#preview-swf'), sidebar_el = $('#preview-sidebar'),
|
||||
footer = $('#footer'), jwindow = $(window), overrideFull = false;
|
||||
|
||||
|
||||
function fit() {
|
||||
if(!overrideFull) {
|
||||
var newFull = jwindow.height() > 500;
|
||||
|
@ -185,7 +185,7 @@ View.Fullscreen = function (wardrobe) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(full) {
|
||||
preview_swf = $('#preview-swf'); // swf replaced
|
||||
var available = {
|
||||
|
@ -211,19 +211,19 @@ View.Fullscreen = function (wardrobe) {
|
|||
size.next[margin.active] = (available[dim.larger] - size.next[dim.larger]) / 2;
|
||||
size.next[margin.inactive] = 0;
|
||||
preview_swf.css(size.next);
|
||||
|
||||
|
||||
preview_el.height(available.height);
|
||||
}
|
||||
}
|
||||
$('#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};
|
||||
konami = new Konami();
|
||||
konami.code = function () {
|
||||
|
@ -253,7 +253,7 @@ View.Hash = function (wardrobe) {
|
|||
species: TYPES.INTEGER,
|
||||
state: TYPES.INTEGER
|
||||
}, links_with_return_to = $('a[href*=return_to]');
|
||||
|
||||
|
||||
function checkQuery() {
|
||||
var query = (document.location.hash || document.location.search).substr(1);
|
||||
if(query != previous_query) {
|
||||
|
@ -261,7 +261,7 @@ View.Hash = function (wardrobe) {
|
|||
previous_query = query;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function parseQuery(query) {
|
||||
var new_data = {}, pairs = query.split('&');
|
||||
parse_in_progress = true;
|
||||
|
@ -283,7 +283,7 @@ View.Hash = function (wardrobe) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(new_data.color !== data.color || new_data.species !== data.species) {
|
||||
wardrobe.outfit.setPetTypeByColorAndSpecies(new_data.color, new_data.species);
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ View.Hash = function (wardrobe) {
|
|||
parse_in_progress = false;
|
||||
updateLinksWithReturnTo();
|
||||
}
|
||||
|
||||
|
||||
function changeQuery(changes) {
|
||||
var value;
|
||||
if(!parse_in_progress) {
|
||||
|
@ -336,7 +336,7 @@ View.Hash = function (wardrobe) {
|
|||
updateQuery();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateQuery() {
|
||||
var new_query;
|
||||
new_query = $.param(data).replace(/%5B%5D/g, '[]');
|
||||
|
@ -344,7 +344,7 @@ View.Hash = function (wardrobe) {
|
|||
document.location.hash = '#' + new_query;
|
||||
updateLinksWithReturnTo();
|
||||
}
|
||||
|
||||
|
||||
function updateLinksWithReturnTo() {
|
||||
links_with_return_to.each(function () {
|
||||
var new_return_to = 'return_to=' + encodeURIComponent(
|
||||
|
@ -355,25 +355,25 @@ View.Hash = function (wardrobe) {
|
|||
this.href = this.href.replace(/return_to=[^&]+/, new_return_to);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.initialize = function () {
|
||||
checkQuery();
|
||||
setInterval(checkQuery, 100);
|
||||
}
|
||||
|
||||
|
||||
function singleOutfitResponse(event_name, response) {
|
||||
wardrobe.outfit.bind(event_name, function () {
|
||||
if(!wardrobe.outfit.in_transaction) response.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
singleOutfitResponse('updateClosetItems', function (items) {
|
||||
var item_ids = items.map('id');
|
||||
if(!arraysMatch(item_ids, data.closet)) {
|
||||
changeQuery({closet: item_ids});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
singleOutfitResponse('updateWornItems', function (items) {
|
||||
var item_ids = items.map('id'), changes = {};
|
||||
if(!arraysMatch(item_ids, data.objects)) {
|
||||
|
@ -386,7 +386,7 @@ View.Hash = function (wardrobe) {
|
|||
}
|
||||
if(changes.objects || changes.closet) changeQuery(changes);
|
||||
});
|
||||
|
||||
|
||||
singleOutfitResponse('updatePetType', function (pet_type) {
|
||||
if(pet_type.color_id != data.color || pet_type.species_id != data.species) {
|
||||
changeQuery({
|
||||
|
@ -396,24 +396,24 @@ View.Hash = function (wardrobe) {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
singleOutfitResponse('petTypeNotFound', function () {
|
||||
window.history.back();
|
||||
});
|
||||
|
||||
|
||||
singleOutfitResponse('updatePetState', function (pet_state) {
|
||||
var pet_type = wardrobe.outfit.getPetType();
|
||||
if(pet_state.id != data.state && pet_type && (data.state || pet_state.id != pet_type.pet_state_ids[0])) {
|
||||
changeQuery({state: pet_state.id});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
singleOutfitResponse('setOutfit', function (outfit) {
|
||||
if(outfit.id != data.outfit) {
|
||||
changeQuery({outfit: outfit.id});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('loadOutfit', function (outfit) {
|
||||
changeQuery({
|
||||
closet: outfit.getClosetItemIds(),
|
||||
|
@ -424,12 +424,12 @@ View.Hash = function (wardrobe) {
|
|||
state: outfit.pet_state.id
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('outfitNotFound', function (outfit) {
|
||||
var new_id = outfit ? outfit.id : undefined;
|
||||
changeQuery({outfit: new_id});
|
||||
});
|
||||
|
||||
|
||||
wardrobe.search.bind('updateRequest', function (request) {
|
||||
if(request.offset != data.search_offset || request.query != data.search) {
|
||||
changeQuery({
|
||||
|
@ -442,7 +442,8 @@ View.Hash = function (wardrobe) {
|
|||
|
||||
View.Outfits = function (wardrobe) {
|
||||
var current_outfit_permalink_el = $('#current-outfit-permalink'),
|
||||
current_outfit_url_el = $('#current-outfit-url'),
|
||||
shared_outfit_permalink_el = $('#shared-outfit-permalink'),
|
||||
shared_outfit_url_el = $('#shared-outfit-url'),
|
||||
new_outfit_form_el = $('#save-outfit-form'),
|
||||
new_outfit_name_el = $('#save-outfit-name'),
|
||||
outfits_el = $('#preview-outfits'),
|
||||
|
@ -457,77 +458,77 @@ View.Outfits = function (wardrobe) {
|
|||
sidebar_el = $('#preview-sidebar'),
|
||||
signed_in,
|
||||
previously_viewing = '';
|
||||
|
||||
|
||||
function liForOutfit(outfit) {
|
||||
return $('li.outfit-' + outfit.id);
|
||||
}
|
||||
|
||||
|
||||
function navLinkTo(callback) {
|
||||
return function (e) {
|
||||
e.preventDefault();
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function navigateTo(will_be_viewing) {
|
||||
var currently_viewing = sidebar_el.attr('class');
|
||||
if(currently_viewing != will_be_viewing) previously_viewing = currently_viewing;
|
||||
sidebar_el.attr('class', will_be_viewing);
|
||||
}
|
||||
|
||||
|
||||
/* Show for login */
|
||||
|
||||
|
||||
signed_in = $('meta[name=user-signed-in]').attr('content') == 'true';
|
||||
if(signed_in) {
|
||||
$(document.body).addClass('user-signed-in');
|
||||
} else {
|
||||
$(document.body).addClass('user-not-signed-in');
|
||||
}
|
||||
|
||||
|
||||
/* Nav */
|
||||
|
||||
|
||||
function showCloset() {
|
||||
navigateTo('');
|
||||
}
|
||||
|
||||
|
||||
function showOutfits() {
|
||||
wardrobe.user.loadOutfits();
|
||||
navigateTo('viewing-outfits');
|
||||
}
|
||||
|
||||
|
||||
function showNewOutfitForm() {
|
||||
new_outfit_name_el.val('');
|
||||
new_outfit_form_el.removeClass('starred').stopLoading();
|
||||
save_outfit_wrapper_el.addClass('saving-outfit');
|
||||
new_outfit_name_el.focus();
|
||||
}
|
||||
|
||||
|
||||
function hideNewOutfitForm() {
|
||||
save_outfit_wrapper_el.removeClass('saving-outfit');
|
||||
}
|
||||
|
||||
|
||||
$('#preview-sidebar-nav-outfits').click(navLinkTo(showOutfits));
|
||||
|
||||
|
||||
$('#preview-sidebar-nav-closet').click(navLinkTo(showCloset));
|
||||
|
||||
|
||||
$('#save-outfit, #save-outfit-copy').click(showNewOutfitForm);
|
||||
|
||||
|
||||
$('#save-outfit-cancel').click(hideNewOutfitForm);
|
||||
|
||||
|
||||
$('#save-outfit-not-signed-in').click(function () {
|
||||
window.location.replace($('#userbar a').attr('href'));
|
||||
});
|
||||
|
||||
|
||||
/* Outfits list */
|
||||
|
||||
|
||||
$('#outfit-template').template('outfitTemplate');
|
||||
|
||||
|
||||
wardrobe.user.bind('outfitsLoaded', function (outfits) {
|
||||
var outfit_els = $.tmpl('outfitTemplate', outfits);
|
||||
outfits_list_el.html('').append(outfit_els).addClass('loaded');
|
||||
updateActiveOutfit();
|
||||
});
|
||||
|
||||
|
||||
wardrobe.user.bind('addOutfit', function (outfit, i) {
|
||||
var next_child = outfits_list_el.children().not('.hiding').eq(i),
|
||||
outfit_el = $.tmpl('outfitTemplate', outfit);
|
||||
|
@ -539,23 +540,23 @@ View.Outfits = function (wardrobe) {
|
|||
updateActiveOutfit();
|
||||
outfit_el.hide().show('normal');
|
||||
});
|
||||
|
||||
|
||||
wardrobe.user.bind('removeOutfit', function (outfit, i) {
|
||||
var outfit_el = outfits_list_el.children().not('.hiding').eq(i);
|
||||
outfit_el.addClass('hiding').stop(true).hide('normal', function () { outfit_el.remove() });
|
||||
});
|
||||
|
||||
|
||||
$('#preview-outfits h4').live('click', function () {
|
||||
wardrobe.outfit.load($(this).tmplItem().data.id);
|
||||
});
|
||||
|
||||
|
||||
$('a.outfit-rename-button').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
var li = $(this).closest('li').addClass('renaming'),
|
||||
name = li.find('h4').text();
|
||||
li.find('input.outfit-rename-field').val(name).focus();
|
||||
});
|
||||
|
||||
|
||||
function submitRename() {
|
||||
var el = $(this), outfit = el.tmplItem().data, new_name = el.val(),
|
||||
li = el.closest('li').removeClass('renaming');
|
||||
|
@ -564,26 +565,26 @@ View.Outfits = function (wardrobe) {
|
|||
wardrobe.user.renameOutfit(outfit, new_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('input.outfit-rename-field').live('blur', submitRename);
|
||||
|
||||
|
||||
$('form.outfit-rename-form').live('submit', function (e) {
|
||||
e.preventDefault();
|
||||
var input = $(this).find('input');
|
||||
submitRename.apply(input);
|
||||
});
|
||||
|
||||
|
||||
$('input.outfit-url').live('mouseover', function () {
|
||||
this.focus();
|
||||
}).live('mouseout', function () {
|
||||
this.blur();
|
||||
});
|
||||
|
||||
|
||||
$('button.outfit-delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest('li').addClass('confirming-deletion');
|
||||
});
|
||||
|
||||
|
||||
$('a.outfit-delete-confirmation-yes').live('click', function (e) {
|
||||
var outfit = $(this).tmplItem().data;
|
||||
e.preventDefault();
|
||||
|
@ -592,108 +593,116 @@ View.Outfits = function (wardrobe) {
|
|||
wardrobe.outfit.setId(null);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('a.outfit-delete-confirmation-no').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest('li').removeClass('confirming-deletion');
|
||||
});
|
||||
|
||||
|
||||
stars.live('click', function () {
|
||||
var el = $(this);
|
||||
el.closest('li').startLoading();
|
||||
wardrobe.user.toggleOutfitStar(el.tmplItem().data);
|
||||
});
|
||||
|
||||
function setOutfitPermalink(outfit) {
|
||||
|
||||
function setOutfitPermalink(outfit, outfit_permalink_el, outfit_url_el) {
|
||||
var url = document.location.protocol + "//" + document.location.host;
|
||||
if(document.location.port) url += ":" + document.location.port;
|
||||
url += "/outfits/" + outfit.id;
|
||||
current_outfit_permalink_el.attr('href', url);
|
||||
current_outfit_url_el.val(url);
|
||||
outfit_permalink_el.attr('href', url);
|
||||
if(outfit_url_el) outfit_url_el.val(url);
|
||||
}
|
||||
|
||||
|
||||
function setCurrentOutfitPermalink(outfit) {
|
||||
setOutfitPermalink(outfit, current_outfit_permalink_el);
|
||||
}
|
||||
|
||||
function setSharedOutfitPermalink(outfit) {
|
||||
setOutfitPermalink(outfit, shared_outfit_permalink_el, shared_outfit_url_el);
|
||||
}
|
||||
|
||||
function setActiveOutfit(outfit) {
|
||||
outfits_list_el.find('li.active').removeClass('active');
|
||||
if(outfit.id) {
|
||||
setOutfitPermalink(outfit);
|
||||
setCurrentOutfitPermalink(outfit);
|
||||
liForOutfit(outfit).addClass('active');
|
||||
save_current_outfit_name_el.text(outfit.name);
|
||||
}
|
||||
save_outfit_wrapper_el.toggleClass('active-outfit', outfit.id ? true : false);
|
||||
}
|
||||
|
||||
|
||||
function updateActiveOutfit() {
|
||||
setActiveOutfit(wardrobe.outfit.getOutfit());
|
||||
}
|
||||
|
||||
|
||||
wardrobe.outfit.bind('setOutfit', setActiveOutfit);
|
||||
wardrobe.outfit.bind('outfitNotFound', setActiveOutfit);
|
||||
|
||||
|
||||
wardrobe.user.bind('outfitRenamed', function (outfit) {
|
||||
if(outfit.id == wardrobe.outfit.getId()) {
|
||||
save_current_outfit_name_el.text(outfit.name);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/* Saving */
|
||||
|
||||
|
||||
save_current_outfit_el.click(function () {
|
||||
wardrobe.outfit.update();
|
||||
});
|
||||
|
||||
|
||||
new_outfit_form_el.submit(function (e) {
|
||||
e.preventDefault();
|
||||
new_outfit_form_el.startLoading();
|
||||
wardrobe.outfit.create({starred: new_outfit_form_el.hasClass('starred'), name: new_outfit_name_el.val()});
|
||||
});
|
||||
|
||||
|
||||
$('#share-outfit').click(function () {
|
||||
save_outfit_wrapper_el.startLoading();
|
||||
wardrobe.outfit.share();
|
||||
});
|
||||
|
||||
|
||||
new_outfit_form_el.find('div.outfit-star').click(function () {
|
||||
new_outfit_form_el.toggleClass('starred');
|
||||
});
|
||||
|
||||
|
||||
var SAVE_ERRORS = {
|
||||
'item_outfit_relationships': "Item not found. How odd. Pull some items out of your closet and try again.",
|
||||
'pet_state': "Pet state not found. How odd. Try picking a new Gender/Emotion.",
|
||||
'name': true,
|
||||
'user': "You must be logged in to save outfits"
|
||||
};
|
||||
|
||||
|
||||
function saveErrorMessage(text) {
|
||||
save_error_el.text(text).notify();
|
||||
}
|
||||
|
||||
|
||||
wardrobe.outfit.bind('saveSuccess', function (outfit) {
|
||||
save_success_el.notify();
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('createSuccess', function (outfit) {
|
||||
wardrobe.user.addOutfit(outfit);
|
||||
showOutfits();
|
||||
hideNewOutfitForm();
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('updateSuccess', function (outfit) {
|
||||
wardrobe.user.updateOutfit(outfit);
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('shareSuccess', function (outfit) {
|
||||
save_outfit_wrapper_el.stopLoading().addClass('shared-outfit');
|
||||
setOutfitPermalink(outfit);
|
||||
setSharedOutfitPermalink(outfit);
|
||||
});
|
||||
|
||||
|
||||
function clearSharedOutfit() {
|
||||
save_outfit_wrapper_el.removeClass('shared-outfit');
|
||||
}
|
||||
|
||||
|
||||
wardrobe.outfit.bind('updateClosetItems', clearSharedOutfit);
|
||||
wardrobe.outfit.bind('updateWornItems', clearSharedOutfit);
|
||||
wardrobe.outfit.bind('updatePetState', clearSharedOutfit);
|
||||
|
||||
|
||||
function saveFailure(outfit, response) {
|
||||
var errors = response.errors;
|
||||
if(typeof errors == 'undefined') {
|
||||
|
@ -714,16 +723,16 @@ View.Outfits = function (wardrobe) {
|
|||
new_outfit_form_el.stopLoading();
|
||||
liForOutfit(outfit).stopLoading();
|
||||
}
|
||||
|
||||
|
||||
wardrobe.outfit.bind('saveFailure', saveFailure);
|
||||
wardrobe.user.bind('saveFailure', saveFailure)
|
||||
wardrobe.outfit.bind('shareFailure', function (outfit, response) {
|
||||
save_outfit_wrapper_el.stopLoading();
|
||||
saveFailure(outfit, response);
|
||||
});
|
||||
|
||||
|
||||
/* Error */
|
||||
|
||||
|
||||
wardrobe.outfit.bind('outfitNotFound', function () {
|
||||
outfit_not_found_el.notify();
|
||||
});
|
||||
|
@ -738,14 +747,14 @@ View.PetStateForm = function (wardrobe) {
|
|||
e.preventDefault();
|
||||
wardrobe.outfit.setPetStateById(+$(this).data('value'));
|
||||
});
|
||||
|
||||
|
||||
function updatePetState(pet_state) {
|
||||
if(pet_state) {
|
||||
ul.children('li.selected').removeClass('selected');
|
||||
$(button_query + '[data-value=' + pet_state.id + ']').parent().addClass('selected');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wardrobe.outfit.bind('petTypeLoaded', function (pet_type) {
|
||||
var ids = pet_type.pet_state_ids, i, id, li, button, label;
|
||||
ul.children().remove();
|
||||
|
@ -767,7 +776,7 @@ View.PetStateForm = function (wardrobe) {
|
|||
updatePetState(wardrobe.outfit.getPetState());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('updatePetState', updatePetState);
|
||||
}
|
||||
|
||||
|
@ -781,11 +790,11 @@ View.PetTypeForm = function (wardrobe) {
|
|||
}).children('select').each(function () {
|
||||
dropdowns[this.name] = $(this);
|
||||
});
|
||||
|
||||
|
||||
this.initialize = function () {
|
||||
wardrobe.pet_attributes.load();
|
||||
}
|
||||
|
||||
|
||||
function updatePetType(pet_type) {
|
||||
if(loaded && pet_type) {
|
||||
$.each(dropdowns, function (name) {
|
||||
|
@ -793,7 +802,7 @@ View.PetTypeForm = function (wardrobe) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wardrobe.pet_attributes.bind('update', function (attributes) {
|
||||
$.each(attributes, function (type) {
|
||||
var dropdown = dropdowns[type];
|
||||
|
@ -808,9 +817,9 @@ View.PetTypeForm = function (wardrobe) {
|
|||
loaded = true;
|
||||
updatePetType(wardrobe.outfit.getPetType());
|
||||
});
|
||||
|
||||
|
||||
wardrobe.outfit.bind('updatePetType', updatePetType);
|
||||
|
||||
|
||||
wardrobe.outfit.bind('petTypeNotFound', function () {
|
||||
$('#pet-type-not-found').show('normal').delay(3000).hide('fast');
|
||||
});
|
||||
|
@ -837,21 +846,21 @@ View.Search = function (wardrobe) {
|
|||
EL_ID: '#preview-search-form-pagination',
|
||||
PER_PAGE: 21
|
||||
}, object_width = 112, last_request;
|
||||
|
||||
|
||||
PAGINATION.EL = $(PAGINATION.EL_ID);
|
||||
PAGINATION.GAP_EL = $('<span/>', {'class': 'gap', html: PAGINATION.GAP_TEXT})
|
||||
PAGINATION.PREV_EL = $('<a/>', {href: '#', rel: 'prev', html: PAGINATION.PREV_TEXT});
|
||||
PAGINATION.NEXT_EL = $('<a/>', {href: '#', rel: 'next', html: PAGINATION.NEXT_TEXT});
|
||||
|
||||
|
||||
$(PAGINATION.EL_ID + ' a').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
loadPage($(this).data('page'));
|
||||
});
|
||||
|
||||
|
||||
this.initialize = $.proxy(wardrobe.item_zone_sets, 'load');
|
||||
|
||||
|
||||
wardrobe.search.setPerPage(PAGINATION.PER_PAGE);
|
||||
|
||||
|
||||
function updatePerPage() {
|
||||
var new_per_page = Math.floor(form.width() / object_width),
|
||||
offset, new_page;
|
||||
|
@ -866,34 +875,34 @@ View.Search = function (wardrobe) {
|
|||
}
|
||||
$(window).resize(updatePerPage).load(updatePerPage);
|
||||
updatePerPage();
|
||||
|
||||
|
||||
function loadOffset(offset) {
|
||||
wardrobe.search.setItemsByQuery(input_el.val(), {offset: offset});
|
||||
}
|
||||
|
||||
|
||||
function loadPage(page) {
|
||||
wardrobe.search.setItemsByQuery(input_el.val(), {page: page});
|
||||
}
|
||||
|
||||
|
||||
function stopLoading() {
|
||||
loading_el.stop(true, true).hide();
|
||||
}
|
||||
|
||||
|
||||
form.submit(function (e) {
|
||||
e.preventDefault();
|
||||
loadPage(1);
|
||||
});
|
||||
|
||||
|
||||
clear_el.click(function (e) {
|
||||
e.preventDefault();
|
||||
input_el.val('');
|
||||
form.submit();
|
||||
});
|
||||
|
||||
|
||||
wardrobe.search.bind('startRequest', function () {
|
||||
loading_el.delay(1000).show('slow');
|
||||
});
|
||||
|
||||
|
||||
wardrobe.search.bind('updateItems', function (items) {
|
||||
var fit = $('#preview').data('fit') || $.noop;
|
||||
stopLoading();
|
||||
|
@ -908,7 +917,7 @@ View.Search = function (wardrobe) {
|
|||
form.toggleClass('has-results', items.length > 0);
|
||||
fit();
|
||||
});
|
||||
|
||||
|
||||
wardrobe.search.bind('updateRequest', function (request) {
|
||||
last_request = request;
|
||||
error_el.hide('fast');
|
||||
|
@ -918,37 +927,37 @@ View.Search = function (wardrobe) {
|
|||
no_results_span.text(request.query);
|
||||
clear_el.toggle(!!request.query);
|
||||
});
|
||||
|
||||
|
||||
wardrobe.search.bind('updatePagination', function (current_page, total_pages) {
|
||||
// ported from http://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers.rb#L274
|
||||
var window_from = current_page - PAGINATION.INNER_WINDOW,
|
||||
window_to = current_page + PAGINATION.INNER_WINDOW,
|
||||
visible = [], left_gap, right_gap, subtract_left, subtract_right,
|
||||
i = 1;
|
||||
|
||||
|
||||
if(window_to > total_pages) {
|
||||
window_from -= window_to - total_pages;
|
||||
window_to = total_pages;
|
||||
}
|
||||
|
||||
|
||||
if(window_from < 1) {
|
||||
window_to += 1 - window_from;
|
||||
window_from = 1;
|
||||
if(window_to > total_pages) window_to = total_pages;
|
||||
}
|
||||
|
||||
|
||||
left_gap = [2 + PAGINATION.OUTER_WINDOW, window_from];
|
||||
right_gap = [window_to + 1, total_pages - PAGINATION.OUTER_WINDOW];
|
||||
|
||||
|
||||
subtract_left = (left_gap[1] - left_gap[0]) > 1;
|
||||
subtract_right = (right_gap[1] - right_gap[0]) > 1;
|
||||
|
||||
|
||||
PAGINATION.EL.children().remove();
|
||||
|
||||
|
||||
if(current_page > 1) {
|
||||
PAGINATION.PREV_EL.clone().data('page', current_page - 1).appendTo(PAGINATION.EL);
|
||||
}
|
||||
|
||||
|
||||
while(i <= total_pages) {
|
||||
if(subtract_left && i >= left_gap[0] && i < left_gap[1]) {
|
||||
PAGINATION.GAP_EL.clone().appendTo(PAGINATION.EL);
|
||||
|
@ -965,17 +974,17 @@ View.Search = function (wardrobe) {
|
|||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(current_page < total_pages) {
|
||||
PAGINATION.NEXT_EL.clone().data('page', current_page + 1).appendTo(PAGINATION.EL);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
wardrobe.search.bind('error', function (error) {
|
||||
stopLoading();
|
||||
error_el.text(error).show('normal');
|
||||
});
|
||||
|
||||
|
||||
help_el.find('dt').each(function () {
|
||||
var el = $(this);
|
||||
if(!el.children().length) {
|
||||
|
@ -985,7 +994,7 @@ View.Search = function (wardrobe) {
|
|||
var el = $(this);
|
||||
el.replaceWith($('<a/>', {href: '#', text: el.text()}));
|
||||
});
|
||||
|
||||
|
||||
help_el.find('dt a').live('click', function (e) {
|
||||
var el = $(this), siblings = el.parent().children(), query;
|
||||
e.preventDefault();
|
||||
|
@ -1000,12 +1009,12 @@ View.Search = function (wardrobe) {
|
|||
input_el.val(query);
|
||||
form.submit();
|
||||
});
|
||||
|
||||
|
||||
$('select.search-helper').live('change', function () {
|
||||
var el = $(this), filter = el.attr('data-search-filter');
|
||||
$('select.search-helper[data-search-filter=' + filter + ']').val(el.val());
|
||||
});
|
||||
|
||||
|
||||
function prepBuildHelper(type, getSet) {
|
||||
return function (objs) {
|
||||
var select = $('<select/>',
|
||||
|
@ -1020,13 +1029,13 @@ View.Search = function (wardrobe) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getSpecies(x) { return x.species }
|
||||
|
||||
|
||||
wardrobe.item_zone_sets.bind('update', prepBuildHelper('type', function (x) {
|
||||
return x;
|
||||
}));
|
||||
|
||||
|
||||
wardrobe.pet_attributes.bind('update', prepBuildHelper('species', getSpecies));
|
||||
//wardrobe.pet_attributes.bind('update', prepBuildHelper('only', getSpecies));
|
||||
}
|
||||
|
@ -1059,3 +1068,4 @@ $.ajaxSetup({
|
|||
main_wardrobe = new Wardrobe();
|
||||
main_wardrobe.registerViews(View);
|
||||
main_wardrobe.initialize();
|
||||
|
||||
|
|
|
@ -61,13 +61,13 @@ DeepObject.prototype.deepSet = function () {
|
|||
|
||||
function Wardrobe() {
|
||||
var wardrobe = this, BiologyAsset, ItemAsset;
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Models
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function determineRestrictedZones() {
|
||||
var i, zone;
|
||||
this.restricted_zones = [];
|
||||
|
@ -75,7 +75,7 @@ function Wardrobe() {
|
|||
this.restricted_zones.push(zone);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Asset(data) {
|
||||
var asset = this;
|
||||
for(var key in data) {
|
||||
|
@ -84,37 +84,37 @@ function Wardrobe() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function BiologyAsset(data) {
|
||||
Asset.apply(this, [data]);
|
||||
determineRestrictedZones.apply(this);
|
||||
}
|
||||
|
||||
|
||||
function ItemAsset(data) {
|
||||
Asset.apply(this, [data]);
|
||||
}
|
||||
|
||||
|
||||
function Item(id) {
|
||||
var item = this;
|
||||
this.id = id;
|
||||
this.assets_by_body_id = {};
|
||||
this.load_started = false;
|
||||
this.loaded = false;
|
||||
|
||||
|
||||
this.getAssetsFitting = function (pet_type) {
|
||||
return this.assets_by_body_id[pet_type.body_id] || [];
|
||||
}
|
||||
|
||||
|
||||
this.hasAssetsFitting = function (pet_type) {
|
||||
return typeof item.assets_by_body_id[pet_type.body_id] != 'undefined' &&
|
||||
item.assets_by_body_id[pet_type.body_id].length > 0;
|
||||
}
|
||||
|
||||
|
||||
this.couldNotLoadAssetsFitting = function (pet_type) {
|
||||
return typeof item.assets_by_body_id[pet_type.body_id] != 'undefined' &&
|
||||
item.assets_by_body_id[pet_type.body_id].length == 0;
|
||||
}
|
||||
|
||||
|
||||
this.update = function (data) {
|
||||
for(var key in data) {
|
||||
if(data.hasOwnProperty(key) && key != 'id') { // do not replace ID with string
|
||||
|
@ -124,10 +124,10 @@ function Wardrobe() {
|
|||
determineRestrictedZones.apply(this);
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
|
||||
Item.cache[id] = this;
|
||||
}
|
||||
|
||||
|
||||
Item.find = function (id) {
|
||||
var item = Item.cache[id];
|
||||
if(!item) {
|
||||
|
@ -135,9 +135,9 @@ function Wardrobe() {
|
|||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
var item_load_callbacks = [];
|
||||
|
||||
|
||||
Item.loadByIds = function (ids, success) {
|
||||
var ids_to_load = [], ids_not_loaded = [], items = $.map(ids, function (id) {
|
||||
var item = Item.find(id);
|
||||
|
@ -180,9 +180,9 @@ function Wardrobe() {
|
|||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
Item.PER_PAGE = 21;
|
||||
|
||||
|
||||
Item.loadByQuery = function (query, offset, success, error) {
|
||||
var page = Math.round(offset / Item.PER_PAGE) + 1;
|
||||
$.getJSON('/items.json', {q: query, per_page: Item.PER_PAGE, page: page}, function (data) {
|
||||
|
@ -200,13 +200,13 @@ function Wardrobe() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Item.cache = {};
|
||||
|
||||
|
||||
function ItemZoneSet(name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
ItemZoneSet.loadAll = function (success) {
|
||||
$.getJSON('/item_zone_sets.json', function (data) {
|
||||
for(var i = 0, l = data.length; i < l; i++) {
|
||||
|
@ -215,19 +215,19 @@ function Wardrobe() {
|
|||
success(ItemZoneSet.all);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
ItemZoneSet.all = [];
|
||||
|
||||
|
||||
function Outfit(data) {
|
||||
var outfit = this, previous_pet_type, worn_item_ids = [],
|
||||
closet_item_ids = [], new_record = true;
|
||||
|
||||
|
||||
this.setWornAndUnwornItemIds = function (new_ids) {
|
||||
this.worn_and_unworn_item_ids = new_ids;
|
||||
worn_item_ids = new_ids.worn;
|
||||
closet_item_ids = new_ids.unworn.concat(new_ids.worn);
|
||||
}
|
||||
|
||||
|
||||
if(typeof data != 'undefined') {
|
||||
this.color_id = data.color_id;
|
||||
this.id = data.id;
|
||||
|
@ -238,27 +238,31 @@ function Wardrobe() {
|
|||
this.setWornAndUnwornItemIds(data.worn_and_unworn_item_ids);
|
||||
new_record = false;
|
||||
}
|
||||
|
||||
|
||||
this.closet_items = [];
|
||||
this.worn_items = [];
|
||||
|
||||
|
||||
this.anonymous = false;
|
||||
|
||||
this.getWornItemIds = function () { // TODO just expose the worn_item_ids
|
||||
return worn_item_ids;
|
||||
}
|
||||
|
||||
|
||||
this.getClosetItemIds = function () { // TODO just expose the closet_item_ids
|
||||
return closet_item_ids;
|
||||
}
|
||||
|
||||
|
||||
function getAttributes() {
|
||||
var outfit_data = {};
|
||||
outfit_data.name = outfit.name;
|
||||
outfit_data.starred = outfit.starred;
|
||||
outfit_data.worn_and_unworn_item_ids = outfit.getWornAndUnwornItemIds();
|
||||
if(outfit.pet_state) outfit_data.pet_state_id = outfit.pet_state.id;
|
||||
outfit_data.anonymous = outfit.anonymous;
|
||||
console.log(outfit.anonymous, outfit_data);
|
||||
return outfit_data;
|
||||
}
|
||||
|
||||
|
||||
function getRestrictedZones() {
|
||||
// note: may contain duplicates - loop through assets, not these, for
|
||||
// best performance
|
||||
|
@ -269,15 +273,15 @@ function Wardrobe() {
|
|||
});
|
||||
return restricted_zones;
|
||||
}
|
||||
|
||||
|
||||
function hasItemInCloset(item) {
|
||||
return $.inArray(item, outfit.closet_items) != -1;
|
||||
}
|
||||
|
||||
|
||||
function isWearingItem(item) {
|
||||
return $.inArray(item, outfit.worn_items) != -1;
|
||||
}
|
||||
|
||||
|
||||
function itemAssetsOnLoad(added_item, updateItemsCallback, updateItemAssetsCallback) {
|
||||
var item_zones, item_zones_length, existing_item, existing_item_zones, passed,
|
||||
new_items = [], new_worn_item_ids = [];
|
||||
|
@ -308,7 +312,7 @@ function Wardrobe() {
|
|||
}
|
||||
updateItemAssetsCallback();
|
||||
}
|
||||
|
||||
|
||||
function petTypeOnLoad(pet_type, petTypeLoadedCallback, updatePetStateCallback, updateItemsCallback, updateItemAssetsCallback) {
|
||||
if(!outfit.pet_state || !pet_type.ownsPetState(outfit.pet_state)) {
|
||||
outfit.setPetStateById(null, updatePetStateCallback);
|
||||
|
@ -316,7 +320,7 @@ function Wardrobe() {
|
|||
petTypeLoadedCallback(pet_type);
|
||||
updateItemAssets(null, updateItemsCallback, updateItemAssetsCallback);
|
||||
}
|
||||
|
||||
|
||||
function updateItemAssets(added_item, updateItemsCallback, updateItemAssetsCallback) {
|
||||
if(outfit.pet_type && outfit.pet_type.loaded && worn_item_ids.length) {
|
||||
outfit.pet_type.loadItemAssets(worn_item_ids, function () {
|
||||
|
@ -324,7 +328,7 @@ function Wardrobe() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sendUpdate(outfit_data, success, failure) {
|
||||
$.ajax({
|
||||
url: '/outfits/' + outfit.id,
|
||||
|
@ -341,7 +345,7 @@ function Wardrobe() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.closetItem = function (item, updateClosetItemsCallback) {
|
||||
if(!hasItemInCloset(item)) {
|
||||
this.closet_items.push(item);
|
||||
|
@ -349,14 +353,14 @@ function Wardrobe() {
|
|||
updateClosetItemsCallback(this.closet_items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.getPetStateId = function () {
|
||||
if(typeof outfit.pet_state_id === 'undefined') {
|
||||
outfit.pet_state_id = outfit.pet_state.id;
|
||||
}
|
||||
return outfit.pet_state_id;
|
||||
}
|
||||
|
||||
|
||||
this.getVisibleAssets = function () {
|
||||
var assets = this.pet_state.assets, restricted_zones = getRestrictedZones(),
|
||||
visible_assets = [];
|
||||
|
@ -370,11 +374,11 @@ function Wardrobe() {
|
|||
});
|
||||
return visible_assets;
|
||||
}
|
||||
|
||||
|
||||
this.rename = function (new_name, success, failure) {
|
||||
this.updateAttributes({name: new_name}, success, failure);
|
||||
}
|
||||
|
||||
|
||||
this.setClosetItemsByIds = function (ids, updateItemsCallback) {
|
||||
if(ids) closet_item_ids = ids;
|
||||
if(ids && ids.length) {
|
||||
|
@ -387,7 +391,7 @@ function Wardrobe() {
|
|||
updateItemsCallback(this.closet_items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.setPetStateById = function (id, petStateOnLoad) {
|
||||
if(!id && this.pet_type) {
|
||||
id = this.pet_type.pet_state_ids[0];
|
||||
|
@ -398,7 +402,7 @@ function Wardrobe() {
|
|||
this.pet_state.loadAssets(petStateOnLoad);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.setPetTypeByColorAndSpecies = function (color_id, species_id, updatePetTypeCallback, petTypeLoadedCallback, petTypeNotFoundCallback, updatePetStateCallback, updateItemsCallback, updateItemAssetsCallback) {
|
||||
this.pet_type = PetType.findOrCreateByColorAndSpecies(color_id, species_id);
|
||||
this.color_id = color_id;
|
||||
|
@ -406,7 +410,7 @@ function Wardrobe() {
|
|||
updatePetTypeCallback(this.pet_type);
|
||||
this.pet_type.load(function (pet_type) { petTypeOnLoad(pet_type, petTypeLoadedCallback, updatePetStateCallback, updateItemsCallback, updateItemAssetsCallback) }, petTypeNotFoundCallback);
|
||||
}
|
||||
|
||||
|
||||
this.setWornItemsByIds = function (ids, updateItemsCallback, updateItemAssetsCallback) {
|
||||
if(ids) worn_item_ids = ids;
|
||||
if(ids && ids.length) {
|
||||
|
@ -417,11 +421,11 @@ function Wardrobe() {
|
|||
}
|
||||
updateItemAssets(null, updateItemsCallback, updateItemAssetsCallback);
|
||||
}
|
||||
|
||||
|
||||
this.toggleStar = function (success) {
|
||||
this.updateAttributes({starred: !outfit.starred}, success);
|
||||
}
|
||||
|
||||
|
||||
this.unclosetItem = function (item, updateClosetItemsCallback, updateWornItemsCallback) {
|
||||
var i = $.inArray(item, this.closet_items), id_i;
|
||||
if(i != -1) {
|
||||
|
@ -432,7 +436,7 @@ function Wardrobe() {
|
|||
this.unwearItem(item, updateWornItemsCallback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.unwearItem = function (item, updateWornItemsCallback) {
|
||||
var i = $.inArray(item, this.worn_items), id_i;
|
||||
if(i != -1) {
|
||||
|
@ -442,11 +446,11 @@ function Wardrobe() {
|
|||
updateWornItemsCallback(this.worn_items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.update = function (success, failure) {
|
||||
sendUpdate(getAttributes(), success, failure);
|
||||
}
|
||||
|
||||
|
||||
this.wearItem = function (item, updateWornItemsCallback, updateClosetItemsCallback, updateItemAssetsCallback) {
|
||||
if(!isWearingItem(item)) {
|
||||
this.worn_items.push(item);
|
||||
|
@ -458,7 +462,7 @@ function Wardrobe() {
|
|||
updateWornItemsCallback(this.worn_items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.getWornAndUnwornItemIds = function () {
|
||||
var unworn_item_ids = [], id;
|
||||
for(var i = 0; i < closet_item_ids.length; i++) {
|
||||
|
@ -470,7 +474,7 @@ function Wardrobe() {
|
|||
outfit.worn_and_unworn_item_ids = {worn: worn_item_ids, unworn: unworn_item_ids};
|
||||
return outfit.worn_and_unworn_item_ids;
|
||||
}
|
||||
|
||||
|
||||
this.clone = function () {
|
||||
var new_outfit = new Outfit;
|
||||
new_outfit.cloneAttributesFrom(outfit);
|
||||
|
@ -479,7 +483,7 @@ function Wardrobe() {
|
|||
new_outfit.starred = outfit.starred;
|
||||
return new_outfit;
|
||||
}
|
||||
|
||||
|
||||
this.cloneAttributesFrom = function (base_outfit) {
|
||||
var base_ids = base_outfit.getWornAndUnwornItemIds(),
|
||||
new_ids = {};
|
||||
|
@ -494,7 +498,7 @@ function Wardrobe() {
|
|||
new_ids.unworn = base_ids.unworn.slice(0);
|
||||
outfit.setWornAndUnwornItemIds(new_ids);
|
||||
}
|
||||
|
||||
|
||||
this.destroy = function (success) {
|
||||
$.ajax({
|
||||
url: '/outfits/' + outfit.id + '.json',
|
||||
|
@ -503,7 +507,7 @@ function Wardrobe() {
|
|||
success: function () { success(outfit) }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.create = function (success, error) {
|
||||
$.ajax({
|
||||
url: '/outfits',
|
||||
|
@ -520,7 +524,7 @@ function Wardrobe() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.updateAttributes = function (attributes, success, failure) {
|
||||
var outfit_data = {};
|
||||
for(var key in attributes) {
|
||||
|
@ -531,9 +535,9 @@ function Wardrobe() {
|
|||
sendUpdate(outfit_data, success, failure);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Outfit.cache = {};
|
||||
|
||||
|
||||
Outfit.find = function (id, callback) {
|
||||
if(typeof Outfit.cache[id] !== 'undefined') {
|
||||
callback(Outfit.cache[id]);
|
||||
|
@ -551,7 +555,7 @@ function Wardrobe() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Outfit.loadForCurrentUser = function (success) {
|
||||
var outfits = [];
|
||||
$.getJSON('/users/current-user/outfits.json', function (data) {
|
||||
|
@ -565,21 +569,21 @@ function Wardrobe() {
|
|||
success(outfits);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function PetAttribute() {}
|
||||
|
||||
|
||||
PetAttribute.loadAll = function (success) {
|
||||
$.getJSON('/pet_attributes.json', function (data) {
|
||||
success(data);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function PetState(id) {
|
||||
var pet_state = this, loaded = false;
|
||||
|
||||
|
||||
this.id = id;
|
||||
this.assets = [];
|
||||
|
||||
|
||||
this.loadAssets = function (success) {
|
||||
var params;
|
||||
if(loaded) {
|
||||
|
@ -593,10 +597,10 @@ function Wardrobe() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PetState.cache[id] = this;
|
||||
}
|
||||
|
||||
|
||||
PetState.find = function (id) {
|
||||
var pet_state = PetState.cache[id];
|
||||
if(!pet_state) {
|
||||
|
@ -604,12 +608,12 @@ function Wardrobe() {
|
|||
}
|
||||
return pet_state;
|
||||
}
|
||||
|
||||
|
||||
PetState.cache = {};
|
||||
|
||||
|
||||
function PetType() {
|
||||
var pet_type = this;
|
||||
|
||||
|
||||
this.loaded = false;
|
||||
this.pet_states = [];
|
||||
|
||||
|
@ -642,7 +646,7 @@ function Wardrobe() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.loadItemAssets = function (item_ids, success) {
|
||||
var item_ids_needed = [];
|
||||
for(var i = 0; i < item_ids.length; i++) {
|
||||
|
@ -674,12 +678,12 @@ function Wardrobe() {
|
|||
success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.toString = function () {
|
||||
return 'PetType{color_id: ' + this.color_id + ', species_id: ' +
|
||||
this.species_id + '}';
|
||||
}
|
||||
|
||||
|
||||
this.ownsPetState = function (pet_state) {
|
||||
for(var i = 0; i < this.pet_states.length; i++) {
|
||||
if(this.pet_states[i] == pet_state) return true;
|
||||
|
@ -687,9 +691,9 @@ function Wardrobe() {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PetType.cache_by_color_and_species = new DeepObject();
|
||||
|
||||
|
||||
PetType.findOrCreateByColorAndSpecies = function (color_id, species_id) {
|
||||
var pet_type = PetType.cache_by_color_and_species.deepGet(color_id, species_id);
|
||||
if(!pet_type) {
|
||||
|
@ -699,19 +703,19 @@ function Wardrobe() {
|
|||
}
|
||||
return pet_type;
|
||||
}
|
||||
|
||||
|
||||
function SwfAsset() {}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Controllers
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function Controller() {
|
||||
var controller = this;
|
||||
this.events = {};
|
||||
|
||||
|
||||
function fireEvent(event_name, subarguments) {
|
||||
var events = controller.events[event_name];
|
||||
if(typeof events !== 'undefined') {
|
||||
|
@ -720,20 +724,20 @@ function Wardrobe() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.bind = function (event, callback) {
|
||||
if(typeof this.events[event] == 'undefined') {
|
||||
this.events[event] = [];
|
||||
}
|
||||
this.events[event].push(callback);
|
||||
}
|
||||
|
||||
|
||||
this.event = function (event_name) {
|
||||
return function () {
|
||||
fireEvent(event_name, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.events.trigger = function (event_name) {
|
||||
var subarguments, event;
|
||||
if(controller.events[event_name]) {
|
||||
|
@ -742,14 +746,14 @@ function Wardrobe() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Controller.all = {};
|
||||
|
||||
|
||||
Controller.all.Outfit = function OutfitController() {
|
||||
var controller = this, outfit = new Outfit;
|
||||
|
||||
|
||||
this.in_transaction = false;
|
||||
|
||||
|
||||
function setFullOutfit(new_outfit) {
|
||||
outfit = new_outfit;
|
||||
controller.in_transaction = true;
|
||||
|
@ -761,57 +765,57 @@ function Wardrobe() {
|
|||
controller.in_transaction = false;
|
||||
controller.events.trigger('loadOutfit', outfit);
|
||||
}
|
||||
|
||||
|
||||
function setOutfitIdentity(new_outfit) {
|
||||
new_outfit.cloneAttributesFrom(outfit);
|
||||
outfit = new_outfit;
|
||||
}
|
||||
|
||||
|
||||
this.closetItem = function (item) {
|
||||
outfit.closetItem(
|
||||
item,
|
||||
controller.event('updateClosetItems')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.getClosetItems = function () {
|
||||
return outfit.closet_items;
|
||||
}
|
||||
|
||||
|
||||
this.getId = function () {
|
||||
return outfit.id;
|
||||
}
|
||||
|
||||
|
||||
this.getOutfit = function () {
|
||||
return outfit;
|
||||
}
|
||||
|
||||
|
||||
this.getPetState = function () {
|
||||
return outfit.pet_state;
|
||||
}
|
||||
|
||||
|
||||
this.getPetType = function () {
|
||||
return outfit.pet_type;
|
||||
}
|
||||
|
||||
|
||||
this.getVisibleAssets = function () {
|
||||
return outfit.getVisibleAssets();
|
||||
}
|
||||
|
||||
|
||||
this.getWornItems = function () {
|
||||
return outfit.worn_items;
|
||||
}
|
||||
|
||||
|
||||
this.load = function (new_outfit_id) {
|
||||
Outfit.find(new_outfit_id, function (new_outfit) {
|
||||
setFullOutfit(new_outfit.clone());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.loadData = function (new_outfit_data) {
|
||||
setFullOutfit(new Outfit(new_outfit_data));
|
||||
}
|
||||
|
||||
|
||||
this.create = function (attributes) {
|
||||
if(attributes) {
|
||||
outfit.starred = attributes.starred;
|
||||
|
@ -826,14 +830,14 @@ function Wardrobe() {
|
|||
controller.event('saveFailure')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.setClosetItemsByIds = function (item_ids) {
|
||||
outfit.setClosetItemsByIds(
|
||||
item_ids,
|
||||
controller.event('updateClosetItems')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.setId = function (outfit_id) {
|
||||
// Note that this does not load the outfit, but only sets the ID of the
|
||||
// outfit we're supposedly working with. This allows the hash to contain
|
||||
|
@ -852,11 +856,11 @@ function Wardrobe() {
|
|||
controller.events.trigger('setOutfit', outfit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.setPetStateById = function (pet_state_id) {
|
||||
outfit.setPetStateById(pet_state_id, controller.event('updatePetState'));
|
||||
}
|
||||
|
||||
|
||||
this.setPetTypeByColorAndSpecies = function(color_id, species_id) {
|
||||
outfit.setPetTypeByColorAndSpecies(color_id, species_id,
|
||||
controller.event('updatePetType'),
|
||||
|
@ -867,7 +871,7 @@ function Wardrobe() {
|
|||
controller.event('updateItemAssets')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.setWornItemsByIds = function (item_ids) {
|
||||
outfit.setWornItemsByIds(
|
||||
item_ids,
|
||||
|
@ -875,15 +879,16 @@ function Wardrobe() {
|
|||
controller.event('updateItemAssets')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.share = function () {
|
||||
var sharedOutfit = outfit.clone();
|
||||
sharedOutfit.anonymous = true;
|
||||
sharedOutfit.create(
|
||||
controller.event('shareSuccess'),
|
||||
controller.event('shareFailure')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.unclosetItem = function (item) {
|
||||
outfit.unclosetItem(
|
||||
item,
|
||||
|
@ -891,11 +896,11 @@ function Wardrobe() {
|
|||
controller.event('updateWornItems')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.unwearItem = function (item) {
|
||||
outfit.unwearItem(item, controller.event('updateWornItems'));
|
||||
}
|
||||
|
||||
|
||||
this.update = function () {
|
||||
outfit.update(
|
||||
function (outfit) {
|
||||
|
@ -905,7 +910,7 @@ function Wardrobe() {
|
|||
controller.event('saveFailure')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
this.wearItem = function (item) {
|
||||
outfit.wearItem(
|
||||
item,
|
||||
|
@ -915,54 +920,54 @@ function Wardrobe() {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Controller.all.BasePet = function BasePetController() {
|
||||
var base_pet = this;
|
||||
|
||||
|
||||
this.setName = function (name) {
|
||||
base_pet.name = name;
|
||||
base_pet.events.trigger('updateName', name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Controller.all.PetAttributes = function PetAttributesController() {
|
||||
var pet_attributes = this;
|
||||
|
||||
|
||||
function onLoad(attributes) {
|
||||
pet_attributes.events.trigger('update', attributes);
|
||||
}
|
||||
|
||||
|
||||
this.load = function () {
|
||||
PetAttribute.loadAll(onLoad);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Controller.all.ItemZoneSets = function ItemZoneSetsController() {
|
||||
var item_zone_sets = this;
|
||||
|
||||
|
||||
function onLoad(sets) {
|
||||
item_zone_sets.events.trigger('update', sets);
|
||||
}
|
||||
|
||||
|
||||
this.load = function () {
|
||||
ItemZoneSet.loadAll(onLoad);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Controller.all.Search = function SearchController() {
|
||||
var search = this;
|
||||
|
||||
|
||||
this.request = {};
|
||||
|
||||
|
||||
function itemsOnLoad(items, total_pages, page) {
|
||||
search.events.trigger('updateItems', items);
|
||||
search.events.trigger('updatePagination', page, total_pages);
|
||||
}
|
||||
|
||||
|
||||
function itemsOnError(error) {
|
||||
search.events.trigger('error', error);
|
||||
}
|
||||
|
||||
|
||||
this.setItemsByQuery = function (query, where) {
|
||||
var offset = (typeof where.offset != 'undefined') ? where.offset : (Item.PER_PAGE * (where.page - 1));
|
||||
search.request = {
|
||||
|
@ -978,15 +983,15 @@ function Wardrobe() {
|
|||
search.events.trigger('updatePagination', 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.setPerPage = function (per_page) {
|
||||
Item.PER_PAGE = per_page;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Controller.all.User = function UserController() {
|
||||
var controller = this, outfits = [], outfits_loaded = false;
|
||||
|
||||
|
||||
function compareOutfits(a, b) {
|
||||
if(a.starred) {
|
||||
if(!b.starred) return -1;
|
||||
|
@ -997,7 +1002,7 @@ function Wardrobe() {
|
|||
else if(a.name == b.name) return 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
|
||||
function insertOutfit(outfit) {
|
||||
for(var i = 0; i < outfits.length; i++) {
|
||||
if(compareOutfits(outfit, outfits[i]) < 0) {
|
||||
|
@ -1009,11 +1014,11 @@ function Wardrobe() {
|
|||
controller.events.trigger('addOutfit', outfit, outfits.length);
|
||||
outfits.push(outfit);
|
||||
}
|
||||
|
||||
|
||||
function sortOutfits(outfits) {
|
||||
outfits.sort(compareOutfits);
|
||||
}
|
||||
|
||||
|
||||
function yankOutfit(outfit) {
|
||||
var i;
|
||||
for(i = 0; i < outfits.length; i++) {
|
||||
|
@ -1024,15 +1029,15 @@ function Wardrobe() {
|
|||
}
|
||||
controller.events.trigger('removeOutfit', outfit, i);
|
||||
}
|
||||
|
||||
|
||||
this.addOutfit = insertOutfit;
|
||||
|
||||
|
||||
this.destroyOutfit = function (outfit) {
|
||||
outfit.destroy(function () {
|
||||
yankOutfit(outfit);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.loadOutfits = function () {
|
||||
if(!outfits_loaded) {
|
||||
Outfit.loadForCurrentUser(function (new_outfits) {
|
||||
|
@ -1043,7 +1048,7 @@ function Wardrobe() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.renameOutfit = function (outfit, new_name) {
|
||||
var old_name = outfit.name;
|
||||
outfit.rename(new_name, function () {
|
||||
|
@ -1055,7 +1060,7 @@ function Wardrobe() {
|
|||
controller.events.trigger('saveFailure', outfit_copy, response);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.toggleOutfitStar = function (outfit) {
|
||||
outfit.toggleStar(function () {
|
||||
yankOutfit(outfit);
|
||||
|
@ -1063,7 +1068,7 @@ function Wardrobe() {
|
|||
controller.events.trigger('outfitStarToggled', outfit);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.updateOutfit = function (outfit) {
|
||||
for(var i = 0; i < outfits.length; i++) {
|
||||
if(outfits[i].id == outfit.id) {
|
||||
|
@ -1086,7 +1091,7 @@ function Wardrobe() {
|
|||
Controller.apply(wardrobe[underscored_name]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.initialize = function () {
|
||||
var view;
|
||||
for(var name in wardrobe.views) {
|
||||
|
@ -1098,7 +1103,7 @@ function Wardrobe() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.registerViews = function (views) {
|
||||
wardrobe.views = {};
|
||||
$.each(views, function (name) {
|
||||
|
@ -1113,7 +1118,7 @@ Wardrobe.StandardPreview = {
|
|||
|
||||
Wardrobe.getStandardView = function (options) {
|
||||
var StandardView = {};
|
||||
|
||||
|
||||
function requireKeys() {
|
||||
var key, key_stack = [], scope = options;
|
||||
for(var i = 0; i < arguments.length; i++) {
|
||||
|
@ -1125,21 +1130,21 @@ Wardrobe.getStandardView = function (options) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
requireKeys('Preview', 'swf_url');
|
||||
requireKeys('Preview', 'wrapper');
|
||||
requireKeys('Preview', 'placeholder');
|
||||
|
||||
|
||||
if(document.location.search.substr(0, 6) == '?debug') {
|
||||
StandardView.Console = function (wardrobe) {
|
||||
if(typeof console != 'undefined' && typeof console.log == 'function') {
|
||||
window.log = $.proxy(console, 'log');
|
||||
}
|
||||
|
||||
|
||||
this.initialize = function () {
|
||||
log('Welcome to the Wardrobe!');
|
||||
}
|
||||
|
||||
|
||||
var outfit_events = ['updateWornItems', 'updateClosetItems', 'updateItemAssets', 'updatePetType', 'updatePetState'];
|
||||
for(var i = 0; i < outfit_events.length; i++) {
|
||||
(function (event) {
|
||||
|
@ -1148,7 +1153,7 @@ Wardrobe.getStandardView = function (options) {
|
|||
});
|
||||
})(outfit_events[i]);
|
||||
}
|
||||
|
||||
|
||||
wardrobe.outfit.bind('petTypeNotFound', function (pet_type) {
|
||||
log(pet_type.toString() + ' not found');
|
||||
});
|
||||
|
@ -1161,7 +1166,7 @@ Wardrobe.getStandardView = function (options) {
|
|||
preview_swf_id = preview_swf_placeholder.attr('id'),
|
||||
preview_swf,
|
||||
update_pending_flash = false;
|
||||
|
||||
|
||||
swfobject.embedSWF(
|
||||
options.Preview.swf_url,
|
||||
preview_swf_id,
|
||||
|
@ -1172,9 +1177,9 @@ Wardrobe.getStandardView = function (options) {
|
|||
{'id': preview_swf_id},
|
||||
{'wmode': 'transparent'}
|
||||
);
|
||||
|
||||
|
||||
Wardrobe.StandardPreview.views_by_swf_id[preview_swf_id] = this;
|
||||
|
||||
|
||||
this.previewSWFIsReady = function () {
|
||||
preview_swf = document.getElementById(preview_swf_id);
|
||||
if(update_pending_flash) {
|
||||
|
@ -1182,7 +1187,7 @@ Wardrobe.getStandardView = function (options) {
|
|||
updateAssets();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateAssets() {
|
||||
var assets, assets_for_swf;
|
||||
if(update_pending_flash) return false;
|
||||
|
@ -1193,15 +1198,16 @@ Wardrobe.getStandardView = function (options) {
|
|||
update_pending_flash = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wardrobe.outfit.bind('updateWornItems', updateAssets);
|
||||
wardrobe.outfit.bind('updateItemAssets', updateAssets);
|
||||
wardrobe.outfit.bind('updatePetState', updateAssets);
|
||||
}
|
||||
|
||||
|
||||
window.previewSWFIsReady = function (id) {
|
||||
Wardrobe.StandardPreview.views_by_swf_id[id].previewSWFIsReady();
|
||||
}
|
||||
|
||||
|
||||
return StandardView;
|
||||
}
|
||||
|
||||
|
|
|
@ -844,42 +844,46 @@ body.outfits-edit #save-outfit-wrapper button {
|
|||
display: none;
|
||||
}
|
||||
/* line 133, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit-wrapper #share-outfit {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 135, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit-wrapper.loading {
|
||||
background-image: url('/images/loading.gif?1296599919');
|
||||
background-position: left center;
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 20px;
|
||||
}
|
||||
/* line 139, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit, body.outfits-edit #share-outfit, body.outfits-edit #save-outfit-not-signed-in, body.outfits-edit #save-current-outfit, body.outfits-edit #save-outfit-copy, body.outfits-edit #save-outfit-finish {
|
||||
/* line 141, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit, body.outfits-edit #save-outfit-not-signed-in, body.outfits-edit #save-current-outfit, body.outfits-edit #save-outfit-copy, body.outfits-edit #save-outfit-finish {
|
||||
background: #ff5c00 url('/images/alert-overlay.png?1296599919') repeat-x;
|
||||
}
|
||||
/* line 34, ../../../app/stylesheets/partials/clean/_mixins.sass */
|
||||
body.outfits-edit #save-outfit:hover, body.outfits-edit #share-outfit:hover, body.outfits-edit #save-outfit-not-signed-in:hover, body.outfits-edit #save-current-outfit:hover, body.outfits-edit #save-outfit-copy:hover, body.outfits-edit #save-outfit-finish:hover {
|
||||
body.outfits-edit #save-outfit:hover, body.outfits-edit #save-outfit-not-signed-in:hover, body.outfits-edit #save-current-outfit:hover, body.outfits-edit #save-outfit-copy:hover, body.outfits-edit #save-outfit-finish:hover {
|
||||
background-color: #ee4b00;
|
||||
}
|
||||
/* line 141, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #current-outfit-permalink {
|
||||
/* line 143, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #current-outfit-permalink, body.outfits-edit #shared-outfit-permalink {
|
||||
display: none;
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
/* line 144, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #current-outfit-permalink img {
|
||||
/* line 146, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #current-outfit-permalink img, body.outfits-edit #shared-outfit-permalink img {
|
||||
bottom: -2px;
|
||||
height: 16px;
|
||||
position: relative;
|
||||
width: 16px;
|
||||
}
|
||||
/* line 146, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #current-outfit-url {
|
||||
/* line 148, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #shared-outfit-url {
|
||||
display: none;
|
||||
width: 15em;
|
||||
}
|
||||
/* line 149, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 151, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview {
|
||||
clear: both;
|
||||
}
|
||||
/* line 151, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 153, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-swf {
|
||||
float: left;
|
||||
height: 400px;
|
||||
|
@ -887,7 +891,7 @@ body.outfits-edit #preview-swf {
|
|||
position: relative;
|
||||
width: 400px;
|
||||
}
|
||||
/* line 157, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 159, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-swf-overlay {
|
||||
-moz-opacity: 0;
|
||||
-webkit-opacity: 0;
|
||||
|
@ -900,7 +904,7 @@ body.outfits-edit #preview-swf-overlay {
|
|||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
/* line 165, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 167, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar {
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
|
@ -912,73 +916,73 @@ body.outfits-edit #preview-sidebar {
|
|||
overflow: auto;
|
||||
width: 378px;
|
||||
}
|
||||
/* line 175, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 177, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar.viewing-outfits #preview-closet {
|
||||
display: none;
|
||||
}
|
||||
/* line 177, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 179, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar.viewing-outfits #preview-outfits {
|
||||
display: block;
|
||||
}
|
||||
/* line 179, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 181, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar.viewing-saving-outfit {
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
/* line 182, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 184, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar.viewing-saving-outfit #preview-closet {
|
||||
display: none;
|
||||
}
|
||||
/* line 184, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 186, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar.viewing-saving-outfit #preview-saving-outfit {
|
||||
display: block;
|
||||
}
|
||||
/* line 187, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 189, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar .sidebar-view h2 {
|
||||
margin-bottom: 0.25em;
|
||||
margin-left: 24px;
|
||||
}
|
||||
/* line 192, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 194, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet h2 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
/* line 194, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 196, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet ul {
|
||||
text-align: center;
|
||||
}
|
||||
/* line 196, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 198, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet .object {
|
||||
background: #eeffee;
|
||||
}
|
||||
/* line 198, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 200, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet .object img {
|
||||
-moz-opacity: 0.5;
|
||||
-webkit-opacity: 0.5;
|
||||
-o-opacity: 0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
}
|
||||
/* line 200, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 202, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet .object.worn {
|
||||
background: transparent;
|
||||
}
|
||||
/* line 202, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 204, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet .object.worn img {
|
||||
-moz-opacity: 1;
|
||||
-webkit-opacity: 1;
|
||||
-o-opacity: 1;
|
||||
-khtml-opacity: 1;
|
||||
}
|
||||
/* line 204, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 206, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet .object.no-assets {
|
||||
background: #fbe3e4;
|
||||
color: #8a1f11;
|
||||
padding-bottom: 1.25em;
|
||||
}
|
||||
/* line 208, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 210, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-closet .object.no-assets .no-assets-message {
|
||||
display: block;
|
||||
}
|
||||
/* line 210, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 212, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .no-assets-message {
|
||||
background: #f3dbdc;
|
||||
bottom: 0;
|
||||
|
@ -990,7 +994,7 @@ body.outfits-edit .no-assets-message {
|
|||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
/* line 220, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 222, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #no-assets-full-message {
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
|
@ -1004,12 +1008,12 @@ body.outfits-edit #no-assets-full-message {
|
|||
top: -9999px;
|
||||
width: 30em;
|
||||
}
|
||||
/* line 231, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 233, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form {
|
||||
clear: both;
|
||||
text-align: left;
|
||||
}
|
||||
/* line 234, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 236, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form h2 {
|
||||
display: -moz-inline-box;
|
||||
-moz-box-orient: vertical;
|
||||
|
@ -1019,7 +1023,7 @@ body.outfits-edit #preview-search-form h2 {
|
|||
*vertical-align: auto;
|
||||
margin: 0 1em 0 0;
|
||||
}
|
||||
/* line 237, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 239, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form input {
|
||||
display: -moz-inline-box;
|
||||
-moz-box-orient: vertical;
|
||||
|
@ -1028,7 +1032,7 @@ body.outfits-edit #preview-search-form input {
|
|||
*display: inline;
|
||||
*vertical-align: auto;
|
||||
}
|
||||
/* line 239, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 241, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-pagination {
|
||||
display: -moz-inline-box;
|
||||
-moz-box-orient: vertical;
|
||||
|
@ -1038,53 +1042,53 @@ body.outfits-edit #preview-search-form-pagination {
|
|||
*vertical-align: auto;
|
||||
margin-left: 2em;
|
||||
}
|
||||
/* line 242, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 244, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-pagination a, body.outfits-edit #preview-search-form-pagination span {
|
||||
margin: 0 0.25em;
|
||||
}
|
||||
/* line 244, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 246, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-pagination .current {
|
||||
font-weight: bold;
|
||||
}
|
||||
/* line 246, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 248, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-clear {
|
||||
display: none;
|
||||
font-size: 87.5%;
|
||||
margin-left: 2em;
|
||||
}
|
||||
/* line 250, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 252, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-loading {
|
||||
display: none;
|
||||
font-size: 75%;
|
||||
font-style: italic;
|
||||
margin-left: 2em;
|
||||
}
|
||||
/* line 256, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 258, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-no-results {
|
||||
display: none;
|
||||
}
|
||||
/* line 258, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 260, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-help {
|
||||
font-size: 87.5%;
|
||||
margin-left: 2em;
|
||||
}
|
||||
/* line 261, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 263, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .search-helper {
|
||||
font-family: inherit;
|
||||
}
|
||||
/* line 263, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 265, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .possible-error {
|
||||
display: none;
|
||||
}
|
||||
/* line 266, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 268, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #fullscreen-copyright {
|
||||
display: none;
|
||||
}
|
||||
/* line 268, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 270, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen {
|
||||
height: 100%;
|
||||
}
|
||||
/* line 271, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 273, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #container {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
|
@ -1097,19 +1101,19 @@ body.outfits-edit.fullscreen #container {
|
|||
position: relative;
|
||||
width: 80%;
|
||||
}
|
||||
/* line 279, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 281, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen h1 {
|
||||
display: none;
|
||||
}
|
||||
/* line 281, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 283, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #short-url-response {
|
||||
position: static;
|
||||
}
|
||||
/* line 283, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 285, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #preview {
|
||||
width: 100%;
|
||||
}
|
||||
/* line 285, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 287, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #preview-sidebar {
|
||||
float: right;
|
||||
height: 100%;
|
||||
|
@ -1117,12 +1121,12 @@ body.outfits-edit.fullscreen #preview-sidebar {
|
|||
position: relative;
|
||||
width: 400px;
|
||||
}
|
||||
/* line 291, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 293, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #preview-sidebar.viewing-saving-outfit {
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
/* line 294, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 296, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #preview-search-form {
|
||||
bottom: 1.5em;
|
||||
left: 0;
|
||||
|
@ -1131,7 +1135,7 @@ body.outfits-edit.fullscreen #preview-search-form {
|
|||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
/* line 302, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 304, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #preview-search-form-help div {
|
||||
display: -moz-inline-box;
|
||||
-moz-box-orient: vertical;
|
||||
|
@ -1141,27 +1145,27 @@ body.outfits-edit.fullscreen #preview-search-form-help div {
|
|||
*vertical-align: auto;
|
||||
width: 48%;
|
||||
}
|
||||
/* line 305, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 307, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #footer {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
/* line 310, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 312, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #footer ul, body.outfits-edit.fullscreen #footer p, body.outfits-edit.fullscreen #footer li {
|
||||
display: inline;
|
||||
}
|
||||
/* line 312, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 314, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.fullscreen #footer ul {
|
||||
margin-right: 2em;
|
||||
}
|
||||
/* line 315, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 317, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object {
|
||||
padding: 6px;
|
||||
position: relative;
|
||||
}
|
||||
/* line 318, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 320, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object ul {
|
||||
display: none;
|
||||
left: 0;
|
||||
|
@ -1169,11 +1173,11 @@ body.outfits-edit .object ul {
|
|||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
/* line 324, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 326, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object ul li {
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
/* line 326, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 328, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object ul li a {
|
||||
/* http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html */
|
||||
-moz-border-radius: 5px;
|
||||
|
@ -1214,11 +1218,11 @@ body.outfits-edit .object ul li a:active {
|
|||
body.outfits-edit .object ul li a:hover {
|
||||
background-color: #999999;
|
||||
}
|
||||
/* line 332, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 334, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object:hover ul, body.outfits-edit .object:hover .object-info {
|
||||
display: block;
|
||||
}
|
||||
/* line 339, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 341, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .nc-icon {
|
||||
background: url('/images/nc.png?1296599919') no-repeat;
|
||||
height: 16px;
|
||||
|
@ -1228,14 +1232,14 @@ body.outfits-edit .nc-icon {
|
|||
top: 64px;
|
||||
width: 16px;
|
||||
}
|
||||
/* line 347, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 349, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .nc-icon:hover {
|
||||
-moz-opacity: 0.5;
|
||||
-webkit-opacity: 0.5;
|
||||
-o-opacity: 0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
}
|
||||
/* line 350, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 352, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object-info {
|
||||
-moz-border-radius: 12px;
|
||||
-webkit-border-radius: 12px;
|
||||
|
@ -1252,26 +1256,26 @@ body.outfits-edit .object-info {
|
|||
top: 0;
|
||||
width: 16px;
|
||||
}
|
||||
/* line 361, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 363, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object-info span {
|
||||
font-family: "Droid Serif", Georgia, "Times New Roman", Times, serif;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
top: -2px;
|
||||
}
|
||||
/* line 367, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 369, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .object-info:hover {
|
||||
-moz-opacity: 1;
|
||||
-webkit-opacity: 1;
|
||||
-o-opacity: 1;
|
||||
-khtml-opacity: 1;
|
||||
}
|
||||
/* line 370, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 372, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-outfits {
|
||||
display: none;
|
||||
text-align: left;
|
||||
}
|
||||
/* line 373, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 375, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-outfits > ul {
|
||||
margin-left: 24px;
|
||||
margin-right: 24px;
|
||||
|
@ -1282,7 +1286,7 @@ body.outfits-edit #preview-outfits > ul {
|
|||
margin-bottom: 1em;
|
||||
min-height: 16px;
|
||||
}
|
||||
/* line 382, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 384, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-outfits > ul > li {
|
||||
padding: 0.25em 0;
|
||||
}
|
||||
|
@ -1461,18 +1465,18 @@ body.outfits-edit #preview-outfits > ul > li.renaming:hover .outfit-rename-butto
|
|||
body.outfits-edit #preview-outfits > ul > li:hover .outfit-rename-button {
|
||||
display: inline;
|
||||
}
|
||||
/* line 384, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 386, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-outfits > ul.loaded {
|
||||
background: transparent;
|
||||
}
|
||||
/* line 387, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 389, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .preview-sidebar-nav {
|
||||
float: right;
|
||||
font-size: 85%;
|
||||
margin-right: 24px;
|
||||
margin-top: 1em;
|
||||
}
|
||||
/* line 394, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 396, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-success, body.outfits-edit #save-error, body.outfits-edit #outfit-not-found {
|
||||
margin-left: 24px;
|
||||
margin-right: 24px;
|
||||
|
@ -1480,19 +1484,19 @@ body.outfits-edit #save-success, body.outfits-edit #save-error, body.outfits-edi
|
|||
margin-top: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
/* line 401, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 403, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-success {
|
||||
background: #e6efc2;
|
||||
border: 1px solid #c6d880;
|
||||
color: #264409;
|
||||
}
|
||||
/* line 404, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 406, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-error, body.outfits-edit #outfit-not-found {
|
||||
background: #fbe3e4;
|
||||
border: 1px solid #fbc2c4;
|
||||
color: #8a1f11;
|
||||
}
|
||||
/* line 407, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 409, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #userbar-message {
|
||||
-moz-opacity: 0.5;
|
||||
-webkit-opacity: 0.5;
|
||||
|
@ -1500,7 +1504,7 @@ body.outfits-edit #userbar-message {
|
|||
-khtml-opacity: 0.5;
|
||||
display: none;
|
||||
}
|
||||
/* line 411, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 413, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #new-outfit {
|
||||
padding: 0.25em 0;
|
||||
margin-left: 24px;
|
||||
|
@ -1682,33 +1686,33 @@ body.outfits-edit #new-outfit.renaming:hover .outfit-rename-button {
|
|||
body.outfits-edit #new-outfit:hover .outfit-rename-button {
|
||||
display: inline;
|
||||
}
|
||||
/* line 415, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 417, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #new-outfit h4 {
|
||||
display: inline;
|
||||
}
|
||||
/* line 417, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 419, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #new-outfit h4:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
/* line 419, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 421, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #new-outfit .outfit-star {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
/* line 422, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 424, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #new-outfit-name {
|
||||
font: inherit;
|
||||
line-height: 1;
|
||||
}
|
||||
/* line 426, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 428, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-saving-outfit {
|
||||
display: none;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
/* line 430, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 432, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #pet-type-form, body.outfits-edit #pet-state-form, body.outfits-edit #preview-swf, body.outfits-edit #preview-search-form {
|
||||
position: relative;
|
||||
}
|
||||
/* line 433, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 435, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .control-overlay {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
|
@ -1717,11 +1721,11 @@ body.outfits-edit .control-overlay {
|
|||
width: 100%;
|
||||
z-index: 5;
|
||||
}
|
||||
/* line 441, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 443, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-sidebar-nav-outfits, body.outfits-edit #save-outfit-signed-in {
|
||||
display: none;
|
||||
}
|
||||
/* line 444, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 446, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit form#save-outfit-form {
|
||||
padding: 0.25em 0;
|
||||
display: none;
|
||||
|
@ -1903,7 +1907,7 @@ body.outfits-edit form#save-outfit-form.renaming:hover .outfit-rename-button {
|
|||
body.outfits-edit form#save-outfit-form:hover .outfit-rename-button {
|
||||
display: inline;
|
||||
}
|
||||
/* line 450, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 452, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit form#save-outfit-form .outfit-star, body.outfits-edit form#save-outfit-form input, body.outfits-edit form#save-outfit-form button {
|
||||
display: -moz-inline-box;
|
||||
-moz-box-orient: vertical;
|
||||
|
@ -1914,50 +1918,54 @@ body.outfits-edit form#save-outfit-form .outfit-star, body.outfits-edit form#sav
|
|||
float: none;
|
||||
vertical-align: top;
|
||||
}
|
||||
/* line 455, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 457, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit form#save-outfit-form .outfit-star {
|
||||
margin-top: 0.25em;
|
||||
}
|
||||
/* line 458, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 460, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .outfit-url {
|
||||
font-size: 75%;
|
||||
}
|
||||
/* line 462, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 464, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #preview-sidebar-nav-outfits {
|
||||
display: block;
|
||||
}
|
||||
/* line 464, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 466, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 468, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 470, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #save-outfit {
|
||||
display: none;
|
||||
}
|
||||
/* line 470, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 472, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #save-current-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #save-outfit-copy {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 472, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 474, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #current-outfit-permalink {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 475, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 477, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit-form {
|
||||
display: block;
|
||||
}
|
||||
/* line 477, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-current-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit-copy, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #current-outfit-permalink {
|
||||
/* line 479, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-current-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit-copy, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #current-outfit-permalink, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #shared-outfit-permalink, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #share-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #shared-outfit-url {
|
||||
display: none;
|
||||
}
|
||||
/* line 481, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-not-signed-in #share-outfit, body.outfits-edit.user-not-signed-in #save-outfit-not-signed-in {
|
||||
/* line 483, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-not-signed-in #save-outfit-not-signed-in {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 484, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-not-signed-in #save-outfit-wrapper.shared-outfit #current-outfit-permalink, body.outfits-edit.user-not-signed-in #save-outfit-wrapper.shared-outfit #current-outfit-url {
|
||||
/* line 487, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit-wrapper.shared-outfit #shared-outfit-permalink, body.outfits-edit #save-outfit-wrapper.shared-outfit #shared-outfit-url {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 489, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit-wrapper.shared-outfit #current-outfit-permalink {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* line 4, ../../../app/stylesheets/outfits/_index.sass */
|
||||
body.outfits-index #outfits {
|
||||
|
|
Loading…
Reference in a new issue