Teams desktop cannot open task modules - javascript

I try to use task modules to open the html page, and it can be opened on the web side, but it cannot be opened on the desktop version. What is the reason? Thanks!
enter image description here
enter image description here
This is handleTeamsTaskModuleFetch:
if (cardTaskFetchValue === "feedbackSubmit") {
taskInfo.url = taskInfo.fallbackUrl = 'https://156e-38-83-110-6.ngrok.io'+'/CustomForm.html';
this.setTaskInfo(taskInfo, TaskModuleUIConstants.CustomForm);
}
return TaskModuleResponseFactory.toTaskModuleResponse(taskInfo);

Related

How to open Linkedin App with Company Page?

It is simple HTML Page and my code is below.
LinkedIn
click on above link in device open LinkedIn app and open company page. This is working fine in IOS devices but not working in Android Devices. Is there any solution for android device? Thanks in Advance
This is the solution. If the user has the linkedin app the app will be launched else the company profile appear in the browser.
String pageId = "your-company-id";
final String urlFb = "linkedin://" + pageId;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(urlFb));
final PackageManager packageManager = this.getPackageManager();
List<ResolveInfo> list = packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() == 0) {
final String urlBrowser = "http://www.linkedin.com/company/" + pageId;
intent.setData(Uri.parse(urlBrowser));
}
this.startActivity(intent);
For Company Search use :
linkedin://profile/company/{company-name}
I have added
LinkedIn
If linked in App available than open and redirect to company page.
Working fine in Android Device.

Files encoding isse in chrome only

I have different links which opens another page in a popup.The popup function is like this.
function popUp(URL) {
eval("lesson = window.open(URL, 'lesson', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 250,top = 50');");
}
When links are opened,its working fine in mozilla.When links are opened in chrome its giving me the following content
The filename has spaces.I dont if this is happening because of this space or not because I am not able to rename or upload the files into that server

Select a file from OneDrive on phone - mobile web site

Edit - title was previously
OneDrive Web picker SDK (Javascript) cannot choose/open file on mobile
device
Auto email from SO suggests I change title as bounty period expired.
I have created a OneDrive picker in a mobile friendly website according to these instructions https://dev.onedrive.com/sdk/javascript-picker-saver.htm and it works fine on a Windows desktop.
However on a mobile browser (Android Browser & Chrome on Android 4.2, and Safari on iOS 7) the picker launches and logs me in OK, I can see the files, but when I tap to select a file the "Open" button remains disabled.
Edit, just to clarify : I do not want to upload a file to OneDrive. I want to pick a file already in my OneDrive account and pass its URL back to the page. So that I can send that URL to my server and have the server fetch the file
If I long press on my selected file a content (by that I mean like a right click menu in Windows) menu appears, with an "Open" option - choosing this just seems to make Onedrive re-load.
My code is:
<script type="text/javascript" src="https://js.live.net/v5.0/OneDrive.js" id="onedrive-js" client-id="0000000011111111"></script>
<script type="text/javascript">
var pickerOptions = {
success: function(files) {
console.log(files);
document.getElementById("cloud_cv_source_input").value = "onedrive" ;
document.getElementById("cloud_cv_file_url_input").value = files.values[0].link ;
document.getElementById("cloud_cv_file_name_input").value = files.values[0].fileName;
document.getElementById("cloud_cv_file_size_input").value = files.values[0].size;
},
cancel: function() {
// handle when the user cancels picking a file
},
linkType: "downloadLink", // or "downloadLink",
multiSelect: false // or true
}
function launchOneDrive()
{
OneDrive.open(pickerOptions);
}
</script>
I did see this at the end of the docs:
The OneDrive picker and saver supports the following web browsers:
Internet Explorer 9+
Latest version of Chrome
Latest version of Firefox
Latest version of Safari
So assume this SDK is just for desktop sites, is this correct, and if so, what should I use for a mobile site? I know there are SDK's for Android and iOS but I'm not making a native app.
Thanks.
I spent some time looking into this and doing some tests, and without having a URL to your app online (so I can test it directly and on a server) here are my initial thoughts:
Will this work on mobile devices? In theory it should if the user is browsing on their mobile with the supported devices. But when I tried viewing the reference URI you provided for OneDrive Dev Center to the JS Web Picker SDK...the page would not display the example which lets me choose the files on my Android using: Chrome, Firefox, or my wife's iPhone with Safari. Apparently, Micro$oft has chosen not to test the documentation page code on mobile versions of the browsers they state they support.
You might want to add a sanity check around your execution code (to make sure that a file was available in the response). Additionally, I see in the documentation code, they're clearing the results of the picker on cancel and selection (for viewing and saving). If you have a URI where I could test your code, I'd be happy to help more on this.
<script type="text/javascript" src="https://js.live.net/v5.0/OneDrive.js" id="onedrive-js" client-id="0000000011111111"></script>
<script type="text/javascript">
var pickerOptions = {
success: function(file) {
// Sanity check
if( !file ) {
// Handle no file being returned
} else {
var f = file.values[0];
document.getElementById("cloud_cv_source_input").value = "onedrive" ;
document.getElementById("cloud_cv_file_url_input").value = f.link ;
document.getElementById("cloud_cv_file_name_input").value = f.fileName;
document.getElementById("cloud_cv_file_size_input").value = f.size;
} // end if
},
cancel: function() {
// handle when the user cancels picking a file
},
linkType: "downloadLink",
multiSelect: false
}
function launchOneDrive() {
OneDrive.open(pickerOptions);
}
</script>

Open ppt file in a new browser tab

A link that contains a .pdf such as the following opens in a new tab:
<a target="_blank" href="http://somePDF.pdf">Download</a>
Is it possible to make a Powerpoint file, .ppt, open in a new browser tab instead of making the user download the file?
I have tried this the following but this makes a user download the file:
<a target="_blank" href="http://somePPT.ppt">Download</a>
I am not sure if this is possible and have not been able to find any information on it so I am posting here.
If the user's browser isn't able to display the file and has no plugin that can display the file, it will offer the file as a download.
If you can export the PowerPoint slides to PDF or HTML, they are more likely to be displayed in the browser.
you could check if the browser has installed an pdf plugin, and if not use pdf.js to convert your pdf into an html page.
could look like this:
function hasPDFPlugin() {
for(var i = 0; i < navigator.plugins.length; i++) {
if(navigator.plugins[i].name.toLowerCase().indexOf('pdf') >== 0) {
return true;
}
}
return false;
}
if(!hasPDFPlugin()) {
// do the pdf.js stuff
}
with the help of google docs it can viewable.add file location after url=
https://docs.google.com/viewerng/viewer?url=
ex-https://docs.google.com/viewerng/viewer?url=http://example.in/filename.ppt

Parse a javascript window.close() function from a web page in xcode

I am writing an application for my parent's photo booth business.
They upload all the event pictures to different Flickr photosets on their account, and on the website they have an albums page with a collection of all their events so that people from the events can go and see all their photo strips, as well as each individual picture and then download them for themselves.
Most of their traffic is from mobile devices (my brother wrote the website specifically to fit mobile device screens as well as normal computer screens just as well); however, downloading and sharing the images is easier through an app (thanks to Apple's iOS 6 UIActivityViewController and UICollectionView).
So I'm writing the app that makes it easier to view and share the pictures. I have most of it done and working great! However, it currently only supports iOS 6 and I'm trying to include iOS 5. It only supports iOS 6 because I am using a UICollectionView to display the pictures from events. However, since iOS 5 does not include collection views I use a web view of our albums web page which displays all images.
When you select an image, you can choose a size of the image to view. When you pick a size, it opens a new tab, that includes the image and two links. One to download the image, and one to close the tab. The two links are within an unordered list and each link is its own list item.
This is the link to download the image:
Download Image
And the closing tab link has a tag of:
<a href="javascript:window.close();">
I've seen that you can use the webView's delegate method shouldStartLoadWithRequest: and then:
if ([[[request URL] absoluteString] hasPrefix:#"/downloadImage.php"]) {
UIImageWriteToSavedPhotosAlbum(imageToBeSaved, nil, nil, nil);
return NO;
} else if ([[[request URL] absoluteString] hasPrefix:#"javascript"]) {
[webView goBack];
return NO;
} else { return YES; }
Which would make it do those functions when the links are clicked...right?
These do not work though. And I'm not sure how to make them work.
I am searching for the correct way to use this method, or some alternative method, if possible, to use Objective-C to do the equivalent of what the html normally does.
I figured out a way to do basically what I wanted. Rather than let the webView open a new page when you selected an image size. I set the size links to just download the image right there using this code:
// for links thats contain the displayImage.php do not allow user interaction
if ([[[request URL] absoluteString] hasPrefix:#"http://www.remembermephotobooths.com/displayImage.php?link="]) {
//scan through the link url get the image link so that I can download it
NSMutableArray *substring = [NSMutableArray new];
NSScanner *scanner = [NSScanner scannerWithString:[[request URL] absoluteString]];
[scanner scanUpToString:#"http://farm9" intoString:nil]; // Scan all characters after and including http://farm9 because all download links begin with http://farm9
while(![scanner isAtEnd]) {
NSString *string = nil;
[scanner scanString:#"&title=" intoString:nil]; // Scan up to &title
if([scanner scanUpToString:#"&" intoString:&string]) {
[substring addObject:string];
}
[scanner scanUpToString:#".jpg" intoString:nil]; // Scan all characters up to and including .jpg because all images are jpegs
}
// save image to photo library
UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:substring[0]]]], nil, nil, nil);
// let the user know the image was saved
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
[hud setMode:MBProgressHUDModeText];
hud.labelText = #"Saved Image!";
[hud setMinShowTime:1.5];
[MBProgressHUD hideHUDForView:self.view animated:YES];
[substring release];
return NO; //this is what disables the links usual code and has it run my code instead
}
else { //all other links are enabled
return YES;
}

Categories