Data8_DataCaptureValidation - Version 1.0.3

Version Notes

Fixed cross-browser issues.

Download this release

Release Info

Developer Data8
Extension Data8_DataCaptureValidation
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

Files changed (3) hide show
  1. js/Data8/address.js +2 -2
  2. js/Data8/magentoaddress.js +44 -4
  3. package.xml +4 -4
js/Data8/address.js CHANGED
@@ -185,9 +185,9 @@ data8.postcodeLookupButton.prototype.showAddressList = function (addresses) {
185
  // Add the addresses to the list.
186
  for (var i = 0; i < addresses.length; i++) {
187
  var option = document.createElement('option');
188
- option.innerText = this.getAddressText(addresses[i]);
189
  option.address = addresses[i];
190
- listElement.options[i] = option;
191
  }
192
 
193
  // Save the function to apply the selected address.
185
  // Add the addresses to the list.
186
  for (var i = 0; i < addresses.length; i++) {
187
  var option = document.createElement('option');
188
+ option.text = this.getAddressText(addresses[i]);
189
  option.address = addresses[i];
190
+ listElement.add(option, null);
191
  }
192
 
193
  // Save the function to apply the selected address.
js/Data8/magentoaddress.js CHANGED
@@ -10,14 +10,14 @@ data8.magentoPostcodeLookupButton.prototype = new data8.postcodeLookupButton();
10
 
11
  data8.magentoPostcodeLookupButton.prototype.createButton = function () {
12
  var button = document.createElement('button');
13
- button.type = 'button';
14
  button.className = 'button';
15
  button.style.marginLeft = '10px';
16
  var span1 = document.createElement('span');
17
  button.appendChild(span1);
18
  var span2 = document.createElement('span');
19
  span1.appendChild(span2);
20
- span2.innerText = 'Find';
21
 
22
  return button;
23
  };
@@ -61,8 +61,48 @@ data8.magentoPostcodeLookupButton.prototype.show = function () {
61
  button.hide();
62
 
63
  // Check if we can move the postcode and country fields above the rest of the address.
64
- if (countryDropDown.get(0).parentNode.parentNode.parentNode == this.button.parentNode.parentNode.parentNode && // both on same row
65
- this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.childNodes[3].childNodes[1].id.indexOf('street') != -1) { // 3 rows after street 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  // Move the row up
67
  var postcodeCountryRow = this.button.parentNode.parentNode.parentNode;
68
  var street1Row = postcodeCountryRow.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling;
10
 
11
  data8.magentoPostcodeLookupButton.prototype.createButton = function () {
12
  var button = document.createElement('button');
13
+ button.setAttribute('type', 'button');
14
  button.className = 'button';
15
  button.style.marginLeft = '10px';
16
  var span1 = document.createElement('span');
17
  button.appendChild(span1);
18
  var span2 = document.createElement('span');
19
  span1.appendChild(span2);
20
+ span2.innerHTML = 'Find';
21
 
22
  return button;
23
  };
61
  button.hide();
62
 
63
  // Check if we can move the postcode and country fields above the rest of the address.
64
+ if (countryDropDown.get(0).parentNode &&
65
+ countryDropDown.get(0).parentNode.parentNode &&
66
+ countryDropDown.get(0).parentNode.parentNode.parentNode &&
67
+ this.button.parentNode &&
68
+ this.button.parentNode.parentNode &&
69
+ this.button.parentNode.parentNode.parentNode &&
70
+ countryDropDown.get(0).parentNode.parentNode.parentNode == this.button.parentNode.parentNode.parentNode && // both on same row
71
+ this.button.parentNode.parentNode.parentNode.previousSibling &&
72
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling &&
73
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling &&
74
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.childNodes.length > 2 &&
75
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.childNodes[2].childNodes.length > 0 &&
76
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.childNodes[2].childNodes[0].id &&
77
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.childNodes[2].childNodes[0].id.indexOf('street') != -1) { // 3 rows after street 1
78
+ // Move the row up
79
+ var postcodeCountryRow = this.button.parentNode.parentNode.parentNode;
80
+ var street1Row = postcodeCountryRow.previousSibling.previousSibling.previousSibling;
81
+ postcodeCountryRow.parentNode.removeChild(postcodeCountryRow);
82
+ jQuery(postcodeCountryRow).insertBefore(street1Row);
83
+
84
+ // Swap the fields around in the row.
85
+ var postcodeField = this.button.parentNode.parentNode;
86
+ postcodeCountryRow.removeChild(postcodeField);
87
+ postcodeCountryRow.appendChild(postcodeField);
88
+ }
89
+ else if (countryDropDown.get(0).parentNode &&
90
+ countryDropDown.get(0).parentNode.parentNode &&
91
+ countryDropDown.get(0).parentNode.parentNode.parentNode &&
92
+ this.button.parentNode &&
93
+ this.button.parentNode.parentNode &&
94
+ this.button.parentNode.parentNode.parentNode &&
95
+ countryDropDown.get(0).parentNode.parentNode.parentNode == this.button.parentNode.parentNode.parentNode && // both on same row
96
+ this.button.parentNode.parentNode.parentNode.previousSibling &&
97
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling &&
98
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling &&
99
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling &&
100
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling &&
101
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling &&
102
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.childNodes.length > 3 &&
103
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.childNodes[3].childNodes.length > 1 &&
104
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.childNodes[3].childNodes[1].id &&
105
+ this.button.parentNode.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.childNodes[3].childNodes[1].id.indexOf('street') != -1) { // 3 rows after street 1
106
  // Move the row up
107
  var postcodeCountryRow = this.button.parentNode.parentNode.parentNode;
108
  var street1Row = postcodeCountryRow.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Data8_DataCaptureValidation</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -10,11 +10,11 @@
10
  <description>* Adds postcode lookup functionality to all address entry screens, speeding up the checkout process and improving the deliverability of parcels. Covers all UK addresses and degrades gracefully when a different country is selected.&#xD;
11
  * Adds extensive telephone number validation for all UK and North American telephone numbers and degrades gracefully when a different country is selected.&#xD;
12
  * Adds extensive international email address validation.</description>
13
- <notes>Fixed installation issues.</notes>
14
  <authors><author><name>Data8</name><user>data8_technical</user><email>technical@data-8.co.uk</email></author></authors>
15
  <date>2012-05-10</date>
16
- <time>09:23:32</time>
17
- <contents><target name="magecommunity"><dir name="Data8"><dir name="DataCaptureValidation"><dir name="Block"><file name="Javascript.php" hash="16f9e4084dd2f20ca6588a39edcc1f0c"/></dir><file name="EmailValidationTypeList.php" hash="89910b62ec4efe9c4eada99b76d8b2cd"/><dir name="Helper"><file name="Data.php" hash="e8c6af1f98bf0f9640134b24dc642122"/></dir><file name="LicenseTypeList.php" hash="ddd66dd3149d083ecd69555bd4ba1a52"/><dir name="controllers"><file name="IndexController.php" hash="8d82912789ff1b1494aa56345ff5d7d9"/></dir><dir name="etc"><file name="config.xml" hash="37b7ffa4921af00ee82a44c54d129e36"/><file name="system.xml" hash="c1a609fa83e13d2c1ccab80d3890f6a9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="Data8_DataCaptureValidation.xml" hash="506c38f100fa1cf2b8eda1f72b694810"/></dir><dir name="template"><dir name="data8"><dir name="datacapturevalidation"><file name="data8_javascript.phtml" hash="9a426048ed6a23f93e36bf4a66e1ab4b"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="Data8"><file name="address.js" hash="80079b237bb12af3559b779ea322df0a"/><file name="jquery-1.7.1.min.js" hash="2c57990a020cc3a35c4a603413d67a28"/><file name="magentoaddress.js" hash="fed5a9804481add938626e686b2d0f45"/><file name="validation.js" hash="2f164db255c20476b4b29449b6be3147"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Data8_DataCaptureValidation.xml" hash="9c16925bf791b39a2e51dd40552b6429"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0.0</max></package></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Data8_DataCaptureValidation</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
10
  <description>* Adds postcode lookup functionality to all address entry screens, speeding up the checkout process and improving the deliverability of parcels. Covers all UK addresses and degrades gracefully when a different country is selected.&#xD;
11
  * Adds extensive telephone number validation for all UK and North American telephone numbers and degrades gracefully when a different country is selected.&#xD;
12
  * Adds extensive international email address validation.</description>
13
+ <notes>Fixed cross-browser issues.</notes>
14
  <authors><author><name>Data8</name><user>data8_technical</user><email>technical@data-8.co.uk</email></author></authors>
15
  <date>2012-05-10</date>
16
+ <time>10:38:10</time>
17
+ <contents><target name="magecommunity"><dir name="Data8"><dir name="DataCaptureValidation"><dir name="Block"><file name="Javascript.php" hash="16f9e4084dd2f20ca6588a39edcc1f0c"/></dir><file name="EmailValidationTypeList.php" hash="89910b62ec4efe9c4eada99b76d8b2cd"/><dir name="Helper"><file name="Data.php" hash="e8c6af1f98bf0f9640134b24dc642122"/></dir><file name="LicenseTypeList.php" hash="ddd66dd3149d083ecd69555bd4ba1a52"/><dir name="controllers"><file name="IndexController.php" hash="8d82912789ff1b1494aa56345ff5d7d9"/></dir><dir name="etc"><file name="config.xml" hash="37b7ffa4921af00ee82a44c54d129e36"/><file name="system.xml" hash="c1a609fa83e13d2c1ccab80d3890f6a9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="Data8_DataCaptureValidation.xml" hash="506c38f100fa1cf2b8eda1f72b694810"/></dir><dir name="template"><dir name="data8"><dir name="datacapturevalidation"><file name="data8_javascript.phtml" hash="9a426048ed6a23f93e36bf4a66e1ab4b"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="Data8"><file name="address.js" hash="f03ee3c3bf1bebabfb0518b8f0bd46b9"/><file name="jquery-1.7.1.min.js" hash="2c57990a020cc3a35c4a603413d67a28"/><file name="magentoaddress.js" hash="f164aeeb0e9904fcbceb4ac3ce9d9ce7"/><file name="validation.js" hash="2f164db255c20476b4b29449b6be3147"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Data8_DataCaptureValidation.xml" hash="9c16925bf791b39a2e51dd40552b6429"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0.0</max></package></required></dependencies>
20
  </package>