A business request is to deliver via SharePoint an "e-books" functionality in which the site visitors can read documents, without need to download them. For Microsoft Office file formats, SharePoint supports this via Office Web Apps (OWA). But the majority of publication documents is in Acrobat PDF format. Even when a document library is configured to open documents in browser, SharePoint defaults to open PDF documents in the native PDF client. However, with the power of JavaScript at hand this default behavior can simple be overloaded:
var EnrichEBooksView = window.EnrichEBooksView || {}; EnrichEBooksView.UI = function () { function OverloadDispEx() { var baseDispEx = DispEx; DispEx = function(o,n,e,a,d,i,g,m,k,b,h,j,f,c,l) { if (m == 'PdfFile.OpenDocuments') { m = 'SharePoint.OpenDocuments'; } return baseDispEx(o,n,e,a,d,i,g,m,k,b,h,j,f,c,l); }; } var ModuleInit = (function() { ExecuteOrDelayUntilScriptLoaded(OverloadDispEx, "core.js"); })(); }();
No comments:
Post a Comment