This repository has been archived by the owner on Apr 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update styles and overrides for 1.0.x new base theme
- Loading branch information
Alexey Topolyanskiy
committed
Feb 3, 2012
1 parent
cabd6a8
commit ebdd983
Showing
64 changed files
with
223 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,83 @@ | ||
(function($){ | ||
$(document).ready(function(){ | ||
if($('.edit_order').is('*')){ | ||
//$('#checkout_form_address').validate(); | ||
|
||
var get_states = function(region){ | ||
var country = $('span#' + region + 'country :only-child').val(); | ||
return state_mapper[country]; | ||
} | ||
//$('#checkout_form_address').validate(); | ||
|
||
var update_state = function(region) { | ||
var states = get_states(region); | ||
|
||
var state_select = $('span#' + region + 'state select'); | ||
var state_input = $('span#' + region + 'state input'); | ||
|
||
if(states) { | ||
var selected = state_select.val(); | ||
state_select.html(''); | ||
var states_with_blank = [["",""]].concat(states); | ||
$.each(states_with_blank, function(pos,id_nm) { | ||
var opt = $(document.createElement('option')) | ||
.attr('value', id_nm[0]) | ||
.html(id_nm[1]); | ||
if(selected==id_nm[0]){ | ||
opt.attr('selected', 'selected'); | ||
} | ||
state_select.append(opt); | ||
}); | ||
state_select.removeAttr('disabled').show(); | ||
state_input.hide().attr('disabled', 'disabled'); | ||
|
||
} else { | ||
state_input.removeAttr('disabled').show(); | ||
state_select.hide().attr('disabled', 'disabled'); | ||
} | ||
var get_states = function(region){ | ||
var country = $('span#' + region + 'country :only-child').val(); | ||
return state_mapper[country]; | ||
} | ||
|
||
}; | ||
var update_state = function(region) { | ||
var states = get_states(region); | ||
|
||
var show_payment_method = function(){ | ||
$('li.payment_method').hide(); | ||
var id = $("input[name='order[payments_attributes][][payment_method_id]']:checked").val() | ||
var state_select = $('span#' + region + 'state select'); | ||
var state_input = $('span#' + region + 'state input'); | ||
|
||
if(states) { | ||
var selected = state_select.val(); | ||
state_select.html(''); | ||
var states_with_blank = [["",""]].concat(states); | ||
$.each(states_with_blank, function(pos,id_nm) { | ||
var opt = $(document.createElement('option')) | ||
.attr('value', id_nm[0]) | ||
.html(id_nm[1]); | ||
if(selected==id_nm[0]){ | ||
opt.attr('selected', 'selected'); | ||
} | ||
state_select.append(opt); | ||
}); | ||
state_select.removeAttr('disabled').show(); | ||
state_input.hide().attr('disabled', 'disabled'); | ||
|
||
$('li.payment_method.' + id).show(); | ||
} else { | ||
state_input.removeAttr('disabled').show(); | ||
state_select.hide().attr('disabled', 'disabled'); | ||
} | ||
|
||
// Show fields for the selected payment method | ||
$("input[type='radio'][name='order[payments_attributes][][payment_method_id]']").change(function(){ | ||
show_payment_method(); | ||
}) | ||
|
||
$('span#bcountry select').change(function() { update_state('b'); }); | ||
$('span#scountry select').change(function() { update_state('s'); }); | ||
update_state('b'); | ||
update_state('s'); | ||
show_payment_method() | ||
|
||
$('input#order_use_billing').click(function() { | ||
if($(this).is(':checked')) { | ||
$('#shipping .inner').hide(); | ||
$('#shipping .inner input, #shipping .inner select').attr('disabled', 'disabled'); | ||
} else { | ||
$('#shipping .inner').show(); | ||
$('#shipping .inner input, #shipping .inner select').removeAttr('disabled', 'disabled'); | ||
|
||
//only want to enable relevant field | ||
if(get_states('s')){ | ||
$('span#sstate input').hide().attr('disabled', 'disabled'); | ||
}else{ | ||
$('span#sstate select').hide().attr('disabled', 'disabled'); | ||
} | ||
}; | ||
|
||
var show_payment_method = function(){ | ||
$('li.payment_method').hide(); | ||
var id = $("input[name='order[payments_attributes][][payment_method_id]']:checked").val() | ||
|
||
$('li.payment_method.' + id).show(); | ||
} | ||
|
||
// Show fields for the selected payment method | ||
$("input[type='radio'][name='order[payments_attributes][][payment_method_id]']").change(function(){ | ||
show_payment_method(); | ||
}) | ||
|
||
$('span#bcountry select').change(function() { update_state('b'); }); | ||
$('span#scountry select').change(function() { update_state('s'); }); | ||
update_state('b'); | ||
update_state('s'); | ||
show_payment_method() | ||
|
||
$('input#order_use_billing').click(function() { | ||
if($(this).is(':checked')) { | ||
$('#shipping .inner').hide(); | ||
$('#shipping .inner input, #shipping .inner select').attr('disabled', 'disabled'); | ||
} else { | ||
$('#shipping .inner').show(); | ||
$('#shipping .inner input, #shipping .inner select').removeAttr('disabled', 'disabled'); | ||
|
||
//only want to enable relevant field | ||
if(get_states('s')){ | ||
$('span#sstate input').hide().attr('disabled', 'disabled'); | ||
}else{ | ||
$('span#sstate select').hide().attr('disabled', 'disabled'); | ||
} | ||
}).triggerHandler('click'); | ||
|
||
$('form.edit_checkout').submit(function() { | ||
$(this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass('disabled'); | ||
}); | ||
} | ||
}).triggerHandler('click'); | ||
|
||
$('form.edit_checkout').submit(function() { | ||
$(this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass('disabled'); | ||
}); | ||
|
||
|
||
} | ||
}); | ||
})(jQuery); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Deface::Override.new(:virtual_path => %q{shared/_head}, | ||
Deface::Override.new(:virtual_path => %q{spree/shared/_head}, | ||
:name => %q{add_to_head}, | ||
:insert_after => %q{code[erb-loud]:contains('stylesheet_link_tag')}, | ||
:text => %q{<link href="<%=request.protocol%>fonts.googleapis.com/css?family=Arvo:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/overrides/redefine_replace_account_summary_with_social_logins.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{users/show}, | ||
Deface::Override.new(:virtual_path => %q{spree/users/show}, | ||
:name => %q{remove_account_summary}, | ||
:remove => %q{[data-hook='account_summary']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{shared/_login}, | ||
Deface::Override.new(:virtual_path => %q{spree/shared/_login}, | ||
:name => %q{remove_brs_from_login_form}, | ||
:remove => %q{br}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Deface::Override.new(:virtual_path => %q{shared/_user_form}, | ||
Deface::Override.new(:virtual_path => %q{spree/shared/_user_form}, | ||
:name => %q{remove_brs_from_user_form}, | ||
:remove => %q{br}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/payment/_gateway}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/payment/_gateway}, | ||
:name => %q{remove_card_expiration}, | ||
:remove => %q{[data-hook='card_expiration']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/payment/_gateway}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/payment/_gateway}, | ||
:name => %q{remove_cart_code}, | ||
:remove => %q{[data-hook='cart_code']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/registration}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/registration}, | ||
:name => %q{remove_checkout_registration_header}, | ||
:remove => %q{h2}, | ||
:sequence => {:before => 'replace_checkout_registration' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/_confirm}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/_confirm}, | ||
:name => %q{remove_confirm_buttons}, | ||
:remove => %q{[data-hook='buttons']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/_delivery}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/_delivery}, | ||
:name => %q{remove_delivery_buttons}, | ||
:remove => %q{[data-hook='buttons']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/_payment}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/_payment}, | ||
:name => %q{remove_payment_buttons}, | ||
:remove => %q{[data-hook='buttons']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/_address}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/_address}, | ||
:name => %q{remove_shipping}, | ||
:remove => %q{#shipping[data-hook]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Deface::Override.new(:virtual_path => %q{checkout/_summary}, | ||
Deface::Override.new(:virtual_path => %q{spree/checkout/_summary}, | ||
:name => %q{remove_summary_title}, | ||
:remove => %q{h3}, | ||
:sequence => {:before => 'replace_order_summary'}) |
Oops, something went wrong.