| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | # This file is generated by author/assets.pl. Do not edit manually. | 
| 2 |  |  |  |  |  |  | package Amon2::Setup::Asset::MicroLocationJS; | 
| 3 | 1 |  |  | 1 |  | 370 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 39 |  | 
| 4 | 1 |  |  | 1 |  | 6 | use warnings; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 106 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | sub tags { | 
| 7 | 1 |  |  | 1 | 0 | 5 | <<',,,'; | 
| 8 |  |  |  |  |  |  | <script src="<: uri_for('/static/js/micro-location.js') :>"></script> | 
| 9 |  |  |  |  |  |  | ,,, | 
| 10 |  |  |  |  |  |  | } | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | sub files { | 
| 13 |  |  |  |  |  |  | return { | 
| 14 | 0 |  |  | 0 | 0 |  | 'js/micro-location.js' => '/** | 
| 15 |  |  |  |  |  |  | * https://github.com/cho45/micro-location.js | 
| 16 |  |  |  |  |  |  | * (c) cho45 http://cho45.github.com/mit-license | 
| 17 |  |  |  |  |  |  | */ | 
| 18 |  |  |  |  |  |  | // immutable object, should not assign a value to properties | 
| 19 |  |  |  |  |  |  | function Location () { this.init.apply(this, arguments) } | 
| 20 |  |  |  |  |  |  | Location.prototype = { | 
| 21 |  |  |  |  |  |  | init : function (protocol, host, hostname, port, pathname, search, hash) { | 
| 22 |  |  |  |  |  |  | this.protocol  = protocol; | 
| 23 |  |  |  |  |  |  | this.host      = host; | 
| 24 |  |  |  |  |  |  | this.hostname  = hostname; | 
| 25 |  |  |  |  |  |  | this.port      = port || ""; | 
| 26 |  |  |  |  |  |  | this.pathname  = pathname || ""; | 
| 27 |  |  |  |  |  |  | this.search    = search || ""; | 
| 28 |  |  |  |  |  |  | this.hash      = hash || ""; | 
| 29 |  |  |  |  |  |  | if (protocol) { | 
| 30 |  |  |  |  |  |  | with (this) this.href = protocol + \'//\' + host + pathname + search + hash; | 
| 31 |  |  |  |  |  |  | } else | 
| 32 |  |  |  |  |  |  | if (host) { | 
| 33 |  |  |  |  |  |  | with (this) this.href = \'//\' + host + pathname + search + hash; | 
| 34 |  |  |  |  |  |  | } else { | 
| 35 |  |  |  |  |  |  | with (this) this.href = pathname + search + hash; | 
| 36 |  |  |  |  |  |  | } | 
| 37 |  |  |  |  |  |  | }, | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  | params : function (name) { | 
| 40 |  |  |  |  |  |  | if (!this._params) { | 
| 41 |  |  |  |  |  |  | var params = {}; | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | var pairs = this.search.substring(1).split(/[;&]/); | 
| 44 |  |  |  |  |  |  | for (var i = 0, len = pairs.length; i < len; i++) { | 
| 45 |  |  |  |  |  |  | if (!pairs[i]) continue; | 
| 46 |  |  |  |  |  |  | var pair = pairs[i].split(/=/); | 
| 47 |  |  |  |  |  |  | var key  = decodeURIComponent(pair[0].replace(/\\+/g, \'%20\')); | 
| 48 |  |  |  |  |  |  | var val  = decodeURIComponent(pair[1].replace(/\\+/g, \'%20\')); | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | if (!params[key]) params[key] = []; | 
| 51 |  |  |  |  |  |  | params[key].push(val); | 
| 52 |  |  |  |  |  |  | } | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | this._params = params; | 
| 55 |  |  |  |  |  |  | } | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | switch (typeof name) { | 
| 58 |  |  |  |  |  |  | case "undefined": return this._params; | 
| 59 |  |  |  |  |  |  | case "object"   : return this.build(name); | 
| 60 |  |  |  |  |  |  | } | 
| 61 |  |  |  |  |  |  | return this._params[name] ? this._params[name][0] : null; | 
| 62 |  |  |  |  |  |  | }, | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | build : function (params) { | 
| 65 |  |  |  |  |  |  | if (!params) params = this._params; | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | var ret = new Location(); | 
| 68 |  |  |  |  |  |  | var _search = this.search; | 
| 69 |  |  |  |  |  |  | if (params) { | 
| 70 |  |  |  |  |  |  | var search = []; | 
| 71 |  |  |  |  |  |  | for (var key in params) if (params.hasOwnProperty(key)) { | 
| 72 |  |  |  |  |  |  | var val = params[key]; | 
| 73 |  |  |  |  |  |  | switch (typeof val) { | 
| 74 |  |  |  |  |  |  | case "object": | 
| 75 |  |  |  |  |  |  | for (var i = 0, len = val.length; i < len; i++) { | 
| 76 |  |  |  |  |  |  | search.push(encodeURIComponent(key) + \'=\' + encodeURIComponent(val[i])); | 
| 77 |  |  |  |  |  |  | } | 
| 78 |  |  |  |  |  |  | break; | 
| 79 |  |  |  |  |  |  | default: | 
| 80 |  |  |  |  |  |  | search.push(encodeURIComponent(key) + \'=\' + encodeURIComponent(val)); | 
| 81 |  |  |  |  |  |  | } | 
| 82 |  |  |  |  |  |  | } | 
| 83 |  |  |  |  |  |  | _search = \'?\' + search.join(\'&\'); | 
| 84 |  |  |  |  |  |  | } | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | with (this) ret.init.apply(ret, [ | 
| 87 |  |  |  |  |  |  | protocol, | 
| 88 |  |  |  |  |  |  | host, | 
| 89 |  |  |  |  |  |  | hostname, | 
| 90 |  |  |  |  |  |  | port, | 
| 91 |  |  |  |  |  |  | pathname, | 
| 92 |  |  |  |  |  |  | _search, | 
| 93 |  |  |  |  |  |  | hash | 
| 94 |  |  |  |  |  |  | ]); | 
| 95 |  |  |  |  |  |  | return ret; | 
| 96 |  |  |  |  |  |  | } | 
| 97 |  |  |  |  |  |  | }; | 
| 98 |  |  |  |  |  |  | Location.regexp = new RegExp(\'^(?:(https?:)//(([^:/]+)(:[^/]+)?))?([^#?]*)(\\\\?[^#]*)?(#.*)?$\'); | 
| 99 |  |  |  |  |  |  | Location.parse = function (string) { | 
| 100 |  |  |  |  |  |  | var matched = String(string).match(this.regexp); | 
| 101 |  |  |  |  |  |  | var ret = new Location(); | 
| 102 |  |  |  |  |  |  | ret.init.apply(ret, matched.slice(1)); | 
| 103 |  |  |  |  |  |  | return ret; | 
| 104 |  |  |  |  |  |  | }; | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  | (function (root, factory) { | 
| 107 |  |  |  |  |  |  | if (typeof module === "object" && module.exports) { | 
| 108 |  |  |  |  |  |  | module.exports = { | 
| 109 |  |  |  |  |  |  | Location: factory() | 
| 110 |  |  |  |  |  |  | }; | 
| 111 |  |  |  |  |  |  | } else if (typeof define === \'function\' && define.amd) { | 
| 112 |  |  |  |  |  |  | define([], function () { | 
| 113 |  |  |  |  |  |  | return { | 
| 114 |  |  |  |  |  |  | Location: factory() | 
| 115 |  |  |  |  |  |  | } | 
| 116 |  |  |  |  |  |  | }); | 
| 117 |  |  |  |  |  |  | } else { | 
| 118 |  |  |  |  |  |  | root.Location = factory(); | 
| 119 |  |  |  |  |  |  | } | 
| 120 |  |  |  |  |  |  | }(this, function () { | 
| 121 |  |  |  |  |  |  | return Location; | 
| 122 |  |  |  |  |  |  | })); | 
| 123 |  |  |  |  |  |  | ' | 
| 124 |  |  |  |  |  |  | } | 
| 125 |  |  |  |  |  |  | ; | 
| 126 |  |  |  |  |  |  | } | 
| 127 |  |  |  |  |  |  |  | 
| 128 |  |  |  |  |  |  | 1; |