PageSourceSearch

https://www.englandgolf.org/js/dg-ko-extensions.js?rev=261

js englandgolf.org collected 2026-09-24 19:17:54 UTC 1,230 bytes, 36 lines download raw bytes

1
2ko.bindingHandlers.truncatedText = {
3    update: function (element, valueAccessor, allBindingsAccessor) {
4
5        var allBindings = allBindingsAccessor();
6        var text = allBindings.truncatedText;
7        var allowedLength = allBindings.maxTextLength;
8        var originalText = ko.toJS(text);
9
10        if (originalText != undefined) {
11            var originalText = originalText,
12                length = allowedLength || 20,
13                truncatedText = originalText.length > length ? originalText.substring(0, length) + "..." : originalText;
14
15            ko.bindingHandlers.text.update(element, function () {
16                return truncatedText;
17            });
18        }
19    }
20};
21
22ko.bindingHandlers.attrIf = {
23    update: function (element, valueAccessor, allBindingsAccessor) {
24        var h = ko.utils.unwrapObservable(valueAccessor());
25        var show = ko.utils.unwrapObservable(h._if);
26        if (show) {
27            ko.bindingHandlers.attr.update(element, valueAccessor, allBindingsAccessor);
28        } else {
29            for (var k in h) {
30                if (h.hasOwnProperty(k) && k.indexOf("_") !== 0) {
31                    $(element).removeAttr(k);
32                }
33            }
34        }
35    }
36};

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.