Last active
September 20, 2019 08:43
-
-
Save Robin-bob/ce13866761078b87acbccc8cac511f31 to your computer and use it in GitHub Desktop.
rename Authors to Something...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renameAuthors() { | |
// console.log('renameAuthors') | |
var author = document.querySelector('.cbt-tabs--author-area .cbt-tabs--subtitle'); | |
if (author) { | |
author.innerText ='Director' | |
} else { | |
setTimeout(function(){ | |
renameAuthors() | |
}, 100) | |
} | |
} | |
function renameAuthorsSelect() { | |
// console.log('renameAuthorsSelect') | |
var author = document.querySelector('.s-category-area + div #authorId option:nth-of-type(1)'); | |
var label = document.querySelector('.s-category-area + div .selectr-label'); | |
if (author || label) { | |
if (author.innerText != 'Director' || label.innerText != 'Director') { | |
author.innerText ='Director' | |
label.innerText ='Director' | |
} | |
} else { | |
setTimeout(function(){ | |
renameAuthorsSelect() | |
}, 100) | |
} | |
} | |
function renameAuthorsSelectCatalog() { | |
// console.log('renameAuthorsSelectCatalog') | |
var author = document.querySelector('.secondary-filters > div:nth-of-type(2) #authorId option:nth-of-type(1)'); | |
var label = document.querySelector('.secondary-filters > div:nth-of-type(2) .selectr-label'); | |
if (author || label) { | |
if (author.innerText != 'Director' || label.innerText != 'Director') { | |
author.innerText ='Director' | |
label.innerText ='Director' | |
} | |
} else { | |
setTimeout(function(){ | |
renameAuthorsSelectCatalog() | |
}, 100) | |
} | |
} | |
function callProgramFunctions() { | |
// console.log('callProgramFunctions') | |
if (document.querySelector('.cbt-area')) { | |
renameAuthors(); | |
} | |
setTimeout(function(){ | |
callProgramFunctions() | |
}, 500) | |
} | |
function callCategoryFunctions() { | |
// console.log('callCategoryFunctions') | |
renameAuthorsSelect(); | |
setTimeout(function(){ | |
callCategoryFunctions() | |
}, 500) | |
} | |
function callCatalogFunctions() { | |
// console.log('callCatalogFunctions') | |
renameAuthorsSelectCatalog(); | |
setTimeout(function(){ | |
callCatalogFunctions() | |
}, 500) | |
} | |
callCategoryFunctions() | |
callProgramFunctions() | |
callCatalogFunctions() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment