Commit ba69596a authored by joetsuihk's avatar joetsuihk

Merge branch 'development' into 'master'

Extension update, added handling on no result, added notification, added bracket for all if clause

See merge request !7
parents f87e8c53 395b4c9c
...@@ -53,21 +53,28 @@ if (link.match(/login/g)){ ...@@ -53,21 +53,28 @@ if (link.match(/login/g)){
a.click(); a.click();
//Unselect >1MB Product images //Unselect >1MB Product images
if(a.innerText.match(/PDP\(Product Cut\)/g)) { if(a.innerText.match(/PDP\(Product Cut\)/g)) {
if(a.innerText.match(/MB/g)) if(a.innerText.match(/MB/g)) {
a.click(); a.click();
} }
return;
}
//Unselect posters //Unselect posters
if(a.innerText.match(/Poster/g)) if(a.innerText.match(/Poster/g)) {
a.click(); a.click();
return;
}
//If images names start with "G" but it isnt a model image, unselect //If images names start with "G" but it isnt a model image, unselect
if(a.innerText.match(/^G/g)) { if(a.innerText.match(/^G/g)) {
if(!a.innerText.match(/Model/g)) if(!a.innerText.match(/Model/g)) {
a.click(); a.click();
} }
return;
}
//If images doesnt have sku, unselect //If images doesnt have sku, unselect
if(!a.querySelector(".name").innerText.match(currentSku)) if(!a.querySelector(".name").innerText.match(currentSku)) {
a.click(); a.click();
} }
}
}); });
downloadlist = document.querySelectorAll(".panel-inner .is-checked"); downloadlist = document.querySelectorAll(".panel-inner .is-checked");
if(downloadlist.length == 0) { if(downloadlist.length == 0) {
...@@ -75,8 +82,9 @@ if (link.match(/login/g)){ ...@@ -75,8 +82,9 @@ if (link.match(/login/g)){
} }
if(noImage) { if(noImage) {
console.log("Nothing to Download!! , index: " , index ," " , a); console.log("Nothing to Download!! , index: " , index ," " , a);
if(index+2 != a.length) if(index+2 != a.length) {
window.open("https://digitallibrary-external.fastretailing.com/asset?t=datacategory%2Fasset&w="+ a[index+2] + "&r=north"); window.open("https://digitallibrary-external.fastretailing.com/asset?t=datacategory%2Fasset&w="+ a[index+2] + "&r=north");
}
chrome.runtime.sendMessage({noImage : "true", currentSku : currentSku}); chrome.runtime.sendMessage({noImage : "true", currentSku : currentSku});
return; return;
} }
...@@ -109,8 +117,9 @@ if (link.match(/login/g)){ ...@@ -109,8 +117,9 @@ if (link.match(/login/g)){
}); });
document.querySelector("#assets_btn_download_asset").click(); document.querySelector("#assets_btn_download_asset").click();
setTimeout(function(){ setTimeout(function(){
if(index+2 != a.length) if(index+2 != a.length) {
window.open("https://digitallibrary-external.fastretailing.com/asset?t=datacategory%2Fasset&w="+ a[index+2] + "&r=north"); window.open("https://digitallibrary-external.fastretailing.com/asset?t=datacategory%2Fasset&w="+ a[index+2] + "&r=north");
}
},5000); },5000);
},5000); },5000);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment