whisper.cat/weboasis/weather/js/classie.min.js
2023-10-05 23:28:32 +11:00

1 line
655 B
JavaScript

!function(s){"use strict";function n(s){return new RegExp("(^|\\s+)"+s+"(\\s+|$)")}var t,a,c;function e(s,e){(t(s,e)?c:a)(s,e)}"classList"in document.documentElement?(t=function(s,e){return s.classList.contains(e)},a=function(s,e){s.classList.add(e)},c=function(s,e){s.classList.remove(e)}):(t=function(s,e){return n(e).test(s.className)},a=function(s,e){t(s,e)||(s.className=s.className+" "+e)},c=function(s,e){s.className=s.className.replace(n(e)," ")});var o={hasClass:t,addClass:a,removeClass:c,toggleClass:e,has:t,add:a,remove:c,toggle:e};"function"==typeof define&&define.amd?define(o):"object"==typeof exports?module.exports=o:s.classie=o}(window);