Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed prototypejs from varien/product.js, varien/configurable.js and configurableswatches/swatches-product.js #68

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<?php if ($this->getLayout()->getBlock('head')->getItems('skin_js/js/configurableswatches/swatches-product.js')): ?>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var swatchesConfig = new ProductConfigurableSwatches(spConfig);
new Product.ConfigurableSwatches(spConfig);
});
</script>
<?php endif ?>
36 changes: 0 additions & 36 deletions public/js/prototype/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -815,42 +815,6 @@ Object.extend(String.prototype, (function() {
};
})());

var Template = Class.create({
initialize: function(template, pattern) {
this.template = template.toString();
this.pattern = pattern || Template.Pattern;
},

evaluate: function(object) {
if (object && Object.isFunction(object.toTemplateReplacements))
object = object.toTemplateReplacements();

return this.template.gsub(this.pattern, function(match) {
if (object == null) return (match[1] + '');

var before = match[1] || '';
if (before == '\\') return match[2];

var ctx = object, expr = match[3],
pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;

match = pattern.exec(expr);
if (match == null) return before;

while (match != null) {
var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
ctx = ctx[comp];
if (null == ctx || '' == match[3]) break;
expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
match = pattern.exec(expr);
}

return before + String.interpret(ctx);
});
}
});
Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;

var $break = { };

var Enumerable = (function() {
Expand Down
Loading
Loading