Use URL template to support URLs of different formatting.

semantics-font
Frode Petterson 2015-04-20 10:30:52 +02:00
parent 165db6ff6c
commit fba8badf1a
1 changed files with 3 additions and 3 deletions

View File

@ -1562,7 +1562,7 @@ H5P.createTitle = function(rawTitle, maxLength) {
*/ */
function contentUserDataAjax(contentId, dataType, subContentId, done, data, preload, invalidate, async) { function contentUserDataAjax(contentId, dataType, subContentId, done, data, preload, invalidate, async) {
var options = { var options = {
url: H5PIntegration.ajaxPath + 'content-user-data/' + contentId + '/' + dataType + '/' + (subContentId ? subContentId : 0), url: H5PIntegration.ajax.contentUserData.replace(':contentId', contentId).replace(':dataType', dataType).replace(':subContentId', subContentId ? subContentId : 0),
dataType: 'json', dataType: 'json',
async: async === undefined ? true : async async: async === undefined ? true : async
}; };
@ -1680,7 +1680,7 @@ H5P.createTitle = function(rawTitle, maxLength) {
data = JSON.stringify(data); data = JSON.stringify(data);
} }
catch (err) { catch (err) {
if (options.errorCallback) { if (options.errorCallback) {
options.errorCallback(err); options.errorCallback(err);
} }
return; // Failed to serialize. return; // Failed to serialize.
@ -1747,7 +1747,7 @@ H5P.createTitle = function(rawTitle, maxLength) {
if (state !== undefined) { if (state !== undefined) {
// Async is not used to prevent the request from being cancelled. // Async is not used to prevent the request from being cancelled.
H5P.setUserData(instance.contentId, 'state', state, {deleteOnChange: true, async: false}); H5P.setUserData(instance.contentId, 'state', state, {deleteOnChange: true, async: false});
} }
} }
} }