Browse Source

Load JSON rather than expecting a script

New backend URL
master
Chris Smith 12 years ago
parent
commit
e74d977482
2 changed files with 4 additions and 3 deletions
  1. 1
    1
      .htaccess
  2. 3
    2
      res/js/viewer.js

+ 1
- 1
.htaccess View File

@@ -1,2 +1,2 @@
1 1
 RewriteEngine On
2
-RewriteRule ^/?res/data/layouts/([0-9]+).js http://mifune.co.uk/~shane/convert.php?id=$1 [P]
2
+RewriteRule ^/?res/data/layouts/([0-9]+).js http://backend.layoutviewer.co.uk/getLayout/$1.js [P]

+ 3
- 2
res/js/viewer.js View File

@@ -163,7 +163,8 @@ $(function() {
163 163
  $('#createlayout').click(showPicker);
164 164
  $('#layoutmask').click(closePicker);
165 165
 
166
- function updateLayout() {
166
+ function updateLayout(data) {
167
+  layout = data;
167 168
   thisLevel = levels[layout.level - 1];
168 169
   $('#mapcontainer').css('background-image', 'url("' + thisLevel.minimap + '")');
169 170
 
@@ -177,7 +178,7 @@ $(function() {
177 178
  }
178 179
 
179 180
  function getLayout(id) {
180
-  $.getScript('res/data/layouts/' + id + '.js', updateLayout);
181
+  $.getJSON('res/data/layouts/' + id + '.js', updateLayout);
181 182
  }
182 183
 
183 184
  getLayout(parseInt(getURLParameter('id')) || 13934);

Loading…
Cancel
Save