PageSourceSearch

https://munkedal.se/webapp-resource/2.5f43657e157d5ad96e58a44/360.…/1611152179664/webapp-assets.js

js munkedal.se collected 2026-10-02 12:14:02 UTC 10,600 bytes, 373 lines download raw bytes

1AppRegistry.registerBundle({applicationId:'limepark.cookie-approval|1.3.3',bundle: {"en":{"hello":"Hello"},"sv":{"hello":"Hej"}}});
2AppRegistry.registerModule({applicationId:'limepark.cookie-approval|1.3.3',path:'/module/client/js-cookie_2.2.1/src/js.cookie',module:function(define){'use strict';/*!
3 * JavaScript Cookie v2.2.1
4 * https://github.com/js-cookie/js-cookie
5 *
6 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
7 * Released under the MIT license
8 */
9;
10
11(function (factory) {
12  var registeredInModuleLoader;
13
14  if (typeof define === 'function' && define.amd) {
15    define(factory);
16    registeredInModuleLoader = true;
17  }
18
19  if (typeof exports === 'object') {
20    module.exports = factory();
21    registeredInModuleLoader = true;
22  }
23
24  if (!registeredInModuleLoader) {
25    var OldCookies = window.Cookies;
26    var api = window.Cookies = factory();
27
28    api.noConflict = function () {
29      window.Cookies = OldCookies;
30      return api;
31    };
32  }
33})(function () {
34  function extend() {
35    var i = 0;
36    var result = {};
37
38    for (; i < arguments.length; i++) {
39      var attributes = arguments[i];
40
41      for (var key in attributes) {
42        result[key] = attributes[key];
43      }
44    }
45
46    return result;
47  }
48
49  function decode(s) {
50    return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
51  }
52
53  function init(converter) {
54    function api() {}
55
56    function set(key, value, attributes) {
57      if (typeof document === 'undefined') {
58        return;
59      }
60
61      attributes = extend({
62        path: '/'
63      }, api.defaults, attributes);
64
65      if (typeof attributes.expires === 'number') {
66        attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
67      } // We're using "expires" because "max-age" is not supported by IE
68
69
70      attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
71
72      try {
73        var result = JSON.stringify(value);
74
75        if (/^[\{\[]/.test(result)) {
76          value = result;
77        }
78      } catch (e) {}
79
80      value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
81      key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
82      var stringifiedAttributes = '';
83
84      for (var attributeName in attributes) {
85        if (!attributes[attributeName]) {
86          continue;
87        }
88
89        stringifiedAttributes += '; ' + attributeName;
90
91        if (attributes[attributeName] === true) {
92          continue;
93        } // Considers RFC 6265 section 5.2:
94        // ...
95        // 3.  If the remaining unparsed-attributes contains a %x3B (";")
96        //     character:
97        // Consume the characters of the unparsed-attributes up to,
98        // not including, the first %x3B (";") character.
99        // ...
100
101
102        stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
103      }
104
105      return document.cookie = key + '=' + value + stringifiedAttributes;
106    }
107
108    function get(key, json) {
109      if (typeof document === 'undefined') {
110        return;
111      }
112
113      var jar = {}; // To prevent the for loop in the first place assign an empty array
114      // in case there are no cookies at all.
115
116      var cookies = document.cookie ? document.cookie.split('; ') : [];
117      var i = 0;
118
119      for (; i < cookies.length; i++) {
120        var parts = cookies[i].split('=');
121        var cookie = parts.slice(1).join('=');
122
123        if (!json && cookie.charAt(0) === '"') {
124          cookie = cookie.slice(1, -1);
125        }
126
127        try {
128          var name = decode(parts[0]);
129          cookie = (converter.read || converter)(cookie, name) || decode(cookie);
130
131          if (json) {
132            try {
133              cookie = JSON.parse(cookie);
134            } catch (e) {}
135          }
136
137          jar[name] = cookie;
138
139          if (key === name) {
140            break;
141          }
142        } catch (e) {}
143      }
144
145      return key ? jar[key] : jar;
146    }
147
148    api.set = set;
149
150    api.get = function (key) {
151      return get(key, false
152      /* read as raw */
153      );
154    };
155
156    api.getJSON = function (key) {
157      return get(key, true
158      /* read as json */
159      );
160    };
161
162    api.remove = function (key, attributes) {
163      set(key, '', extend(attributes, {
164        expires: -1
165      }));
166    };
167
168    api.defaults = {};
169    api.withConverter = init;
170    return api;
171  }
172
173  return init(function () {});
174});}});
175AppRegistry.registerModule({applicationId:'limepark.cookie-approval|1.3.3',path:'/template/main',module:function(define){define(function(require){var _=require('underscore');return function(obj){
176var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
177with(obj||{}){
178__p+='';
179 if (showCookieInformation) { 
180__p+='\n<!--googleoff: index-->\n<div class="lp-cookie-approval lp-cookie-approval--position-'+
181((__t=(position))==null?'':__t)+
182'">\n  <form method="post" action="'+
183((__t=( getStandaloneUrl('/save')))==null?'':__t)+
184'" class="lp-cookie-approval__form">\n    <input type="hidden" name="returnTo" value="'+
185((__t=( getUrl('/')))==null?'':__t)+
186'" />\n    <p class="env-text lp-cookie-approval__text">\n      '+
187((__t=(infoText))==null?'':__t)+
188'\n      ';
189 if (showMoreInfoLink && moreInfoUrl && moreInfoType == 'link') { 
190__p+='\n      <a href="'+
191((__t=(moreInfoUrl))==null?'':__t)+
192'" class="lp-cookie-approval-form__link">'+
193((__t=(moreInfoText))==null?'':__t)+
194'</a>\n      ';
195 } 
196__p+='\n    </p>\n\n    <button type="submit" class="env-button env-button--primary lp-cookie-approval__button" name="approve">'+
197((__t=(buttonText))==null?'':__t)+
198'</button>\n    ';
199 if (useDisallow) { 
200__p+='\n    <button type="submit" class="env-button env-button--danger lp-cookie-disallow__button" name="disallow">'+
201((__t=(disallowButtonText))==null?'':__t)+
202'</button>\n    ';
203 } 
204__p+='\n\n    ';
205 if (showMoreInfoLink && moreInfoType == 'button') { 
206__p+='\n    <a href="'+
207((__t=(moreInfoUrl))==null?'':__t)+
208'" class="env-button lp-cookie-approval__more-info-button">'+
209((__t=(moreInfoText))==null?'':__t)+
210'</a>\n    ';
211 } 
212__p+='\n  </form>\n</div>\n<!--googleon: index -->\n';
213 } 
214__p+='\n\n';
215 if (userHasConsented) { 
216__p+='\n';
217 scripts.forEach(function(script) { 
218__p+='\n';
219 if (script.type == 'code') { 
220__p+=''+
221((__t=(script.value ))==null?'':__t)+
222'';
223 } 
224__p+='\n';
225 if (script.type == 'internal-script') { 
226__p+=''+
227((__t=(script.value ))==null?'':__t)+
228'';
229 } 
230__p+='\n';
231 if (script.type == 'external-script') { 
232__p+=''+
233((__t=(script.value ))==null?'':__t)+
234'';
235 } 
236__p+='\n';
237 }) 
238__p+='\n';
239 } 
240__p+='';
241}
242return __p;
243};});}});
244AppRegistry.registerModule({applicationId:'limepark.cookie-approval|1.3.3',path:'/module/client/CookieApproval',module:function(define){'use strict';function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
245
246function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
247
248function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
249
250var CookieApproval =
251/*#__PURE__*/
252function () {
253  function CookieApproval() {
254    _classCallCheck(this, CookieApproval);
255
256    this._onApprovedHandlers = [];
257    this._hasTriggeredApproved = false;
258  }
259
260  _createClass(CookieApproval, [{
261    key: "onApproved",
262    value: function onApproved(fn) {
263      this._onApprovedHandlers.push(fn);
264    }
265  }, {
266    key: "_triggerOnApproved",
267    value: function _triggerOnApproved() {
268      this._onApprovedHandlers.forEach(function (fn) {
269        return fn();
270      });
271    }
272  }, {
273    key: "_setHasApproved",
274    value: function _setHasApproved(hasApproved) {
275      if (hasApproved && !this._hasTriggeredApproved) {
276        this._hasTriggeredApproved = true;
277
278        this._triggerOnApproved();
279      }
280    }
281  }]);
282
283  return CookieApproval;
284}();
285
286CookieApproval.instance = null;
287
288CookieApproval.getInstance = function CookieApproval_getInstance() {
289  if (!CookieApproval.instance) {
290    CookieApproval.instance = new CookieApproval();
291  }
292
293  return CookieApproval.instance;
294};
295
296if (typeof window !== 'undefined') {
297  window.CookieApproval = CookieApproval.getInstance();
298}
299
300define(function () {
301  return CookieApproval.getInstance();
302});}});
303AppRegistry.registerModule({applicationId:'limepark.cookie-approval|1.3.3',path:'/main',module:function(define){'use strict';define(function (require) {
304  'use strict';
305
306  var _ = require('underscore');
307
308  var Component = require('Component');
309
310  var template = require('/template/main');
311
312  var Cookies = require("/module/client/js-cookie_2.2.1/src/js.cookie");
313
314  var CookieApproval = require('/module/client/CookieApproval');
315
316  return Component.extend({
317    template: template,
318    events: {
319      dom: {
320        'submit form': 'handleApprovalForm',
321        'click [name=approve]': 'handleApproval',
322        'click [name=disallow]': 'handleDisallow'
323      },
324      self: {
325        'state:changed': 'render'
326      }
327    },
328    onInit: function onInit() {
329      CookieApproval._setHasApproved(this.state.userHasConsented);
330    },
331    handleDisallow: function handleDisallow(e) {
332      Cookies.set(this.state.cookieName, 'false', {
333        expires: 365,
334        path: '/'
335      });
336
337      var newState = _.extend({}, this.state, {
338        showCookieInformation: false,
339        userHasConsented: false
340      });
341
342      CookieApproval._setHasApproved(false);
343
344      this.setState(newState);
345      return false;
346    },
347    handleApprovalForm: function handleApprovalForm(e) {
348      e.preventDefault(); // console.log(e);
349
350      return false;
351    },
352    handleApproval: function handleApproval(e) {
353      e.preventDefault();
354      Cookies.set(this.state.cookieName, 'true', {
355        expires: 365,
356        path: '/'
357      });
358
359      var newState = _.extend({}, this.state, {
360        showCookieInformation: false,
361        userHasConsented: true
362      });
363
364      CookieApproval._setHasApproved(true);
365
366      this.setState(newState);
367      return false;
368    },
369    filterState: function filterState(state) {
370      return _.extend({}, state);
371    }
372  });
373});}});

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.