Skip to content

Commit

Permalink
sorted the labs in all the functions
Browse files Browse the repository at this point in the history
  • Loading branch information
madhavi committed Dec 14, 2017
1 parent cf296ec commit d0c3dc3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/runtime/disciplines.org
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ var getAllDisciplines = function(){
// console.log(dis_url);
$.getJSON(dis_url, function(data) {
var disciplines = '';
data.sort(function (key, value) {
return key.discipline_name.localeCompare(value.discipline_name);
});
$.each(data, function(key, value){
var discipline_name = value['discipline_name'];
var image_name = value['assets'][0]['path'];
Expand Down Expand Up @@ -94,6 +97,9 @@ var getLabsByDisciplineName = function(image, flag) {
var labs_by_dis_url = labs_url + "?discipline_name="+ discipline_name;
$.getJSON(labs_by_dis_url, function(data) {
var labs = '';
data.sort(function (key, value) {
return key.lab_name.localeCompare(value.lab_name);
});
$.each(data, function(key, value){
var lab_name = value['lab_name'];
var hosting_info = value['hosting_info'];
Expand Down
6 changes: 6 additions & 0 deletions src/runtime/institutes.org
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ var getAllInstitutes = function(){
// console.log(institute_url);
$.getJSON(institute_url, function(data) {
var institutes = '';
data.sort(function (key, value) {
return key.institute_name.localeCompare(value.institute_name);
});
$.each(data, function(key, value){
var institute_name = value['institute_name'];
var image_name = value['assets'][0]['path'];
Expand Down Expand Up @@ -101,6 +104,9 @@ var getLabsByInstituteName = function(image, flag) {
console.log(labs_by_institute_url);
$.getJSON(labs_by_institute_url, function(data) {
var labs = '';
data.sort(function (key, value) {
return key.lab_name.localeCompare(value.lab_name);
});
$.each(data, function(key, value){
var lab_name = value['lab_name'];
var hosting_info = value['hosting_info'];
Expand Down
10 changes: 10 additions & 0 deletions src/runtime/manage-iframes.org
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ var resetContentInIframe = function(data, htmlFile) {
addScriptTags();
};

var resetContentInIframe = function(data) {
console.log("=======re setting content=====");
var iframe = parent.document.getElementById("contentIframe");
iframe.sandbox = 'allow-scripts allow-same-origin allow-popups allow-forms';
var content = iframe.contentWindow.document;
content.body.innerHTML="";
content.write(data);
addScriptTags();
};

#+END_SRC

** Set the source and content to an frame
Expand Down
5 changes: 4 additions & 1 deletion src/runtime/search.org
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ var getLabsByKeyword = function(){
}
}
var labs='';
data.sort(function (key, value) {
return key.lab_name.localeCompare(value.lab_name);
});
$.each(data, function(key, value){
var lab_name = value['lab_name'];
var hosting_info = value['hosting_info'];
Expand Down Expand Up @@ -75,7 +78,7 @@ onclick="javascript:validateAuthentication(this)" src="' + path +'" id="' + host
'" style="text-align:center; color:#2c99ce;" >'+ lab_name +'</h4></a></div></div></div>';
});
var labs_list = '<div class="container-fluid"><div class="row">'+ labs +'</div></div>';
resetContentInIframe(labs, "labs.html");
resetContentInIframe(labs);
};

#+END_SRC
Expand Down

0 comments on commit d0c3dc3

Please sign in to comment.