liberty-prettydiff
Version:
Language aware code comparison tool for several web based languages. It also beautifies, minifies, and a few other things.
71 lines (66 loc) • 2.33 kB
Plain Text
<a>
{% if exists %}
<script>
(function ($) {
"use strict";
$(document).ready(function () {
var x = {{ settings.x }};
var y = {{ settings.y | json }};
{% assign z_array = settings.z | strip_newlines | split: ',' %}
var zArray = [
{% for a in z %}
{% assign a_x = a | split: ':' | first %}
{% assign a_y = a | split: ':' | last | plus: 0 %}
{
x: "{{ a_x }}",
y: {{ a_y }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
{% case %}
q,
{% when %}
w,
{% when %}
z
{% endcase %}
];
});
})(jQuery);
</script>
{% endif %}
{% if exists %}
<style>
a {
color : red;
{{if x}}
background: green;
{{end}}
}
a {
background: {{settings.x}};
color : {{settings.y | json}};
{% assign z_array = settings.z | strip_newlines | split: ',' %}
b {
{% for a in z %}
{% assign a_x = a | split: ':' | first %}
{% assign a_y = a | split: ':' | last | plus: 0 %}
c {
x: {{a_x}};
y: {{a_y}};
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
{% case %}
x {
color: Red;
} {% when %} y {
color: blue;
} {% when %} f {
color: yellow;
}
{% endcase %}
}
}
</style>
{% endif %}
</a>