Skip to content
Snippets Groups Projects
Commit 8f2022b2 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Merge remote-tracking branch 'origin/master'

parents a2304bdd 055bcc78
No related branches found
No related tags found
No related merge requests found
<?php
$EMPTY_SPACE_FILE = kg_get_space_file_path("default").".hidden";
add_action("wp_ajax_get_space", "kg_get_space"); // Fires only for logged-in-users
add_action("wp_ajax_nopriv_get_space", 'kg_get_space' ); // Fires for everyone
function kg_get_space() {
$file_path = kg_get_space_file_path($_POST["space"]);
// If it doesn't exist, create new empty space
if (!file_exists($file_path)) {
kg_create_empty_space($file_path);
}
$content = file_get_contents($file_path);
echo $content;
......@@ -69,6 +77,18 @@ function kg_get_list_of_spaces() {
return $spaces;
}
function kg_create_empty_space($file_path) {
// Don't do anything, if it exists
if (file_exists($file_path)) {
return;
}
// Read and copy default empty graph from default file
global $EMPTY_SPACE_FILE;
$empty_graph = file_get_contents($EMPTY_SPACE_FILE);
file_put_contents($file_path, $empty_graph);
}
function endsWith( $haystack, $needle ) {
# Source: https://stackoverflow.com/a/834355/7376120
$length = strlen( $needle );
......
{"links":[],"nodes":[]}
\ No newline at end of file
......@@ -63,7 +63,16 @@
</div>
</div>
<div id="settings-menu" class="hidden" checked>
<label for="space-id-select">Space</label>
<label for="label-toggle" class="bottom-space">
<input type="checkbox" checked id="label-toggle" name="label-toggle"></input>
Show labels in graph
</label>
</br>
</br>
<h3>Space</h3>
<label for="space-id-select">Currently open</label>
</br>
<select id="space-id-select" name="space-id-select" class="bottom-space">
</select>
......@@ -71,15 +80,8 @@
</br>
</br>
<input type="checkbox" checked id="label-toggle" name="label-toggle" class="bottom-space">
<label for="label-toggle">Show labels in graph</label>
</input>
<h3>Physics Simulation</h3>
</br>
</br>
<label>Simulate physics from beginning</label>
</br>
<button id="reanimate-button" name="reanimate-button" class="bottom-space">Re-simulate</button>
</br>
......
......@@ -4322,12 +4322,12 @@
}
},
"node_modules/cssnano": {
"version": "5.0.11",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.0.11.tgz",
"integrity": "sha512-5SHM31NAAe29jvy0MJqK40zZ/8dGlnlzcfHKw00bWMVFp8LWqtuyPSFwbaoIoxvt71KWJOfg8HMRGrBR3PExCg==",
"version": "5.0.12",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.0.12.tgz",
"integrity": "sha512-U38V4x2iJ3ijPdeWqUrEr4eKBB5PbEKsNP5T8xcik2Au3LeMtiMHX0i2Hu9k51FcKofNZumbrcdC6+a521IUHg==",
"dev": true,
"dependencies": {
"cssnano-preset-default": "^5.1.7",
"cssnano-preset-default": "^5.1.8",
"is-resolvable": "^1.1.0",
"lilconfig": "^2.0.3",
"yaml": "^1.10.2"
......@@ -4344,9 +4344,9 @@
}
},
"node_modules/cssnano-preset-default": {
"version": "5.1.7",
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.1.7.tgz",
"integrity": "sha512-bWDjtTY+BOqrqBtsSQIbN0RLGD2Yr2CnecpP0ydHNafh9ZUEre8c8VYTaH9FEbyOt0eIfEUAYYk5zj92ioO8LA==",
"version": "5.1.8",
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.1.8.tgz",
"integrity": "sha512-zWMlP0+AMPBVE852SqTrP0DnhTcTA2C1wAF92TKZ3Va+aUVqLIhkqKlnJIXXdqXD7RN+S1ujuWmNpvrJBiM/vg==",
"dev": true,
"dependencies": {
"css-declaration-sorter": "^6.0.3",
......@@ -4374,7 +4374,7 @@
"postcss-normalize-url": "^5.0.3",
"postcss-normalize-whitespace": "^5.0.1",
"postcss-ordered-values": "^5.0.2",
"postcss-reduce-initial": "^5.0.1",
"postcss-reduce-initial": "^5.0.2",
"postcss-reduce-transforms": "^5.0.1",
"postcss-svgo": "^5.0.3",
"postcss-unique-selectors": "^5.0.2"
......@@ -4669,9 +4669,9 @@
"integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug=="
},
"node_modules/debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
"integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"dev": true,
"dependencies": {
"ms": "2.1.2"
......@@ -5041,9 +5041,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.3.tgz",
"integrity": "sha512-hfpppjYhqIZB8jrNb0rNceQRkSnBN7QJl3W26O1jUv3F3BkQknqy1YTqVXkFnIcFtBc3Qnv5M7r5Lez2iOLgZA==",
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.4.tgz",
"integrity": "sha512-teHtgwcmVcL46jlFvAaqjyiTLWuMrUQO1JqV303JKB4ysXG6m8fXSFhbjal9st0r9mNskI22AraJZorb1VcLVg==",
"dev": true
},
"node_modules/elliptic": {
......@@ -10260,9 +10260,9 @@
}
},
"node_modules/postcss": {
"version": "8.4.1",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.1.tgz",
"integrity": "sha512-WqLs/TTzXdG+/A4ZOOK9WDZiikrRaiA+eoEb/jz2DT9KUhMNHgP7yKPO8vwi62ZCsb703Gwb7BMZwDzI54Y2Ag==",
"version": "8.4.4",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.4.tgz",
"integrity": "sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q==",
"dev": true,
"dependencies": {
"nanoid": "^3.1.30",
......@@ -10856,12 +10856,12 @@
}
},
"node_modules/postcss-reduce-initial": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.0.1.tgz",
"integrity": "sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw==",
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.0.2.tgz",
"integrity": "sha512-v/kbAAQ+S1V5v9TJvbGkV98V2ERPdU6XvMcKMjqAlYiJ2NtsHGlKYLPjWWcXlaTKNxooId7BGxeraK8qXvzKtw==",
"dev": true,
"dependencies": {
"browserslist": "^4.16.0",
"browserslist": "^4.16.6",
"caniuse-api": "^3.0.0"
},
"engines": {
......@@ -11083,27 +11083,27 @@
"dev": true
},
"node_modules/purgecss": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/purgecss/-/purgecss-4.0.3.tgz",
"integrity": "sha512-PYOIn5ibRIP34PBU9zohUcCI09c7drPJJtTDAc0Q6QlRz2/CHQ8ywGLdE7ZhxU2VTqB7p5wkvj5Qcm05Rz3Jmw==",
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/purgecss/-/purgecss-4.1.1.tgz",
"integrity": "sha512-oVNNzN9tRVoRCeITtpC3ofLU5wGLLYayXkOELeSr0FjwSVdxNK1GbIAvDQNSm5X1WFXGkfcb9JbvTsS2G364/w==",
"dev": true,
"dependencies": {
"commander": "^6.0.0",
"glob": "^7.0.0",
"postcss": "^8.2.1",
"postcss-selector-parser": "^6.0.2"
"commander": "^8.0.0",
"glob": "^7.1.7",
"postcss": "^8.3.5",
"postcss-selector-parser": "^6.0.6"
},
"bin": {
"purgecss": "bin/purgecss.js"
}
},
"node_modules/purgecss/node_modules/commander": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
"dev": true,
"engines": {
"node": ">= 6"
"node": ">= 12"
}
},
"node_modules/qs": {
......@@ -17210,21 +17210,21 @@
"dev": true
},
"cssnano": {
"version": "5.0.11",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.0.11.tgz",
"integrity": "sha512-5SHM31NAAe29jvy0MJqK40zZ/8dGlnlzcfHKw00bWMVFp8LWqtuyPSFwbaoIoxvt71KWJOfg8HMRGrBR3PExCg==",
"version": "5.0.12",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.0.12.tgz",
"integrity": "sha512-U38V4x2iJ3ijPdeWqUrEr4eKBB5PbEKsNP5T8xcik2Au3LeMtiMHX0i2Hu9k51FcKofNZumbrcdC6+a521IUHg==",
"dev": true,
"requires": {
"cssnano-preset-default": "^5.1.7",
"cssnano-preset-default": "^5.1.8",
"is-resolvable": "^1.1.0",
"lilconfig": "^2.0.3",
"yaml": "^1.10.2"
}
},
"cssnano-preset-default": {
"version": "5.1.7",
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.1.7.tgz",
"integrity": "sha512-bWDjtTY+BOqrqBtsSQIbN0RLGD2Yr2CnecpP0ydHNafh9ZUEre8c8VYTaH9FEbyOt0eIfEUAYYk5zj92ioO8LA==",
"version": "5.1.8",
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.1.8.tgz",
"integrity": "sha512-zWMlP0+AMPBVE852SqTrP0DnhTcTA2C1wAF92TKZ3Va+aUVqLIhkqKlnJIXXdqXD7RN+S1ujuWmNpvrJBiM/vg==",
"dev": true,
"requires": {
"css-declaration-sorter": "^6.0.3",
......@@ -17252,7 +17252,7 @@
"postcss-normalize-url": "^5.0.3",
"postcss-normalize-whitespace": "^5.0.1",
"postcss-ordered-values": "^5.0.2",
"postcss-reduce-initial": "^5.0.1",
"postcss-reduce-initial": "^5.0.2",
"postcss-reduce-transforms": "^5.0.1",
"postcss-svgo": "^5.0.3",
"postcss-unique-selectors": "^5.0.2"
......@@ -17476,9 +17476,9 @@
"integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug=="
},
"debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
"integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"dev": true,
"requires": {
"ms": "2.1.2"
......@@ -17764,9 +17764,9 @@
}
},
"electron-to-chromium": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.3.tgz",
"integrity": "sha512-hfpppjYhqIZB8jrNb0rNceQRkSnBN7QJl3W26O1jUv3F3BkQknqy1YTqVXkFnIcFtBc3Qnv5M7r5Lez2iOLgZA==",
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.4.tgz",
"integrity": "sha512-teHtgwcmVcL46jlFvAaqjyiTLWuMrUQO1JqV303JKB4ysXG6m8fXSFhbjal9st0r9mNskI22AraJZorb1VcLVg==",
"dev": true
},
"elliptic": {
......@@ -21811,9 +21811,9 @@
"dev": true
},
"postcss": {
"version": "8.4.1",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.1.tgz",
"integrity": "sha512-WqLs/TTzXdG+/A4ZOOK9WDZiikrRaiA+eoEb/jz2DT9KUhMNHgP7yKPO8vwi62ZCsb703Gwb7BMZwDzI54Y2Ag==",
"version": "8.4.4",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.4.tgz",
"integrity": "sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q==",
"dev": true,
"requires": {
"nanoid": "^3.1.30",
......@@ -22237,12 +22237,12 @@
}
},
"postcss-reduce-initial": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.0.1.tgz",
"integrity": "sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw==",
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.0.2.tgz",
"integrity": "sha512-v/kbAAQ+S1V5v9TJvbGkV98V2ERPdU6XvMcKMjqAlYiJ2NtsHGlKYLPjWWcXlaTKNxooId7BGxeraK8qXvzKtw==",
"dev": true,
"requires": {
"browserslist": "^4.16.0",
"browserslist": "^4.16.6",
"caniuse-api": "^3.0.0"
}
},
......@@ -22412,21 +22412,21 @@
"dev": true
},
"purgecss": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/purgecss/-/purgecss-4.0.3.tgz",
"integrity": "sha512-PYOIn5ibRIP34PBU9zohUcCI09c7drPJJtTDAc0Q6QlRz2/CHQ8ywGLdE7ZhxU2VTqB7p5wkvj5Qcm05Rz3Jmw==",
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/purgecss/-/purgecss-4.1.1.tgz",
"integrity": "sha512-oVNNzN9tRVoRCeITtpC3ofLU5wGLLYayXkOELeSr0FjwSVdxNK1GbIAvDQNSm5X1WFXGkfcb9JbvTsS2G364/w==",
"dev": true,
"requires": {
"commander": "^6.0.0",
"glob": "^7.0.0",
"postcss": "^8.2.1",
"postcss-selector-parser": "^6.0.2"
"commander": "^8.0.0",
"glob": "^7.1.7",
"postcss": "^8.3.5",
"postcss-selector-parser": "^6.0.6"
},
"dependencies": {
"commander": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
"dev": true
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment