1/** 2 * @file 3 * SIU Get User Location. 4 */ 5 6(function ($, Drupal) { 7 'use strict'; 8 9 Drupal.behaviors.siuGetUserLocation = { 10 attach: function (context, settings) { 11 12 function success(pos) { 13 var crd = pos.coords; 14 var latlon = crd.latitude + ',' + crd.longitude; 15 16 $('.form-item-location-value input').val(latlon); 17 $('.form-item-location-postal-code input').val('Your Location'); 18 19 console.log(pos); 20 } 21 22 function error(err) { 23 console.warn('ERROR(${err.code}): ${err.message}'); 24 } 25 26 $('.get-user-location').on('click', function (e) { 27 e.preventDefault(); 28 navigator.geolocation.getCurrentPosition(success, error); 29 }); 30 } 31 }; 32 33}(jQuery, Drupal));
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.