Existing Codes

Rating: No reviews yet
Downloads: 6
Updated: Jan 11, 2011 by iashah
Dev status: Planning Help Icon

Recommended Download

Source Code Existing Code Example
source code, 1K, uploaded Jan 11, 2011 - 6 downloads

Release Notes

Google Language Detect API using PHP

$url = "https://ajax.googleapis.com/ajax/services/language/detect?" + "v=1.0&q=Hola,%20mi%20amigo!&key=INSERT-YOUR-KEY&userip=INSERT-USER-IP";
// sendRequest // note how referer is set manually $ch = curl_init();
curlsetopt($ch, CURLOPTURL, $url); curlsetopt($ch, CURLOPTRETURNTRANSFER, 1);
curlsetopt($ch, CURLOPTREFERER, /* Enter the URL of your site here */);
$body = curlexec($ch); curlclose($ch);
// now, process the JSON string $json = json_decode($body);

Set the keyboard layout
function drawMenu()
{
html = ["<ul>"];
for (var i in google.elements.keyboard.LayoutCode)
{ var code = google.elements.keyboard.LayoutCode[i];
var name = google.elements.keyboard.getLayoutName(code);
html.push("<li><a href='#' onclick='kbd.setLayout(\"", code, "\")'>", name, "</a></li>");
}
html.push("</ul>");
document.getElementById("menu").innerHTML = html.join('');
}

Detect if the keyboard is visible
function toggleVisible() {

var button = document.getElementById('btVisible');

if (kbd.isVisible()) {
kbd.setVisible(false);
document.getElementById('btVisible').value = 'Show';
} else {
kbd.setVisible(true);
document.getElementById('btVisible').value = 'Hide';
}