From 9d9b3bbc5173c4ed3835a49f4f537a98d0be616a Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Wed, 3 Jul 2013 14:22:00 +0200 Subject: [PATCH] OPPG-376: Added api function that was removed in previous commit by Frode Petterson --- js/h5p.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index 3b1fa97..afede07 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -102,7 +102,14 @@ H5P.fullScreen = function ($el, obj) { }; /** - * Find the path to the content files base on the id of the content. + * Find the path to the content files based on the id of the content + * + * Also identifies and returns absolute paths + * + * @param string path + * Absolute path to a file, or relative path to a file in the content folder + * @param contentId + * Id of the content requesting a path */ H5P.getPath = function (path, contentId) { if (path.substr(0, 7) === 'http://' || path.substr(0, 8) === 'https://') { @@ -112,6 +119,17 @@ H5P.getPath = function (path, contentId) { return H5PIntegration.getContentPath(contentId) + path; }; +/** + * Find the path to the content files folder based on the id of the content + * + * @param contentId + * Id of the content requesting a path + */ +H5P.getContentPath = function (contentId) { + return H5PIntegration.getContentPath(contentId); +}; + + // // Used from libraries to construct instances of other libraries' objects by // name.