So close! I'm able to use syntax highlighting AND grab the content with js (which then adds to a textarea), but the Flask for loop is only noticed on the first iteration. I can't grab the subsequent values. I need to find a way to dynamically find IDs.
This commit is contained in:
BIN
app/static/.DS_Store
vendored
Normal file
BIN
app/static/.DS_Store
vendored
Normal file
Binary file not shown.
4
app/static/css/prism.css
Normal file
4
app/static/css/prism.css
Normal file
@ -0,0 +1,4 @@
|
||||
/* PrismJS 1.29.0
|
||||
https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+clike+javascript&plugins=line-numbers */
|
||||
code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}
|
||||
pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}
|
||||
7
app/static/css/prism.js
Normal file
7
app/static/css/prism.js
Normal file
File diff suppressed because one or more lines are too long
@ -170,7 +170,7 @@ li {
|
||||
|
||||
.man-csv-opts {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
justify-content: space-evenly;
|
||||
|
||||
}
|
||||
.csv-upload {
|
||||
@ -182,6 +182,15 @@ li {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.window-body {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
#templates {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
#currentDate {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
getAllGroups();
|
||||
});
|
||||
|
||||
const apiKey = 'session["key"]';
|
||||
const groups= [];
|
||||
const getAllGroups = async (num) => {
|
||||
if(num === 1){
|
||||
}
|
||||
let page = num;
|
||||
|
||||
await axios({
|
||||
method: 'get',
|
||||
url: `https://api.northpass.com/v2/groups?page=${page}`,
|
||||
headers: {
|
||||
'accept': '*/*',
|
||||
'x-api-key': apiKey,
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.data.links.next != null) {
|
||||
page++;
|
||||
for (let i = 0; i < res.data.data.length; i++) {
|
||||
let groupName = res.data.data[i].attributes.name;
|
||||
selectInput = '<option value='+ groupName +'>'+ groupName+'</option>';
|
||||
$('#groups').append(selectInput);
|
||||
groups.push(res.data.data[i].attributes.name);
|
||||
}
|
||||
await getAllGroups(page);
|
||||
} else {
|
||||
for (let i = 0; i < res.data.data.length; i++) {
|
||||
groups.push(res.data.data[i].attributes.name);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user