Bug 251435 - Populate translation hints if string has no translations

Make hints more useful by adding the Clear button

Signed-off-by: droy <denis.roy@eclipse-foundation.org>
diff --git a/html/callback/getCurrentStringTranslation.php b/html/callback/getCurrentStringTranslation.php
index 475e188..913ac71 100644
--- a/html/callback/getCurrentStringTranslation.php
+++ b/html/callback/getCurrentStringTranslation.php
@@ -127,7 +127,7 @@
 		<div style='overflow: auto; height: 75px;'>
 			<div id="english-string"><?= nl2br(htmlspecialchars($line['string_value'])); ?></div>
 		</div>
-		<h4 id="translation-hints-title">Translation Hints</h4>
+		<h4 id="translation-hints-title">Translation Hints [<a id="clear-btn" href="javascript:clearHints();">Clear</a>]</h4>
 		<div id="translation-hints" style='overflow-x: hidden; overflow-y: auto; height: 75px;'>
 		Select some English text above to find similar translations
 		<?php
diff --git a/html/js/global.js b/html/js/global.js
index 7d40a99..a1fb87c 100644
--- a/html/js/global.js
+++ b/html/js/global.js
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 Eclipse Foundation and others.
+ * Copyright (c) 2007-2018 Eclipse Foundation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -124,11 +124,14 @@
 		// document.selection.empty();
 	}
 	if(sel != "") {
-		if(document.getElementById('translation-hints')) {
+		if(document.getElementById('translation-hints') && !document.getElementById('translation-hints').innerHTML.includes("or use from the following:") ) {
 			var domNode = document.getElementById('translation-hints');
-			
-			domNode.innerHTML = "Please wait, looking for : <b>" + sel + "</b>";			
+
+			domNode.innerHTML = "Please wait, looking for : <b>" + sel + "</b>";
 			showTranslationHints(sel);
 		}
+        	if(document.getElementById('translation-hints') && document.getElementById('translation-hints').innerHTML.includes("or use from the following:") ) {
+            		YAHOO.util.Event.addListener("clear-btn","click",clearHints);
+        	}
 	}
 }
\ No newline at end of file