-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1476 from magento-performance/perf_mpi
Bugs - MAGETWO-70163 Add quote generation ability for fixtures generation tool - MAGETWO-66914 PAT with custom profile - MAGETWO-72401 fix jenkins unittest - MAGETWO-71870 Unable to place new order for a New Customer from backend - MAGETWO-72184 PHP precision causes issues with float and rounded digits - MAGETWO-72305 USPS First-Class Mail Parcel method no longer displaying checkout - MAGETWO-71831 Unable to create a shipping label for a shipment with USPS - MAGETWO-71759 Impossible place order from admin using saved PayPal Pro credit card - MAGETWO-65688 Unable to configure products from products and wish list accordion when managing shopping cart - MAGETWO-71969 Unable to finish checkout in Safari (private mode) - MAGETWO-69210 [Google Tag Manager] Ajax "Add to Cart" / "Remove from Cart" do not fire any events
- Loading branch information
Showing
28 changed files
with
1,990 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 132 additions & 0 deletions
132
app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
/** | ||
* Polyfill for local storage and session storage for old browsers and with enabled private mode. | ||
* | ||
* Emulates behavior of the native local storage and session storage. Adds ability to use "getItem", "setItem", | ||
* "removeItem" methods. | ||
*/ | ||
?> | ||
|
||
<script> | ||
try { | ||
if (!window.localStorage || !window.sessionStorage) { | ||
throw new Error(); | ||
} | ||
|
||
localStorage.setItem('storage_test', 1); | ||
localStorage.removeItem('storage_test'); | ||
} catch(e) { | ||
(function () { | ||
var Storage = function (type) { | ||
var data; | ||
|
||
function createCookie(name, value, days) { | ||
var date, expires; | ||
|
||
if (days) { | ||
date = new Date(); | ||
date.setTime(date.getTime()+(days * 24 * 60 * 60 * 1000)); | ||
expires = '; expires=' + date.toGMTString(); | ||
} else { | ||
expires = ''; | ||
} | ||
document.cookie = name + '=' + value+expires+'; path=/'; | ||
} | ||
|
||
function readCookie(name) { | ||
var nameEQ = name + '=', | ||
ca = document.cookie.split(';'), | ||
i = 0, | ||
c; | ||
|
||
for (i=0; i < ca.length; i++) { | ||
c = ca[i]; | ||
|
||
while (c.charAt(0) === ' ') { | ||
c = c.substring(1,c.length); | ||
} | ||
|
||
if (c.indexOf(nameEQ) === 0) { | ||
return c.substring(nameEQ.length, c.length); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
function setData(data) { | ||
data = encodeURIComponent(JSON.stringify(data)); | ||
createCookie(type === 'session' ? getSessionName() : 'localStorage', data, 365); | ||
} | ||
|
||
function clearData() { | ||
createCookie(type === 'session' ? getSessionName() : 'localStorage', '', 365); | ||
} | ||
|
||
function getData() { | ||
var data = type === 'session' ? readCookie(getSessionName()) : readCookie('localStorage'); | ||
|
||
return data ? JSON.parse(decodeURIComponent(data)) : {}; | ||
} | ||
|
||
function getSessionName() { | ||
if (!window.name) { | ||
window.name = new Date().getTime(); | ||
} | ||
|
||
return 'sessionStorage' + window.name; | ||
} | ||
|
||
data = getData(); | ||
|
||
return { | ||
length: 0, | ||
clear: function () { | ||
data = {}; | ||
this.length = 0; | ||
clearData(); | ||
}, | ||
|
||
getItem: function (key) { | ||
return data[key] === undefined ? null : data[key]; | ||
}, | ||
|
||
key: function (i) { | ||
var ctr = 0, | ||
k; | ||
|
||
for (k in data) { | ||
if (ctr.toString() === i.toString()) { | ||
return k; | ||
} else { | ||
ctr++ | ||
} | ||
} | ||
|
||
return null; | ||
}, | ||
|
||
removeItem: function (key) { | ||
delete data[key]; | ||
this.length--; | ||
setData(data); | ||
}, | ||
|
||
setItem: function (key, value) { | ||
data[key] = value.toString(); | ||
this.length++; | ||
setData(data); | ||
} | ||
}; | ||
}; | ||
|
||
window.localStorage.__proto__ = window.localStorage = new Storage('local'); | ||
window.sessionStorage.__proto__ = window.sessionStorag = new Storage('session'); | ||
})(); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.