Possible to Target File Browser Elements in Plugin?
Posted: Wed Sep 20, 2023 9:12 pm
Hi,
My team would like to modify the file icons that display for files in the file browser and on the dashboard.
For example, we specifically want to better distinguish between ditamaps and dita files like so:
I am able to accomplish this using the following JS code (with jQuery) in Chrome's console; however, I haven't been able to accomplish this by adding this code to a plugin:
Is it possible to do this with a plugin so that all web Author users see this change?
Thanks,
Daniel
My team would like to modify the file icons that display for files in the file browser and on the dashboard.
For example, we specifically want to better distinguish between ditamaps and dita files like so:
I am able to accomplish this using the following JS code (with jQuery) in Chrome's console; however, I haven't been able to accomplish this by adding this code to a plugin:
Code: Select all
$.expr[':'].textEquals = $.expr[':'].textEquals || $.expr.createPseudo(function(arg) {
return function(elem) {
return $(elem).text().match(arg + "$");
};
});
var ditamapEntry = $('.file-browser-entry.file:textEquals("ditamap")');
var ditaEntry = $('.file-browser-entry.file:textEquals("dita")');
ditamapEntry.css({"display": "inherit", "background-image": "url('../rest/v25.1.0/load/image/?url=%252Fimages%252FDitaMapRoot16.png')"});
ditaEntry.css({"display": "inherit", "background-image": "url('../rest/v25.1.0/load/image/2?url=%25406%25252Fdita%25252Fditamap.framework%25252FDITA%252520Map%252Fimg%252FTopic16.png')"});
Thanks,
Daniel