Skip to content

Commit

Permalink
Merge pull request #137 from joola/feature/#130
Browse files Browse the repository at this point in the history
#130 Fixed issue with localhost reference
  • Loading branch information
itayw committed Oct 26, 2014
2 parents ad8c92c + 27a762f commit b110e9a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ joola.init = function (options, callback) {
if (typeof (jQuery) === 'undefined') {
script = document.createElement('script');
expected++;

script.onload = function () {
//jQuery.noConflict(true);

Expand All @@ -155,23 +156,23 @@ joola.init = function (options, callback) {
script.onload = function () {
done('highcharts-nodata');
};
script.src = '//code.highcharts.com/modules/no-data-to-display.js';
script.src = (location.protocol === 'file:' ? 'http://' : '') + '//code.highcharts.com/modules/no-data-to-display.js';
document.head.appendChild(script);

done('highcharts');
};
script.src = '//code.highcharts.com/highcharts.js';
script.src = (location.protocol === 'file:' ? 'http://' : '') + '//code.highcharts.com/highcharts.js';
document.head.appendChild(script);


done('jquery-ui');
};
script.src = '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js';
script.src = (location.protocol === 'file:' ? 'http://' : '') + '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js';
document.head.appendChild(script);

done('jquery');
};
script.src = '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js';
script.src = (location.protocol === 'file:' ? 'http://' : '') + '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js';
document.head.appendChild(script);
}
else if (typeof (Highcharts) === 'undefined') {
Expand All @@ -183,12 +184,12 @@ joola.init = function (options, callback) {
script.onload = function () {
done('highcharts-nodata-2');
};
script.src = '//code.highcharts.com/modules/no-data-to-display.js';
script.src = (location.protocol === 'file:' ? 'http://' : '') + '//code.highcharts.com/modules/no-data-to-display.js';
document.head.appendChild(script);

done('highcharts-2');
};
script.src = '//code.highcharts.com/highcharts.js';
script.src = (location.protocol === 'file:' ? 'http://' : '') + '//code.highcharts.com/highcharts.js';
document.head.appendChild(script);
}

Expand All @@ -198,7 +199,7 @@ joola.init = function (options, callback) {
script.onload = function () {
done('tablesort');
};
script.src = '//cdn.rawgit.com/tristen/tablesort/gh-pages/tablesort.min.js';
script.src = (location.protocol === 'file:' ? 'http://' : '') + '//cdn.rawgit.com/tristen/tablesort/gh-pages/tablesort.min.js';
document.head.appendChild(script);
}

Expand Down

0 comments on commit b110e9a

Please sign in to comment.