From 4f9827f03525c044488126f626731fd6c6973524 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 24 May 2013 13:24:01 +0200 Subject: [PATCH] Fixed rewrite of css urls when concatenating. Fixed double insert of css and js. --- js/h5p.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/js/h5p.js b/js/h5p.js index ed12bef..c7a0909 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -203,6 +203,38 @@ H5P.trim = function (value) { return value.replace(/^\s+|\s+$/g, ''); }; +/** + * Check if javascript path/key is loaded. + * + * @param {String} path + * @returns {Boolean} + */ +H5P.jsLoaded = function (path) { + for (var i = 0; i < H5P.loadedJs.length; i++) { + if (H5P.loadedJs[i] === path) { + return true; + } + } + + return false; +}; + +/** + * Check if styles path/key is loaded. + * + * @param {String} path + * @returns {Boolean} + */ +H5P.cssLoaded = function (path) { + for (var i = 0; i < H5P.loadedCss.length; i++) { + if (H5P.loadedCss[i] === path) { + return true; + } + } + + return false; +}; + // We have several situations where we want to shuffle an array, extend array // to do so. Array.prototype.shuffle = function() {