PageSourceSearch

https://projectlinus.org/assets/HTML5_map/map-interact.js

js projectlinus.org collected 2026-10-02 03:20:14 UTC 3,466 bytes, 75 lines download raw bytes

1function isTouchEnabled() {
2  return (("ontouchstart" in window)
3    || (navigator.MaxTouchPoints > 0)
4    || (navigator.msMaxTouchPoints > 0));
5}
6jQuery(function () {
7  jQuery("path[id^=usjs]").each(function (i, e) {
8    usaddEvent( jQuery(e).attr("id"));
9  });
10});
11jQuery(function () {
12  jQuery('#lakes').find('path').attr({'fill':usjsconfig.general.lakesFill}).css({'stroke':usjsconfig.general.lakesOutline});
13});
14function usaddEvent(id,relationId) {
15  var _obj = jQuery("#" + id);
16  var arr = id.split("");
17  var _Textobj = jQuery("#" + id + "," + "#usjsvn" + arr.slice(4).join(""));
18  jQuery("#" + ["visnames"]).attr({"fill":usjsconfig.general.visibleNames});
19  _obj.attr({"fill":usjsconfig[id].upColor, "stroke":usjsconfig.general.borderColor});
20  _Textobj.attr({"cursor": "default"});
21  if (usjsconfig[id].active === true) {
22    _Textobj.attr({"cursor": "pointer"});
23    _Textobj.hover(function () {
24      jQuery("#usjstip").show().html(usjsconfig[id].hover);
25      _obj.css({"fill":usjsconfig[id].overColor});
26    }, function () {
27      jQuery("#usjstip").hide();
28      jQuery("#" + id).css({"fill":usjsconfig[id].upColor});
29    });
30    if (usjsconfig[id].target !== "none") {
31      _Textobj.mousedown(function () {
32        jQuery("#" + id).css({"fill":usjsconfig[id].downColor});
33      });
34    }
35    _Textobj.mouseup(function () {
36      jQuery("#" + id).css({"fill":usjsconfig[id].overColor});
37      if (usjsconfig[id].target === "new_window") {
38        window.open(usjsconfig[id].url);	
39      } else if (usjsconfig[id].target === "same_window") {
40        window.parent.location.href = usjsconfig[id].url;
41      } else if (usjsconfig[id].target === "modal") {
42        jQuery(usjsconfig[id].url).modal("show");
43      }
44    });
45    _Textobj.mousemove(function (e) {
46      var x = e.pageX + 10, y = e.pageY + 15;
47      var tipw =jQuery("#usjstip").outerWidth(), tiph =jQuery("#usjstip").outerHeight(),
48      x = (x + tipw >jQuery(document).scrollLeft() +jQuery(window).width())? x - tipw - (20 * 2) : x ;
49      y = (y + tiph >jQuery(document).scrollTop() +jQuery(window).height())? jQuery(document).scrollTop() +jQuery(window).height() - tiph - 10 : y ;
50      jQuery("#usjstip").css({left: x, top: y});
51    });
52    if (isTouchEnabled()) {
53      _Textobj.on("touchstart", function (e) {
54        var touch = e.originalEvent.touches[0];
55        var x = touch.pageX + 10, y = touch.pageY + 15;
56        var tipw =jQuery("#usjstip").outerWidth(), tiph =jQuery("#usjstip").outerHeight(),
57        x = (x + tipw >jQuery(document).scrollLeft() +jQuery(window).width())? x - tipw -(20 * 2) : x ;
58        y =(y + tiph >jQuery(document).scrollTop() +jQuery(window).height())? jQuery(document).scrollTop() +jQuery(window).height() -tiph - 10 : y ;
59        jQuery("#" + id).css({"fill":usjsconfig[id].downColor});
60        jQuery("#usjstip").show().html(usjsconfig[id].hover);
61        jQuery("#usjstip").css({left: x, top: y});
62      });
63      _Textobj.on("touchend", function () {
64        jQuery("#" + id).css({"fill":usjsconfig[id].upColor});
65        if (usjsconfig[id].target === "new_window") {
66          window.open(usjsconfig[id].url);
67        } else if (usjsconfig[id].target === "same_window") {
68          window.parent.location.href = usjsconfig[id].url;
69        } else if (usjsconfig[id].target === "modal") {
70          jQuery(usjsconfig[id].url).modal("show");
71        }
72      });
73    }
74	}
75}

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.