Version Notes
1.6.1.0
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | Lib_Js_Mage |
| Version | 1.6.1.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.6.0.0 to 1.6.1.0
- js/mage/adminhtml/flexuploader.js +2 -2
- js/mage/adminhtml/giftmessage.js +0 -9
- js/mage/adminhtml/grid.js +71 -4
- js/mage/adminhtml/product.js +3 -3
- js/mage/adminhtml/sales.js +6 -1
- js/mage/adminhtml/tools.js +37 -17
- js/mage/translate_inline.js +4 -1
- js/varien/product.js +10 -8
- package.xml +6 -6
js/mage/adminhtml/flexuploader.js
CHANGED
|
@@ -65,8 +65,8 @@ if(!window.Flex) {
|
|
| 65 |
top: 300,
|
| 66 |
width: flexWidth,
|
| 67 |
height: 20,
|
| 68 |
-
src: uploaderSrc
|
| 69 |
-
|
| 70 |
});
|
| 71 |
// this.getInnerElement('browse').disabled = true;
|
| 72 |
// this.getInnerElement('upload').disabled = true;
|
| 65 |
top: 300,
|
| 66 |
width: flexWidth,
|
| 67 |
height: 20,
|
| 68 |
+
src: uploaderSrc,
|
| 69 |
+
wmode: 'transparent'
|
| 70 |
});
|
| 71 |
// this.getInnerElement('browse').disabled = true;
|
| 72 |
// this.getInnerElement('upload').disabled = true;
|
js/mage/adminhtml/giftmessage.js
CHANGED
|
@@ -66,10 +66,6 @@ var giftMessagesController = {
|
|
| 66 |
$(container).down('.action-link').addClassName('open');
|
| 67 |
$(container).down('.default-text').hide();
|
| 68 |
$(container).down('.close-text').show();
|
| 69 |
-
this.toogleRequired(this.getFieldId(container, 'message'), [
|
| 70 |
-
this.getFieldId(container, 'sender'),
|
| 71 |
-
this.getFieldId(container, 'recipient')
|
| 72 |
-
]);
|
| 73 |
} else {
|
| 74 |
$(container).toogleGiftMessage = false;
|
| 75 |
$(this.getFieldId(container, 'message')).formObj = $(this.getFieldId(container, 'form'));
|
|
@@ -106,11 +102,6 @@ var giftMessagesController = {
|
|
| 106 |
return false;
|
| 107 |
},
|
| 108 |
saveGiftMessage: function(container) {
|
| 109 |
-
this.toogleRequired(this.getFieldId(container, 'message'), [
|
| 110 |
-
this.getFieldId(container, 'sender'),
|
| 111 |
-
this.getFieldId(container, 'recipient')
|
| 112 |
-
]);
|
| 113 |
-
|
| 114 |
$(this.getFieldId(container, 'message')).formObj = $(this.getFieldId(container, 'form'));
|
| 115 |
|
| 116 |
if(!$(this.getFieldId(container, 'form')).validator) {
|
| 66 |
$(container).down('.action-link').addClassName('open');
|
| 67 |
$(container).down('.default-text').hide();
|
| 68 |
$(container).down('.close-text').show();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
} else {
|
| 70 |
$(container).toogleGiftMessage = false;
|
| 71 |
$(this.getFieldId(container, 'message')).formObj = $(this.getFieldId(container, 'form'));
|
| 102 |
return false;
|
| 103 |
},
|
| 104 |
saveGiftMessage: function(container) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
$(this.getFieldId(container, 'message')).formObj = $(this.getFieldId(container, 'form'));
|
| 106 |
|
| 107 |
if(!$(this.getFieldId(container, 'form')).validator) {
|
js/mage/adminhtml/grid.js
CHANGED
|
@@ -175,6 +175,8 @@ varienGrid.prototype = {
|
|
| 175 |
onComplete: this.initGridAjax.bind(this),
|
| 176 |
onSuccess: function(transport) {
|
| 177 |
try {
|
|
|
|
|
|
|
| 178 |
if (transport.responseText.isJSON()) {
|
| 179 |
var response = transport.responseText.evalJSON()
|
| 180 |
if (response.error) {
|
|
@@ -193,17 +195,17 @@ varienGrid.prototype = {
|
|
| 193 |
*/
|
| 194 |
var divId = $(this.containerId);
|
| 195 |
if (divId.id == this.containerId) {
|
| 196 |
-
divId.update(
|
| 197 |
} else {
|
| 198 |
-
$$('div[id="'+this.containerId+'"]')[0].update(
|
| 199 |
}
|
| 200 |
}
|
| 201 |
} catch (e) {
|
| 202 |
var divId = $(this.containerId);
|
| 203 |
if (divId.id == this.containerId) {
|
| 204 |
-
divId.update(
|
| 205 |
} else {
|
| 206 |
-
$$('div[id="'+this.containerId+'"]')[0].update(
|
| 207 |
}
|
| 208 |
}
|
| 209 |
}.bind(this)
|
|
@@ -341,6 +343,7 @@ varienGridMassaction.prototype = {
|
|
| 341 |
gridIds: [],
|
| 342 |
useSelectAll: false,
|
| 343 |
currentItem: false,
|
|
|
|
| 344 |
fieldTemplate: new Template('<input type="hidden" name="#{name}" value="#{value}" />'),
|
| 345 |
initialize: function (containerId, grid, checkedValues, formFieldNameInternal, formFieldName) {
|
| 346 |
this.setOldCallback('row_click', grid.rowClickCallback);
|
|
@@ -379,6 +382,8 @@ varienGridMassaction.prototype = {
|
|
| 379 |
this.form = this.prepareForm();
|
| 380 |
this.validator = new Validation(this.form);
|
| 381 |
this.select.observe('change', this.onSelectChange.bindAsEventListener(this));
|
|
|
|
|
|
|
| 382 |
},
|
| 383 |
prepareForm: function() {
|
| 384 |
var form = $(this.containerId + '-form'), formPlace = null,
|
|
@@ -511,18 +516,21 @@ varienGridMassaction.prototype = {
|
|
| 511 |
this.setCheckedValues((this.useSelectAll ? this.getGridIds() : this.getCheckboxesValuesAsString()));
|
| 512 |
this.checkCheckboxes();
|
| 513 |
this.updateCount();
|
|
|
|
| 514 |
return false;
|
| 515 |
},
|
| 516 |
unselectAll: function() {
|
| 517 |
this.setCheckedValues('');
|
| 518 |
this.checkCheckboxes();
|
| 519 |
this.updateCount();
|
|
|
|
| 520 |
return false;
|
| 521 |
},
|
| 522 |
selectVisible: function() {
|
| 523 |
this.setCheckedValues(this.getCheckboxesValuesAsString());
|
| 524 |
this.checkCheckboxes();
|
| 525 |
this.updateCount();
|
|
|
|
| 526 |
return false;
|
| 527 |
},
|
| 528 |
unselectVisible: function() {
|
|
@@ -531,6 +539,7 @@ varienGridMassaction.prototype = {
|
|
| 531 |
}.bind(this));
|
| 532 |
this.checkCheckboxes();
|
| 533 |
this.updateCount();
|
|
|
|
| 534 |
return false;
|
| 535 |
},
|
| 536 |
setCheckedValues: function(values) {
|
|
@@ -630,6 +639,64 @@ varienGridMassaction.prototype = {
|
|
| 630 |
},
|
| 631 |
getListener: function(strValue) {
|
| 632 |
return eval(strValue);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 633 |
}
|
| 634 |
};
|
| 635 |
|
| 175 |
onComplete: this.initGridAjax.bind(this),
|
| 176 |
onSuccess: function(transport) {
|
| 177 |
try {
|
| 178 |
+
var responseText = transport.responseText.replace(/>\s+</g, '><');
|
| 179 |
+
|
| 180 |
if (transport.responseText.isJSON()) {
|
| 181 |
var response = transport.responseText.evalJSON()
|
| 182 |
if (response.error) {
|
| 195 |
*/
|
| 196 |
var divId = $(this.containerId);
|
| 197 |
if (divId.id == this.containerId) {
|
| 198 |
+
divId.update(responseText);
|
| 199 |
} else {
|
| 200 |
+
$$('div[id="'+this.containerId+'"]')[0].update(responseText);
|
| 201 |
}
|
| 202 |
}
|
| 203 |
} catch (e) {
|
| 204 |
var divId = $(this.containerId);
|
| 205 |
if (divId.id == this.containerId) {
|
| 206 |
+
divId.update(responseText);
|
| 207 |
} else {
|
| 208 |
+
$$('div[id="'+this.containerId+'"]')[0].update(responseText);
|
| 209 |
}
|
| 210 |
}
|
| 211 |
}.bind(this)
|
| 343 |
gridIds: [],
|
| 344 |
useSelectAll: false,
|
| 345 |
currentItem: false,
|
| 346 |
+
lastChecked: { left: false, top: false, checkbox: false },
|
| 347 |
fieldTemplate: new Template('<input type="hidden" name="#{name}" value="#{value}" />'),
|
| 348 |
initialize: function (containerId, grid, checkedValues, formFieldNameInternal, formFieldName) {
|
| 349 |
this.setOldCallback('row_click', grid.rowClickCallback);
|
| 382 |
this.form = this.prepareForm();
|
| 383 |
this.validator = new Validation(this.form);
|
| 384 |
this.select.observe('change', this.onSelectChange.bindAsEventListener(this));
|
| 385 |
+
this.lastChecked = { left: false, top: false, checkbox: false };
|
| 386 |
+
this.initMassSelect();
|
| 387 |
},
|
| 388 |
prepareForm: function() {
|
| 389 |
var form = $(this.containerId + '-form'), formPlace = null,
|
| 516 |
this.setCheckedValues((this.useSelectAll ? this.getGridIds() : this.getCheckboxesValuesAsString()));
|
| 517 |
this.checkCheckboxes();
|
| 518 |
this.updateCount();
|
| 519 |
+
this.clearLastChecked();
|
| 520 |
return false;
|
| 521 |
},
|
| 522 |
unselectAll: function() {
|
| 523 |
this.setCheckedValues('');
|
| 524 |
this.checkCheckboxes();
|
| 525 |
this.updateCount();
|
| 526 |
+
this.clearLastChecked();
|
| 527 |
return false;
|
| 528 |
},
|
| 529 |
selectVisible: function() {
|
| 530 |
this.setCheckedValues(this.getCheckboxesValuesAsString());
|
| 531 |
this.checkCheckboxes();
|
| 532 |
this.updateCount();
|
| 533 |
+
this.clearLastChecked();
|
| 534 |
return false;
|
| 535 |
},
|
| 536 |
unselectVisible: function() {
|
| 539 |
}.bind(this));
|
| 540 |
this.checkCheckboxes();
|
| 541 |
this.updateCount();
|
| 542 |
+
this.clearLastChecked();
|
| 543 |
return false;
|
| 544 |
},
|
| 545 |
setCheckedValues: function(values) {
|
| 639 |
},
|
| 640 |
getListener: function(strValue) {
|
| 641 |
return eval(strValue);
|
| 642 |
+
},
|
| 643 |
+
initMassSelect: function() {
|
| 644 |
+
$$('input[class~="massaction-checkbox"]').each(
|
| 645 |
+
function(element) {
|
| 646 |
+
element.observe('click', this.massSelect.bind(this));
|
| 647 |
+
}.bind(this)
|
| 648 |
+
);
|
| 649 |
+
},
|
| 650 |
+
clearLastChecked: function() {
|
| 651 |
+
this.lastChecked = {
|
| 652 |
+
left: false,
|
| 653 |
+
top: false,
|
| 654 |
+
checkbox: false
|
| 655 |
+
};
|
| 656 |
+
},
|
| 657 |
+
massSelect: function(evt) {
|
| 658 |
+
if(this.lastChecked.left !== false && this.lastChecked.top !== false) {
|
| 659 |
+
// Left mouse button and "Shift" key was pressed together
|
| 660 |
+
if(evt.button === 0 && evt.shiftKey === true) {
|
| 661 |
+
var clickedOffset = Event.element(evt).viewportOffset();
|
| 662 |
+
|
| 663 |
+
this.grid.rows.each(
|
| 664 |
+
function(row) {
|
| 665 |
+
var element = row.select('.massaction-checkbox')[0];
|
| 666 |
+
var offset = element.viewportOffset();
|
| 667 |
+
|
| 668 |
+
if(
|
| 669 |
+
(
|
| 670 |
+
// The checkbox is past the most recently clicked checkbox
|
| 671 |
+
(offset.top < clickedOffset.top) &&
|
| 672 |
+
// The checkbox is not past the "boundary" checkbox
|
| 673 |
+
(offset.top > this.lastChecked.top || element == this.lastChecked.checkbox)
|
| 674 |
+
)
|
| 675 |
+
||
|
| 676 |
+
(
|
| 677 |
+
// The checkbox is before the most recently clicked checkbox
|
| 678 |
+
(offset.top > clickedOffset.top) &&
|
| 679 |
+
// The checkbox is after the "boundary" checkbox
|
| 680 |
+
(offset.top < this.lastChecked.top || element == this.lastChecked.checkbox)
|
| 681 |
+
)
|
| 682 |
+
) {
|
| 683 |
+
// Set the checkbox to the state of the most recently clicked checkbox
|
| 684 |
+
element.checked = Event.element(evt).checked;
|
| 685 |
+
|
| 686 |
+
this.setCheckbox(element);
|
| 687 |
+
}
|
| 688 |
+
}.bind(this)
|
| 689 |
+
);
|
| 690 |
+
|
| 691 |
+
this.updateCount();
|
| 692 |
+
}
|
| 693 |
+
}
|
| 694 |
+
|
| 695 |
+
this.lastChecked = {
|
| 696 |
+
left: Event.element(evt).viewportOffset().left,
|
| 697 |
+
top: Event.element(evt).viewportOffset().top,
|
| 698 |
+
checkbox: Event.element(evt) // "boundary" checkbox
|
| 699 |
+
};
|
| 700 |
}
|
| 701 |
};
|
| 702 |
|
js/mage/adminhtml/product.js
CHANGED
|
@@ -403,14 +403,14 @@ Product.Configurable.prototype = {
|
|
| 403 |
var use_default_checked = '';
|
| 404 |
if (attribute.use_default == '1') {
|
| 405 |
use_default_checked = ' checked="checked"';
|
| 406 |
-
label_readonly = '
|
| 407 |
}
|
| 408 |
|
| 409 |
var template = this.addAttributeTemplate.evaluate(attribute);
|
| 410 |
template = template.replace(
|
| 411 |
-
new RegExp(' readonly="label"', '
|
| 412 |
template = template.replace(new RegExp(
|
| 413 |
-
' checked="use_default"', '
|
| 414 |
li.update(template);
|
| 415 |
li.attributeObject = attribute;
|
| 416 |
|
| 403 |
var use_default_checked = '';
|
| 404 |
if (attribute.use_default == '1') {
|
| 405 |
use_default_checked = ' checked="checked"';
|
| 406 |
+
label_readonly = ' readonly="readonly"';
|
| 407 |
}
|
| 408 |
|
| 409 |
var template = this.addAttributeTemplate.evaluate(attribute);
|
| 410 |
template = template.replace(
|
| 411 |
+
new RegExp(' readonly="label"', 'ig'), label_readonly);
|
| 412 |
template = template.replace(new RegExp(
|
| 413 |
+
' checked="use_default"', 'ig'), use_default_checked);
|
| 414 |
li.update(template);
|
| 415 |
li.attributeObject = attribute;
|
| 416 |
|
js/mage/adminhtml/sales.js
CHANGED
|
@@ -134,6 +134,11 @@ AdminOrder.prototype = {
|
|
| 134 |
var field = Event.element(event);
|
| 135 |
var re = /[^\[]*\[([^\]]*)_address\]\[([^\]]*)\](\[(\d)\])?/;
|
| 136 |
var matchRes = field.name.match(re);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
var type = matchRes[1];
|
| 138 |
var name = matchRes[2];
|
| 139 |
var data;
|
|
@@ -422,7 +427,7 @@ AdminOrder.prototype = {
|
|
| 422 |
var listType = confLink.readAttribute('list_type');
|
| 423 |
var productId = confLink.readAttribute('product_id');
|
| 424 |
if (typeof this.productPriceBase[productId] == 'undefined') {
|
| 425 |
-
var priceBase = priceColl.innerHTML.match(/.*?([
|
| 426 |
if (!priceBase) {
|
| 427 |
this.productPriceBase[productId] = 0;
|
| 428 |
} else {
|
| 134 |
var field = Event.element(event);
|
| 135 |
var re = /[^\[]*\[([^\]]*)_address\]\[([^\]]*)\](\[(\d)\])?/;
|
| 136 |
var matchRes = field.name.match(re);
|
| 137 |
+
|
| 138 |
+
if (!matchRes) {
|
| 139 |
+
return;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
var type = matchRes[1];
|
| 143 |
var name = matchRes[2];
|
| 144 |
var data;
|
| 427 |
var listType = confLink.readAttribute('list_type');
|
| 428 |
var productId = confLink.readAttribute('product_id');
|
| 429 |
if (typeof this.productPriceBase[productId] == 'undefined') {
|
| 430 |
+
var priceBase = priceColl.innerHTML.match(/.*?([\d,]+\.?\d*)/);
|
| 431 |
if (!priceBase) {
|
| 432 |
this.productPriceBase[productId] = 0;
|
| 433 |
} else {
|
js/mage/adminhtml/tools.js
CHANGED
|
@@ -99,6 +99,24 @@ function imagePreview(element){
|
|
| 99 |
}
|
| 100 |
}
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
function toggleValueElements(checkbox, container, excludedElements, checked){
|
| 103 |
if(container && checkbox){
|
| 104 |
var ignoredElements = [checkbox];
|
|
@@ -114,24 +132,26 @@ function toggleValueElements(checkbox, container, excludedElements, checked){
|
|
| 114 |
var elems = Element.select(container, ['select', 'input', 'textarea', 'button', 'img']);
|
| 115 |
var isDisabled = (checked != undefined ? checked : checkbox.checked);
|
| 116 |
elems.each(function (elem) {
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
}
|
| 123 |
-
}
|
| 124 |
-
if (isIgnored) {
|
| 125 |
-
return;
|
| 126 |
-
}
|
| 127 |
-
elem.disabled=isDisabled;
|
| 128 |
-
if (isDisabled) {
|
| 129 |
-
elem.addClassName('disabled');
|
| 130 |
-
} else {
|
| 131 |
-
elem.removeClassName('disabled');
|
| 132 |
-
}
|
| 133 |
-
if(elem.tagName == 'IMG') {
|
| 134 |
-
isDisabled ? elem.hide() : elem.show();
|
| 135 |
}
|
| 136 |
})
|
| 137 |
}
|
| 99 |
}
|
| 100 |
}
|
| 101 |
|
| 102 |
+
function checkByProductPriceType(elem) {
|
| 103 |
+
if (elem.id == 'price_type') {
|
| 104 |
+
this.productPriceType = elem.value;
|
| 105 |
+
return false;
|
| 106 |
+
} else {
|
| 107 |
+
if (elem.id == 'price' && this.productPriceType == 0) {
|
| 108 |
+
return false;
|
| 109 |
+
}
|
| 110 |
+
return true;
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
Event.observe(window, 'load', function() {
|
| 115 |
+
if ($('price_default') && $('price_default').checked) {
|
| 116 |
+
$('price').disabled = 'disabled';
|
| 117 |
+
}
|
| 118 |
+
});
|
| 119 |
+
|
| 120 |
function toggleValueElements(checkbox, container, excludedElements, checked){
|
| 121 |
if(container && checkbox){
|
| 122 |
var ignoredElements = [checkbox];
|
| 132 |
var elems = Element.select(container, ['select', 'input', 'textarea', 'button', 'img']);
|
| 133 |
var isDisabled = (checked != undefined ? checked : checkbox.checked);
|
| 134 |
elems.each(function (elem) {
|
| 135 |
+
if (checkByProductPriceType(elem)) {
|
| 136 |
+
var isIgnored = false;
|
| 137 |
+
for (var i = 0; i < ignoredElements.length; i++) {
|
| 138 |
+
if (elem == ignoredElements[i]) {
|
| 139 |
+
isIgnored = true;
|
| 140 |
+
break;
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
if (isIgnored) {
|
| 144 |
+
return;
|
| 145 |
+
}
|
| 146 |
+
elem.disabled=isDisabled;
|
| 147 |
+
if (isDisabled) {
|
| 148 |
+
elem.addClassName('disabled');
|
| 149 |
+
} else {
|
| 150 |
+
elem.removeClassName('disabled');
|
| 151 |
+
}
|
| 152 |
+
if(elem.tagName == 'IMG') {
|
| 153 |
+
isDisabled ? elem.hide() : elem.show();
|
| 154 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
}
|
| 156 |
})
|
| 157 |
}
|
js/mage/translate_inline.js
CHANGED
|
@@ -47,7 +47,10 @@ TranslateInline.prototype = {
|
|
| 47 |
if(!el.initializedTranslate) {
|
| 48 |
el.addClassName('translate-inline');
|
| 49 |
el.initializedTranslate = true;
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
Event.observe(el, 'mouseout', this.trigHideDelayed.bind(this));
|
| 52 |
}
|
| 53 |
},
|
| 47 |
if(!el.initializedTranslate) {
|
| 48 |
el.addClassName('translate-inline');
|
| 49 |
el.initializedTranslate = true;
|
| 50 |
+
// mouseover is not suitable here because for some reason this handler is executed before the handler
|
| 51 |
+
// specified in menu element description. This causes 'book' to be shown out of the screen because
|
| 52 |
+
// 'over' CSS class has not been added yet.
|
| 53 |
+
Event.observe(el, 'mousemove', this.trigShow.bind(this, el));
|
| 54 |
Event.observe(el, 'mouseout', this.trigHideDelayed.bind(this));
|
| 55 |
}
|
| 56 |
},
|
js/varien/product.js
CHANGED
|
@@ -280,12 +280,12 @@ Product.Config.prototype = {
|
|
| 280 |
$(this.settings[i]).nextSetting = nextSetting;
|
| 281 |
childSettings.push(this.settings[i]);
|
| 282 |
}
|
| 283 |
-
|
| 284 |
// Set default values - from config and overwrite them by url values
|
| 285 |
if (config.defaultValues) {
|
| 286 |
this.values = config.defaultValues;
|
| 287 |
}
|
| 288 |
-
|
| 289 |
var separatorIndex = window.location.href.indexOf('#');
|
| 290 |
if (separatorIndex != -1) {
|
| 291 |
var paramsStr = window.location.href.substr(separatorIndex+1);
|
|
@@ -301,7 +301,7 @@ Product.Config.prototype = {
|
|
| 301 |
this.configureForValues();
|
| 302 |
document.observe("dom:loaded", this.configureForValues.bind(this));
|
| 303 |
},
|
| 304 |
-
|
| 305 |
configureForValues: function () {
|
| 306 |
if (this.values) {
|
| 307 |
this.settings.each(function(element){
|
|
@@ -599,7 +599,7 @@ Product.OptionsPrice.prototype = {
|
|
| 599 |
var nonTaxable = 0;
|
| 600 |
var oldPrice = 0;
|
| 601 |
var priceInclTax = 0;
|
| 602 |
-
var currentTax = this.currentTax;
|
| 603 |
$H(this.optionPrices).each(function(pair) {
|
| 604 |
if ('undefined' != typeof(pair.value.price) && 'undefined' != typeof(pair.value.oldPrice)) {
|
| 605 |
price += parseFloat(pair.value.price);
|
|
@@ -609,7 +609,7 @@ Product.OptionsPrice.prototype = {
|
|
| 609 |
} else if (pair.key == 'priceInclTax') {
|
| 610 |
priceInclTax += pair.value;
|
| 611 |
} else if (pair.key == 'optionsPriceInclTax') {
|
| 612 |
-
priceInclTax += pair.value * (100 + currentTax) / 100;
|
| 613 |
} else {
|
| 614 |
price += parseFloat(pair.value);
|
| 615 |
oldPrice += parseFloat(pair.value);
|
|
@@ -632,6 +632,7 @@ Product.OptionsPrice.prototype = {
|
|
| 632 |
var _productPrice;
|
| 633 |
var _plusDisposition;
|
| 634 |
var _minusDisposition;
|
|
|
|
| 635 |
if ($(pair.value)) {
|
| 636 |
if (pair.value == 'old-price-'+this.productId && this.productOldPrice != this.productPrice) {
|
| 637 |
_productPrice = this.productOldPrice;
|
|
@@ -642,20 +643,21 @@ Product.OptionsPrice.prototype = {
|
|
| 642 |
_plusDisposition = this.plusDisposition;
|
| 643 |
_minusDisposition = this.minusDisposition;
|
| 644 |
}
|
|
|
|
| 645 |
|
| 646 |
if (pair.value == 'old-price-'+this.productId && optionOldPrice !== undefined) {
|
| 647 |
price = optionOldPrice+parseFloat(_productPrice);
|
| 648 |
} else if (this.specialTaxPrice == 'true' && this.priceInclTax !== undefined && this.priceExclTax !== undefined) {
|
| 649 |
price = optionPrices+parseFloat(this.priceExclTax);
|
| 650 |
-
|
| 651 |
} else {
|
| 652 |
price = optionPrices+parseFloat(_productPrice);
|
| 653 |
-
|
| 654 |
}
|
| 655 |
|
| 656 |
if (this.specialTaxPrice == 'true') {
|
| 657 |
var excl = price;
|
| 658 |
-
var incl =
|
| 659 |
} else if (this.includeTax == 'true') {
|
| 660 |
// tax = tax included into product price by admin
|
| 661 |
var tax = price / (100 + this.defaultTax) * this.defaultTax;
|
| 280 |
$(this.settings[i]).nextSetting = nextSetting;
|
| 281 |
childSettings.push(this.settings[i]);
|
| 282 |
}
|
| 283 |
+
|
| 284 |
// Set default values - from config and overwrite them by url values
|
| 285 |
if (config.defaultValues) {
|
| 286 |
this.values = config.defaultValues;
|
| 287 |
}
|
| 288 |
+
|
| 289 |
var separatorIndex = window.location.href.indexOf('#');
|
| 290 |
if (separatorIndex != -1) {
|
| 291 |
var paramsStr = window.location.href.substr(separatorIndex+1);
|
| 301 |
this.configureForValues();
|
| 302 |
document.observe("dom:loaded", this.configureForValues.bind(this));
|
| 303 |
},
|
| 304 |
+
|
| 305 |
configureForValues: function () {
|
| 306 |
if (this.values) {
|
| 307 |
this.settings.each(function(element){
|
| 599 |
var nonTaxable = 0;
|
| 600 |
var oldPrice = 0;
|
| 601 |
var priceInclTax = 0;
|
| 602 |
+
var currentTax = this.currentTax;
|
| 603 |
$H(this.optionPrices).each(function(pair) {
|
| 604 |
if ('undefined' != typeof(pair.value.price) && 'undefined' != typeof(pair.value.oldPrice)) {
|
| 605 |
price += parseFloat(pair.value.price);
|
| 609 |
} else if (pair.key == 'priceInclTax') {
|
| 610 |
priceInclTax += pair.value;
|
| 611 |
} else if (pair.key == 'optionsPriceInclTax') {
|
| 612 |
+
priceInclTax += pair.value * (100 + currentTax) / 100;
|
| 613 |
} else {
|
| 614 |
price += parseFloat(pair.value);
|
| 615 |
oldPrice += parseFloat(pair.value);
|
| 632 |
var _productPrice;
|
| 633 |
var _plusDisposition;
|
| 634 |
var _minusDisposition;
|
| 635 |
+
var _priceInclTax;
|
| 636 |
if ($(pair.value)) {
|
| 637 |
if (pair.value == 'old-price-'+this.productId && this.productOldPrice != this.productPrice) {
|
| 638 |
_productPrice = this.productOldPrice;
|
| 643 |
_plusDisposition = this.plusDisposition;
|
| 644 |
_minusDisposition = this.minusDisposition;
|
| 645 |
}
|
| 646 |
+
_priceInclTax = priceInclTax;
|
| 647 |
|
| 648 |
if (pair.value == 'old-price-'+this.productId && optionOldPrice !== undefined) {
|
| 649 |
price = optionOldPrice+parseFloat(_productPrice);
|
| 650 |
} else if (this.specialTaxPrice == 'true' && this.priceInclTax !== undefined && this.priceExclTax !== undefined) {
|
| 651 |
price = optionPrices+parseFloat(this.priceExclTax);
|
| 652 |
+
_priceInclTax += this.priceInclTax;
|
| 653 |
} else {
|
| 654 |
price = optionPrices+parseFloat(_productPrice);
|
| 655 |
+
_priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100;
|
| 656 |
}
|
| 657 |
|
| 658 |
if (this.specialTaxPrice == 'true') {
|
| 659 |
var excl = price;
|
| 660 |
+
var incl = _priceInclTax;
|
| 661 |
} else if (this.includeTax == 'true') {
|
| 662 |
// tax = tax included into product price by admin
|
| 663 |
var tax = price / (100 + this.defaultTax) * this.defaultTax;
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Lib_Js_Mage</name>
|
| 4 |
-
<version>1.6.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>Mixed</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Javascript Libraries for Magento</summary>
|
| 10 |
<description>Javascript Libraries for Magento</description>
|
| 11 |
-
<notes>1.6.
|
| 12 |
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
|
| 13 |
-
<date>2011-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="mageweb"><dir name="js"><dir name="lib"><file name="FABridge.js" hash="64244d8d58abd42bd71f0ee3309767ad"/><file name="boxover.js" hash="a5ade77452e8d5066cb84dcac3d34ed5"/><file name="ccard.js" hash="d3e849be0977d53de4af933b40293ff6"/><file name="dropdown.js" hash="b47a46ecc0ffaa60c7ef3b60bad27bf3"/><file name="ds-sleight.js" hash="85af457d444865d1587bfe4875bd4fc6"/><file name="flex.js" hash="59191d36c041897d4ea86671671f7b65"/></dir><dir name="mage"><dir name="adminhtml"><file name="accordion.js" hash="6f0269f9d5060cfe42a0cb806d4657c5"/><file name="browser.js" hash="6433918dff8f6797553005a543a194dd"/><file name="events.js" hash="e63e761d3feb5a176bf9517ed8c13af9"/><file name="flexuploader.js" hash="
|
| 16 |
<compatible/>
|
| 17 |
-
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Lib_Js_Prototype</name><channel>community</channel><min>1.7.0.0</min><max>1.7.1.0</max></package></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Lib_Js_Mage</name>
|
| 4 |
+
<version>1.6.1.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>Mixed</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Javascript Libraries for Magento</summary>
|
| 10 |
<description>Javascript Libraries for Magento</description>
|
| 11 |
+
<notes>1.6.1.0</notes>
|
| 12 |
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
|
| 13 |
+
<date>2011-10-19</date>
|
| 14 |
+
<time>11:50:03</time>
|
| 15 |
+
<contents><target name="mageweb"><dir name="js"><dir name="lib"><file name="FABridge.js" hash="64244d8d58abd42bd71f0ee3309767ad"/><file name="boxover.js" hash="a5ade77452e8d5066cb84dcac3d34ed5"/><file name="ccard.js" hash="d3e849be0977d53de4af933b40293ff6"/><file name="dropdown.js" hash="b47a46ecc0ffaa60c7ef3b60bad27bf3"/><file name="ds-sleight.js" hash="85af457d444865d1587bfe4875bd4fc6"/><file name="flex.js" hash="59191d36c041897d4ea86671671f7b65"/></dir><dir name="mage"><dir name="adminhtml"><file name="accordion.js" hash="6f0269f9d5060cfe42a0cb806d4657c5"/><file name="browser.js" hash="6433918dff8f6797553005a543a194dd"/><file name="events.js" hash="e63e761d3feb5a176bf9517ed8c13af9"/><file name="flexuploader.js" hash="eff043aacce1e22863cce636319a0d5c"/><file name="form.js" hash="d427e4b296cc5823900b54195207a474"/><file name="giftmessage.js" hash="93e1d40a2f61324dd44882afc839f727"/><dir name="giftoptions"><file name="tooltip.js" hash="693608acf4d65958c91765260c1c8434"/></dir><file name="grid.js" hash="82ce2f4c5d181899fd6c1943715a0c75"/><file name="hash.js" hash="5be791a6cd26ff7ab09ac9df5a9fdc9b"/><file name="image.js" hash="5721f1141f99e350bb5efb32dd004067"/><file name="loader.js" hash="f96ba03feef42b1335b94b294a0a991c"/><file name="magento-all.js" hash="23677c90ebc09dac2179476715be9e3b"/><dir name="product"><dir name="composite"><file name="configure.js" hash="f23f502c62f0656148b705dd0f6815bb"/></dir></dir><file name="product.js" hash="98a18acf38cca1daaa9da0c1dd874318"/><file name="rules.js" hash="ef09be8d19fd77c7d91eae6a2d6573fc"/><dir name="sales"><file name="packaging.js" hash="1ab04d26b4b9281149486bdcadcc85d8"/></dir><file name="sales.js" hash="48d609bb2958b93d7254c13957b704c4"/><file name="scrollbar.js" hash="bee8e4ad54a830e5bd054f2ab2ce3dd1"/><file name="tabs.js" hash="562a6244e92532be0bdea8b7efab5638"/><file name="tools.js" hash="c97ffb942302c607541954653a60c5cd"/><file name="uploader.js" hash="41d67dcd00f3b0d98ddd572c5f9bbeb4"/><file name="variables.js" hash="8d2261b60d2f8b9a16fc287c1409c94c"/><dir name="wysiwyg"><dir name="tiny_mce"><dir name="plugins"><dir name="magentovariable"><file name="editor_plugin.js" hash="5c2745eb128c45d2d1991c063a5583b5"/><dir name="img"><file name="icon.gif" hash="682b29a0e734f952cb2edabede6a25d1"/></dir></dir><dir name="magentowidget"><file name="editor_plugin.js" hash="60fdac7be7bbc4872ff27f2f15f6f8de"/><dir name="img"><file name="icon.gif" hash="532c141286373f098f1f4362e001c7f8"/></dir></dir></dir><file name="setup.js" hash="01a0c5b901bfd934e83c27a3a5a15eb3"/><dir name="themes"><dir name="advanced"><dir name="skins"><dir name="default"><file name="content.css" hash="39d109d661ea96af47d6a19c8c938d1e"/><file name="dialog.css" hash="97841661b61720b5ec4c9abf5e2e2abc"/></dir></dir></dir></dir></dir><file name="widget.js" hash="720586f7c4dda7674fa32d41c3e1c43b"/></dir></dir><file name="centinel.js" hash="41e4e3934681ef033860851ee2b7aba1"/><file name="cookies.js" hash="27b928501b43734c92b079ce19cba820"/><file name="directpost.js" hash="753e0c8f8d41cd7f3130b380ab5f6172"/><file name="translate.js" hash="ad862170f3baf5d16aa2c6c61ae232af"/><file name="translate_inline.css" hash="ecc986ee6878c40889d99f0f1964f625"/><file name="translate_inline.js" hash="3d261d14e5eb76d4ef682a30150b76e4"/></dir><dir name="varien"><file name="accordion.js" hash="70dde90999d61bf0ead8fbb24853c57a"/><file name="configurable.js" hash="10ecc0453a2acb613f1e9230c0e4f0bf"/><file name="form.js" hash="a470621a37d8c0fd1fd29c1aa5ee8670"/><file name="iehover-fix.js" hash="e5222683d48a9d4e1c9dbd3869d272e5"/><file name="js.js" hash="bcebae57a13302f0f9a8a1d71c7e49c9"/><file name="menu.js" hash="d3769730462205cd5a4096f5846faf3a"/><file name="payment.js" hash="2af70aefbfe63f09a96eb44aad61cd1a"/><file name="product.js" hash="e4569380256d6472c528ca218f932814"/><file name="telephone.js" hash="8b1b8c13882e07d210b2a89116c2d6bd"/><file name="weee.js" hash="bf921d6da47bdf79dcf0b7ce483caa1c"/></dir><file name="blank.html" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="index.php" hash="9a76023de59c1958cac0473ef31efa26"/><file name="spacer.gif" hash="df3e567d6f16d040326c7a0ea29a4f41"/><dir name="flash"><file name="AC_RunActiveContent.js" hash="3e038cea960c1b650442b85cea237053"/></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Lib_Js_Prototype</name><channel>community</channel><min>1.7.0.0.2</min><max>1.7.1.0</max></package></required></dependencies>
|
| 18 |
</package>
|
