Now only loads & runs if JSHint is available

Script only loads if file is available
Processes in function only run if JSHINT is available
This commit is contained in:
Matt Pass
2012-12-13 09:16:13 +00:00
parent 01b035d7af
commit 2bb961b7a8
2 changed files with 6 additions and 2 deletions

View File

@@ -35,7 +35,11 @@ window.onbeforeunload = function() {
</script>
<script language="JavaScript" src="lib/ice-coder.js"></script>
<script src="plugins/jshint/jshint.js"></script>
<?php
if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
echo '<script src="plugins/jshint/jshint.js"></script>';
}
?>
</head>
<body onLoad="<?php

View File

@@ -1151,7 +1151,7 @@ var ICEcoder = {
updateHints: function() {
var cM;
if (top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1].indexOf('.js')>-1) {
if ("undefined" != typeof JSHINT && top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1].indexOf('.js')>-1) {
cM = ICEcoder.getcMInstance();
cM.operation(function(){
var widgets = top.ICEcoder['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]+'widgets'];