PageSourceSearch

https://www.openstreetmap.org/assets/index_modules/note-eb7ebc7cb1…f846df4e5e619b9b398315a884d42747262e50df.js

js openstreetmap.org collected 2026-09-24 06:40:47 UTC 1,655 bytes, 1 lines download raw bytes

1export default function(t){function n(a,i,r){o.find("button[name]").on("click",function(t){t.preventDefault();const{url:r,method:s}=$(t.target).data(),c=$(t.target).attr("name"),d=new URLSearchParams;if(o.find("button[name]").prop("disabled",!0),"subscribe"!==c&&"unsubscribe"!==c){const t=o.find("textarea");t.length&&d.set("text",t.val())}fetch(r,{method:s,headers:{...OSM.oauth},body:d}).then(t=>t.ok?t:t.text().then(n=>{throw new Error(n||`HTTP Error ${t.status} ${t.statusText}`)})).then(()=>OSM.loadSidebarContent(a)).then(()=>n(a,i,!1)).catch(t=>{o.find("#comment-error").text(t.message).prop("hidden",!1).get(0).scrollIntoView({block:"nearest"}),e()})}),o.find("textarea").on("input",function(t){e(t.target.form)}),o.find("textarea").val("").trigger("input");const s=$(".details").data();if(s){const n=OSM.parseHash();t.addObject({type:"note",id:parseInt(i,10),latLng:L.latLng(s.coordinates.split(",")),icon:OSM.noteMarkers[s.status]},function(){if(!n.center&&!r){const n=L.latLng(s.coordinates.split(","));OSM.router.withoutMoveListener(function(){t.setView(n,15,{reset:!0})})}})}}function e(){const t=o.find("button[name='close']"),n=o.find("button[name='comment']");o.find("button[name]").prop("disabled",!1),""===o.find("textarea").val()?(t.text(t.data("defaultActionText")),n.prop("disabled",!0)):t.text(t.data("commentActionText"))}const o=$("#sidebar_content"),a={load:function(e,o){OSM.loadSidebarContent(e).then(function(){const a=$(".details").data();if(!a)return;const[i,r]=a.coordinates.split(",").map(parseFloat);n(e,o,t.getBounds().contains({lat:i,lng:r}))})},init:function(t,e){n(t,e)},unload:function(){t.removeObject()}};return a}

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.