(scheduler2)
| 21091 | notImplemented.alert("Units", scheduler2.assert); |
| 21092 | } |
| 21093 | function url(scheduler2) { |
| 21094 | function parseHashParameters() { |
| 21095 | const parameters = /* @__PURE__ */ Object.create(null); |
| 21096 | const raw = (document.location.hash || "").replace("#", ""); |
| 21097 | if (!raw) { |
| 21098 | return parameters; |
| 21099 | } |
| 21100 | const pairs = raw.split(","); |
| 21101 | const forbiddenKeys = ["__proto__", "constructor", "prototype"]; |
| 21102 | for (let i = 0; i < pairs.length; i++) { |
| 21103 | const parts = pairs[i].split("="); |
| 21104 | if (parts.length === 2 && !forbiddenKeys.includes(parts[0])) { |
| 21105 | parameters[parts[0]] = parts[1]; |
| 21106 | } |
| 21107 | } |
| 21108 | return parameters; |
| 21109 | } |
| 21110 | scheduler2._get_url_nav = function() { |
| 21111 | return parseHashParameters(); |
| 21112 | }; |
| 21113 | const dateToString = scheduler2.date.date_to_str("%Y-%m-%d"); |
| 21114 | const originalGetInitialState = scheduler2._getInitialState; |
| 21115 | scheduler2._getInitialState = function(provided) { |
| 21116 | const baseState = originalGetInitialState.call(this, provided); |
| 21117 | const url2 = scheduler2._get_url_nav ? scheduler2._get_url_nav() : null; |
| 21118 | if (!url2) { |
| 21119 | return baseState; |
| 21120 | } |
| 21121 | const nextState = { date: baseState.date, mode: baseState.mode }; |
| 21122 | if (url2.date) { |
| 21123 | const stringToDate = scheduler2.date.str_to_date("%Y-%m-%d"); |
| 21124 | try { |
| 21125 | const parsed = stringToDate(url2.date); |
| 21126 | if (!isNaN(+parsed)) { |
| 21127 | nextState.date = parsed; |
| 21128 | } |
| 21129 | } catch (e) { |
| 21130 | } |
| 21131 | } |
| 21132 | if (url2.mode) { |
| 21133 | try { |
| 21134 | if (this.isViewExists(url2.mode)) { |
| 21135 | nextState.mode = url2.mode; |
| 21136 | } |
| 21137 | } catch (e) { |
| 21138 | } |
| 21139 | } |
| 21140 | return nextState; |
| 21141 | }; |
| 21142 | function updateHashFromState(optionalSelectedEventId) { |
| 21143 | const currentDate = scheduler2._date || scheduler2.getState().date; |
| 21144 | const currentMode = scheduler2.getState().mode; |
| 21145 | const values = ["date=" + dateToString(currentDate), "mode=" + currentMode]; |
| 21146 | if (optionalSelectedEventId) { |
| 21147 | values.push("event=" + optionalSelectedEventId); |
| 21148 | } |
| 21149 | document.location.hash = "#" + values.join(","); |
| 21150 | } |
nothing calls this directly
no test coverage detected