Template/Update (Part 47)

* split global.js into its components, so it can be reasonably processed by setup
 * make reputation requirements configurable
 * move Markup and Locale back into global.js (removed associated build scripts)
 * extend Icon to display iconId in lightbox popup
This commit is contained in:
Sarjuuk
2025-08-11 16:00:18 +02:00
parent a48e94cd8b
commit 6557e70d5c
73 changed files with 26256 additions and 25699 deletions

View File

@@ -0,0 +1,38 @@
function Line(x1, y1, x2, y2, type)
{
var left = Math.min(x1, x2),
right = Math.max(x1, x2),
top = Math.min(y1, y2),
bottom = Math.max(y1, y2),
width = (right - left),
height = (bottom - top),
length = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)),
radian = Math.atan2(height, width),
sinTheta = Math.sin(radian),
cosTheta = Math.cos(radian);
var $line = $WH.ce('span');
$line.className = 'line';
$line.style.top = top.toFixed(2) + 'px';
$line.style.left = left.toFixed(2) + 'px';
$line.style.width = width.toFixed(2) + 'px';
$line.style.height = height.toFixed(2) + 'px';
var v = $WH.ce('var');
v.style.width = length.toFixed(2) + 'px';
v.style.OTransform = 'rotate(' + radian + 'rad)';
v.style.MozTransform = 'rotate(' + radian + 'rad)';
v.style.webkitTransform = 'rotate(' + radian + 'rad)';
v.style.filter = "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=" + cosTheta + ', M12=' + (-1 * sinTheta) + ', M21=' + sinTheta + ', M22=' + cosTheta + ')';
$WH.ae($line, v);
if (!(x1 == left && y1 == top) && !(x2 == left && y2 == top))
$line.className += ' flipped';
if (type != null)
$line.className += ' line-' + type;
return $line;
}