Skip to content

Commit

Permalink
remove google search
Browse files Browse the repository at this point in the history
  • Loading branch information
ManivannanMurugavel committed Apr 22, 2019
1 parent b042d3c commit d162098
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
35 changes: 28 additions & 7 deletions assets/js/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ function myFunction(){
}, 0);
// alert();
}
function getCorrectedText(){
if($(".gsc-results.gsc-webResult").children().length > 3){
corrected_text = $(".gs-spelling a").first().text();
l(corrected_text)
}
}
function getFilename(myFile){
if(myFile.files.length > 0){
var file = myFile.files[0];
var filename = file.name;
$(".custom-file-label").text(filename);
l(filename);
}
else{
$(".custom-file-label").text('Choose file...');
}
}
function onPaste(e){
e.preventDefault();

Expand Down Expand Up @@ -57,13 +74,13 @@ $(document).ready(function(){
$('textarea').attr('readonly',false);
$("#fileUpload").click()

var cx = '011558942542564350974:nldba-ydc7g'; // Insert your own Custom Search engine ID here
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
// var cx = '011558942542564350974:nldba-ydc7g'; // Insert your own Custom Search engine ID here
// var gcse = document.createElement('script');
// gcse.type = 'text/javascript';
// gcse.async = true;
// gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
// var s = document.getElementsByTagName('script')[0];
// s.parentNode.insertBefore(gcse, s);


// var inputText = prompt('Please enter the training dataset(filename.txt)');
Expand Down Expand Up @@ -98,6 +115,10 @@ $(document).ready(function(){
});
$("#save").click(function(){
full_text = $("#editor").text();
if(full_text != $("#gsc-i-id1").val()){
$("#gsc-i-id1.gsc-input").val(full_text);
$(".gsc-search-button").click();
}
$("#editor").attr('contenteditable',false);
$("#save").hide();
$("#edit").show();
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ <h4>Class Names</h4>
</div>
</div>
</div>
<div class="col-12">
<!-- <div class="col-12">
<div class="container">
<gcse:search></gcse:search>
</div>
</div>
</div> -->

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
Expand All @@ -236,7 +236,7 @@ <h5 class="modal-title" id="exampleModalLabel">File Upload</h5>
<div class="modal-body">
<form class="was-validated">
<div class="custom-file">
<input type="file" class="custom-file-input" id="validatedCustomFile" accept=".txt" required>
<input type="file" class="custom-file-input" id="validatedCustomFile" onchange="getFilename(this)" accept=".txt" required>
<label class="custom-file-label" for="validatedCustomFile">Choose file...</label>
<div class="invalid-feedback">Please upload your training dataset(filename.txt)</div>
</div>
Expand Down

0 comments on commit d162098

Please sign in to comment.