Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #115 from hermfischer-wf/edgar24.2.u1
Browse files Browse the repository at this point in the history
  • Loading branch information
austinmatherne-wk authored Jul 31, 2024
2 parents bb958c0 + c9156c7 commit 5555a01
Show file tree
Hide file tree
Showing 309 changed files with 7,698 additions and 14,494 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
GUI may use tools->language labels setting to override system language for labels
"""
VERSION = '3.24.2'
VERSION = '3.24.2.u1'

from collections import defaultdict
from arelle import PythonUtil
Expand Down Expand Up @@ -1209,7 +1209,7 @@ def copyResourceToReportFolder(filename):
hasEditedCont = True
if removableUnits: # check for orphaned units
for e in ixdsHtmlRootElt.iter("{http://www.xbrl.org/2003/instance}unit"):
if e in removableUnits and not any((f.id not in redactTgtElts) for f in modelXbrl.facts and f.id not in redactTgtElts and isinstance(f, ModelFact) and f.unit == e):
if e in removableUnits and not any((f.id not in redactTgtElts) for f in modelXbrl.facts if f.id not in redactTgtElts and isinstance(f, ModelFact) and f.unit == e):
e.getparent().remove(e) # remove this context
e.modelXbrl.units.pop(e.id, None)
hasEditedCont = True
Expand Down
3 changes: 3 additions & 0 deletions ix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- this doesn't work on Arelle LocalViewer but is required on sec.gov website
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
-->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
Expand Down
121 changes: 121 additions & 0 deletions ix-for-sec-website
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<title>XBRL Viewer</title>
<script language="JavaScript">
/* <![CDATA[ */
/* Created by staff of the U.S. Securities and Exchange Commission.
* Data and content created by government employees within the scope of their employment
* are not subject to domestic copyright protection. 17 U.S.C. 105.
*
* This script checks the accession number of the document requested to determine
* the year and sequence of filing. If filed after the availability of ixviewer-plus
* this script redirects to that viewer, otherwise to a prior ixviewer in effect
* or deemed compatible with the filing.
*/
function loadViewer(ixvUrl) {
// load viewer in an iframe so the end user's browser URL is not changed
var iFrame = document.getElementById("ixvFrame");
iFrame.src = ixvUrl;
}
const url = location.href;
// url doc pattern is /Archives/edgar/data/ciknum/{10digits}{YY}{sequence}/{more params}
// uncomment one of the following urlPatterns depending on usage:
// for SEC.GOV: const urlPattern = /(\?doc=(\/Archives\/edgar\/data\/[0-9]+\/[0-9]{10}([0-9]{8})\/).*$)/;
// for Arelle GUI: const urlPattern = /(\?doc=(\/[0-9]+\/).*$)/;
const urlPattern = /(\?doc=(\/Archives\/edgar\/data\/[0-9]+\/[0-9]{10}([0-9]{8})\/).*$)/;
const ixvPlusNsPattern = /http:\/\/xbrl.sec.gov\/(ffd|sbs)\/.*$/;
var ixvUrl = null;
if (! urlPattern.test(url)) {
alert("Not an EDGAR inline XBRL document viewing request, please check URL");
// this hangs: loadViewer("/ixviewer/ix.html" + ixParams);
} else {
const match = url.match(urlPattern);
const ixParams = match[1];
const docPath = match[2];
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {
const ml = JSON.parse(this.responseText);
if (!(typeof ml === 'object' && "instance" in ml)) {
console.log("Metalinks does not have instance objects");
// Unable to read MetaLinks.json, use 23.2 ixviewer
loadViewer("/ixviewer/ix.html" + ixParams);
} else {
const numInstances = Object.keys(ml["instance"]).length;
let maxDocsPerInst = 0;
let hasIxvPlusExhibit = false;
Object.keys(ml["instance"]).forEach(instanceNames => {
let docsInInstance = instanceNames.split(" ").length;
if (docsInInstance > maxDocsPerInst)
maxDocsPerInst = docsInInstance;
if ("baseTaxonomies" in ml["instance"][instanceNames]) {
Object.keys(ml["instance"][instanceNames]["baseTaxonomies"])
.forEach(baseTaxonomyUrl => {
if (ixvPlusNsPattern.test(baseTaxonomyUrl))
hasIxvPlusExhibit = true;
});
}
});
if (numInstances > 1 || maxDocsPerInst > 1 || hasIxvPlusExhibit || url.includes("&redline=true") )
loadViewer("/ixviewer-plus/ix.xhtml" + ixParams);
else
loadViewer("/ixviewer/ix.html" + ixParams);
}
} else {
console.log("Unable to read MetaLinks.json for this accession");
// Unable to read MetaLinks.json, use 23.2 ixviewer
loadViewer("/ixviewer/ix.html" + ixParams);
}
}
};
xhr.ontimeout = function() {
console.log("Timeout reading MetaLinks.json for this accession");
// Unable to read MetaLinks.json, use 23.2 ixviewer
loadViewer("/ixviewer/ix.html" + ixParams);
};
xhr.open("GET", docPath + 'MetaLinks.json', true);
xhr.timeout = 2000; // milliseconds
xhr.send();
/* Arelle GUI usage: set title for tab in browser for when there are multiple tabs */
const urlTitleParamPattern = /&title=([^&]+),*$/;
if (urlTitleParamPattern.test(url)) {
const match = url.match(urlTitleParamPattern);
document.title = decodeURIComponent(match[1]);
}
/* alternative select viewer using accession number
const acsnYrSeq = match[3];
if (acsnYrSeq > "24905000") {
loadViewer(docPath + "ixbrlviewer.xhtml");
} else if (acsnYrSeq > "23905000") {
loadViewer("/ixviewer-plus/ix.xhtml" + ixParams);
} else {
loadViewer("/ixviewer/ix.html" + ixParams);
}
*/
}
/* ]]> */
</script>
</head>

<body style="margin: 0">
<noscript>
Please enable JavaScript to use the EDGAR Inline XBRL Viewer.
</noscript>
<iframe id="ixvFrame"
title="Inline XBRL Viewer"
style="position: absolute; height: 100%; width: 100%; border: none"
/>
</body>
</html>
7 changes: 5 additions & 2 deletions ixviewer-plus-src/.eslintrc
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
},
"rules":
{
"no-extra-boolean-cast": "warn",
"prefer-const": "warn",
"@typescript-eslint/no-non-null-assertion": "off"
"no-extra-boolean-cast": "off",
"@typescript-eslint/no-non-null-assertion": "off",

//this needs to stay off until we have good types across the app
"@typescript-eslint/no-explicit-any": "off"
}
}
Empty file modified ixviewer-plus-src/.gitignore
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/copy-test-files.sh
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/create-builds.js
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/createSectionsReport.mjs
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/createSymlinkToArchives.sh
100644 → 100755
Empty file.
10 changes: 0 additions & 10 deletions ixviewer-plus-src/cypress.config.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ export default defineConfig({
skipScrapers: true,
limitNumOfFilingsForTestRun: true, // Good for doing a health check of all tests
limitOfFilingsToTest: 3,
docBaseForCurrentDomain: function() {
switch(this.host) {
case domains.dev1:
return urls.dev1DocRoot
case domains.local:
return urls.localDocRoot
default:
return urls.dev1DocRoot
}
}
},
e2e: {
setupNodeEvents(on, config) {
Expand Down
Empty file modified ixviewer-plus-src/cypress/data/enrichedFilings.js
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/cypress/data/enrichedFilings.old.js
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified ixviewer-plus-src/cypress/data/extendedFilings.js
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/cypress/data/filingsMeta.txt
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/cypress/data/max5OfEachFormType.js
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/cypress/data/scraperRunStatus.js
100644 → 100755
Empty file.
Empty file modified ixviewer-plus-src/cypress/data/urlsEdgeCases.js
100644 → 100755
Empty file.
5 changes: 4 additions & 1 deletion ixviewer-plus-src/cypress/dataPlus/domains.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export const urls = {
dev1DocRoot: 'http://172.18.85.157:8082/ix3/ixviewer3/ix.xhtml?doc='
localRoot: 'http://localhost:3000/',
dev1Root: 'http://172.18.85.157:8082/ixviewer-ix-dev/',
dev1DocRoot: 'http://172.18.85.157:8082/ixviewer-ix-dev/ix.xhtml?doc=',
secRoot: 'https://www.sec.gov/ixviewer-plus/'
}
Loading

0 comments on commit 5555a01

Please sign in to comment.