I'm looking for a way to make a SharePoint library preview fully functional with all types of documents using Javascript. So far the preview feature only works with images and PDF's.
This is the script I am using for my library to load the preview by clicking the icon types of each document.
function hookupToExpGroup() {
var defaultExpCollGroupMethod = ExpCollGroup;
ExpCollGroup = function() {
defaultExpCollGroupMethod.apply(this, arguments);
setTimeout(searchATags,2000);
};
}
function hookupToRefreshPageTo() {
var defaultRefreshPageToMethod = RefreshPageTo;
RefreshPageTo = function() {
defaultRefreshPageToMethod.apply(this, arguments);
setTimeout(searchATags,2000);
};
}
function insertClick(oLink, oImg) {
oLink.id = "my_anchor_" + i;
oImg.id = "my_hover_" + i;
oImg.onclick = function() {
var res = this.id.split("_");
var lastIndex = res.length - 1;
var anchorId = "my_anchor_" + res[lastIndex];
href = document.getElementById(anchorId).href;
var options = { url: href, width: 800, height: 600 };
SP.UI.ModalDialog.showModalDialog(options);
}
}
function searchATags() {
var aTagsTotal = document.links.length;
for (i = 0; i
Like I said it fully works on images and PDF's but if I were to click on any other type document, it gets stuck on the "Working On it" Screen when previewing.
Preview for images and pdf document types; works fine when icon is clicked
Word, Excel and Powerpoint Document types don't work on preview

Can Anyone explain or help, why is this happening and how I can adjust coding to make work or find the solution within SharePoint itself?