Skip to content

Instantly share code, notes, and snippets.

@esokullu
Created August 26, 2022 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esokullu/ed48faf0e52a4436a198bc684fe81b85 to your computer and use it in GitHub Desktop.
Save esokullu/ed48faf0e52a4436a198bc684fe81b85 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
<style>
.width-100 {
width: 100%;
}
</style>
<title></title>
</head>
<body>
<div class="sidebar">
<p>Türkçeleştirmek istediğiniz metni seçip aşağıdaki butonu tıklayın.</p>
<form>
<div class="block" id="button-bar">
<button onclick="doIt()">Türkçeleştir</button>
</div>
</form>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
/**
* On document load, assign click handlers to each button and try to load the
* user's origin and destination language preferences if previously set.
*/
$(function() {
$('#run-translation').click(runTranslation);
$('#insert-text').click(insertText);
});
function doIt() {
google.script.run.doIt();
}
/**
* Inserts a div that contains an error message after a given element.
*
* @param {string} msg The error message to display.
* @param {DOMElement} element The element after which to display the error.
*/
function showError(msg, element) {
const div = $('<div id="error" class="error">' + msg + '</div>');
$(element).after(div);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment