handle new versioning
@@ -45,21 +45,11 @@ function hideSelectors(selectors){
function populateOptions(optionSelector, otherSelectors){
if(currentPackage()){
- var versionRequestUrl = "https://azuresdkdocs.blob.core.windows.net/$web?restype=container&comp=list&prefix=" + SELECTED_LANGUAGE + "/" + currentPackage() + "/versions/"
+ var versionRequestUrl = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + currentPackage() + "/versioning/versions"
httpGetAsync(versionRequestUrl, function(responseText){
if(responseText){
- data_stored = responseText
-
- parser = new DOMParser();
- xmlDoc = parser.parseFromString(responseText,"text/xml");
-
- nameElements = Array.from(xmlDoc.getElementsByTagName('Name'))
- options = []
-
- for (var i in nameElements){
- options.push(nameElements[i].textContent.split('/')[3])
- }
+ options = responseText.match(/[^\r\n]+/g)
populateVersionDropDown(optionSelector, options)
showSelectors(otherSelectors)
@@ -93,19 +83,11 @@ function getPackageUrl(language, package, version){
function populateIndexList(selector, packageName)
{
- url = "https://azuresdkdocs.blob.core.windows.net/$web?restype=container&comp=list&prefix=" + SELECTED_LANGUAGE + "/" + packageName + "/versions/"
+ url = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + packageName + "/versioning/versions"
httpGetAsync(url, function (responseText){
if(responseText){
- parser = new DOMParser();
- xmlDoc = parser.parseFromString(responseText,"text/xml");
-
- nameElements = Array.from(xmlDoc.getElementsByTagName('Name'))
- options = []
-
- for (var i in nameElements){
- options.push(nameElements[i].textContent.split('/')[3])
- }
+ options = responseText.match(/[^\r\n]+/g)
for (var i in options){
$(selector).append('<li><a target="new" href="' + getPackageUrl(SELECTED_LANGUAGE, packageName, options[i]) + '">' + options[i] + '</a></li>')
