Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,241 @@
<?php
/* @PrestaShop/Admin/Helpers/range_inputs.html.twig */
class __TwigTemplate_f9c392cd42b79cc0f82d72373db783164a91c01104fc1d0ae3373734bee95841 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 26
echo "<script>
\$(document).ready(function() {
var sliderInput = \$('#";
// line 28
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "');
var minInput = \$('#";
// line 29
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "_min');
var maxInput = \$('#";
// line 30
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "_max');
// parse and fix init value
var value = sliderInput.attr('sql');
if (value != '') {
\t value = value.replace('BETWEEN ', '');
\t value = value.replace(' AND ', ',');
\t value = value.replace('<=', '";
// line 37
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo ",');
\t value = value.replace('>=', '";
// line 38
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo ",');
\t value = value.split(',');
\t value[0] = Number(value[0]);
\t value[1] = Number(value[1]);
} else {
value = [";
// line 43
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo ", ";
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo "];
}
value = value.sort(function sortNumber(a,b) {
return a - b;
});
// Init inputs
if (value[0] > ";
// line 50
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo ")
minInput.val(value[0]);
if (value[1] < ";
// line 52
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo ")
maxInput.val(value[1]);
// Change events
var inputFlasher = function(input) {
// animate input to highlight it (like a pulsate effect on jqueryUI)
\$(input).stop().delay(100)
.fadeIn(100).fadeOut(100)
.queue(function() { \$(this).css(\"background-color\", \"#FF5555\").dequeue(); })
.fadeIn(160).fadeOut(160).fadeIn(160).fadeOut(160).fadeIn(160)
.animate({ backgroundColor: \"#FFFFFF\"}, 800);
};
var updater = function(srcElement) {
var isMinModified = (srcElement.attr('id') == minInput.attr('id'));
// retrieve values, replace ',' by '.', cast them into numbers (float/int)
var newValues = [(minInput.val()!='')?Number(minInput.val().replace(',', '.')):";
// line 68
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo ", (maxInput.val()!='')?Number(maxInput.val().replace(',', '.')):";
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo "];
// if newValues are out of bounds, or not valid, fix the element.
if (isMinModified && !(newValues[0] >= ";
// line 71
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo " && newValues[0] <= ";
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo ")) {
newValues[0] = ";
// line 72
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo ";
minInput.val('');
inputFlasher(minInput);
}
if (!isMinModified && !(newValues[1] >= ";
// line 76
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo " && newValues[1] <= ";
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo ")) {
newValues[1] = ";
// line 77
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo ";
maxInput.val('');
inputFlasher(maxInput);
}
// if newValues are not ordered, fix the opposite input.
if (isMinModified && newValues[0] > newValues[1]) {
newValues[1] = newValues[0];
maxInput.val(newValues[0]);
inputFlasher(maxInput);
}
if (!isMinModified && newValues[0] > newValues[1]) {
newValues[0] = newValues[1];
minInput.val(newValues[0]);
inputFlasher(minInput);
}
if (newValues[0] == ";
// line 94
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo " && newValues[1] == ";
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo ") {
sliderInput.attr('sql', '');
} else if (newValues[0] == ";
// line 96
echo twig_escape_filter($this->env, ((array_key_exists("min", $context)) ? (_twig_default_filter(($context["min"] ?? null), "0")) : ("0")), "html", null, true);
echo ") {
sliderInput.attr('sql', '<='+newValues[1]);
} else if (newValues[1] == ";
// line 98
echo twig_escape_filter($this->env, ((array_key_exists("max", $context)) ? (_twig_default_filter(($context["max"] ?? null), "1000000000")) : ("1000000000")), "html", null, true);
echo ") {
sliderInput.attr('sql', '>='+newValues[0]);
} else {
sliderInput.attr('sql', 'BETWEEN ' + newValues[0] + ' AND ' + newValues[1]);
}
";
// line 104
if (array_key_exists("on_change_func_name", $context)) {
// line 105
echo " var afterUpdate = function() {
";
// line 106
echo ($context["on_change_func_name"] ?? null);
echo "
};
afterUpdate();
";
}
// line 110
echo " }
minInput.on('change', function(event) {
updater(\$(event.srcElement));
});
maxInput.on('change', function(event) {
updater(\$(event.srcElement));
});
});
</script>
<div id=\"";
// line 119
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "_div\">
<input type=\"hidden\" id=\"";
// line 120
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "\" name=\"";
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "\" value=\"\" sql=\"";
echo twig_escape_filter($this->env, ($context["value"] ?? null), "html", null, true);
echo "\" />
<input class=\"form-control form-min-max\" type=\"text\" id=\"";
// line 121
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "_min\" value=\"\" placeholder=\"";
echo twig_escape_filter($this->env, ((array_key_exists("minLabel", $context)) ? (_twig_default_filter(($context["minLabel"] ?? null), "Min")) : ("Min")), "html", null, true);
echo "\" ";
if (((array_key_exists("disabled", $context)) ? (_twig_default_filter(($context["disabled"] ?? null), false)) : (false))) {
echo "disabled";
}
echo " />
<input class=\"form-control form-min-max\" type=\"text\" id=\"";
// line 122
echo twig_escape_filter($this->env, ($context["input_name"] ?? null), "html", null, true);
echo "_max\" value=\"\" placeholder=\"";
echo twig_escape_filter($this->env, ((array_key_exists("maxLabel", $context)) ? (_twig_default_filter(($context["maxLabel"] ?? null), "Max")) : ("Max")), "html", null, true);
echo "\" ";
if (((array_key_exists("disabled", $context)) ? (_twig_default_filter(($context["disabled"] ?? null), false)) : (false))) {
echo "disabled";
}
echo " />
</div>
";
}
public function getTemplateName()
{
return "@PrestaShop/Admin/Helpers/range_inputs.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 202 => 122, 192 => 121, 184 => 120, 180 => 119, 169 => 110, 162 => 106, 159 => 105, 157 => 104, 148 => 98, 143 => 96, 136 => 94, 116 => 77, 110 => 76, 103 => 72, 97 => 71, 89 => 68, 70 => 52, 65 => 50, 53 => 43, 45 => 38, 41 => 37, 31 => 30, 27 => 29, 23 => 28, 19 => 26,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Twig_Source("", "@PrestaShop/Admin/Helpers/range_inputs.html.twig", "/var/www/clients/client1/web14/web/src/PrestaShopBundle/Resources/views/Admin/Helpers/range_inputs.html.twig");
}
}