Embedded Yammer Script in SharePoint 2010 CEWP Opens Multiple New Windows with different Yammer Feed - yammer

I have two Yammer feeds that I need to embed in SharePoint 2010 using CEWPs. Each is on a separate page. The web part is linking to a text file in the Style Library. One of them is working correctly and displaying the feed. However, the other is opening the feed in the web part, but also pops up two windows with the other feed.
Both are embedded using the same script with the correct parameters. The only difference in the two being the "FeedId". Below is the contents of the text files (with the "Network" and "FeedId" parameters changed for privacy).
<div id="embedded-feed" style="height:800px;width:400px;"></div>
<script type="text/javascript" src="https://s0-azure.assets-
yammer.com/assets/platform_embed.js"></script>
<script type="text/javascript">
yam.connect.embedFeed({
container: "#embedded-feed",
network: "myNet.com",
feedType: "group",
feedId: "1234567"
});
</script>
Why would one of these cause popups with a different feed and the other work as expected?

This is not really a programming question and therefore may be deleted from this site. You are best to test the same Embed snippets with the configuration tool and see if you have the same issues. If you do, open a support request from within the O365 Tenant Admin portal so that someone can investigate the issue specific to your environment.
You should also note that SharePoint 2010 uses unsupported Document Modes forcing Internet Explorer to run with a down-level engine. As a result, you can experience many issues.

Related

Is there a platform-independent method for opening links in an Outlook-addin?

I have an outlook-addin written in Angular framework, which communicates with the Outlook through the office-js.
My goal is to implement a service that opens any kind of URLs/links in any mainstream platforms where outlook is available, to be specific: in Google Chrome, Safari, Firefox, Opera, Internet Explorer, The MacOS desktop Outlook - old and new versions either, and most of the Windows desktop Outlook versions (2016, 2019, O365). But unfortunately I can not find a way that works in all of the platforms, and I want to avoid implementing it in a platform-dependent manner.
The first problem I encountered with, is that when I am trying to open links by a simple js function window.open(url) then the outlook versions that use Internet Explorer as an engine are failing to open URLs that contain the character #. That is because IE does not seem to be able to read this character and it cuts the URL in half by the # character and it completely removes the parts followed by the #.
https://en.wikipedia.org/wiki/County_Antrim#/media/File:Ballycastle_Harbour_-_geograph.org.uk_-_468327.jpg
window.open(
"https://en.wikipedia.org/wiki/County_Antrim#/media/File:Ballycastle_Harbour_-_geograph.org.uk_-_468327.jpg",
"_blank"
);
For example, if I try to open the URL above on Windows outlook 2019 which uses Internet Explorer as it's engine, then the url will look like this in the end:
https://en.wikipedia.org/wiki/County_Antrim
For a solution I've implemented a workaround that encodes the URL by a built-in function that comes with typescript which allows the IE to be able to open the link. By simply passing the encoded URL to the window.open() does not work because it concatenates the url with the host of my addin, which results in an invalid link.
window.open(
encodeURIComponent(
"https://en.wikipedia.org/wiki/County_Antrim#/media/File:Ballycastle_Harbour_-_geograph.org.uk_-_468327.jpg"
),
"_blank"
);
The host of my addin + the encoded URL:
https://localhost.eu.ngrok.io/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FCounty_Antrim%23%2Fmedia%2FFile%3ABallycastle_Harbour_-_geograph.org.uk_-_468327.jpg
So I had to redirect manually with a simple html code as shown below:
redirect.html:
<html>
<head>
<script type="text/javascript">
window.onload = function (event) {
var regex = /\?url=(.*)/ig;
var match = regex.exec(location.search);
if (match && match[1] && match[1] !== "") {
location.href = decodeURIComponent(match[1]);
}
else {
document.body.innerHTML = "Redirect failed!";
}
};
</script>
</head>
</html>
typescript code:
url = "https://en.wikipedia.org/wiki/County_Antrim#/media/File:Ballycastle_Harbour_-_geograph.org.uk_-_468327.jpg"
window.open("./redirect.html?url=" + encodeURIComponent(url), "_blank");
Unfortunately, this method also has some flaws in the desktop outlook of MacOS. Redirecting makes the links open in a simple webviewer of the outlook application, and not in Safari as it is expected since the default browser is set to Safari in both of the system preferences and in the outlook browser preference. Despite the fact that it can open the links in this webviewer, I can not use it, because some of the webpages I want to navigate to does not support to be opened by the webviewer.
I was suspecting that this behaviour is caused by the relativity of the url ("./redirect..."). So I have tried building the URL by adding dynamically or even hardcoding the host of my addin to the beginning of the URL this way:
`${window.location.origin + window.location.pathname}/redirect.html?url=` + encodeURIComponent(url);
But there was no difference in the results by doing it, so I am guessing that referencing the host of the addin itself does not change quality or state of the URL, meaning that it is still managed as a relative link.
Since I had the opportunity to host the redirect.html from another server, I have tried referencing the redirect.html file from another host, and that way even the MacOS Outlook worked perfectly, proving my suspicion of the wrong management of relative links.
I have also tried using the function called openBrowserWindow provided by office-js the following way:
Office.context.ui.openBrowserWindow(url);
But this was also a dead-end, since this could neither handle the # character in IE nor it was supported in all of the platforms I need to use.
The last workaround I have tried is by completely reworking the service and instead of opening the links by using js or ts functions, I have tried binding the urls to the href attribute of <a></a> elements, however the application requirements exclude this method, as there are some links that are expected to be opened by double clicking, which can not be done with using an <a> tag as far as I know, at least not in an "hacky" way.
Which I would really like to know, what makes the links open in the webviewer of the MacOS outlook application instead of the default browser of the system? Is it a setting I am missing, or is there a way to force using the safari?
Did you try simply doing:
if (Office.context.ui.openBrowserWindow) {
Office.context.ui.openBrowserWindow("https://google.com");
} else
{
window.open("https://google.com");
}
Since openBrowserWindow is selectively not supported in OWA, window.open will automatically take over.

Property ribbon doesn't exist on office

While working on enabling/desabling a control in an Excel web complement the editor throw the following error :""property 'ribbon' doesn't exist on type 'type of office'" from an 'Office.ribbon instruction'.
My Excel Version is : 2104 (Build 13929 20296)
Here is a snapshot of the code code with office.ribbon. This code comes from https://learn.microsoft.com/fr-fr/office/dev/add-ins/design/disable-add-in-commands. Note than isSetSupported('RibbonApi', '1.1') ==true
Screen shot :
Xml of my addin
Make sure you specified the latest Office JavaScript API library in the add-in manifest. If you use runtime checks, you need to reference the most current version of the Office JavaScript API library from the content delivery network (CDN). To do this, add the following script tag to your HTML. Using /1/ in the CDN URL ensures that you reference the most recent version of Office.js.
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
A workaround is to use message boxes. Off course it's quite Ugly, but I need to publish my app shortly. I hope that by this time I will find a way to actually enable/desable commands on this addin.

ASPx template to produce html as well as PDF in Windows Azure

I have a project requirement to produce PDF files as well as HTML on a solution deployed on MS Windows Azure. The PDF files are often printed and delivered to clients as part of a presentation as and also made available through a client portal. Users of the client portal should also be able to interact with the information in a more interactive way via html. So here’s my question, are there ASPx controls that allow the information to be rendered in html or pdf that run on an Azure server?
You could just create an HTML solution and convert each page to PDF when needed. There are several tools that can help you with this:
wkhtmltopdf (LGPL, command
line applicacion)
Amyuni WebkitPDF, a HTML to PDF/XAML conversion library (free
for commercial and non-commercial use, Windows library with C#
bindings)

Problem with Outlook plugin and webbrowser

I've created a couple of Office plugins. The plugin shows a set of html files installed on the clients computer. The plugin uses a COM-accessible assembly which shows a WinForm with a WebBrowser on it. The plugin makes the WebBrowser navigate to a file on the clients computer. The assembly is also used in other programs to show the same information.
When showing the local html files using a 'normal' browser (e.g. double clicking a file in Windows Explorer) the browser popup a security warning about running active content. This is because we have some javascript in it. This warning is supressed by setting the 'Allow active content to run in files on My Computer' in the Internet Explorer settings. This solves the issue using a 'normal' browser.
Funny enough the 'active content' warning is not shown when getting the same file using a Word/Excel/PowerPoint plugin. It calls the same assembly, using the same WinForm and using the same content. Despite the setting 'Allow active content to run from My Computer' being false, the content is shown without a warning and the javascript is executed.
Now, the problem and the real question is that Outlook does the reverse. No matter what I use for 'Allow active content to run from My Computer' the browser warning about the active content in the html file is shown. When I confirm the message and allow the scripts to continue, the javascript runs fine. So, even when I set the 'Allow active content to run from My Computer' to true, the warning is given.
I've gone through all (sort of) relevant settings in Outlook, but nothing helps.
I assume that Outlook is using some kind of private context for a webbrowser (probably because it is using a webbrowser object internally).
The real question is: how can I make the Outlook plugin respect the IE settings?
(I understand this is a long story and maybe not clear enough. Please let me know if I have to elaborate more).
I couldn't get rid of the security warning without lowering the security setting. And that is not an option: we are talking about a project that will be installed on millions of computers.
I decided to go another route. Let's see if we can make the browser trust the html pages. So, what to do to get rid of the 'Active content' warning.
First I investigated what exactly triggers the warning. That was easy: any tag in your html file will do. And I need script, so removing that isn't an option. But, when hosted from a website, the scripts run fine and don't suffer from a warning. So, I investigated if it is possible to run my files in the Internet-context.
I found out there is a way, at least for IE (which in my case is sufficient). If you save a webpage as a complete HTML file from IE, the browser adds a comment to the html to signal its origin. Something like: . If you later open that stored html file, the file is shown in the Internet context.
So, I tried adding to the html file. And, voila, the file is opened in the Internet context. The security warning about active content is gone and the scripts are executed fine.
But, that raised another problem. We have a couple of window.open statements in the scripts and using that causes he cross domain browsing problems that in recent IE versions are blocked. Even if you use a relative path in the window.open call, if fails and you end up with a blank window.
In our case, we can (probably) decide to get rid of the window.open calls. But, if a reader ever finds a solution for using window.open in this scenario, I would be very happy if you let me know.
So, for now: case closed...
Internet explorer use Mark of web in such cases
<!-- saved from url=(0014)about:internet -->
<!doctype html>
<!-- saved from url=(0023)http://www.contoso.com/ -->
<html>
<head>
<title>A Mark of the Web Example.</title>
</head>
<body>
<p>Hello, World</p>
</body>
</html>
More info from here
https://msdn.microsoft.com/en-us/library/ms537628(v=vs.85).aspx

Multiple swf files not loading in DNN 5.X

We have run numerous tests now and it has now come down to either a DNN-SWFObject loading multiple swf files on a page or Firefox bug.
Here's the outcome we need:
Two swf files on one page:
Header.swf: which holds the nav and some bling animation.
Map.swf: which has different provinces of the country highlighted on rollover. The active province is highlighted by reading the URL via Javascript and then loaded into the Map.swf via FlashVars.
In all of our other tests in other browsers, the scenario works very well but in Firefox 3.5.3 The swf files refuse to show.
We have stripped this test down to the bare minimum, one html page scenario and embedding it the same way using SWFObject 2.2 and this works in Firefox. When it is uploaded in DNN, the swf files refuse to show.
Is there anything anyone can think of?
Many thanks,
James
My first thought would be the way dnn renames element ids - and are you using client ids
If you could post some code it might help to look at it or a url to look at

Resources