Lib_Js_Mage - Version 1.7.0.0

Version Notes

1.7.0.0

Download this release

Release Info

Developer Magento Core Team
Extension Lib_Js_Mage
Version 1.7.0.0
Comparing to
See all releases


Code changes from version 1.6.1.0 to 1.7.0.0

Files changed (49) hide show
  1. js/lib/dropdown.js +1 -1
  2. js/lib/flex.js +1 -1
  3. js/mage/adminhtml/accordion.js +1 -1
  4. js/mage/adminhtml/backup.js +192 -0
  5. js/mage/adminhtml/browser.js +1 -1
  6. js/mage/adminhtml/events.js +1 -1
  7. js/mage/adminhtml/flexuploader.js +9 -9
  8. js/mage/adminhtml/form.js +80 -11
  9. js/mage/adminhtml/giftmessage.js +1 -1
  10. js/mage/adminhtml/giftoptions/tooltip.js +1 -1
  11. js/mage/adminhtml/grid.js +16 -8
  12. js/mage/adminhtml/hash.js +1 -1
  13. js/mage/adminhtml/image.js +1 -1
  14. js/mage/adminhtml/loader.js +6 -3
  15. js/mage/adminhtml/magento-all.js +1 -1
  16. js/mage/adminhtml/product.js +1 -1
  17. js/mage/adminhtml/product/composite/configure.js +10 -10
  18. js/mage/adminhtml/rules.js +1 -1
  19. js/mage/adminhtml/sales.js +217 -15
  20. js/mage/adminhtml/sales/packaging.js +13 -2
  21. js/mage/adminhtml/scrollbar.js +1 -1
  22. js/mage/adminhtml/tabs.js +1 -1
  23. js/mage/adminhtml/tools.js +1 -1
  24. js/mage/adminhtml/uploader.js +1 -1
  25. js/mage/adminhtml/variables.js +2 -2
  26. js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +1 -1
  27. js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js +1 -1
  28. js/mage/adminhtml/wysiwyg/tiny_mce/setup.js +11 -4
  29. js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css +1 -1
  30. js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css +1 -1
  31. js/mage/adminhtml/wysiwyg/widget.js +13 -2
  32. js/mage/captcha.js +87 -0
  33. js/mage/centinel.js +1 -1
  34. js/mage/cookies.js +1 -1
  35. js/mage/directpost.js +1 -1
  36. js/mage/translate.js +1 -1
  37. js/mage/translate_inline.css +5 -3
  38. js/mage/translate_inline.js +95 -69
  39. js/varien/accordion.js +1 -1
  40. js/varien/configurable.js +1 -1
  41. js/varien/form.js +71 -7
  42. js/varien/iehover-fix.js +1 -1
  43. js/varien/js.js +32 -10
  44. js/varien/menu.js +1 -1
  45. js/varien/payment.js +1 -1
  46. js/varien/product.js +58 -6
  47. js/varien/telephone.js +1 -1
  48. js/varien/weee.js +1 -1
  49. package.xml +6 -6
js/lib/dropdown.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
dropdown = function() {
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
dropdown = function() {
js/lib/flex.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/accordion.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienAccordion = new Class.create();
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienAccordion = new Class.create();
js/mage/adminhtml/backup.js ADDED
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category Mage
21
+ * @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+ var AdminBackup = new Class.create();
26
+ AdminBackup.prototype = {
27
+ initialize : function(a, b){
28
+ this.reset();
29
+ this.rollbackUrl = this.backupUrl = '';
30
+ this.rollbackValidator = new Validation($('rollback-form'));
31
+ this.backupValidator = new Validation($('backup-form'));
32
+ },
33
+
34
+ reset: function() {
35
+ this.time = 0;
36
+ this.type = '';
37
+ $('use-ftp-checkbox-row').hide();
38
+ $('use_ftp').checked = false;
39
+ $('ftp-credentials-container').hide();
40
+ $('#ftp-credentials-container input').each(function(item) {
41
+ item.removeClassName('required-entry');
42
+ });
43
+ $('backup_maintenance_mode').checked = false;
44
+ $('rollback_maintenance_mode').checked = false;
45
+ $('exclude_media').checked = false;
46
+ $('password').value = '';
47
+ $('backup_name').value = '';
48
+ $('.validation-advice').invoke('remove');
49
+ $('input').invoke('removeClassName', 'validation-failed');
50
+ $('input').invoke('removeClassName', 'validation-passed');
51
+ $('.backup-messages').invoke('hide');
52
+ $('#ftp-credentials-container input').each(function(item) {
53
+ item.value = '';
54
+ });
55
+ },
56
+
57
+ backup: function(type) {
58
+ this.reset();
59
+ this.type = type;
60
+ this.showBackupWarning();
61
+ return false;
62
+ },
63
+
64
+ rollback: function(type, time) {
65
+ this.reset();
66
+ this.time = time;
67
+ this.type = type;
68
+ this.showRollbackWarning();
69
+ return false;
70
+ },
71
+
72
+ showBackupWarning: function() {
73
+ this.showPopup('backup-warning');
74
+ },
75
+
76
+ showRollbackWarning: function() {
77
+ this.showPopup('rollback-warning');
78
+ },
79
+
80
+ requestBackupOptions: function() {
81
+ this.hidePopups();
82
+ var action = this.type != 'snapshot' ? 'hide' : 'show';
83
+ $('#exclude-media-checkbox-container').invoke(action);
84
+ this.showPopup('backup-options');
85
+ },
86
+
87
+ requestPassword: function() {
88
+ this.hidePopups();
89
+ this.type != 'db' ? $('use-ftp-checkbox-row').show() : $('use-ftp-checkbox-row').hide();
90
+ this.showPopup('rollback-request-password');
91
+ },
92
+
93
+ toggleFtpCredentialsForm: function() {
94
+ $('use_ftp').checked ? $('ftp-credentials-container').show()
95
+ : $('ftp-credentials-container').hide();
96
+ var divId = 'rollback-request-password';
97
+
98
+ $('#ftp-credentials-container input').each(function(item) {
99
+ if (item.name == 'ftp_path') return;
100
+ $('use_ftp').checked ? item.addClassName('required-entry') : item.removeClassName('required-entry');
101
+ });
102
+
103
+ $(divId).show().setStyle({
104
+ 'marginTop': -$(divId).getDimensions().height / 2 + 'px'
105
+ });
106
+ },
107
+
108
+ submitBackup: function () {
109
+ if (!!this.backupValidator && this.backupValidator.validate()) {
110
+ this.hidePopups();
111
+ var data = {
112
+ 'type': this.type,
113
+ 'maintenance_mode': $('backup_maintenance_mode').checked ? 1 : 0,
114
+ 'backup_name': $('backup_name').value,
115
+ 'exclude_media': $('exclude_media').checked ? 1 : 0
116
+ };
117
+
118
+ new Ajax.Request(this.backupUrl, {
119
+ onSuccess: function(transport) {
120
+ this.processResponse(transport, 'backup-options');
121
+ }.bind(this),
122
+ method: 'post',
123
+ parameters: data
124
+ });
125
+ }
126
+ return false;
127
+ },
128
+
129
+ submitRollback: function() {
130
+ if (!!this.rollbackValidator && this.rollbackValidator.validate()) {
131
+ var data = this.getPostData();
132
+ this.hidePopups();
133
+ new Ajax.Request(this.rollbackUrl, {
134
+ onSuccess: function(transport) {
135
+ this.processResponse(transport, 'rollback-request-password');
136
+ }.bind(this),
137
+ method: 'post',
138
+ parameters: data
139
+ });
140
+ }
141
+ return false;
142
+ },
143
+
144
+ processResponse: function(transport, popupId) {
145
+ if (!transport.responseText.isJSON()) {
146
+ return;
147
+ }
148
+
149
+ var json = transport.responseText.evalJSON();
150
+
151
+ if (!!json.error) {
152
+ this.displayError(popupId, json.error);
153
+ this.showPopup(popupId);
154
+ return;
155
+ }
156
+
157
+ if (!!json.redirect_url) {
158
+ setLocation(json.redirect_url);
159
+ }
160
+ },
161
+
162
+ displayError: function(parentContainer, message) {
163
+ var messageHtml = this.getErrorMessageHtml(message);
164
+ $('#' + parentContainer + ' .backup-messages .messages').invoke('update', messageHtml);
165
+ $('#' + parentContainer + ' .backup-messages').invoke('show');
166
+ },
167
+
168
+ getErrorMessageHtml: function(message) {
169
+ return '<li class="error-msg"><ul><li><span>' + message + '</span></li></ul></li>';
170
+ },
171
+
172
+ getPostData: function() {
173
+ var data = $('rollback-form').serialize(true);
174
+ data['time'] = this.time;
175
+ data['type'] = this.type;
176
+ return data;
177
+ },
178
+
179
+ showPopup: function(divId) {
180
+ $(divId).show().setStyle({
181
+ 'marginTop': -$(divId).getDimensions().height / 2 + 'px'
182
+ });
183
+ $('popup-window-mask').setStyle({
184
+ height: $('html-body').getHeight() + 'px'
185
+ }).show();
186
+ },
187
+
188
+ hidePopups: function() {
189
+ $('.backup-dialog').each(Element.hide);
190
+ $('popup-window-mask').hide();
191
+ }
192
+ }
js/mage/adminhtml/browser.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
MediabrowserUtility = {
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
MediabrowserUtility = {
js/mage/adminhtml/events.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
// from http://www.someelement.com/2007/03/eventpublisher-custom-events-la-pubsub.html
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
// from http://www.someelement.com/2007/03/eventpublisher-custom-events-la-pubsub.html
js/mage/adminhtml/flexuploader.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
@@ -283,16 +283,16 @@ if(!window.Flex) {
283
};
284
},
285
formatSize: function(size) {
286
- if (size > 1024*1024*1024*1024) {
287
- return this.round(size/(1024*1024*1024*1024)) + ' ' + this.translate('Tb');
288
- } else if (size > 1024*1024*1024) {
289
- return this.round(size/(1024*1024*1024)) + ' ' + this.translate('Gb');
290
- } else if (size > 1024*1024) {
291
- return this.round(size/(1024*1024)) + ' ' + this.translate('Mb');
292
} else if (size > 1024) {
293
- return this.round(size/(1024)) + ' ' + this.translate('Kb');
294
}
295
- return size + ' ' + this.translate('b');
296
},
297
round: function(number) {
298
return Math.round(number*100)/100;
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
283
};
284
},
285
formatSize: function(size) {
286
+ if (size > 1024 * 1024 * 1024 * 1024) {
287
+ return this.round(size / (1024 * 1024 * 1024 * 1024)) + ' ' + this.translate('TB');
288
+ } else if (size > 1024 * 1024 * 1024) {
289
+ return this.round(size / (1024 * 1024 * 1024)) + ' ' + this.translate('GB');
290
+ } else if (size > 1024 * 1024) {
291
+ return this.round(size / (1024 * 1024)) + ' ' + this.translate('MB');
292
} else if (size > 1024) {
293
+ return this.round(size / (1024)) + ' ' + this.translate('kB');
294
}
295
+ return size + ' ' + this.translate('B');
296
},
297
round: function(number) {
298
return Math.round(number*100)/100;
js/mage/adminhtml/form.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienForm = new Class.create();
@@ -101,10 +101,11 @@ varienForm.prototype = {
101
},
102
103
_submit : function(){
104
if(this.submitUrl){
105
- $(this.formId).action = this.submitUrl;
106
}
107
- $(this.formId).submit();
108
}
109
}
110
@@ -191,6 +192,8 @@ RegionUpdater.prototype = {
191
// // clone for select element (#6924)
192
// this._regionSelectEl = {};
193
// this.tpl = new Template('<select class="#{className}" name="#{name}" id="#{id}">#{innerHTML}</select>');
194
this.regions = regions;
195
this.disableAction = (typeof disableAction=='undefined') ? 'hide' : disableAction;
196
this.clearRegionValueOnDisable = (typeof clearRegionValueOnDisable == 'undefined') ? false : clearRegionValueOnDisable;
@@ -207,6 +210,64 @@ RegionUpdater.prototype = {
207
Event.observe(this.countryEl, 'change', this.update.bind(this));
208
},
209
210
update: function()
211
{
212
if (this.regions[this.countryEl.value]) {
@@ -217,13 +278,13 @@ RegionUpdater.prototype = {
217
if (this.lastCountryId!=this.countryEl.value) {
218
var i, option, region, def;
219
220
if (this.regionTextEl) {
221
- def = this.regionTextEl.value.toLowerCase();
222
this.regionTextEl.value = '';
223
}
224
- if (!def) {
225
- def = this.regionSelectEl.getAttribute('defaultValue');
226
- }
227
228
this.regionSelectEl.options.length = 1;
229
for (regionId in this.regions[this.countryEl.value]) {
@@ -231,7 +292,8 @@ RegionUpdater.prototype = {
231
232
option = document.createElement('OPTION');
233
option.value = regionId;
234
- option.text = region.name;
235
236
if (this.regionSelectEl.options.add) {
237
this.regionSelectEl.options.add(option);
@@ -294,6 +356,7 @@ RegionUpdater.prototype = {
294
// this.regionSelectEl = null;
295
}
296
varienGlobalEvents.fireEvent("address_country_changed", this.countryEl);
297
},
298
299
setMarkDisplay: function(elem, display){
@@ -387,7 +450,6 @@ SelectUpdater.prototype = {
387
/**
388
* Observer that watches for dependent form elements
389
* If an element depends on 1 or more of other elements, it should show up only when all of them gain specified values
390
- * TODO: implement multiple values per "master" elements
391
*/
392
FormElementDependenceController = Class.create();
393
FormElementDependenceController.prototype = {
@@ -396,6 +458,7 @@ FormElementDependenceController.prototype = {
396
* 'id_of_dependent_element' : {
397
* 'id_of_master_element_1' : 'reference_value',
398
* 'id_of_master_element_2' : 'reference_value'
399
* ...
400
* }
401
* }
@@ -441,8 +504,14 @@ FormElementDependenceController.prototype = {
441
var shouldShowUp = true;
442
for (var idFrom in valuesFrom) {
443
var from = $(idFrom);
444
- if (!from || from.value != valuesFrom[idFrom]) {
445
- shouldShowUp = false;
446
}
447
}
448
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienForm = new Class.create();
101
},
102
103
_submit : function(){
104
+ var $form = $(this.formId);
105
if(this.submitUrl){
106
+ $form.action = this.submitUrl;
107
}
108
+ $form.submit();
109
}
110
}
111
192
// // clone for select element (#6924)
193
// this._regionSelectEl = {};
194
// this.tpl = new Template('<select class="#{className}" name="#{name}" id="#{id}">#{innerHTML}</select>');
195
+ this.config = regions['config'];
196
+ delete regions.config;
197
this.regions = regions;
198
this.disableAction = (typeof disableAction=='undefined') ? 'hide' : disableAction;
199
this.clearRegionValueOnDisable = (typeof clearRegionValueOnDisable == 'undefined') ? false : clearRegionValueOnDisable;
210
Event.observe(this.countryEl, 'change', this.update.bind(this));
211
},
212
213
+ _checkRegionRequired: function()
214
+ {
215
+ var label, wildCard;
216
+ var elements = [this.regionTextEl, this.regionSelectEl];
217
+ var that = this;
218
+ if (typeof this.config == 'undefined') {
219
+ return;
220
+ }
221
+ var regionRequired = this.config.regions_required.indexOf(this.countryEl.value) >= 0;
222
+
223
+ elements.each(function(currentElement) {
224
+ if(!currentElement) {
225
+ return;
226
+ }
227
+ Validation.reset(currentElement);
228
+ label = $('label[for="' + currentElement.id + '"]')[0];
229
+ if (label) {
230
+ wildCard = label.down('em') || label.down('span.required');
231
+ var topElement = label.up('tr') || label.up('li');
232
+ if (!that.config.show_all_regions && topElement) {
233
+ if (regionRequired) {
234
+ topElement.show();
235
+ } else {
236
+ topElement.hide();
237
+ }
238
+ }
239
+ }
240
+
241
+ if (label && wildCard) {
242
+ if (!regionRequired) {
243
+ wildCard.hide();
244
+ } else {
245
+ wildCard.show();
246
+ }
247
+ }
248
+
249
+ if (!regionRequired || !currentElement.visible()) {
250
+ if (currentElement.hasClassName('required-entry')) {
251
+ currentElement.removeClassName('required-entry');
252
+ }
253
+ if ('select' == currentElement.tagName.toLowerCase() &&
254
+ currentElement.hasClassName('validate-select')
255
+ ) {
256
+ currentElement.removeClassName('validate-select');
257
+ }
258
+ } else {
259
+ if (!currentElement.hasClassName('required-entry')) {
260
+ currentElement.addClassName('required-entry');
261
+ }
262
+ if ('select' == currentElement.tagName.toLowerCase() &&
263
+ !currentElement.hasClassName('validate-select')
264
+ ) {
265
+ currentElement.addClassName('validate-select');
266
+ }
267
+ }
268
+ });
269
+ },
270
+
271
update: function()
272
{
273
if (this.regions[this.countryEl.value]) {
278
if (this.lastCountryId!=this.countryEl.value) {
279
var i, option, region, def;
280
281
+ def = this.regionSelectEl.getAttribute('defaultValue');
282
if (this.regionTextEl) {
283
+ if (!def) {
284
+ def = this.regionTextEl.value.toLowerCase();
285
+ }
286
this.regionTextEl.value = '';
287
}
288
289
this.regionSelectEl.options.length = 1;
290
for (regionId in this.regions[this.countryEl.value]) {
292
293
option = document.createElement('OPTION');
294
option.value = regionId;
295
+ option.text = region.name.stripTags();
296
+ option.title = region.name;
297
298
if (this.regionSelectEl.options.add) {
299
this.regionSelectEl.options.add(option);
356
// this.regionSelectEl = null;
357
}
358
varienGlobalEvents.fireEvent("address_country_changed", this.countryEl);
359
+ this._checkRegionRequired();
360
},
361
362
setMarkDisplay: function(elem, display){
450
/**
451
* Observer that watches for dependent form elements
452
* If an element depends on 1 or more of other elements, it should show up only when all of them gain specified values
453
*/
454
FormElementDependenceController = Class.create();
455
FormElementDependenceController.prototype = {
458
* 'id_of_dependent_element' : {
459
* 'id_of_master_element_1' : 'reference_value',
460
* 'id_of_master_element_2' : 'reference_value'
461
+ * 'id_of_master_element_3' : ['reference_value1', 'reference_value2']
462
* ...
463
* }
464
* }
504
var shouldShowUp = true;
505
for (var idFrom in valuesFrom) {
506
var from = $(idFrom);
507
+ if (valuesFrom[idFrom] instanceof Array) {
508
+ if (!from || valuesFrom[idFrom].indexOf(from.value) == -1) {
509
+ shouldShowUp = false;
510
+ }
511
+ } else {
512
+ if (!from || from.value != valuesFrom[idFrom]) {
513
+ shouldShowUp = false;
514
+ }
515
}
516
}
517
js/mage/adminhtml/giftmessage.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/giftoptions/tooltip.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/grid.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienGrid = new Class.create();
@@ -240,20 +240,27 @@ varienGrid.prototype = {
240
_processFailure : function(transport){
241
location.href = BASE_URL;
242
},
243
- addVarToUrl : function(varName, varValue){
244
var re = new RegExp('\/('+varName+'\/.*?\/)');
245
- var parts = this.url.split(new RegExp('\\?'));
246
- this.url = parts[0].replace(re, '/');
247
- this.url+= varName+'/'+varValue+'/';
248
if(parts.size()>1) {
249
- this.url+= '?' + parts[1];
250
}
251
- //this.url = this.url.replace(/([^:])\/{2,}/g, '$1/');
252
return this.url;
253
},
254
doExport : function(){
255
if($(this.containerId+'_export')){
256
- location.href = $(this.containerId+'_export').value;
257
}
258
},
259
bindFilterFields : function(){
@@ -353,6 +360,7 @@ varienGridMassaction.prototype = {
353
354
this.useAjax = false;
355
this.grid = grid;
356
this.containerId = containerId;
357
this.initMassactionElements();
358
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienGrid = new Class.create();
240
_processFailure : function(transport){
241
location.href = BASE_URL;
242
},
243
+ _addVarToUrl : function(url, varName, varValue){
244
var re = new RegExp('\/('+varName+'\/.*?\/)');
245
+ var parts = url.split(new RegExp('\\?'));
246
+ url = parts[0].replace(re, '/');
247
+ url+= varName+'/'+varValue+'/';
248
if(parts.size()>1) {
249
+ url+= '?' + parts[1];
250
}
251
+ return url;
252
+ },
253
+ addVarToUrl : function(varName, varValue){
254
+ this.url = this._addVarToUrl(this.url, varName, varValue);
255
return this.url;
256
},
257
doExport : function(){
258
if($(this.containerId+'_export')){
259
+ var exportUrl = $(this.containerId+'_export').value;
260
+ if(this.massaction && this.massaction.checkedString) {
261
+ exportUrl = this._addVarToUrl(exportUrl, this.massaction.formFieldNameInternal, this.massaction.checkedString);
262
+ }
263
+ location.href = exportUrl;
264
}
265
},
266
bindFilterFields : function(){
360
361
this.useAjax = false;
362
this.grid = grid;
363
+ this.grid.massaction = this;
364
this.containerId = containerId;
365
this.initMassactionElements();
366
js/mage/adminhtml/hash.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
/*
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
/*
js/mage/adminhtml/image.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/loader.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
@@ -225,9 +225,12 @@ varienLoaderHandler.handler = {
225
function setLoaderPosition(){
226
var elem = $('loading_mask_loader');
227
if (elem && Prototype.Browser.IE) {
228
- var middle = parseInt(document.body.clientHeight/2)+document.body.scrollTop;
229
elem.style.position = 'absolute';
230
- elem.style.top = middle;
231
}
232
}
233
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
225
function setLoaderPosition(){
226
var elem = $('loading_mask_loader');
227
if (elem && Prototype.Browser.IE) {
228
+ var elementDims = elem.getDimensions();
229
+ var viewPort = document.viewport.getDimensions();
230
+ var offsets = document.viewport.getScrollOffsets();
231
+ elem.style.left = Math.floor(viewPort.width / 2 + offsets.left - elementDims.width / 2) + 'px';
232
+ elem.style.top = Math.floor(viewPort.height / 2 + offsets.top - elementDims.height / 2) + 'px';
233
elem.style.position = 'absolute';
234
}
235
}
236
js/mage/adminhtml/magento-all.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/product.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/product/composite/configure.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
@@ -213,16 +213,16 @@ ProductConfigure.prototype = {
213
} else if (response) {
214
response = response + '';
215
this.blockFormFields.update(response);
216
-
217
// Add special div to hold mage data, e.g. scripts to execute on every popup show
218
var mageData = {};
219
var scripts = response.extractScripts();
220
mageData.scripts = scripts;
221
-
222
var scriptHolder = new Element('div', {'style': 'display:none'});
223
scriptHolder.mageData = mageData;
224
this.blockFormFields.insert(scriptHolder);
225
-
226
// Show window
227
this._showWindow();
228
}
@@ -343,8 +343,6 @@ ProductConfigure.prototype = {
343
* Triggered when form was submitted and iFrame was loaded. Get response from iFrame and handle it
344
*/
345
onLoadIFrame: function() {
346
- varienLoaderHandler.handler.onComplete();
347
-
348
this.blockFormConfirmed.select('[configure_disabled=1]').each(function (element) {
349
element.disabled = element.getAttribute('configure_prev_disabled') == '1';
350
});
@@ -371,6 +369,8 @@ ProductConfigure.prototype = {
371
372
document.fire(this.current.listType + ':afterIFrameLoaded');
373
}
374
this.clean('current');
375
},
376
@@ -585,7 +585,7 @@ ProductConfigure.prototype = {
585
var patternFlat = null;
586
var replacement = null;
587
var replacementFlat = null
588
- var scopeArr = blockItem.id.match(/.*\[\w+\]\[(\w+)\]#x2F;);
589
var itemId = scopeArr[1];
590
if (method == 'current_confirmed_to_form') {
591
pattern = RegExp('(\\w+)(\\[?)');
@@ -694,7 +694,7 @@ ProductConfigure.prototype = {
694
restoreConfirmedValues(this.blockFormFields.getElementsByTagName('input'));
695
restoreConfirmedValues(this.blockFormFields.getElementsByTagName('select'));
696
restoreConfirmedValues(this.blockFormFields.getElementsByTagName('textarea'));
697
-
698
// Execute scripts
699
if (mageData && mageData.scripts) {
700
this.restorePhase = true;
@@ -718,7 +718,7 @@ ProductConfigure.prototype = {
718
719
this.blockFormConfirmed.update();
720
this.blockConfirmed.childElements().each(function(blockItem) {
721
- var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[(\w+)\]#x2F;);
722
var listType = scopeArr[1];
723
var itemId = scopeArr[2];
724
if (allowedListTypes[listType] && (!this.itemsFilter[listType]
@@ -731,7 +731,7 @@ ProductConfigure.prototype = {
731
case 'form_confirmed_to_confirmed':
732
var listInfo = this.listTypes[this.current.listType];
733
this.blockFormConfirmed.childElements().each(function(blockItem) {
734
- var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[(\w+)\]#x2F;);
735
var listType = scopeArr[1];
736
_renameFields(method, blockItem, listInfo.complexTypes ? listType : null);
737
this.blockConfirmed.insert(blockItem);
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
213
} else if (response) {
214
response = response + '';
215
this.blockFormFields.update(response);
216
+
217
// Add special div to hold mage data, e.g. scripts to execute on every popup show
218
var mageData = {};
219
var scripts = response.extractScripts();
220
mageData.scripts = scripts;
221
+
222
var scriptHolder = new Element('div', {'style': 'display:none'});
223
scriptHolder.mageData = mageData;
224
this.blockFormFields.insert(scriptHolder);
225
+
226
// Show window
227
this._showWindow();
228
}
343
* Triggered when form was submitted and iFrame was loaded. Get response from iFrame and handle it
344
*/
345
onLoadIFrame: function() {
346
this.blockFormConfirmed.select('[configure_disabled=1]').each(function (element) {
347
element.disabled = element.getAttribute('configure_prev_disabled') == '1';
348
});
369
370
document.fire(this.current.listType + ':afterIFrameLoaded');
371
}
372
+ varienLoaderHandler.handler.onComplete();
373
+
374
this.clean('current');
375
},
376
585
var patternFlat = null;
586
var replacement = null;
587
var replacementFlat = null
588
+ var scopeArr = blockItem.id.match(/.*\[\w+\]\[([^\]]+)\]#x2F;);
589
var itemId = scopeArr[1];
590
if (method == 'current_confirmed_to_form') {
591
pattern = RegExp('(\\w+)(\\[?)');
694
restoreConfirmedValues(this.blockFormFields.getElementsByTagName('input'));
695
restoreConfirmedValues(this.blockFormFields.getElementsByTagName('select'));
696
restoreConfirmedValues(this.blockFormFields.getElementsByTagName('textarea'));
697
+
698
// Execute scripts
699
if (mageData && mageData.scripts) {
700
this.restorePhase = true;
718
719
this.blockFormConfirmed.update();
720
this.blockConfirmed.childElements().each(function(blockItem) {
721
+ var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]]+)\]#x2F;);
722
var listType = scopeArr[1];
723
var itemId = scopeArr[2];
724
if (allowedListTypes[listType] && (!this.itemsFilter[listType]
731
case 'form_confirmed_to_confirmed':
732
var listInfo = this.listTypes[this.current.listType];
733
this.blockFormConfirmed.childElements().each(function(blockItem) {
734
+ var scopeArr = blockItem.id.match(/.*\[(\w+)\]\[([^\]]+)\]#x2F;);
735
var listType = scopeArr[1];
736
_renameFields(method, blockItem, listInfo.complexTypes ? listType : null);
737
this.blockConfirmed.insert(blockItem);
js/mage/adminhtml/rules.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/sales.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var AdminOrder = new Class.create();
@@ -42,6 +42,59 @@ AdminOrder.prototype = {
42
this.giftMessageDataChanged = false;
43
this.productConfigureAddFields = {};
44
this.productPriceBase = {};
45
},
46
47
setLoadBaseUrl : function(url){
@@ -63,7 +116,7 @@ AdminOrder.prototype = {
63
setCustomerAfter : function () {
64
this.customerSelectorHide();
65
if (this.storeId) {
66
- $(this.getAreaId('data')).callback = 'dataShow';
67
this.loadArea(['data'], true);
68
}
69
else {
@@ -219,14 +272,26 @@ AdminOrder.prototype = {
219
}
220
},
221
222
- disableShippingAddress : function(flag){
223
this.shippingAsBilling = flag;
224
- if($('order-shipping_address_customer_address_id')) {
225
- $('order-shipping_address_customer_address_id').disabled=flag;
226
}
227
- if($(this.shippingAddressContainer)){
228
var dataFields = $(this.shippingAddressContainer).select('input', 'select', 'textarea');
229
- for(var i=0;i<dataFields.length;i++) dataFields[i].disabled = flag;
230
}
231
},
232
@@ -598,13 +663,27 @@ AdminOrder.prototype = {
598
this.showArea('data');
599
},
600
601
- sidebarApplyChanges : function(){
602
- if($(this.getAreaId('sidebar'))){
603
- var data = {};
604
- var elems = $(this.getAreaId('sidebar')).select('input');
605
- for(var i=0; i<elems.length; i++){
606
- if(elems[i].getValue()){
607
- data[elems[i].name] = elems[i].getValue();
608
}
609
}
610
data.reset_shipping = true;
@@ -1056,5 +1135,128 @@ AdminOrder.prototype = {
1056
top: parentPos[1] + 'px',
1057
left: parentPos[0] + 'px'
1058
});
1059
}
1060
- }
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var AdminOrder = new Class.create();
42
this.giftMessageDataChanged = false;
43
this.productConfigureAddFields = {};
44
this.productPriceBase = {};
45
+ this.collectElementsValue = true;
46
+ Event.observe(window, 'load', (function(){
47
+ this.dataArea = new OrderFormArea('data', $(this.getAreaId('data')), this);
48
+ this.itemsArea = Object.extend(new OrderFormArea('items', $(this.getAreaId('items')), this), {
49
+ addControlButton: function(button){
50
+ var controlButtonArea = $(this.node).select('.form-buttons')[0];
51
+ if (typeof controlButtonArea != 'undefined') {
52
+ var buttons = controlButtonArea.childElements();
53
+ for (var i = 0; i < buttons.length; i++) {
54
+ if (buttons[i].innerHTML.include(button.label)) {
55
+ return ;
56
+ }
57
+ }
58
+ button.insertIn(controlButtonArea, 'top');
59
+ }
60
+ }
61
+ });
62
+
63
+ var searchButton = new ControlButton(Translator.translate('Add Products')),
64
+ searchAreaId = this.getAreaId('search');
65
+ searchButton.onClick = function() {
66
+ $(searchAreaId).show();
67
+ var el = this;
68
+ window.setTimeout(function () {
69
+ el.remove();
70
+ }, 10);
71
+ }
72
+
73
+ this.dataArea.onLoad = this.dataArea.onLoad.wrap(function(proceed) {
74
+ proceed();
75
+ this._parent.itemsArea.setNode($(this._parent.getAreaId('items')));
76
+ this._parent.itemsArea.onLoad();
77
+ });
78
+
79
+ this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) {
80
+ proceed();
81
+ if (!$(searchAreaId).visible()) {
82
+ this.addControlButton(searchButton);
83
+ }
84
+ });
85
+ this.areasLoaded();
86
+ this.itemsArea.onLoad();
87
+ }).bind(this));
88
+ },
89
+
90
+ areasLoaded: function(){
91
+ },
92
+
93
+ itemsLoaded: function(){
94
+ },
95
+
96
+ dataLoaded: function(){
97
+ this.dataShow();
98
},
99
100
setLoadBaseUrl : function(url){
116
setCustomerAfter : function () {
117
this.customerSelectorHide();
118
if (this.storeId) {
119
+ $(this.getAreaId('data')).callback = 'dataLoaded';
120
this.loadArea(['data'], true);
121
}
122
else {
272
}
273
},
274
275
+ disableShippingAddress : function(flag) {
276
this.shippingAsBilling = flag;
277
+ if ($('order-shipping_address_customer_address_id')) {
278
+ $('order-shipping_address_customer_address_id').disabled = flag;
279
}
280
+ if ($(this.shippingAddressContainer)) {
281
var dataFields = $(this.shippingAddressContainer).select('input', 'select', 'textarea');
282
+ for (var i = 0; i < dataFields.length; i++) {
283
+ dataFields[i].disabled = flag;
284
+ }
285
+ var buttons = $(this.shippingAddressContainer).select('button');
286
+ // Add corresponding class to buttons while disabling them
287
+ for (i = 0; i < buttons.length; i++) {
288
+ buttons[i].disabled = flag;
289
+ if (flag) {
290
+ buttons[i].addClassName('disabled');
291
+ } else {
292
+ buttons[i].removeClassName('disabled');
293
+ }
294
+ }
295
}
296
},
297
663
this.showArea('data');
664
},
665
666
+ clearShoppingCart : function(confirmMessage){
667
+ if (confirm(confirmMessage)) {
668
+ this.collectElementsValue = false;
669
+ order.sidebarApplyChanges({'sidebar[empty_customer_cart]': 1});
670
+ }
671
+ },
672
+
673
+ sidebarApplyChanges : function(auxiliaryParams) {
674
+ if ($(this.getAreaId('sidebar'))) {
675
+ var data = {};
676
+ if (this.collectElementsValue) {
677
+ var elems = $(this.getAreaId('sidebar')).select('input');
678
+ for (var i=0; i < elems.length; i++) {
679
+ if (elems[i].getValue()) {
680
+ data[elems[i].name] = elems[i].getValue();
681
+ }
682
+ }
683
+ }
684
+ if (auxiliaryParams instanceof Object) {
685
+ for (var paramName in auxiliaryParams) {
686
+ data[paramName] = String(auxiliaryParams[paramName]);
687
}
688
}
689
data.reset_shipping = true;
1135
top: parentPos[1] + 'px',
1136
left: parentPos[0] + 'px'
1137
});
1138
+ },
1139
+
1140
+ validateVat: function(parameters)
1141
+ {
1142
+ var params = {
1143
+ country: $(parameters.countryElementId).value,
1144
+ vat: $(parameters.vatElementId).value
1145
+ };
1146
+
1147
+ if (this.storeId !== false) {
1148
+ params.store_id = this.storeId;
1149
+ }
1150
+
1151
+ var currentCustomerGroupId = $(parameters.groupIdHtmlId).value;
1152
+
1153
+ new Ajax.Request(parameters.validateUrl, {
1154
+ parameters: params,
1155
+ onSuccess: function(response) {
1156
+ var message = '';
1157
+ var groupChangeRequired = false;
1158
+ try {
1159
+ response = response.responseText.evalJSON();
1160
+
1161
+ if (true === response.valid) {
1162
+ message = parameters.vatValidMessage;
1163
+ if (currentCustomerGroupId != response.group) {
1164
+ message = parameters.vatValidAndGroupChangeMessage;
1165
+ groupChangeRequired = true;
1166
+ }
1167
+ } else if (response.success) {
1168
+ message = parameters.vatInvalidMessage.replace(/%s/, params.vat);
1169
+ groupChangeRequired = true;
1170
+ } else {
1171
+ message = parameters.vatValidationFailedMessage;
1172
+ groupChangeRequired = true;
1173
+ }
1174
+
1175
+ } catch (e) {
1176
+ message = parameters.vatErrorMessage;
1177
+ }
1178
+ if (!groupChangeRequired) {
1179
+ alert(message);
1180
+ }
1181
+ else {
1182
+ this.processCustomerGroupChange(parameters.groupIdHtmlId, message, response.group);
1183
+ }
1184
+ }.bind(this)
1185
+ });
1186
+ },
1187
+
1188
+ processCustomerGroupChange: function(groupIdHtmlId, message, groupId)
1189
+ {
1190
+ var currentCustomerGroupId = $(groupIdHtmlId).value;
1191
+ var currentCustomerGroupTitle = $('#' + groupIdHtmlId + ' > option[value=' + currentCustomerGroupId + ']')[0].text;
1192
+ var customerGroupOption = $('#' + groupIdHtmlId + ' > option[value=' + groupId + ']')[0];
1193
+ var confirmText = message.replace(/%s/, customerGroupOption.text);
1194
+ confirmText = confirmText.replace(/%s/, currentCustomerGroupTitle);
1195
+ if (confirm(confirmText)) {
1196
+ $('#' + groupIdHtmlId + ' option').each(function(o) {
1197
+ o.selected = o.readAttribute('value') == groupId;
1198
+ });
1199
+ this.accountGroupChange();
1200
+ }
1201
+ }
1202
+ };
1203
+
1204
+ var OrderFormArea = Class.create();
1205
+ OrderFormArea.prototype = {
1206
+ _name: null,
1207
+ _node: null,
1208
+ _parent: null,
1209
+ _callbackName: null,
1210
+
1211
+ initialize: function(name, node, parent){
1212
+ this._name = name;
1213
+ this._parent = parent;
1214
+ this._callbackName = node.callback;
1215
+ if (typeof this._callbackName == 'undefined') {
1216
+ this._callbackName = name + 'Loaded';
1217
+ node.callback = this._callbackName;
1218
+ }
1219
+ parent[this._callbackName] = parent[this._callbackName].wrap((function (proceed){
1220
+ proceed();
1221
+ this.onLoad();
1222
+ }).bind(this));
1223
+
1224
+ this.setNode(node);
1225
+ },
1226
+
1227
+ setNode: function(node){
1228
+ if (!node.callback) {
1229
+ node.callback = this._callbackName;
1230
+ }
1231
+ this.node = node;
1232
+ },
1233
+
1234
+ onLoad: function(){
1235
+ }
1236
+ };
1237
+
1238
+ var ControlButton = Class.create();
1239
+ ControlButton.prototype = {
1240
+ _label: '',
1241
+ _node: null,
1242
+
1243
+ initialize: function(label){
1244
+ this._label = label;
1245
+ this._node = new Element('button', {
1246
+ 'class': 'scalable add',
1247
+ 'type': 'button'
1248
+ });
1249
+ },
1250
+
1251
+ onClick: function(){
1252
+ },
1253
+
1254
+ insertIn: function(element, position){
1255
+ var node = Object.extend(this._node),
1256
+ content = {};
1257
+ node.observe('click', this.onClick);
1258
+ node.update('<span>' + this._label + '</span>');
1259
+ content[position] = node;
1260
+ Element.insert(element, content);
1261
}
1262
+ };
js/mage/adminhtml/sales/packaging.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var Packaging = Class.create();
@@ -248,6 +248,17 @@ Packaging.prototype = {
248
},
249
250
validate: function() {
251
return result = $('[id^="package_block_"] input').collect(function (element) {
252
return this.validateElement(element)
253
}, this).all();
@@ -609,7 +620,7 @@ Packaging.prototype = {
609
return;
610
}
611
612
- currentNode.select(
613
'input[name=container_length],input[name=container_width],input[name=container_height],select[name=container_dimension_units]'
614
).each(function(inputElement) {
615
if (disable) {
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var Packaging = Class.create();
248
},
249
250
validate: function() {
251
+ var dimensionElements = $("packaging_window").select(
252
+ 'input[name=container_length],input[name=container_width],input[name=container_height]'
253
+ );
254
+ var callback = null;
255
+ if ( dimensionElements.any(function(element) { return !!element.value; })) {
256
+ callback = function(element) { $(element).addClassName('required-entry'); };
257
+ } else {
258
+ callback = function(element) { $(element).removeClassName('required-entry'); };
259
+ }
260
+ dimensionElements.each(callback);
261
+
262
return result = $('[id^="package_block_"] input').collect(function (element) {
263
return this.validateElement(element)
264
}, this).all();
620
return;
621
}
622
623
+ $(currentNode).select(
624
'input[name=container_length],input[name=container_width],input[name=container_height],select[name=container_dimension_units]'
625
).each(function(inputElement) {
626
if (disable) {
js/mage/adminhtml/scrollbar.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
/**************************************************
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
/**************************************************
js/mage/adminhtml/tabs.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienTabs = new Class.create();
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var varienTabs = new Class.create();
js/mage/adminhtml/tools.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
function setLocation(url){
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
function setLocation(url){
js/mage/adminhtml/uploader.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
/**
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
/**
js/mage/adminhtml/variables.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
@@ -106,7 +106,7 @@ var Variables = {
106
},
107
prepareVariableRow: function(varValue, varLabel) {
108
var value = (varValue).replace(/"/g, '&quot;').replace(/'/g, '\\&#39;');
109
- var content = '<a href="#" onclick="'+this.insertFunction+'(\''+ value +'\');">' + varLabel + '</a>';
110
return content;
111
},
112
insertVariable: function(value) {
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
106
},
107
prepareVariableRow: function(varValue, varLabel) {
108
var value = (varValue).replace(/"/g, '&quot;').replace(/'/g, '\\&#39;');
109
+ var content = '<a href="#" onclick="'+this.insertFunction+'(\''+ value +'\');return false;">' + varLabel + '</a>';
110
return content;
111
},
112
insertVariable: function(value) {
js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
tinyMCE.addI18n({en:{
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
tinyMCE.addI18n({en:{
js/mage/adminhtml/wysiwyg/tiny_mce/setup.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
@@ -81,9 +81,10 @@ tinyMceWysiwygSetup.prototype =
81
plugins = 'magentowidget,' + plugins;
82
}
83
84
if (this.config.plugins) {
85
- var magentoPluginsOptions = $H({});
86
- var magentoPlugins = '';
87
(this.config.plugins).each(function(plugin){
88
magentoPlugins = plugin.name + ',' + magentoPlugins;
89
magentoPluginsOptions.set(plugin.name, plugin.options);
@@ -170,7 +171,7 @@ tinyMceWysiwygSetup.prototype =
170
openFileBrowser: function(o) {
171
var typeTitle;
172
var storeId = this.config.store_id !== null ? this.config.store_id : 0;
173
- var wUrl = this.config.files_browser_window_url +
174
'target_element_id/' + this.id + '/' +
175
'store/' + storeId + '/';
176
@@ -223,6 +224,12 @@ tinyMceWysiwygSetup.prototype =
223
this.getPluginButtons().each(function(e) {
224
e.show();
225
});
226
},
227
228
closePopups: function() {
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
81
plugins = 'magentowidget,' + plugins;
82
}
83
84
+ var magentoPluginsOptions = $H({});
85
+ var magentoPlugins = '';
86
+
87
if (this.config.plugins) {
88
(this.config.plugins).each(function(plugin){
89
magentoPlugins = plugin.name + ',' + magentoPlugins;
90
magentoPluginsOptions.set(plugin.name, plugin.options);
171
openFileBrowser: function(o) {
172
var typeTitle;
173
var storeId = this.config.store_id !== null ? this.config.store_id : 0;
174
+ var wUrl = this.config.files_browser_window_url +
175
'target_element_id/' + this.id + '/' +
176
'store/' + storeId + '/';
177
224
this.getPluginButtons().each(function(e) {
225
e.show();
226
});
227
+ if (Prototype.Browser.IE) {
228
+ // workaround for ie textarea redraw bug
229
+ window.setTimeout(function(){
230
+ $(this.id).value = $(this.id).value;
231
+ }.bind(this), 0);
232
+ }
233
},
234
235
closePopups: function() {
js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/adminhtml/wysiwyg/widget.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
@@ -51,7 +51,7 @@ var widgetTools = {
51
closable:true,
52
className:'magento',
53
windowClassName:"popup-window",
54
- title:'Insert Widget',
55
top:50,
56
width:950,
57
//height:450,
@@ -88,6 +88,9 @@ WysiwygWidget.Widget.prototype = {
88
this.optionsUrl = optionsSourceUrl;
89
this.optionValues = new Hash({});
90
this.widgetTargetId = widgetTargetId;
91
92
Event.observe(this.widgetEl, "change", this.loadOptions.bind(this));
93
@@ -231,6 +234,14 @@ WysiwygWidget.Widget.prototype = {
231
try {
232
widgetTools.onAjaxSuccess(transport);
233
Windows.close("widget_window");
234
this.updateContent(transport.responseText);
235
} catch(e) {
236
alert(e.message);
19
*
20
* @category Mage
21
* @package Mage_Adminhtml
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
51
closable:true,
52
className:'magento',
53
windowClassName:"popup-window",
54
+ title:Translator.translate('Insert Widget...'),
55
top:50,
56
width:950,
57
//height:450,
88
this.optionsUrl = optionsSourceUrl;
89
this.optionValues = new Hash({});
90
this.widgetTargetId = widgetTargetId;
91
+ if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor) {
92
+ this.bMark = tinyMCE.activeEditor.selection.getBookmark();
93
+ }
94
95
Event.observe(this.widgetEl, "change", this.loadOptions.bind(this));
96
234
try {
235
widgetTools.onAjaxSuccess(transport);
236
Windows.close("widget_window");
237
+
238
+ if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor) {
239
+ tinyMCE.activeEditor.focus();
240
+ if (this.bMark) {
241
+ tinyMCE.activeEditor.selection.moveToBookmark(this.bMark);
242
+ }
243
+ }
244
+
245
this.updateContent(transport.responseText);
246
} catch(e) {
247
alert(e.message);
js/mage/captcha.js ADDED
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category Mage
21
+ * @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+ var Captcha = Class.create();
26
+ Captcha.prototype = {
27
+ initialize: function(url, formId){
28
+ this.url = url;
29
+ this.formId = formId;
30
+ },
31
+ refresh: function(elem) {
32
+ formId = this.formId;
33
+ if (elem) Element.addClassName(elem, 'refreshing');
34
+ new Ajax.Request(this.url, {
35
+ onSuccess: function (response) {
36
+ if (response.responseText.isJSON()) {
37
+ var json = response.responseText.evalJSON();
38
+ if (!json.error && json.imgSrc) {
39
+ $(formId).writeAttribute('src', json.imgSrc);
40
+ if (elem) Element.removeClassName(elem, 'refreshing');
41
+ } else {
42
+ if (elem) Element.removeClassName(elem, 'refreshing');
43
+ }
44
+ }
45
+ },
46
+ method: 'post',
47
+ parameters: {
48
+ 'formId' : this.formId
49
+ }
50
+ });
51
+ }
52
+ };
53
+
54
+ document.observe('billing-request:completed', function(event) {
55
+ if (typeof window.checkout != 'undefined') {
56
+ if (window.checkout.method == 'guest' && $('guest_checkout')){
57
+ $('guest_checkout').captcha.refresh()
58
+ }
59
+ if (window.checkout.method == 'register' && $('register_during_checkout')){
60
+ $('register_during_checkout').captcha.refresh()
61
+ }
62
+ }
63
+ });
64
+
65
+
66
+ document.observe('login:setMethod', function(event) {
67
+ var switchCaptchaElement = function(shown, hidden) {
68
+ var inputPrefix = 'captcha-input-box-', imagePrefix = 'captcha-image-box-';
69
+ if ($(inputPrefix + hidden)) {
70
+ $(inputPrefix + hidden).hide();
71
+ $(imagePrefix + hidden).hide();
72
+ }
73
+ if ($(inputPrefix + shown)) {
74
+ $(inputPrefix + shown).show();
75
+ $(imagePrefix + shown).show();
76
+ }
77
+ };
78
+
79
+ switch (event.memo.method) {
80
+ case 'guest':
81
+ switchCaptchaElement('guest_checkout', 'register_during_checkout');
82
+ break;
83
+ case 'register':
84
+ switchCaptchaElement('register_during_checkout', 'guest_checkout');
85
+ break;
86
+ }
87
+ });
js/mage/centinel.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var CentinelAuthenticate = Class.create();
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var CentinelAuthenticate = Class.create();
js/mage/cookies.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
// old school cookie functions grabbed off the web
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
// old school cookie functions grabbed off the web
js/mage/directpost.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var directPost = Class.create();
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var directPost = Class.create();
js/mage/translate.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/mage/translate_inline.css CHANGED
@@ -19,13 +19,15 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
26
- .translate-inline { /* background:black; font-weight:bold; color:red; */ border:dotted 1px red;}
27
.translate-inline-script, .translate-inline-title { background:yellow; color:black; font-weight:bold; }
28
- #translate-inline-trig { position:absolute;left:-1000px; opacity:.8; filter:alpha(opacity=80); cursor:pointer; margin-top:10px; z-index:1000;}
29
30
.magento_table_container { background:#e7efef; margin:10px; padding:10px; }
31
.magento_table_container table { width:100%; }
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
26
+ [translate], .translate-inline { /* background:black; font-weight:bold; color:red; */ outline: dotted 1px red!important;}
27
+ * html .translate-inline,
28
+ *+html .translate-inline{ border: dotted 1px red !important;}
29
.translate-inline-script, .translate-inline-title { background:yellow; color:black; font-weight:bold; }
30
+ #translate-inline-trig { position:absolute;left:-1000px; opacity:.8; filter:alpha(opacity=80); cursor:pointer; margin-top:10px; z-index:2000;}
31
32
.magento_table_container { background:#e7efef; margin:10px; padding:10px; }
33
.magento_table_container table { width:100%; }
js/mage/translate_inline.js CHANGED
@@ -19,56 +19,78 @@
19
*
20
* @category Mage
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
26
var TranslateInline = Class.create();
27
TranslateInline.prototype = {
28
- initialize: function(trigEl, ajaxUrl, area){
29
this.ajaxUrl = ajaxUrl;
30
this.area = area;
31
32
this.trigTimer = null;
33
this.trigContentEl = null;
34
-
35
- $('*[translate]').each(this.initializeElement.bind(this));
36
- var scope = this;
37
- Ajax.Responders.register({onComplete: function() {setTimeout(scope.reinitElements.bind(scope), 50)}});
38
this.trigEl = $(trigEl);
39
- this.trigEl.observe('mouseover', this.trigHideClear.bind(this));
40
- this.trigEl.observe('mouseout', this.trigHideDelayed.bind(this));
41
this.trigEl.observe('click', this.formShow.bind(this));
42
43
this.helperDiv = document.createElement('div');
44
},
45
46
initializeElement: function(el) {
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
},
57
58
- reinitElements: function (el) {
59
$('*[translate]').each(this.initializeElement.bind(this));
60
},
61
62
- trigShow: function (el) {
63
- this.trigHideClear();
64
-
65
- var p = Element.cumulativeOffset(el);
66
67
- this.trigEl.style.left = p[0]+'px';
68
- this.trigEl.style.top = p[1]+'px';
69
- this.trigEl.style.display = 'block';
70
71
- this.trigContentEl = el;
72
},
73
74
trigHide: function() {
@@ -76,15 +98,18 @@ TranslateInline.prototype = {
76
this.trigContentEl = null;
77
},
78
79
- trigHideDelayed: function () {
80
- this.trigTimer = window.setTimeout(this.trigHide.bind(this), 500);
81
},
82
83
trigHideClear: function() {
84
clearInterval(this.trigTimer);
85
},
86
87
- formShow: function () {
88
if (this.formIsShown) {
89
return;
90
}
@@ -94,27 +119,27 @@ TranslateInline.prototype = {
94
if (!el) {
95
return;
96
}
97
-
98
- eval('var data = '+el.getAttribute('translate'));
99
100
var content = '<form id="translate-inline-form">';
101
var t = new Template(
102
- '<div class="magento_table_container"><table cellspacing="0">'+
103
- '<tr><th class="label">Location:</th><td class="value">#{location}</td></tr>'+
104
- '<tr><th class="label">Scope:</th><td class="value">#{scope}</td></tr>'+
105
- '<tr><th class="label">Shown:</th><td class="value">#{shown_escape}</td></tr>'+
106
- '<tr><th class="label">Original:</th><td class="value">#{original_escape}</td></tr>'+
107
- '<tr><th class="label">Translated:</th><td class="value">#{translated_escape}</td></tr>'+
108
- '<tr><th class="label"><label for="perstore_#{i}">Store View Specific:</label></th><td class="value">'+
109
- '<input id="perstore_#{i}" name="translate[#{i}][perstore]" type="checkbox" value="1"/>'+
110
- '</td></tr>'+
111
- '<tr><th class="label"><label for="custom_#{i}">Custom:</label></th><td class="value">'+
112
- '<input name="translate[#{i}][original]" type="hidden" value="#{scope}::#{original_escape}"/>'+
113
- '<input id="custom_#{i}" name="translate[#{i}][custom]" class="input-text" value="#{translated_escape}" />'+
114
- '</td></tr>'+
115
'</table></div>'
116
);
117
- for (i=0; i<data.length; i++) {
118
data[i]['i'] = i;
119
data[i]['shown_escape'] = this.escapeHTML(data[i]['shown']);
120
data[i]['translated_escape'] = this.escapeHTML(data[i]['translated']);
@@ -125,28 +150,29 @@ TranslateInline.prototype = {
125
126
this.overlayShowEffectOptions = Windows.overlayShowEffectOptions;
127
this.overlayHideEffectOptions = Windows.overlayHideEffectOptions;
128
- Windows.overlayShowEffectOptions = {duration:0};
129
- Windows.overlayHideEffectOptions = {duration:0};
130
131
Dialog.confirm(content, {
132
- draggable:true,
133
- resizable:true,
134
- closable:true,
135
- className:"magento",
136
- title:"Translation",
137
- width:650,
138
- height:470,
139
- zIndex:1000,
140
- recenterAuto:false,
141
- hideEffect:Element.hide,
142
- showEffect:Element.show,
143
- id:"translate-inline",
144
- buttonClass:"form-button button",
145
- okLabel:"Submit",
146
ok: this.formOk.bind(this),
147
cancel: this.formClose.bind(this),
148
onClose: this.formClose.bind(this)
149
});
150
},
151
152
formOk: function(win) {
@@ -156,7 +182,7 @@ TranslateInline.prototype = {
156
this.formIsSubmitted = true;
157
158
var inputs = $('translate-inline-form').getInputs(), parameters = {};
159
- for (var i=0; i<inputs.length; i++) {
160
if (inputs[i].type == 'checkbox') {
161
if (inputs[i].checked) {
162
parameters[inputs[i].name] = inputs[i].value;
@@ -169,9 +195,9 @@ TranslateInline.prototype = {
169
parameters['area'] = this.area;
170
171
new Ajax.Request(this.ajaxUrl, {
172
- method:'post',
173
- parameters:parameters,
174
- onComplete:this.ajaxComplete.bind(this, win)
175
});
176
177
this.formIsSubmitted = false;
@@ -188,12 +214,12 @@ TranslateInline.prototype = {
188
this.formIsShown = false;
189
},
190
191
- escapeHTML: function (str) {
192
- this.helperDiv.innerHTML = '';
193
- var text = document.createTextNode(str);
194
- this.helperDiv.appendChild(text);
195
- var escaped = this.helperDiv.innerHTML;
196
- escaped = escaped.replace(/"/g, '&quot;');
197
- return escaped;
198
}
199
}
19
*
20
* @category Mage
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
26
var TranslateInline = Class.create();
27
TranslateInline.prototype = {
28
+ initialize: function(trigEl, ajaxUrl, area) {
29
this.ajaxUrl = ajaxUrl;
30
this.area = area;
31
32
this.trigTimer = null;
33
this.trigContentEl = null;
34
+ if (Prototype.Browser.IE) {
35
+ $('*[translate]').each(this.initializeElement.bind(this));
36
+ var scope = this;
37
+ Ajax.Responders.register({ onComplete: function() {
38
+ window.setTimeout(scope.reinitElements.bind(scope), 50)
39
+ }
40
+ });
41
+ var ElementNode = (typeof HTMLElement != 'undefined' ? HTMLElement : Element)
42
+ var ElementUpdate = ElementNode.prototype.update;
43
+ ElementNode.prototype.update = function() {
44
+ ElementUpdate.apply(this, arguments);
45
+ $(this).select('*[translate]').each(scope.initializeElement.bind(scope));
46
+ }
47
+ }
48
this.trigEl = $(trigEl);
49
this.trigEl.observe('click', this.formShow.bind(this));
50
51
+ Event.observe(document.body, 'mousemove', function(e) {
52
+ var target = Event.element(e);
53
+ if (!$(target).match('*[translate]')) {
54
+ target = target.up('*[translate]');
55
+ }
56
+
57
+ if (target && $(target).match('*[translate]')) {
58
+ this.trigShow(target, e);
59
+ } else {
60
+ if (Event.element(e).match('#' + trigEl)) {
61
+ this.trigHideClear();
62
+ } else {
63
+ this.trigHideDelayed();
64
+ }
65
+ }
66
+ }.bind(this));
67
+
68
this.helperDiv = document.createElement('div');
69
},
70
71
initializeElement: function(el) {
72
+ if (!el.initializedTranslate) {
73
el.addClassName('translate-inline');
74
el.initializedTranslate = true;
75
}
76
},
77
78
+ reinitElements: function(el) {
79
$('*[translate]').each(this.initializeElement.bind(this));
80
},
81
82
+ trigShow: function(el, event) {
83
+ if (this.trigContentEl != el) {
84
+ this.trigHideClear();
85
+ this.trigContentEl = el;
86
+ var p = Element.cumulativeOffset(el);
87
88
+ this.trigEl.style.left = p[0] + 'px';
89
+ this.trigEl.style.top = p[1] + 'px';
90
+ this.trigEl.style.display = 'block';
91
92
+ Event.stop(event);
93
+ };
94
},
95
96
trigHide: function() {
98
this.trigContentEl = null;
99
},
100
101
+ trigHideDelayed: function() {
102
+ if (this.trigTimer === null) {
103
+ this.trigTimer = window.setTimeout(this.trigHide.bind(this), 2000);
104
+ }
105
},
106
107
trigHideClear: function() {
108
clearInterval(this.trigTimer);
109
+ this.trigTimer = null;
110
},
111
112
+ formShow: function() {
113
if (this.formIsShown) {
114
return;
115
}
119
if (!el) {
120
return;
121
}
122
+ this.trigHideClear();
123
+ eval('var data = ' + el.getAttribute('translate'));
124
125
var content = '<form id="translate-inline-form">';
126
var t = new Template(
127
+ '<div class="magento_table_container"><table cellspacing="0">' +
128
+ '<tr><th class="label">Location:</th><td class="value">#{location}</td></tr>' +
129
+ '<tr><th class="label">Scope:</th><td class="value">#{scope}</td></tr>' +
130
+ '<tr><th class="label">Shown:</th><td class="value">#{shown_escape}</td></tr>' +
131
+ '<tr><th class="label">Original:</th><td class="value">#{original_escape}</td></tr>' +
132
+ '<tr><th class="label">Translated:</th><td class="value">#{translated_escape}</td></tr>' +
133
+ '<tr><th class="label"><label for="perstore_#{i}">Store View Specific:</label></th><td class="value">' +
134
+ '<input id="perstore_#{i}" name="translate[#{i}][perstore]" type="checkbox" value="1"/>' +
135
+ '</td></tr>' +
136
+ '<tr><th class="label"><label for="custom_#{i}">Custom:</label></th><td class="value">' +
137
+ '<input name="translate[#{i}][original]" type="hidden" value="#{scope}::#{original_escape}"/>' +
138
+ '<input id="custom_#{i}" name="translate[#{i}][custom]" class="input-text" value="#{translated_escape}" />' +
139
+ '</td></tr>' +
140
'</table></div>'
141
);
142
+ for (i = 0; i < data.length; i++) {
143
data[i]['i'] = i;
144
data[i]['shown_escape'] = this.escapeHTML(data[i]['shown']);
145
data[i]['translated_escape'] = this.escapeHTML(data[i]['translated']);
150
151
this.overlayShowEffectOptions = Windows.overlayShowEffectOptions;
152
this.overlayHideEffectOptions = Windows.overlayHideEffectOptions;
153
+ Windows.overlayShowEffectOptions = {duration: 0};
154
+ Windows.overlayHideEffectOptions = {duration: 0};
155
156
Dialog.confirm(content, {
157
+ draggable: true,
158
+ resizable: true,
159
+ closable: true,
160
+ className: "magento",
161
+ title: "Translation",
162
+ width: 650,
163
+ height: 470,
164
+ zIndex: 2100,
165
+ recenterAuto: false,
166
+ hideEffect: Element.hide,
167
+ showEffect: Element.show,
168
+ id: "translate-inline",
169
+ buttonClass: "form-button button",
170
+ okLabel: "Submit",
171
ok: this.formOk.bind(this),
172
cancel: this.formClose.bind(this),
173
onClose: this.formClose.bind(this)
174
});
175
+ this.trigHide();
176
},
177
178
formOk: function(win) {
182
this.formIsSubmitted = true;
183
184
var inputs = $('translate-inline-form').getInputs(), parameters = {};
185
+ for (var i = 0; i < inputs.length; i++) {
186
if (inputs[i].type == 'checkbox') {
187
if (inputs[i].checked) {
188
parameters[inputs[i].name] = inputs[i].value;
195
parameters['area'] = this.area;
196
197
new Ajax.Request(this.ajaxUrl, {
198
+ method: 'post',
199
+ parameters: parameters,
200
+ onComplete: this.ajaxComplete.bind(this, win)
201
});
202
203
this.formIsSubmitted = false;
214
this.formIsShown = false;
215
},
216
217
+ escapeHTML: function(str) {
218
+ this.helperDiv.innerHTML = '';
219
+ var text = document.createTextNode(str);
220
+ this.helperDiv.appendChild(text);
221
+ var escaped = this.helperDiv.innerHTML;
222
+ escaped = escaped.replace(/"/g, '&quot;');
223
+ return escaped;
224
}
225
}
js/varien/accordion.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Varien
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
Accordion = Class.create();
19
*
20
* @category Varien
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
Accordion = Class.create();
js/varien/configurable.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Varien
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
if (typeof Product == 'undefined') {
19
*
20
* @category Varien
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
if (typeof Product == 'undefined') {
js/varien/form.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Varien
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
VarienForm = Class.create();
@@ -168,6 +168,8 @@ RegionUpdater.prototype = {
168
this.regionTextEl = $(regionTextEl);
169
this.regionSelectEl = $(regionSelectEl);
170
this.zipEl = $(zipEl);
171
this.regions = regions;
172
173
this.disableAction = (typeof disableAction=='undefined') ? 'hide' : disableAction;
@@ -180,18 +182,76 @@ RegionUpdater.prototype = {
180
Event.observe(this.countryEl, 'change', this.update.bind(this));
181
},
182
183
update: function()
184
{
185
if (this.regions[this.countryEl.value]) {
186
var i, option, region, def;
187
188
if (this.regionTextEl) {
189
- def = this.regionTextEl.value.toLowerCase();
190
this.regionTextEl.value = '';
191
}
192
- if (!def) {
193
- def = this.regionSelectEl.getAttribute('defaultValue');
194
- }
195
196
this.regionSelectEl.options.length = 1;
197
for (regionId in this.regions[this.countryEl.value]) {
@@ -199,7 +259,8 @@ RegionUpdater.prototype = {
199
200
option = document.createElement('OPTION');
201
option.value = regionId;
202
- option.text = region.name;
203
204
if (this.regionSelectEl.options.add) {
205
this.regionSelectEl.options.add(option);
@@ -207,7 +268,9 @@ RegionUpdater.prototype = {
207
this.regionSelectEl.appendChild(option);
208
}
209
210
- if (regionId==def || region.name.toLowerCase()==def || region.code.toLowerCase()==def) {
211
this.regionSelectEl.value = regionId;
212
}
213
}
@@ -246,6 +309,7 @@ RegionUpdater.prototype = {
246
this.setMarkDisplay(this.regionSelectEl, false);
247
}
248
249
// Make Zip and its label required/optional
250
var zipUpdater = new ZipUpdater(this.countryEl.value, this.zipEl);
251
zipUpdater.update();
19
*
20
* @category Varien
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
VarienForm = Class.create();
168
this.regionTextEl = $(regionTextEl);
169
this.regionSelectEl = $(regionSelectEl);
170
this.zipEl = $(zipEl);
171
+ this.config = regions['config'];
172
+ delete regions.config;
173
this.regions = regions;
174
175
this.disableAction = (typeof disableAction=='undefined') ? 'hide' : disableAction;
182
Event.observe(this.countryEl, 'change', this.update.bind(this));
183
},
184
185
+ _checkRegionRequired: function()
186
+ {
187
+ var label, wildCard;
188
+ var elements = [this.regionTextEl, this.regionSelectEl];
189
+ var that = this;
190
+ if (typeof this.config == 'undefined') {
191
+ return;
192
+ }
193
+ var regionRequired = this.config.regions_required.indexOf(this.countryEl.value) >= 0;
194
+
195
+ elements.each(function(currentElement) {
196
+ Validation.reset(currentElement);
197
+ label = $('label[for="' + currentElement.id + '"]')[0];
198
+ if (label) {
199
+ wildCard = label.down('em') || label.down('span.required');
200
+ if (!that.config.show_all_regions) {
201
+ if (regionRequired) {
202
+ label.up().show();
203
+ } else {
204
+ label.up().hide();
205
+ }
206
+ }
207
+ }
208
+
209
+ if (label && wildCard) {
210
+ if (!regionRequired) {
211
+ wildCard.hide();
212
+ if (label.hasClassName('required')) {
213
+ label.removeClassName('required');
214
+ }
215
+ } else if (regionRequired) {
216
+ wildCard.show();
217
+ if (!label.hasClassName('required')) {
218
+ label.addClassName('required')
219
+ }
220
+ }
221
+ }
222
+
223
+ if (!regionRequired) {
224
+ if (currentElement.hasClassName('required-entry')) {
225
+ currentElement.removeClassName('required-entry');
226
+ }
227
+ if ('select' == currentElement.tagName.toLowerCase() &&
228
+ currentElement.hasClassName('validate-select')) {
229
+ currentElement.removeClassName('validate-select');
230
+ }
231
+ } else {
232
+ if (!currentElement.hasClassName('required-entry')) {
233
+ currentElement.addClassName('required-entry');
234
+ }
235
+ if ('select' == currentElement.tagName.toLowerCase() &&
236
+ !currentElement.hasClassName('validate-select')) {
237
+ currentElement.addClassName('validate-select');
238
+ }
239
+ }
240
+ });
241
+ },
242
+
243
update: function()
244
{
245
if (this.regions[this.countryEl.value]) {
246
var i, option, region, def;
247
248
+ def = this.regionSelectEl.getAttribute('defaultValue');
249
if (this.regionTextEl) {
250
+ if (!def) {
251
+ def = this.regionTextEl.value.toLowerCase();
252
+ }
253
this.regionTextEl.value = '';
254
}
255
256
this.regionSelectEl.options.length = 1;
257
for (regionId in this.regions[this.countryEl.value]) {
259
260
option = document.createElement('OPTION');
261
option.value = regionId;
262
+ option.text = region.name.stripTags();
263
+ option.title = region.name;
264
265
if (this.regionSelectEl.options.add) {
266
this.regionSelectEl.options.add(option);
268
this.regionSelectEl.appendChild(option);
269
}
270
271
+ if (regionId==def || (region.name && region.name.toLowerCase()==def) ||
272
+ (region.name && region.code.toLowerCase()==def)
273
+ ) {
274
this.regionSelectEl.value = regionId;
275
}
276
}
309
this.setMarkDisplay(this.regionSelectEl, false);
310
}
311
312
+ this._checkRegionRequired();
313
// Make Zip and its label required/optional
314
var zipUpdater = new ZipUpdater(this.countryEl.value, this.zipEl);
315
zipUpdater.update();
js/varien/iehover-fix.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Varien
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
function toggleMenu(el, over)
19
*
20
* @category Varien
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
function toggleMenu(el, over)
js/varien/js.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Varien
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
function popWin(url,win,para) {
@@ -634,6 +634,7 @@ Element.addMethods({
634
}
635
});
636
637
if (!("console" in window) || !("firebug" in console))
638
{
639
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
@@ -643,6 +644,7 @@ if (!("console" in window) || !("firebug" in console))
643
for (var i = 0; i < names.length; ++i)
644
window.console[names[i]] = function() {}
645
}
646
647
/**
648
* Executes event handler on the element. Works with event handlers attached by Prototype,
@@ -652,18 +654,38 @@ if (!("console" in window) || !("firebug" in console))
652
*
653
* @example fireEvent($('my-input', 'click'));
654
*/
655
- function fireEvent(element, event){
656
- if (document.createEventObject){
657
- // dispatch for IE
658
var evt = document.createEventObject();
659
- return element.fireEvent('on'+event,evt)
660
}
661
- else{
662
- // dispatch for firefox + others
663
- var evt = document.createEvent("HTMLEvents");
664
- evt.initEvent(event, true, true ); // event type,bubbling,cancelable
665
- return !element.dispatchEvent(evt);
666
}
667
}
668
669
/**
19
*
20
* @category Varien
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
function popWin(url,win,para) {
634
}
635
});
636
637
+ /*
638
if (!("console" in window) || !("firebug" in console))
639
{
640
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
644
for (var i = 0; i < names.length; ++i)
645
window.console[names[i]] = function() {}
646
}
647
+ */
648
649
/**
650
* Executes event handler on the element. Works with event handlers attached by Prototype,
654
*
655
* @example fireEvent($('my-input', 'click'));
656
*/
657
+ function fireEvent(element, event) {
658
+ if (document.createEvent) {
659
+ // dispatch for all browsers except IE before version 9
660
+ var evt = document.createEvent("HTMLEvents");
661
+ evt.initEvent(event, true, true ); // event type, bubbling, cancelable
662
+ return element.dispatchEvent(evt);
663
+ } else {
664
+ // dispatch for IE before version 9
665
var evt = document.createEventObject();
666
+ return element.fireEvent('on' + event, evt)
667
}
668
+ }
669
+
670
+ /**
671
+ * Returns more accurate results of floating-point modulo division
672
+ * E.g.:
673
+ * 0.6 % 0.2 = 0.19999999999999996
674
+ * modulo(0.6, 0.2) = 0
675
+ *
676
+ * @param dividend
677
+ * @param divisor
678
+ */
679
+ function modulo(dividend, divisor)
680
+ {
681
+ var epsilon = divisor / 10000;
682
+ var remainder = dividend % divisor;
683
+
684
+ if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {
685
+ remainder = 0;
686
}
687
+
688
+ return remainder;
689
}
690
691
/**
js/varien/menu.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Varien
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
19
*
20
* @category Varien
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
js/varien/payment.js CHANGED
@@ -19,7 +19,7 @@
19
*
20
* @category Varien
21
* @package js
22
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var paymentForm = Class.create();
19
*
20
* @category Varien
21
* @package js
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
*/
25
var paymentForm = Class.create();