outfit permalink in toolbar

This commit is contained in:
Emi Matchu 2011-02-09 20:29:43 -05:00
parent d1daa6b772
commit ea5908c278
5 changed files with 221 additions and 198 deletions

View file

@ -16,6 +16,12 @@ $outfit-header-padding: 24px
$outfit-content-width: $sidebar-unit-inner-width - $outfit-thumbnail-size - $outfit-thumbnail-margin - 32px $outfit-content-width: $sidebar-unit-inner-width - $outfit-thumbnail-size - $outfit-thumbnail-margin - 32px
$outfit-content-inner-width: $outfit-content-width - $outfit-header-padding $outfit-content-inner-width: $outfit-content-width - $outfit-header-padding
=icon
bottom: -2px
height: 16px
position: relative
width: 16px
=outfit =outfit
//+clearfix //+clearfix
padding: .25em 0 padding: .25em 0
@ -50,20 +56,16 @@ $outfit-content-inner-width: $outfit-content-width - $outfit-header-padding
display: block display: block
padding-left: $outfit-header-padding padding-left: $outfit-header-padding
.outfit-star .outfit-star
+icon
background: background:
image: image-url("unstarred.png") image: image-url("unstarred.png")
position: left top position: left top
repeat: no-repeat repeat: no-repeat
bottom: -2px
/* margin-bottom doesn't work here
cursor: pointer cursor: pointer
display: block display: block
float: left float: left
height: 16px
margin-left: -24px margin-left: -24px
/* makes it not take up inline space /* makes it not take up inline space
position: relative
width: 16px
&.starred .outfit-star &.starred .outfit-star
background-image: image-url("star.png") background-image: image-url("star.png")
&.loading .outfit-star &.loading .outfit-star
@ -154,6 +156,11 @@ body.outfits-edit
display: none display: none
#save-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 +loud-awesome-button-color
#current-outfit-permalink
display: none
margin-right: .25em
img
+icon
#preview #preview
clear: both clear: both
#preview-swf #preview-swf
@ -472,12 +479,12 @@ body.outfits-edit
&.active-outfit &.active-outfit
#save-outfit #save-outfit
display: none display: none
#save-current-outfit, #save-outfit-copy #current-outfit-permalink, #save-current-outfit, #save-outfit-copy
display: inline-block display: inline-block
&.saving-outfit &.saving-outfit
#save-outfit-form #save-outfit-form
display: block display: block
#save-outfit, #save-current-outfit, #save-outfit-copy #save-outfit, #save-current-outfit, #save-outfit-copy, #current-outfit-permalink
display: none display: none
&.user-not-signed-in &.user-not-signed-in

View file

@ -17,6 +17,8 @@
#save-outfit-wrapper #save-outfit-wrapper
%button#save-outfit Save outfit %button#save-outfit Save outfit
%button#save-outfit-not-signed-in Log in to save outfit %button#save-outfit-not-signed-in Log in to save outfit
%a#current-outfit-permalink{:target => '_blank'}
= image_tag 'link_go.png', :alt => 'Permalink', :title => 'Permalink'
%button#save-current-outfit Save &quot;<span>current outfit</span>&quot; %button#save-current-outfit Save &quot;<span>current outfit</span>&quot;
%button#save-outfit-copy Save a copy %button#save-outfit-copy Save a copy
%form#save-outfit-form %form#save-outfit-form

BIN
public/images/link_go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

View file

@ -443,7 +443,7 @@ View.Hash = function (wardrobe) {
} }
View.Outfits = function (wardrobe) { View.Outfits = function (wardrobe) {
var controls = $('#pet-type-form, #pet-state-form, #preview-swf, #preview-search-form'), var current_outfit_permalink_el = $('#current-outfit-permalink'),
new_outfit_form_el = $('#save-outfit-form'), new_outfit_form_el = $('#save-outfit-form'),
new_outfit_name_el = $('#save-outfit-name'), new_outfit_name_el = $('#save-outfit-name'),
outfits_el = $('#preview-outfits'), outfits_el = $('#preview-outfits'),
@ -608,8 +608,12 @@ View.Outfits = function (wardrobe) {
function setActiveOutfit(outfit) { function setActiveOutfit(outfit) {
outfits_list_el.find('li.active').removeClass('active'); outfits_list_el.find('li.active').removeClass('active');
if(outfit.id) { if(outfit.id) {
var url = document.location.protocol + "//" + document.location.host;
if(document.location.port) url += ":" + document.location.port;
url += "/outfits/" + outfit.id;
liForOutfit(outfit).addClass('active'); liForOutfit(outfit).addClass('active');
save_current_outfit_name_el.text(outfit.name); save_current_outfit_name_el.text(outfit.name);
current_outfit_permalink_el.attr('href', url);
} }
save_outfit_wrapper_el.toggleClass('active-outfit', outfit.id ? true : false); save_outfit_wrapper_el.toggleClass('active-outfit', outfit.id ? true : false);
} }
@ -685,6 +689,7 @@ View.Outfits = function (wardrobe) {
} }
} }
} }
new_outfit_form_el.stopLoading();
liForOutfit(outfit).stopLoading(); liForOutfit(outfit).stopLoading();
} }

File diff suppressed because it is too large Load diff