PageSourceSearch

https://carlsbergmalaysia.com.my/assets/scripts/libs/reframe.js

js carlsbergmalaysia.com.my collected 2026-10-03 21:39:06 UTC 1,444 bytes, 44 lines download raw bytes

1(function (global, factory) {
2  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3  typeof define === 'function' && define.amd ? define(factory) :
4  (global.reframe = factory());
5}(this, (function () { 'use strict';
6
7function reframe(target, cName) {
8  var frames = typeof target === 'string' ? document.querySelectorAll(target) : target;
9  if (!('length' in frames)) {
10    frames = [frames];
11  }
12  var classname = cName || 'js-reframe';
13  for (var i = 0; i < frames.length; i++) {
14    var frame = frames[i];
15    var hasClass = frame.className.split(' ').indexOf(classname);
16    if (hasClass >= 0) return;
17    var div = document.createElement('div');
18    var height = frame.offsetHeight;
19    var width = frame.offsetWidth;
20    var padding = height / width * 100;
21    div.style.paddingTop = padding + '%';
22    div.style.position = 'relative';
23    div.style.width = frame.style.width = frame.style.height = '100%';
24    div.className += classname;
25    frame.parentNode.insertBefore(div, frame);
26    frame.parentNode.removeChild(frame);
27    frame.style.left = frame.style.top = '0';
28    frame.style.position = 'absolute';
29    div.appendChild(frame);
30  }
31}
32
33var plugin = window.$ || window.jQuery || window.Zepto;
34if (plugin) {
35  plugin.fn.extend({
36    reframe: function reframeFunc(cName) {
37      return reframe(this, cName);
38    }
39  });
40}
41
42return reframe;
43
44})));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.