Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jporsay/HCIQ1Y2011G3
Browse files Browse the repository at this point in the history
Conflicts:
	TPE1/libs/eCommon.js
	TPE1/userSettings.html
  • Loading branch information
unknown authored and unknown committed May 27, 2011
2 parents 6da910c + 3ad965e commit 73147ba
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 37 deletions.
16 changes: 8 additions & 8 deletions TPE1/checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ <h1 id='header'>Zen Faktor</h1>

<div id="mainArea">
<div class="fieldsCheckout">
<h1>Cart Checkout:</h1>
<h1 id='checkoutCartTitle' class='i18n'>Cart Checkout:</h1>

<h2>Your final order:</h2>
<h2 id='checkoutSubTitle' class='i18n'>Your final order:</h2>
<div id='checkoutTable'></div>

<h2 id='checkoutRequiredInformation'>Please enter the required information in order to complete your order</h2>
<h2 id='checkoutRequiredInformation' class='i18n'>Please enter the required information in order to complete your order</h2>
<form id='billingForm' action='#'>
<div class='billingInformation'>
<fieldset>
<legend>Billing Information</legend>
<legend id='lBillingInformation' class='i18n'>Billing Information</legend>
<span id='checkoutLocationDelivery' class="i18n selectLocationLabel">Select the locaction where the order should be delivered:</span>
<div id='addressSelectContainer'>
</div>
Expand Down Expand Up @@ -118,7 +118,7 @@ <h2 id='checkoutRequiredInformation'>Please enter the required information in or
</div>
<div class='paymentInformation'>
<fieldset>
<legend>Payment Information</legend>
<legend id='lPaymentInformation' class='i18n'>Payment Information</legend>
<input class='cardImges' type='Image' src='./images/checkout/cards.jpg'>
<div class='fieldRow'>
<span>Card Number:</span>
Expand All @@ -134,9 +134,9 @@ <h2 id='checkoutRequiredInformation'>Please enter the required information in or
</div>
</fieldset>
</div>
<span class="footNote">Payment Information FORM IS NOT REQUIRED IN THE VERSION</span>
<input class='cancelButton' id='cancelOrder' type="button" value='Cancel'>
<input class='nextButton' type='submit' id='confirmOrder' value='Create Order'>
<span class="i18n footNote" id='paymentFootNote'>Payment Information FORM IS NOT REQUIRED IN THE VERSION</span>
<input class='i18n cancelButton' id='cancelOrder' type="button" value='Cancel'>
<input class='i18n nextButton' type='submit' id='confirmOrder' value='Order'>
<span id="orderCreatedLabel">Your Order has been created!</span>
<div id="processingOrder"></div>
</form>
Expand Down
15 changes: 15 additions & 0 deletions TPE1/libs/eSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ function loadUserSettings() {
$(':password').val('');
});

$('#centralArea').click(function(e) {
if ($(e.target).is('a')) {
var eClass = $(e.target).attr('id');
if (eClass == 'addAddressLink' ) {
var elem = $('#addAddressForm');
elem.css('display', 'inline');
} else if ( eClass == 'checkAddressLink' ) {
var elem = $('#updateAddressForm');
elem.css('display', 'inline');
}
e.preventDefault();
return;
}
});

getAddressList(getAddressListCallback);
showUserData();
translator.translatePage();
Expand Down
55 changes: 53 additions & 2 deletions TPE1/libs/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function loadSpanish() {
langKeys['published_date'] = 'Fecha de publicaci&oacute;n: ';

//Settings
langKeys['sTitle'] = 'Configuraciones:';
langKeys['ucAddressInformation'] = 'Información sobre direcciones';
langKeys['passwordChangeOk'] = 'Contrase&ntilde;a actualizada';
langKeys['passwordChangeFail'] = 'Contrase&ntilde;a incorrecta';
langKeys['settingsChanged'] = 'Informaci&oacute;n personal actualizada';
Expand All @@ -81,6 +83,8 @@ function loadSpanish() {
langKeys['ucChkAdrs'] = 'Ver direcciones actuales';

//Settings - changeUserData
langKeys['ucSave'] = 'Guardar';
langKeys['ucLegend'] = 'Información personal';
langKeys['ucFullName'] = 'Nombre completo:*';
langKeys['ucEmail'] = 'Email:*';
langKeys['ucBirthDate'] = 'Fecha de nacimiento:*';
Expand All @@ -89,10 +93,19 @@ function loadSpanish() {
langKeys['ucAddAdrs'] = 'Agregar direccion';

//Settings - changePassword
langKeys['cpTitle'] = 'Contraseña'
langKeys['cpSave'] = 'Guardar';
langKeys['cpOldPassword'] = 'Contrase&ntilde;a actual:*';
langKeys['cpNewPassword'] = 'Contrase&ntilde;a nueva:*';

//Settings - address
langKeys['checkAddressLink'] = 'Ver o cambiar direcciones';
langKeys['addAddressLink'] = 'Agregar direcci&oacute;n';

//Settings - addAddress
langKeys['aaLegend'] = 'Agregar dirección';
langKeys['aaCancel'] = 'Cancelar';
langKeys['newAddressSubmit'] = 'Crear';
langKeys['aaName'] = 'Nombre:*';
langKeys['aaAddressOne'] = 'Direcci&oacute;n 1:*';
langKeys['aaAddressTwo'] = 'Direcci&oacute;n 2:*';
Expand All @@ -103,6 +116,9 @@ function loadSpanish() {
langKeys['aaCountry'] = 'Pa&iacute;s:*';

//Settings - changeAddress
langKeys['caCancel'] = 'Cancelar';
langKeys['updateAddress'] = 'Guardar';
langKeys['caLegend'] = 'Ver o cambiar dirección';
langKeys['caAddressOne'] = 'Direcci&oacute;n 1:*';
langKeys['caAddressTwo'] = 'Direcci&oacute;n 2:*';
langKeys['caZipCode'] = 'C&oacute;digo postal:*';
Expand Down Expand Up @@ -132,6 +148,16 @@ function loadSpanish() {
langKeys['checkoutLocationDelivery'] = 'Elija la dirección a la cual quiere que se entregue su orden:';
langKeys['checkoutCreateAddress'] = 'Crear nueva dirección de envio';

//Checkout
langKeys['lBillingInformation'] = 'Información de envio';
langKeys['lPaymentInformation'] = 'Información de pago';
langKeys['paymentFootNote'] = 'Informaci&oacute;n de pago no es requerida';
langKeys['checkoutCartTitle'] = 'Confirmar orden:';
langKeys['checkoutSubTitle'] = 'Su orden final:';
langKeys['checkoutRequiredInformation'] = 'Ingrese la información requerida';
langKeys['cancelOrder'] = 'Cancelar';
langKeys['confirmOrder'] = 'Confirmar';

return langKeys;
}

Expand Down Expand Up @@ -213,6 +239,8 @@ function loadEnglish() {
langKeys['published_date'] = 'Published date: ';

//Settings
langKeys['sTitle'] = 'Settings:';
langKeys['ucAddressInformation'] = 'Address information';
langKeys['passwordChangeOk'] = 'Password updated';
langKeys['passwordChangeFail'] = 'Incorrect password';
langKeys['settingsChanged'] = 'Personal information updated';
Expand All @@ -223,16 +251,26 @@ function loadEnglish() {
langKeys['chkAdrsLegend'] = 'check address';

//Settings - changeUserData
langKeys['ucSave'] = 'Save';
langKeys['ucLegend'] = 'Personal information';
langKeys['ucFullName'] = 'Full name:*';
langKeys['ucEmail'] = 'Email:*';
langKeys['ucBirthDate'] = 'Birth Date:*';
langKeys['ucLegend'] = 'Personal Information';

//Settings - changePassword
langKeys['cpSave'] = 'Save';
langKeys['cpOldPassword'] = 'Old password:*';
langKeys['cpNewPassword'] = 'New Password:*';

//Settings - address
langKeys['checkAddressLink'] = 'Check or change addresses';
langKeys['addAddressLink'] = 'Add address';

//Settings - addAddress
langKeys['aaLegend'] = 'Add address';
langKeys['aaCancel'] = 'Cancel';
langKeys['newAddressSubmit'] = 'Create';
langKeys['aaName'] = 'Name:*';
langKeys['aaAddressOne'] = 'Address 1:*';
langKeys['aaAddressTwo'] = 'Address 2:*';
Expand All @@ -243,6 +281,9 @@ function loadEnglish() {
langKeys['aaCountry'] = 'Country:*';

//Settings - changeAddress
langKeys['caCancel'] = 'Cancel';
langKeys['updateAddress'] = 'Save';
langKeys['caLegend'] = 'View or change address';
langKeys['caAddressOne'] = 'Address 1:*';
langKeys['caAddressTwo'] = 'Address 2:*';
langKeys['caZipCode'] = 'Postal code:*';
Expand All @@ -266,6 +307,16 @@ function loadEnglish() {
langKeys['tPrice'] = 'Price';
langKeys['tQuantity'] = 'Quantity';
langKeys['tTotal'] = 'Total:';

//Checkout
langKeys['lBillingInformation'] = 'Delivery Information';
langKeys['lPaymentInformation'] = 'Payment Information';
langKeys['paymentFootNote'] = 'Payment information is not required';
langKeys['checkoutCartTitle'] = 'Confirm order:';
langKeys['checkoutSubTitle'] = 'Your final order:';
langKeys['checkoutRequiredInformation'] = 'Enter the required information';
langKeys['cancelOrder'] = 'Cancel';
langKeys['confirmOrder'] = 'Confirm';
return langKeys;
}

Expand Down Expand Up @@ -361,11 +412,11 @@ i18n.prototype.translatePage = function() {
i18n.prototype.translateElement = function(node) {
var key = node.id;
var translated = getTranslation(key);
// not using getAttribute since its buggy.
if (translated !== undefined) {
if ($(node).is('input')) {
//not using setAttribute since its broken in IE and in Opera.
node.setAttribute('value', translated);
} else if ($(node).is('legend')) {
$(node).text(translated);
} else {
node.innerHTML = translated;
}
Expand Down
39 changes: 12 additions & 27 deletions TPE1/userSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@
checkIfLoggedOrExit();
$(function() {
loadUserSettings();

$('#centralArea').click(function(e) {
if ($(e.target).is('a')) {
var eClass = $(e.target).attr('class');
if (eClass == 'addAddressLink i18n' ) {
var elem = $('#addAddressForm');
elem.css('display', 'inline');
} else if ( eClass == 'checkAddressLink i18n' ) {
var elem = $('#updateAddressForm');
elem.css('display', 'inline');
}
e.preventDefault();
return;
}
});
});
</script>
<title>Zen Faktor</title>
Expand Down Expand Up @@ -97,7 +82,7 @@ <h2 id='categoryHeader' class='i18n'></h2>
</div>
<div id="centralArea">
<div id='settingsPanel'>
<h1 class='title'>Your settings:</h1>
<h1 class='i18n title' id='sTitle'>Your settings:</h1>
<form id='personalInfoForm' action='#'>
<fieldset>
<legend id='ucLegend' class='i18n'>Personal Information</legend>
Expand All @@ -116,7 +101,7 @@ <h1 class='title'>Your settings:</h1>
<div id='changeUserStatusDiv' class='statusDiv'>
<p id='changeUserStatus'></p>
</div>
<input type="submit" class="submit" value='Guardar'>
<input type="submit" id='ucSave' class="i18n submit" value='Guardar'>
</fieldset>
</form>
<form id='passwordChangeForm' action='#'>
Expand All @@ -133,20 +118,20 @@ <h1 class='title'>Your settings:</h1>
<div id='changePasswordStatusDiv' class='statusDiv'>
<p id='changePasswordStatus'></p>
</div>
<input type="submit" class="submit" value="Guardar">
<input type="submit" id='cpSave' class="i18n submit" value="Guardar">
</fieldset>
</form>
<fieldset>
<legend class="i18n" id="adrsLegend">Addressing information</legend>
<legend id='ucAddressInformation' class='i18n'>Addressing information</legend>
<ul>
<li><a href="#" class="addAddressLink i18n" id="ucAddAdrs">Add Address</a></li>
<li><a href="#" class="checkAddressLink i18n" id="ucChkAdrs">Check Addresses</a></li>
<li><a href="#" class="i18n addAddressLink" id='addAddressLink'>Add Address</a></li>
<li><a href="#" class="i18n checkAddressLink" id='checkAddressLink'>Check Addresses</a></li>
</ul>
</fieldset>
<!--ESTO SERIA AGREGADO CUNADO SE PRESIONA EL BOTON ADD ADDRESS -->
<form id='addAddressForm' action='#'>
<fieldset class='addressFieldSet'>
<legend class="i18n" id="addAdrsLegend">New Address</legend>
<legend id='aaLegend' class='i18n'>New Address</legend>
<div class='fieldRow'>
<span id='aaName' class='i18n'>Name:</span>
<input type='text' id='fullName'>
Expand Down Expand Up @@ -180,16 +165,16 @@ <h1 class='title'>Your settings:</h1>
<div id='addAddressStatusDiv' class='statusWCancelDiv'>
<p id='addAddressStatus'></p>
</div>
<button type='button' class="cancel" onClick="$(this.form).css('display', 'none')">Cancel</button>
<button type="submit" class="submit" id='newAddressSubmit'>Guardar</button>
<button id='aaCancel' type='button' class="i18n cancel" onClick="$(this.form).css('display', 'none')">Cancel</button>
<button type="submit" class="i18n submit" id='newAddressSubmit'>Guardar</button>
</fieldset>
</form>
<!---------------------------------------------------------------->

<!--ESTO SERIA AGREGADO CUNADO SE PRESIONA EL BOTON CHECK ADDRESSES -->
<form id='updateAddressForm' action='#' >
<fieldset class="checkAddress">
<legend class="i18n" id="currAdrsLegend">These are your current addresses:</legend>
<legend class='i18n' id='caLegend'>These are your current addresses:</legend>
<select id="AddressSelect">
<option value="1">item 1</option>
</select>
Expand Down Expand Up @@ -222,8 +207,8 @@ <h1 class='title'>Your settings:</h1>
<div id='updateAddressStatusDiv' class='statusWCancelDiv'>
<p id='updateAddressStatus'></p>
</div>
<button type="button" class="cancel" onClick="$(this.form).css('display', 'none')">Cancel</button>
<input type="submit" class="submit" value='Guardar' id='updateAddress'>
<button id='caCancel' type="button" class="i18n cancel" onClick="$(this.form).css('display', 'none')">Cancel</button>
<input type="submit" class="i18n submit" value='Guardar' id='updateAddress'>
</fieldset>
</form>
<!---------------------------------------------------------------->
Expand Down

0 comments on commit 73147ba

Please sign in to comment.