How to open "Contact" and select a number - javascript

I want to create a input field which will open "Contact" or "Phonebook" and let the user to choose a contract number from there. I couldn't find any html input type to do that.

It is not possible to access your phone with plain html/css/js. If you want functionality to access Contacts, Camera, GPS and so on, you could create a hybrid app with Cordova. Then you can use the many plugins that make your dreams come true.

This is possible. The way to do this is using the Contact Picker API. This is available from chrome 80, and also now available in iOS advanced browser setting.
Check the following resources;
https://developer.mozilla.org/en-US/docs/Web/API/Contact_Picker_API

Related

Google Calendar Custom Button

we're using Google Apps heavily in my company. Now there is a new requirement to set specific settings (prefilled event name, rooms selected, ...) for the event automatically on creation.
This possibility should be available for all users in the company. So I asked myself (and now you also) if there is the possibility to add a custom button to the calendar app? This button could use the e.g. javascript API to create the new event with the prefilled information.
If this is not possible what other ideas do you have?
thanks & regards,
Dominik
Most Calendar App customisation a these days exist as Chrome extensions/plugins (other browsers are available) However, there is a way to install sidebar type tools via hosted XML. This XML can in turn host simple or elaborate web apps.
https://developers.google.com/google-apps/calendar/gadgets/sidebar/
If you are looking for a button anywhere n the Google Calendar UI other than a sidebar then the browser plugin would be your only option.

Is there a way sending email using "mailto" with a code that checks if the user has a gmail or outlook (or other) account?

I want users on my website to contact me via email, and I want to make that easy and super user friendly for them.
Is there a way to identify with that email they are using? Because the default setting to this is Outlook. The other option is when a user changed his browsers settings/has an extension that navigates to Gmail (for example) instead of Outlook (http://blog.hubspot.com/marketing/set-gmail-as-browser-default-email-client-ht).
But for users who don't, is there an other way to do that?
It's a Wordpress website (PHP) and I usually code with PHP and JS (jQuery).
I've run mailto links on many computers, for testing (for another project), and generally, the mailto link does open their default email program, without any plugins or anything. It may be different on Windows, but on Linux, Chrome OS, and Mac OS X, this is true. The possible reason that it is different on Windows is that all of the Microsoft products that come with windows are very tightly integrated into the system, and you can't truly change the default email program on Windows. But AFAIK the mailto link works the way you want it to on most operating systems.
This is maybe not the answer you want, but have you considered setting up a contact form on your website? like this.
This woud probably be the most easy way to let someone contact you without fiddling with external programms. You also woud have more controll about selectable topics and email-format.
Well, you can most definitely detect the provider they're using with simple regex. However, this will not work with people using, say, Google Apps. If you just want to recognise the domain used, you can always do something like:
$matches = array();
preg_match("/#(.*)/", "test#example.com", $matches);
return $matches[1];
However, this will only recognise the provider, not allow you to force another service. As already mentioned, I would suggest using a contact form instead of mailto.

Workflow with Google Maps API

I just need to know where to start. I'm developing an app with Meteor framework, where I need to have let's say a custom marker, which I get from user's input, so this marker shows up in a place where user stands through geolocation. I need to get this input when a user taps a button like "i'm here", so what's the best way to make it so? Some JS on button? Any examples would be appreciate, thanks.
Use dburles:google-maps . The documentation is well written and easy to use. Use GoogleMaps.maps.exampleMap.instance to set the current location on the button click.Grab the users location using either HTML5's location ability or a cordova plugin that provides the same functionality, depending on the app's user base. You could also completely eliminate the need of the button and initialize the map with the users location. See the above package documentation.

Adding Text in pdf using Javascript

I have a SCORM compliant course where only PDFs are to be shown. I want to show the user name to be populated in the PDF using JavaScript whenever user launches the PDF from LMS.
Please Suggest something.
It is quite difficult to determine the name of the user, because the system does not really know it. The closest you can use automatically would be the login name of the user.
There is a JavaScript property which represents the login name of the user. However, for privacy reasons, this property is only accessible when Acrobat/Reader starts up. In order to make it available for the document, you'd have to install an application-level script which would read out the login name and make it available in a (global) variable. This is rather impractical and only possible if you have control over your user's machine.
An alternative is a bit kludgy, but would work, is to create an annotation (for example freetext), and display the author property of the annotation. If not changed elsewhere, this would be the login name.
Another approach would be showing a app.answer() dialog where the user has to enter the name, and then you can fill that answer into the text fields where you want it to appear.

Customize 'share' message in Google Chrome

I want my website to enable people to share their score via instant messengers.
So there is this nifty feature where you can share websites in Google Chrome on Android
with other people (on the screenshot it says 'Teilen'):
Right now all it does is for example messages people on whatsapp the title of the webpage and its URL, so I wondered if I could somehow customize this behavior.
So, is it possible?
Also, is there a way to trigger this share functionality via javascript?
It is not possible to influence this directly from a website, but there are two things you can do.
Change url to highscore specific score
As soon as the user get's a new score use the history API .replaceState function to change the URL to a URL that for others will load a page with his highscore. And set window.title to what you want the title to be (though make sure this is something sensible for the player as well).
Triggering the share dialog from code is not possible.
Cordova (+crosswalk)
If you really wish to trigger the share dialog from code you would have to bundle your application as a native application using Cordova (and crosswalk if it's a game). There are next various plugins that expose the share dialog from Javascript.

Categories

Resources