Skip to content

Commit b53d9e4

Browse files
Merge pull request #522 from Sunbird-Knowlg/release-7.7.0
Merge Release 7.7.0 into 8.0.0
2 parents eda211a + 6d42c13 commit b53d9e4

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

player/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@project-sunbird/content-player",
3-
"version": "5.1.0",
3+
"version": "8.0.0",
44
"description": "Which renders the contents in both web and devices",
55
"dependencies": {
66
"@project-sunbird/telemetry-sdk": "^0.0.14",

player/public/libs/plugin-framework.min.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -700,20 +700,29 @@ org.ekstep.pluginframework.resourceManager = new(Class.extend({
700700
}
701701
},
702702
loadResource: function(url, dataType, callback, publishedTime) {
703-
url = url + "?" + (org.ekstep.pluginframework.config ? org.ekstep.pluginframework.config.build_number : '');
703+
var cleanUrl = (url || '').replace('??', '?');
704+
var buildNumber = (org.ekstep.pluginframework.config ? org.ekstep.pluginframework.config.build_number : '');
705+
if (buildNumber) {
706+
cleanUrl = cleanUrl + (cleanUrl.indexOf('?') !== -1 ? '&' : '?') + buildNumber;
707+
}
704708
if (publishedTime) {
705-
url = url + "&" + publishedTime;
709+
cleanUrl = cleanUrl + (cleanUrl.indexOf('?') !== -1 ? '&' : '?') + publishedTime;
710+
}
711+
var finalDataType = dataType;
712+
if (finalDataType === 'script' && cleanUrl.indexOf(".html")!==-1) {
713+
finalDataType = 'text';
706714
}
707715
org.ekstep.pluginframework.jQuery.ajax({
708716
async: false,
709-
url: url,
710-
dataType: dataType
717+
url: cleanUrl,
718+
dataType: finalDataType,
719+
cache: false,
720+
crossDomain: true,
721+
timeout: 30000
711722
}).done(function(data) {
712723
callback(null, data);
713724
}).fail(function(jqXHR, textStatus, errorThrown) {
714-
if(jqXHR.statusText === 'OK') {
715-
console.log('Unable to load resource:', url, 'error:', errorThrown);
716-
}
725+
console.log('Unable to load resource:', url, 'error:', errorThrown);
717726
callback(errorThrown)
718727
});
719728
}
@@ -1869,4 +1878,4 @@ org.ekstep.pluginframework.publishedRepo = new(org.ekstep.pluginframework.iRepo.
18691878
return org.ekstep.pluginframework.config.pluginRepo + "/" + id + "-" + ver + "/" + resource;
18701879
}
18711880
}));
1872-
org.ekstep.pluginframework.resourceManager.addRepo(org.ekstep.pluginframework.publishedRepo);
1881+
org.ekstep.pluginframework.resourceManager.addRepo(org.ekstep.pluginframework.publishedRepo);

0 commit comments

Comments
 (0)