PageSourceSearch

https://ridni.org/kartafiles/js/ridni_raster.js?v=6

js ridni.org collected 2026-10-02 12:12:13 UTC 3,009 bytes, 95 lines download raw bytes

1$.getScript("/kartafiles/resources/saveSvgAsPng.js");
2$.getScript("/kartafiles/resources/FileSaver.min.js");
3
4var saving_options = {
5    backgroundColor: 'white',
6    encoderType: 'image/png',
7    left: 110,
8    top: 20,
9    width: 780,
10    height: 530,
11//    width:600,
12//    height:600
13};
14
15function getSavePath() {
16    let surname = g._surname.toUpperCase();
17    return "Карта_поширення_прізвища_" + surname + ".png";
18}
19
20function saveStartA() {
21    del.description();
22    let savepath = getSavePath();
23    if (!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)) {
24        var el = document.querySelector('#svg_map');
25        svgAsPngUri(el, saving_options, function (uri) {
26            var link = document.createElement("a");
27            link.setAttribute("href", uri);
28            link.setAttribute("download", savepath);
29            link.click();
30        });
31    } else {
32        var el = $('#svg_map')[0];
33        saveSvgAsPng(el, savepath, saving_options);
34    }
35}
36
37function getLink() {
38    var surname = g._surname.toLowerCase();
39    var filenameLat = transliterate(surname);
40
41    function toClipboard() {
42        var savepath = new URL(window.location.href);
43        savepath = decodeURIComponent(savepath);
44
45        let n = savepath.indexOf('karta/'),
46            m = savepath.indexOf('?');
47        savepath = m > 0 ? savepath.substring(0, m) : savepath.substring(0);
48        savepath = savepath.toLowerCase();
49
50        if (window.clipboardData && window.clipboardData.setData) {
51            return clipboardData.setData("Text", savepath);
52        } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
53            var textarea = document.createElement("textarea");
54            textarea.textContent = savepath;
55            textarea.style.position = "fixed";
56            document.body.appendChild(textarea);
57            textarea.select();
58            try {
59                return document.execCommand("copy");
60            } catch (ex) {
61                return false;
62            } finally {
63                document.body.removeChild(textarea);
64            }
65        }
66    }
67    toClipboard();
68}
69
70function create_raster() {
71    var surname = g._surname.toLowerCase();
72    var opts = {
73        backgroundColor: 'white', // 'transparent';
74        left: 110,
75        top: 20,
76        width: 780,
77        height: 530,
78        encoderOptions: 0.4,
79        scale: 0.4
80    }
81    svgAsPngUri(document.getElementById("svg_map"), opts, function (uri) {
82        $.ajax({
83            type: "POST",
84            url: "/kartafiles/php/ridni_save_image.php",
85            data: {
86                imgBase64: uri,
87                surname: surname
88            }
89        }).fail(function (jqXHR, status, error) {
90            console.log(jqXHR, status, error);
91        }).complete(function (jqXHR, status) {
92           // console.log(jqXHR, status);
93        });
94    });
95}

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.