PageSourceSearch

https://gotland.se/webapp-resource/4.4ba0e70b186a198d5ae3c49c/360.…/1692040044707/webapp-assets.js

js gotland.se collected 2026-09-24 17:10:52 UTC 4,058 bytes, 81 lines download raw bytes

1AppRegistry.registerBundle({applicationId:'marketplace.sitevision.toTop|1.2.3',bundle: {"en":{"small":"Small","settings":"Settings","backgroundColor":"Background color","large":"Large","right":"Right","medium":"Medium","toTop":"To top","colors":"Colors","distanceToTop":"Distance from the top in order for the button to show (px)","size":"Size","left":"Left","visibleInMobile":"Visible in mobile","iconColor":"Icon color","position":"Position","notEmpty":"Field can not be empty"},"sv":{"small":"Liten","settings":"Inställningar","backgroundColor":"Bakgrundsfärg","large":"Stor","right":"Höger","medium":"Mellan","toTop":"Till toppen","colors":"Färger","distanceToTop":"Avstånd från toppen för att knappen ska visas (px)","size":"Storlek","left":"Vänster","visibleInMobile":"Synlig i mobil","iconColor":"Färg för ikon","position":"Position","notEmpty":"Fältet får inte vara tomt"}}});
2AppRegistry.registerModule({applicationId:'marketplace.sitevision.toTop|1.2.3',path:'/template/main',module:function(define){define(function(require){var _=require('underscore');return function(obj){
3var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
4with(obj||{}){
5__p+='<a href="#" id="sv-to-top" class="sv-to-top-hide">\n\n  <svg class="env-icon env-bg-color--darker" aria-hidden="true">\n    <use xlink:href="/sitevision/envision-icons.svg#icon-arrow-up"></use>\n  </svg>\n  <span class="env-assistive-text">'+
6((__t=( i18n('toTop') ))==null?'':_.escape(__t))+
7'</span>\n</a>';
8}
9return __p;
10};});}});
11AppRegistry.registerModule({applicationId:'marketplace.sitevision.toTop|1.2.3',path:'/main',module:function(define){'use strict';define(function (require) {
12  'use strict';
13
14  var _ = require('underscore');
15
16  var Component = require('Component');
17
18  var template = require('/template/main');
19
20  var transitionToTop = {
21    top: 0,
22    left: 0,
23    behavior: 'smooth'
24  };
25  return Component.extend({
26    template: template,
27    onRendered: function onRendered() {
28      var distanceToShowIcon = this.state.distanceToShowIconFromTop || 100;
29      var toTopEl = document.getElementById('sv-to-top');
30
31      if (!this.state.visibleInMobile && document.getElementsByTagName('html')[0].classList.contains('sv-touch')) {
32        return;
33      }
34
35      document.addEventListener('scroll', function () {
36        var distanceFromTop = isIE() ? window.pageYOffset : window.scrollY;
37
38        if (distanceFromTop >= distanceToShowIcon) {
39          toTopEl.classList.remove('sv-to-top-hide');
40          toTopEl.classList.add('sv-to-top-show');
41        } else {
42          toTopEl.classList.remove('sv-to-top-show');
43          toTopEl.classList.add('sv-to-top-hide');
44        }
45      });
46      toTopEl.addEventListener('click', function (e) {
47        e.preventDefault();
48        isIE() ? window.scrollTo(0, 0) : window.scrollTo(transitionToTop);
49      });
50      toTopEl.classList.add(this.state.position === 'right' ? 'sv-to-top--right' : 'sv-to-top--left');
51      var svgItem = toTopEl.firstElementChild;
52
53      if (!isIE()) {
54        svgItem.classList.add('env-icon--' + this.state.size);
55        svgItem.style.backgroundColor = this.state.backgroundColor;
56        svgItem.style.color = this.state.iconColor;
57      } else {
58        svgItem.style.backgroundColor = this.state.backgroundColor;
59        svgItem.style.fill = this.state.iconColor;
60        svgItem.setAttribute('class', 'env-icon env-bg-color--darker env-icon--' + this.state.size);
61      }
62    },
63    filterState: function filterState(state) {
64      return _.extend({}, {
65        distanceToShowIconFromTop: state.distanceToShowIconFromTop,
66        backgroundColor: state.backgroundColor,
67        iconColor: state.iconColor,
68        position: state.position,
69        visibleInMobile: state.visibleInMobile,
70        size: state.size
71      });
72    }
73  });
74
75  function isIE() {
76    var ua = window.navigator.userAgent;
77    /* MSIE used to detect old browsers and Trident used to newer ones*/
78
79    return ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1;
80  }
81});}});

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.