Skip to content

Commit

Permalink
enable CORS header
Browse files Browse the repository at this point in the history
  • Loading branch information
tursics committed Jun 5, 2024
1 parent 0a4ee11 commit 744f06a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
16 changes: 16 additions & 0 deletions app/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
##########################################################################################
# deactivate "directory indexing / directory listing"
Options -Indexes

# deactivate "name completion" and "show similar file names"
CheckSpelling off

##########################################################################################

RewriteEngine on

<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>

##########################################################################################
10 changes: 7 additions & 3 deletions app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ function loadCards() {

if ((typeof cityConfig.cards !== 'undefined') && (config.loaded < cityConfig.cards.length)) {
var url = cityConfig.cards[config.loaded];
if(window.myNavigation.useFileSystem) {
url = 'https://datenwaben.de/' + url;
}
$.ajax(url)
.done(function (json) {
try {
Expand Down Expand Up @@ -570,9 +573,10 @@ function installCity(callbackFunc) {
cityConfig = {};

var url = window.myNavigation.city;
// if(window.myNavigation.useFileSystem) {
// url = location.href.substr(0, location.href.lastIndexOf('/')) + '/' + url;
// }
if(window.myNavigation.useFileSystem) {
url = 'https://datenwaben.de/' + url;
console.error('Load data from remote!');
}

url += '/cityConfig.json';
$.ajax(url)
Expand Down

0 comments on commit 744f06a

Please sign in to comment.