another fix for js crashes

This commit is contained in:
Baris Soner Usakli
2013-07-15 01:40:48 -04:00
parent 6f57e639f9
commit f7f5da00e1
3 changed files with 12 additions and 10 deletions

View File

@@ -1,12 +1,10 @@
var socket,
config,
app = {},
API_URL = null,
RELATIVE_PATH = null;
API_URL = null;
// todo: cleanup,etc
(function() {
RELATIVE_PATH = $('#relative_path').attr('value');
function loadConfig() {
@@ -105,6 +103,8 @@ var socket,
});
}
// takes a string like 1000 and returns 1,000
app.addCommas = function(text) {
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
@@ -238,7 +238,7 @@ var socket,
jQuery('document').ready(function() {
loadConfig();
// On menu click, change "active" state
var menuEl = document.querySelector('.nav'),
@@ -260,7 +260,7 @@ var socket,
addTouchEvents();
});
loadConfig();
function addTouchEvents() {

View File

@@ -3,7 +3,9 @@
<head>
<title>NodeBB Administration Panel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta id="relative_path" template-variable="relative_path" value="{relative_path}" />
<script>
var RELATIVE_PATH = "{relative_path}";
</script>
<link id="base-theme" href="{cssSrc}" rel="stylesheet" media="screen">
<link href="{relative_path}/vendor/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="{relative_path}/vendor/fontawesome/css/font-awesome.min.css">

View File

@@ -8,9 +8,9 @@
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta id="relative_path" template-variable="relative_path" value="{relative_path}" />
<script>
var RELATIVE_PATH = "{relative_path}";
</script>
<link href="{cssSrc}" rel="stylesheet" media="screen">
<link href="{relative_path}/vendor/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="{relative_path}/vendor/fontawesome/css/font-awesome.min.css">