vanilla-ui-router
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -123,3 +123,9 @@ (function (global, factory) { | ||
domEntryPoint.parentElement.insertBefore(domClone, domEntryPoint); | ||
domEntryPoint.remove(); | ||
if (typeof domEntryPoint.remove === 'undefined') { | ||
domEntryPoint.removeNode(true); | ||
} else { | ||
domEntryPoint.remove(); | ||
} | ||
domEntryPoint = domClone; | ||
@@ -126,0 +132,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.vanillaUIRouter=e.vanillaUIRouter||{})}(this,function(e){"use strict";var n=function(e){return isNaN(e)?"true"===e||"false"===e?JSON.parse(e):e:parseInt(e,10)},t=function(e,t){var r=t.split("/"),o=e.split("/");return o.map(function(e,n){if(e.indexOf(":",0)===-1)return null;var t={},o=e.substr(1,e.length-1);return t[o]=r[n],t}).filter(function(e){return null!==e}).reduce(function(e,t){return Object.keys(t).forEach(function(r){e[r]=n(t[r])}),e},{})},r=function(e,n){var t=e.split("/"),r=t[0];return n.filter(function(e){var n=e.split("/"),o=0===n.map(function(e,n){return e.indexOf(":",0)!==-1||e===t[n]}).reduce(function(e,n){return n===!1&&++e,e},0);return e.indexOf(r,0)!==-1&&o&&t.length===n.length})[0]},o=function(e,n){var t=new XMLHttpRequest;t.onreadystatechange=function(){4===t.readyState&&n(t.responseText)},t.open("GET",e),t.send()},i=function(e,n,t){if(e&&(e.templateString&&(n.innerHTML=e.templateString,t()),e.templateUrl&&o(e.templateUrl,function(e){n.innerHTML=e,t()}),e.templateId)){var r=document.getElementById(e.templateId);n.innerHTML=r.text,t()}},u=function(e){var n={},o=e.cloneNode(!0),u=null,a=function(e){window.location.hash=e},f=function(e){n["*"]=e},c=function e(t,r){return n[t]=r,{addRoute:e,otherwise:f,navigateTo:a}},d=function(){if(e.parentElement){var n=o.cloneNode(!0);e.parentElement.insertBefore(n,e),e.remove(),e=n}},l=function(){u&&"undefined"!=typeof u.dispose&&u.dispose(e)},s=function(){var o="*",a=location.hash.slice(1),f=r(a,Object.keys(n)),c={};f&&(c=t(f,a));var s=Object.keys(n).indexOf(f)>-1?n[f]:n[o];s&&(l(s),u=s,d(),"function"==typeof s?s(e,c):i(s,e,function(){"function"==typeof s.routeHandler&&s.routeHandler(e,c)}))};return window&&(window.removeEventListener("hashchange",s),window.addEventListener("hashchange",s),window.removeEventListener("load",s),window.addEventListener("load",s)),{addRoute:c,otherwise:f,navigateTo:a}};e.createRouter=u,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.vanillaUIRouter=e.vanillaUIRouter||{})}(this,function(e){"use strict";var n=function(e){return isNaN(e)?"true"===e||"false"===e?JSON.parse(e):e:parseInt(e,10)},t=function(e,t){var r=t.split("/"),o=e.split("/");return o.map(function(e,n){if(e.indexOf(":",0)===-1)return null;var t={},o=e.substr(1,e.length-1);return t[o]=r[n],t}).filter(function(e){return null!==e}).reduce(function(e,t){return Object.keys(t).forEach(function(r){e[r]=n(t[r])}),e},{})},r=function(e,n){var t=e.split("/"),r=t[0];return n.filter(function(e){var n=e.split("/"),o=0===n.map(function(e,n){return e.indexOf(":",0)!==-1||e===t[n]}).reduce(function(e,n){return n===!1&&++e,e},0);return e.indexOf(r,0)!==-1&&o&&t.length===n.length})[0]},o=function(e,n){var t=new XMLHttpRequest;t.onreadystatechange=function(){4===t.readyState&&n(t.responseText)},t.open("GET",e),t.send()},i=function(e,n,t){if(e&&(e.templateString&&(n.innerHTML=e.templateString,t()),e.templateUrl&&o(e.templateUrl,function(e){n.innerHTML=e,t()}),e.templateId)){var r=document.getElementById(e.templateId);n.innerHTML=r.text,t()}},u=function(e){var n={},o=e.cloneNode(!0),u=null,a=function(e){window.location.hash=e},f=function(e){n["*"]=e},d=function e(t,r){return n[t]=r,{addRoute:e,otherwise:f,navigateTo:a}},c=function(){if(e.parentElement){var n=o.cloneNode(!0);e.parentElement.insertBefore(n,e),"undefined"==typeof e.remove?e.removeNode(!0):e.remove(),e=n}},l=function(){u&&"undefined"!=typeof u.dispose&&u.dispose(e)},s=function(){var o="*",a=location.hash.slice(1),f=r(a,Object.keys(n)),d={};f&&(d=t(f,a));var s=Object.keys(n).indexOf(f)>-1?n[f]:n[o];s&&(l(s),u=s,c(),"function"==typeof s?s(e,d):i(s,e,function(){"function"==typeof s.routeHandler&&s.routeHandler(e,d)}))};return window&&(window.removeEventListener("hashchange",s),window.addEventListener("hashchange",s),window.removeEventListener("load",s),window.addEventListener("load",s)),{addRoute:d,otherwise:f,navigateTo:a}};e.createRouter=u,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -32,3 +32,9 @@ import { | ||
domEntryPoint.parentElement.insertBefore(domClone, domEntryPoint); | ||
domEntryPoint.remove(); | ||
if (typeof domEntryPoint.remove === 'undefined') { | ||
domEntryPoint.removeNode(true); | ||
} else { | ||
domEntryPoint.remove(); | ||
} | ||
domEntryPoint = domClone; | ||
@@ -35,0 +41,0 @@ }; |
{ | ||
"name": "vanilla-ui-router", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Simple vanilla JavaScript router", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/micromata/vanilla-ui-router", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29891
317