").append(le.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},le.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){le.fn[t]=function(e){return this.on(t,e)}}),le.expr.filters.animated=function(e){return le.grep(le.timers,function(t){return e===t.elem}).length};var sn=o.document.documentElement;le.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=le.css(e,"position"),d=le(e),f={};"static"===c&&(e.style.position="relative"),s=d.offset(),o=le.css(e,"top"),u=le.css(e,"left"),l=("absolute"===c||"fixed"===c)&&le.inArray("auto",[o,u])>-1,l?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),le.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):d.css(f)}},le.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){le.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;return o?(t=o.documentElement,le.contains(t,i)?(typeof i.getBoundingClientRect!==Se&&(r=i.getBoundingClientRect()),n=K(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===le.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),le.nodeName(e[0],"html")||(n=e.offset()),n.top+=le.css(e[0],"borderTopWidth",!0),n.left+=le.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-le.css(r,"marginTop",!0),left:t.left-n.left-le.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||sn;e&&!le.nodeName(e,"html")&&"static"===le.css(e,"position");)e=e.offsetParent;return e||sn})}}),le.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);le.fn[e]=function(r){return He(this,function(e,r,i){var o=K(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?le(o).scrollLeft():i,n?i:le(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),le.each(["top","left"],function(e,t){le.cssHooks[t]=L(se.pixelPosition,function(e,n){return n?(n=ot(e,t),st.test(n)?le(e).position()[t]+"px":n):void 0})}),le.each({Height:"height",Width:"width"},function(e,t){le.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){le.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return He(this,function(t,n,r){var i;return le.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?le.css(t,n,a):le.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),le.fn.size=function(){return this.length},le.fn.andSelf=le.fn.addBack,n(2)&&(r=[],void 0!==(i=function(){return le}.apply(t,r))&&(e.exports=i));var un=o.jQuery,ln=o.$;return le.noConflict=function(e){return o.$===le&&(o.$=ln),e&&o.jQuery===le&&(o.jQuery=un),le},typeof a===Se&&(o.jQuery=o.$=le),le})},function(e,t,n){var r=n(0),i=n(3),o=n(4),a=n(5),s=n(6),u=n(7),l=n(8),c=n(10),d=n(11);n(12),r(function(){i(),o(),a(),s(),u(),l(),c(),d()})},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t){function n(e){return[].slice.call(e)}function r(e,t){return!(!e.className||!e.className.match(new RegExp(t)))}function i(e,t){for(var n=e;n&&1===n.nodeType;){if(r(n,t))return n;n=n.parentNode}return null}function o(){return n(document.getElementsByTagName("input")).map(function(e){if(r(e,"vDateField")||r(e,"vTimeField"))return e}).filter(function(e){return!!e})}function a(){o().forEach(function(e){var t,n=i(e,"fieldBox"),o=i(e,"datetime");if(o&&(t=i(o,"fieldBox")),!(t&&t===n||n)){var a=e.parentNode;if(!a)return;r(a,"datetime")&&(a.innerHTML.split(/
/).forEach(function(e){document.body.contains(a)&&a.insertAdjacentHTML("beforebegin",'
'+e+"
")}),document.body.contains(a)&&(a.parentNode.removeChild(a),a=null))}})}function s(){o().forEach(function(e){var t=i(e,"datetime");t||(t=i(e,"fieldBox")),t&&n(t.childNodes).forEach(function(e){if(e.nodeType===Node.TEXT_NODE&&""!==e.textContent.trim()){var t=document.createElement("label");t.appendChild(document.createTextNode(e.textContent)),e.parentNode.replaceChild(t,e)}})})}function u(){a(),s()}e.exports=u},function(e,t){function n(){window.jQuery&&window.django&&window.django.jQuery&&function(e){e.fn.touchSupport&&e(".drag-handler").length&&e(window).touchSupport()}(window.jQuery||window.django.jQuery)}(window.jQuery||window.django&&window.django.jQuery)&&function(e){e.fn.touchSupport=function(){function e(e){var t=e.originalEvent.changedTouches[0],n=document.createEvent("MouseEvent");n.initMouseEvent({touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"}[e.type],!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(n),e.stopPropagation()}!function(t){t.on({touchstart:e,touchmove:e,touchend:e,touchcancel:e})}(this)}}(window.jQuery||window.django.jQuery),e.exports=n},function(e,t,n){function r(){var e=i(".toplinks");i("#changelist-form").find(".actions").length&&i("#toolbar").addClass("actions-visible"),0===e.children().length&&e.parent().hasClass("xfull")&&e.parent().addClass("hidden")}var i=n(0);e.exports=r},function(e,t){function n(e){return[].slice.call(e)}function r(){return n(document.getElementsByClassName("related-widget-wrapper")).map(function(e){return e}).filter(function(e){return!!e})}function i(){r().forEach(function(e){var t=e.getElementsByClassName("related-widget-wrapper-link");t&&t.length&&(e.className+=" widget-wrapper-links-"+t.length)})}function o(){i()}e.exports=o},function(e,t){function n(e,t){var n=e.className,r=n.indexOf(t);if(!e||!t)return!1;-1===r?n+=" "+t:n=n.substr(0,r)+n.substr(r+t.length),e.className=n}function r(){var e=document.getElementsByClassName("submenu")[0],t=document.getElementsByClassName("menu-item")[0],r=document.getElementsByTagName("html")[0];e&&t&&(t.addEventListener("click",function(r){(r||window.event).preventDefault(),n(e,"submenu-open"),n(t,"menu-item-open")}),r.addEventListener("click",function(e){if(e.target!==t){var n=document.getElementsByClassName("submenu-open")[0],r=document.getElementsByClassName("menu-item-open")[0];n&&r&&(n.className=n.className.replace("submenu-open",""),r.className=r.className.replace("menu-item-open",""))}}))}e.exports=r},function(e,t,n){function r(e){return c.ajax({url:f,data:e})}function i(e,t){var n,r,i,o=/(\.0)+[^\.]*$/;for(e=(e+"").replace(o,"").split("."),t=(t+"").replace(o,"").split("."),i=Math.min(e.length,t.length),n=0;n
0||0===n&&!!t.match(/[^\.\d]+/)}function a(e,t){var n=c(c("#cms-update-notification").html());n.find(".js-latest-version").text(e.version),n.find(".js-release-notes-link").attr("href",e.url),n.find(".close").on("click",function(r){r.preventDefault(),d.set("cms_upgrade_notification_closed",JSON.stringify({version:e.version,type:t}),{expires:p}),d.set("cms_upgrade_notification_closed_recently",!0,{expires:h}),n.slideUp("fast",function(){n.remove()})}),n.prependTo("#content").slideDown("fast")}function s(e,t,n){if(void 0!==e){var r=d.get("cms_upgrade_notification_closed");return r&&(r=JSON.parse(r)),(!r||r.type!==n||r.version!==e.version)&&o(e.version,t)}return!1}function u(e,t,n){var r,i,a=t.split("rc")[0].split(".");for(var s in e)s.includes("rc")||(i=s.split("."),i[0]!==a[0]||"patch"===n&&i[1]!==a[1]||(void 0===r||o(s,r))&&(r=s));if(r)return{version:r,url:"https://github.com/django-cms/django-cms/blob/"+r+"/CHANGELOG.rst"}}function l(){var e=c('meta[name="djangocms_version"]');if(e.length&&!d.get("cms_upgrade_notification_closed_recently")){var t=e.attr("content").split("rc")[0],n=c('meta[name="djangocms_version_check_type"]').attr("content");r({version:t,type:n}).done(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}var r=u(e.releases,t,n);s(r,t,n)&&a(r,n)})}}var c=n(0),d=n(9),f="https://pypi.org/pypi/django-cms/json",p=365,h=14;e.exports=l},function(e,t,n){var r,i;!function(o){r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}(function(){function e(){for(var e=0,t={};e1){if(o=e({path:"/"},r.defaults,o),"number"==typeof o.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*o.expires),o.expires=s}try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(e){}return i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",i,o.expires&&"; expires="+o.expires.toUTCString(),o.path&&"; path="+o.path,o.domain&&"; domain="+o.domain,o.secure?"; secure":""].join("")}t||(a={});for(var u=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,c=0;c1)){e.preventDefault();var n=e.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(r)}}if(e.support.touch="ontouchend"in document,e.support.touch){var n,r=e.ui.mouse.prototype,i=r._mouseInit,o=r._mouseDestroy;r._touchStart=function(e){var r=this;!n&&r._mouseCapture(e.originalEvent.changedTouches[0])&&(n=!0,r._touchMoved=!1,t(e,"mouseover"),t(e,"mousemove"),t(e,"mousedown"))},r._touchMove=function(e){n&&(this._touchMoved=!0,t(e,"mousemove"))},r._touchEnd=function(e){n&&(t(e,"mouseup"),t(e,"mouseout"),this._touchMoved||t(e,"click"),n=!1)},r._mouseInit=function(){var t=this;t.element.bind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),i.call(t)},r._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),o.call(t)}}}(r)}]);
\ No newline at end of file
diff --git a/djangocms_admin_style/static/djangocms_admin_style/js/modules/dark-mode.js b/djangocms_admin_style/static/djangocms_admin_style/js/modules/dark-mode.js
index cc967c3f..a6da664d 100644
--- a/djangocms_admin_style/static/djangocms_admin_style/js/modules/dark-mode.js
+++ b/djangocms_admin_style/static/djangocms_admin_style/js/modules/dark-mode.js
@@ -23,6 +23,10 @@ function getTopWindow() {
function getColorSchemeFromSettings(CMS) {
var colorScheme;
+ if (!CMS) {
+ return;
+ }
+
if (CMS.settings && CMS.settings.color_scheme) {
// Use color_scheme from settings.py
colorScheme = CMS.settings.color_scheme;
@@ -54,16 +58,12 @@ function darkModeSettings() {
// CMS not loaded: set color scheme for admin site according to settings
colorScheme = JSON.parse(localStorage.getItem('cms_cookie') || '{}').color_scheme;
}
-
- if (colorScheme === 'auto' || colorScheme === undefined) {
- document.documentElement.dataset.theme = 'auto';
- } else {
- document.documentElement.dataset.theme = colorScheme;
- }
}
}
}
- document.documentElement.dataset.theme = colorScheme;
+ if (colorScheme) {
+ document.documentElement.dataset.theme = colorScheme;
+ }
}
module.exports = darkModeSettings;
diff --git a/setup.py b/setup.py
index 1743c99f..916e394b 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,9 @@
from djangocms_admin_style import __version__
-REQUIREMENTS = []
+REQUIREMENTS = [
+ "Django",
+]
CLASSIFIERS = [