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
- js/lib/dropdown.js +1 -1
- js/lib/flex.js +1 -1
- js/mage/adminhtml/accordion.js +1 -1
- js/mage/adminhtml/backup.js +192 -0
- js/mage/adminhtml/browser.js +1 -1
- js/mage/adminhtml/events.js +1 -1
- js/mage/adminhtml/flexuploader.js +9 -9
- js/mage/adminhtml/form.js +80 -11
- js/mage/adminhtml/giftmessage.js +1 -1
- js/mage/adminhtml/giftoptions/tooltip.js +1 -1
- js/mage/adminhtml/grid.js +16 -8
- js/mage/adminhtml/hash.js +1 -1
- js/mage/adminhtml/image.js +1 -1
- js/mage/adminhtml/loader.js +6 -3
- js/mage/adminhtml/magento-all.js +1 -1
- js/mage/adminhtml/product.js +1 -1
- js/mage/adminhtml/product/composite/configure.js +10 -10
- js/mage/adminhtml/rules.js +1 -1
- js/mage/adminhtml/sales.js +217 -15
- js/mage/adminhtml/sales/packaging.js +13 -2
- js/mage/adminhtml/scrollbar.js +1 -1
- js/mage/adminhtml/tabs.js +1 -1
- js/mage/adminhtml/tools.js +1 -1
- js/mage/adminhtml/uploader.js +1 -1
- js/mage/adminhtml/variables.js +2 -2
- js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +1 -1
- js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js +1 -1
- js/mage/adminhtml/wysiwyg/tiny_mce/setup.js +11 -4
- js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css +1 -1
- js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css +1 -1
- js/mage/adminhtml/wysiwyg/widget.js +13 -2
- js/mage/captcha.js +87 -0
- js/mage/centinel.js +1 -1
- js/mage/cookies.js +1 -1
- js/mage/directpost.js +1 -1
- js/mage/translate.js +1 -1
- js/mage/translate_inline.css +5 -3
- js/mage/translate_inline.js +95 -69
- js/varien/accordion.js +1 -1
- js/varien/configurable.js +1 -1
- js/varien/form.js +71 -7
- js/varien/iehover-fix.js +1 -1
- js/varien/js.js +32 -10
- js/varien/menu.js +1 -1
- js/varien/payment.js +1 -1
- js/varien/product.js +58 -6
- js/varien/telephone.js +1 -1
- js/varien/weee.js +1 -1
- package.xml +6 -6
js/lib/dropdown.js
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
*
|
20 |
* @category Mage
|
21 |
* @package js
|
22 |
-
* @copyright Copyright (c)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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('
|
288 |
-
} else if (size > 1024*1024*1024) {
|
289 |
-
return this.round(size/(1024*1024*1024))
|
290 |
-
} else if (size > 1024*1024) {
|
291 |
-
return this.round(size/(1024*1024))
|
292 |
} else if (size > 1024) {
|
293 |
-
return this.round(size/(1024))
|
294 |
}
|
295 |
-
return size
|
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)
|
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 |
-
$
|
106 |
}
|
107 |
-
$
|
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 |
-
|
|
|
|
|
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 (
|
445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
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)
|
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)
|
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 |
-
|
244 |
var re = new RegExp('\/('+varName+'\/.*?\/)');
|
245 |
-
var parts =
|
246 |
-
|
247 |
-
|
248 |
if(parts.size()>1) {
|
249 |
-
|
250 |
}
|
251 |
-
|
|
|
|
|
|
|
252 |
return this.url;
|
253 |
},
|
254 |
doExport : function(){
|
255 |
if($(this.containerId+'_export')){
|
256 |
-
|
|
|
|
|
|
|
|
|
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)
|
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)
|
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)
|
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
|
|
|
|
|
|
|
|
|
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)
|
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)
|
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)
|
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+\]\[(
|
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+)\]\[(
|
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+)\]\[(
|
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+\]\[([^\]]+)\]$/);
|
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+)\]\[([^\]]+)\]$/);
|
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+)\]\[([^\]]+)\]$/);
|
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)
|
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)
|
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 = '
|
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++)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
231 |
},
|
232 |
|
@@ -598,13 +663,27 @@ AdminOrder.prototype = {
|
|
598 |
this.showArea('data');
|
599 |
},
|
600 |
|
601 |
-
|
602 |
-
if(
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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, '"').replace(/'/g, '\\'');
|
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, '"').replace(/'/g, '\\'');
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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; */
|
|
|
|
|
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:
|
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)
|
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 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
59 |
$$('*[translate]').each(this.initializeElement.bind(this));
|
60 |
},
|
61 |
|
62 |
-
trigShow: function
|
63 |
-
this.
|
64 |
-
|
65 |
-
|
|
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
|
71 |
-
|
|
|
72 |
},
|
73 |
|
74 |
trigHide: function() {
|
@@ -76,15 +98,18 @@ TranslateInline.prototype = {
|
|
76 |
this.trigContentEl = null;
|
77 |
},
|
78 |
|
79 |
-
trigHideDelayed: function
|
80 |
-
this.trigTimer
|
|
|
|
|
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 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
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:
|
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
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
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, '"');
|
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)
|
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)
|
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)
|
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 |
-
|
|
|
|
|
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
|
|
|
|
|
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)
|
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)
|
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.
|
657 |
-
// dispatch for IE
|
|
|
|
|
|
|
|
|
|
|
658 |
var evt = document.createEventObject();
|
659 |
-
return element.fireEvent('on'+event,evt)
|
660 |
}
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
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)
|
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();
|
js/varien/product.js
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
*
|
20 |
* @category Varien
|
21 |
* @package js
|
22 |
-
* @copyright Copyright (c)
|
23 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
24 |
*/
|
25 |
if(typeof Product=='undefined') {
|
@@ -491,7 +491,8 @@ Product.Config.prototype = {
|
|
491 |
for(var i=this.settings.length-1;i>=0;i--){
|
492 |
var selected = this.settings[i].options[this.settings[i].selectedIndex];
|
493 |
if(selected.config){
|
494 |
-
|
|
|
495 |
}
|
496 |
}
|
497 |
if (price < 0)
|
@@ -563,15 +564,21 @@ Product.OptionsPrice.prototype = {
|
|
563 |
this.skipCalculate = config.skipCalculate;//@deprecated after 1.5.1.0
|
564 |
this.duplicateIdSuffix = config.idSuffix;
|
565 |
this.specialTaxPrice = config.specialTaxPrice;
|
|
|
|
|
566 |
|
567 |
this.oldPlusDisposition = config.oldPlusDisposition;
|
568 |
this.plusDisposition = config.plusDisposition;
|
|
|
569 |
|
570 |
this.oldMinusDisposition = config.oldMinusDisposition;
|
571 |
this.minusDisposition = config.minusDisposition;
|
572 |
|
573 |
-
this.
|
574 |
-
|
|
|
|
|
|
|
575 |
|
576 |
this.displayZeroPrice = true;
|
577 |
|
@@ -594,6 +601,9 @@ Product.OptionsPrice.prototype = {
|
|
594 |
this.optionPrices[key] = price;
|
595 |
},
|
596 |
|
|
|
|
|
|
|
597 |
getOptionPrices: function() {
|
598 |
var price = 0;
|
599 |
var nonTaxable = 0;
|
@@ -669,8 +679,25 @@ Product.OptionsPrice.prototype = {
|
|
669 |
var incl = excl + tax;
|
670 |
}
|
671 |
|
672 |
-
|
673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
excl -= parseFloat(_minusDisposition);
|
675 |
incl -= parseFloat(_minusDisposition);
|
676 |
|
@@ -717,6 +744,31 @@ Product.OptionsPrice.prototype = {
|
|
717 |
}
|
718 |
};
|
719 |
}.bind(this));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
},
|
721 |
formatPrice: function(price) {
|
722 |
return formatCurrency(price, this.priceFormat);
|
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') {
|
491 |
for(var i=this.settings.length-1;i>=0;i--){
|
492 |
var selected = this.settings[i].options[this.settings[i].selectedIndex];
|
493 |
if(selected.config){
|
494 |
+
var parsedOldPrice = parseFloat(selected.config.oldPrice);
|
495 |
+
price += isNaN(parsedOldPrice) ? 0 : parsedOldPrice;
|
496 |
}
|
497 |
}
|
498 |
if (price < 0)
|
564 |
this.skipCalculate = config.skipCalculate;//@deprecated after 1.5.1.0
|
565 |
this.duplicateIdSuffix = config.idSuffix;
|
566 |
this.specialTaxPrice = config.specialTaxPrice;
|
567 |
+
this.tierPrices = config.tierPrices;
|
568 |
+
this.tierPricesInclTax = config.tierPricesInclTax;
|
569 |
|
570 |
this.oldPlusDisposition = config.oldPlusDisposition;
|
571 |
this.plusDisposition = config.plusDisposition;
|
572 |
+
this.plusDispositionTax = config.plusDispositionTax;
|
573 |
|
574 |
this.oldMinusDisposition = config.oldMinusDisposition;
|
575 |
this.minusDisposition = config.minusDisposition;
|
576 |
|
577 |
+
this.exclDisposition = config.exclDisposition;
|
578 |
+
|
579 |
+
this.optionPrices = {};
|
580 |
+
this.customPrices = {};
|
581 |
+
this.containers = {};
|
582 |
|
583 |
this.displayZeroPrice = true;
|
584 |
|
601 |
this.optionPrices[key] = price;
|
602 |
},
|
603 |
|
604 |
+
addCustomPrices: function(key, price) {
|
605 |
+
this.customPrices[key] = price;
|
606 |
+
},
|
607 |
getOptionPrices: function() {
|
608 |
var price = 0;
|
609 |
var nonTaxable = 0;
|
679 |
var incl = excl + tax;
|
680 |
}
|
681 |
|
682 |
+
var subPrice = 0;
|
683 |
+
var subPriceincludeTax = 0;
|
684 |
+
Object.values(this.customPrices).each(function(el){
|
685 |
+
if (el.excludeTax && el.includeTax) {
|
686 |
+
subPrice += parseFloat(el.excludeTax);
|
687 |
+
subPriceincludeTax += parseFloat(el.includeTax);
|
688 |
+
} else {
|
689 |
+
subPrice += parseFloat(el.price);
|
690 |
+
subPriceincludeTax += parseFloat(el.price);
|
691 |
+
}
|
692 |
+
});
|
693 |
+
excl += subPrice;
|
694 |
+
incl += subPriceincludeTax;
|
695 |
+
|
696 |
+
if (typeof this.exclDisposition == 'undefined') {
|
697 |
+
excl += parseFloat(_plusDisposition);
|
698 |
+
}
|
699 |
+
|
700 |
+
incl += parseFloat(_plusDisposition) + parseFloat(this.plusDispositionTax);
|
701 |
excl -= parseFloat(_minusDisposition);
|
702 |
incl -= parseFloat(_minusDisposition);
|
703 |
|
744 |
}
|
745 |
};
|
746 |
}.bind(this));
|
747 |
+
|
748 |
+
for (var i = 0; i < this.tierPrices.length; i++) {
|
749 |
+
$$('.price.tier-' + i).each(function (el) {
|
750 |
+
var price = this.tierPrices[i] + parseFloat(optionPrices);
|
751 |
+
el.innerHTML = this.formatPrice(price);
|
752 |
+
}, this);
|
753 |
+
$$('.price.tier-' + i + '-incl-tax').each(function (el) {
|
754 |
+
var price = this.tierPricesInclTax[i] + parseFloat(optionPrices);
|
755 |
+
el.innerHTML = this.formatPrice(price);
|
756 |
+
}, this);
|
757 |
+
$$('.benefit').each(function (el) {
|
758 |
+
var parsePrice = function (html) {
|
759 |
+
return parseFloat(/\d+\.?\d*/.exec(html));
|
760 |
+
};
|
761 |
+
var container = $(this.containers[3]) ? this.containers[3] : this.containers[0];
|
762 |
+
var price = parsePrice($(container).innerHTML);
|
763 |
+
var tierPrice = $$('.price.tier-' + i);
|
764 |
+
tierPrice = tierPrice.length ? parseInt(tierPrice[0].innerHTML, 10) : 0;
|
765 |
+
var $percent = Selector.findChildElements(el, ['.percent.tier-' + i]);
|
766 |
+
$percent.each(function (el) {
|
767 |
+
el.innerHTML = Math.ceil(100 - ((100 / price) * tierPrice));
|
768 |
+
});
|
769 |
+
}, this);
|
770 |
+
}
|
771 |
+
|
772 |
},
|
773 |
formatPrice: function(price) {
|
774 |
return formatCurrency(price, this.priceFormat);
|
js/varien/telephone.js
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
*
|
20 |
* @category Varien
|
21 |
* @package js
|
22 |
-
* @copyright Copyright (c)
|
23 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
24 |
*/
|
25 |
var telephoneElem = 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 telephoneElem = Class.create();
|
js/varien/weee.js
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
*
|
20 |
* @category Varien
|
21 |
* @package js
|
22 |
-
* @copyright Copyright (c)
|
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 |
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Lib_Js_Mage</name>
|
4 |
-
<version>1.
|
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.
|
12 |
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
|
13 |
-
<date>
|
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="
|
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.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Lib_Js_Mage</name>
|
4 |
+
<version>1.7.0.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.7.0.0</notes>
|
12 |
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
|
13 |
+
<date>2012-04-23</date>
|
14 |
+
<time>13:47:52</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="7757104b80e01d507082b60a271f57e7"/><file name="ds-sleight.js" hash="85af457d444865d1587bfe4875bd4fc6"/><file name="flex.js" hash="060f10cef353267ae9fbc04aaae9c961"/></dir><dir name="mage"><dir name="adminhtml"><file name="accordion.js" hash="d7cc8f6c90e080e1fb51917193e5606a"/><file name="backup.js" hash="144263655a5b8de10133c9d8f820ba48"/><file name="browser.js" hash="92b52032653fca56121c080d1d3af4b4"/><file name="events.js" hash="c25dc9026707492f99c2b540baae2a89"/><file name="flexuploader.js" hash="323a7703f4e513f129f32e7128ee95f8"/><file name="form.js" hash="d8c5f666cdfbe8b69b69d7eb9851e9f7"/><file name="giftmessage.js" hash="ca431002459046736333283c91a960dc"/><dir name="giftoptions"><file name="tooltip.js" hash="4922615b101277d29b6134946fa225ee"/></dir><file name="grid.js" hash="9c80acd70822d1617d110ee4a09f4335"/><file name="hash.js" hash="966e0d30a0ae5f49f0d88b854cd03938"/><file name="image.js" hash="2e9b2b2cb643696abd66080008f6d60b"/><file name="loader.js" hash="da82d1a8038dabb927a64c865c74738c"/><file name="magento-all.js" hash="6ea56eb8812f5cbb8b6d52cf10cbff38"/><dir name="product"><dir name="composite"><file name="configure.js" hash="53dd550f86fc844f7014595641855aab"/></dir></dir><file name="product.js" hash="ed9ce060316daef1b12114a9032cc055"/><file name="rules.js" hash="119108973a2b00903832a3d9b7f9f52b"/><dir name="sales"><file name="packaging.js" hash="db2815a9e6827240757f5465e5bb6cad"/></dir><file name="sales.js" hash="a1df25cf1fe8c45c6efe0e8816690b43"/><file name="scrollbar.js" hash="9f667d4cb5f0bac81c9904d776fb6ef7"/><file name="tabs.js" hash="592a85acec47abe61c849639c99c0f6f"/><file name="tools.js" hash="ee9bda25c8f08856ce6002dea7d90e16"/><file name="uploader.js" hash="f26849cfba32c032b6b9eaefd6a25335"/><file name="variables.js" hash="d435a922116e7aa987847f2c393f3a91"/><dir name="wysiwyg"><dir name="tiny_mce"><dir name="plugins"><dir name="magentovariable"><file name="editor_plugin.js" hash="b8dbb8f7cc375c9593e1fd90ec906a50"/><dir name="img"><file name="icon.gif" hash="682b29a0e734f952cb2edabede6a25d1"/></dir></dir><dir name="magentowidget"><file name="editor_plugin.js" hash="87ea6f9c3fbe5da01641972ab7a64890"/><dir name="img"><file name="icon.gif" hash="532c141286373f098f1f4362e001c7f8"/></dir></dir></dir><file name="setup.js" hash="620d54292445b941c236b5324d3af304"/><dir name="themes"><dir name="advanced"><dir name="skins"><dir name="default"><file name="content.css" hash="297eee5563d686c6d35a7bee4d594f4a"/><file name="dialog.css" hash="4e1e5f92c4e7ed40c5d49fda68b84751"/></dir></dir></dir></dir></dir><file name="widget.js" hash="871d4672a43f227bff4deef36fda5215"/></dir></dir><file name="captcha.js" hash="159fcd4a765500a54bad03a41b592371"/><file name="centinel.js" hash="ee5d37c1ea3465d91184c48f5f2d6df0"/><file name="cookies.js" hash="910c5adfacb3e86d4dc3abc4a03f6b72"/><file name="directpost.js" hash="4a2a4778b51a25922d29cead199d1559"/><file name="translate.js" hash="ba0eda44563ecf432eaabd5c681d7ed5"/><file name="translate_inline.css" hash="c60b7f338f5c369feeda574325dfeda0"/><file name="translate_inline.js" hash="04b7a93d865b1912ac9797624ba5c8b5"/></dir><dir name="varien"><file name="accordion.js" hash="cd2d7e0af239a0474de3c93408b9b85f"/><file name="configurable.js" hash="a578e6e7aeba8e4588aecb068fe8b3f9"/><file name="form.js" hash="c16ed6f82b78d8f3bc07de6f5ebd8eb6"/><file name="iehover-fix.js" hash="7def97b6b209314c761178f0e50c4d25"/><file name="js.js" hash="bff5486446e27aeceb7eb73de7756c17"/><file name="menu.js" hash="a457935d44e224b38fce6ad4bdd17e2c"/><file name="payment.js" hash="88dc739195b68244382573b4ad87a94b"/><file name="product.js" hash="baccd30adfbec3c2b4331bc31f1df9d7"/><file name="telephone.js" hash="fd686f1e9635984bb1b754ec3eac5db0"/><file name="weee.js" hash="7c22f52bacac3de7fbd961b49910884e"/></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.3</min><max>1.7.1.0</max></package></required></dependencies>
|
18 |
</package>
|