MCPcopy Create free account
hub / github.com/error311/FileRise / hasUnsavedChanges

Function hasUnsavedChanges

public/js/adminPanel.js:5385–5449  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5383 };
5384}
5385function hasUnsavedChanges() {
5386 const o = originalAdminConfig;
5387 const getVal = id => (document.getElementById(id)?.value || "").trim();
5388 const getChk = id => !!document.getElementById(id)?.checked;
5389
5390 return (
5391 getVal("headerTitle") !== o.headerTitle ||
5392 getVal("publishedUrl") !== (o.publishedUrl || "") ||
5393
5394 getVal("oidcProviderUrl") !== o.oidcProviderUrl ||
5395 getVal("oidcClientId") !== o.oidcClientId ||
5396 getVal("oidcClientSecret") !== o.oidcClientSecret ||
5397 getVal("oidcRedirectUri") !== o.oidcRedirectUri ||
5398 getChk("oidcAllowDemote") !== o.oidcAllowDemote ||
5399 getChk("oidcDebugLogging") !== o.oidcDebugLogging ||
5400 getVal("oidcGroupClaim") !== (o.oidcGroupClaim || "") ||
5401 getVal("oidcExtraScopes") !== (o.oidcExtraScopes || "") ||
5402
5403 // new enable-toggles
5404 getChk("enableFormLogin") !== o.enableFormLogin ||
5405 getChk("enableBasicAuth") !== o.enableBasicAuth ||
5406 getChk("enableOIDCLogin") !== o.enableOIDCLogin ||
5407 getChk("authBypass") !== o.authBypass ||
5408
5409 getChk("enableWebDAV") !== o.enableWebDAV ||
5410 getVal("safeUploadPolicy") !== (o.safeUploadPolicy || "strict") ||
5411 getVal("sharedMaxUploadSize") !== o.sharedMaxUploadSize ||
5412 getVal("resumableChunkMb") !== o.resumableChunkMb ||
5413 getVal("resumableTtlHours") !== o.resumableTtlHours ||
5414 getVal("globalOtpauthUrl") !== o.globalOtpauthUrl ||
5415 getVal("brandingCustomLogoUrl") !== (o.brandingCustomLogoUrl || "") ||
5416 getVal("brandingHeaderBgLight") !== (o.brandingHeaderBgLight || "") ||
5417 getVal("brandingHeaderBgDark") !== (o.brandingHeaderBgDark || "") ||
5418 getVal("brandingMetaDescription") !== (o.brandingMetaDescription || "") ||
5419 getVal("brandingFaviconSvg") !== (o.brandingFaviconSvg || "") ||
5420 getVal("brandingFaviconPng") !== (o.brandingFaviconPng || "") ||
5421 getVal("brandingFaviconIco") !== (o.brandingFaviconIco || "") ||
5422 getVal("brandingAppleTouchIcon") !== (o.brandingAppleTouchIcon || "") ||
5423 getVal("brandingMaskIcon") !== (o.brandingMaskIcon || "") ||
5424 getVal("brandingMaskIconColor") !== (o.brandingMaskIconColor || "") ||
5425 getVal("brandingThemeColorLight") !== (o.brandingThemeColorLight || "") ||
5426 getVal("brandingThemeColorDark") !== (o.brandingThemeColorDark || "") ||
5427 getVal("brandingLoginBgLight") !== (o.brandingLoginBgLight || "") ||
5428 getVal("brandingLoginBgDark") !== (o.brandingLoginBgDark || "") ||
5429 getVal("brandingAppBgLight") !== (o.brandingAppBgLight || "") ||
5430 getVal("brandingAppBgDark") !== (o.brandingAppBgDark || "") ||
5431 getVal("brandingLoginTagline") !== (o.brandingLoginTagline || "") ||
5432 getVal("brandingFooterHtml") !== (o.brandingFooterHtml || "") ||
5433 getVal("defaultLanguage") !== (o.defaultLanguage || "") ||
5434 getVal("hoverPreviewMaxImageMb") !== (o.hoverPreviewMaxImageMb || "") ||
5435 getVal("hoverPreviewMaxVideoMb") !== (o.hoverPreviewMaxVideoMb || "") ||
5436 getChk("enablePdfThumbnails") !== !!o.enablePdfThumbnails ||
5437 getVal("ffmpegPath") !== (o.ffmpegPath || "") ||
5438 getVal("fileListSummaryDepth") !== (o.fileListSummaryDepth || "") ||
5439 getVal("ignoreRegex") !== (o.ignoreRegex || "") ||
5440 getChk("clamavScanUploads") !== o.clamavScanUploads ||
5441 getVal("clamavExcludeDirs") !== (o.clamavExcludeDirs || "") ||
5442 getChk("proSearchEnabled") !== o.proSearchEnabled ||

Callers 1

closeAdminPanelFunction · 0.85

Calls 2

getChkFunction · 0.85
getValFunction · 0.70

Tested by

no test coverage detected