diff options
-rw-r--r-- | dependencies.js | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/dependencies.js b/dependencies.js index 307ee92..51341e4 100644 --- a/dependencies.js +++ b/dependencies.js @@ -1,24 +1,30 @@ -var dir = ["data_structures_correct"]; -var fileextension = "."; +$.getScript('math.js'); +$.getScript('combined.js'); -var script = document.createElement("script"); - script.src = "math.js"; - document.head.appendChild(script); -$.each(dir, function(index, value) { - $.ajax({ // http://stackoverflow.com/a/18480589 - url: value, - success: function(data) { - $(data).find("a:contains(" + fileextension + ")").each(function() { - var filename = this.href.replace(window.location.host, ""); - filename = filename.replace("https://", value); - filename = filename.replace("http://", value); - var script = document.createElement("script"); - script.src = filename; - document.head.appendChild(script); - }); - } - }); +// @Adhitya: 02-07-2016: Commented Jitesh's work to call Data Structures individually, +// and combined all of them into combined.js using combine_script.bat + +/* +$.ajax({ + type: "POST", + // Invoke filenames.php + url: "filenames.php", + // Receive the resultant filenames from the php script in JSON format + dataType: "json", + // Add url for the required folder + data: { + url: "/data_structures_correct/" + }, + success: function (data) { + + // @Parameter: data will have the required filenames in the mentioned folder + // For each url, add the script to the body div element with getScript function + for (i in data) { + $.getScript(data[i]); + } + } }); +*/ function AfficheBlock() { if (arguments.length > 0) { @@ -555,4 +561,4 @@ function inverse() { str += arg + "]]"; var array = JSON.parse(str); return array; -}
\ No newline at end of file +} |