Skip to content

Commit

Permalink
fixed word limit, parsed modal
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammed-abuodeh committed May 1, 2024
1 parent 49638e1 commit 7a31208
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
16 changes: 13 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3237,11 +3237,21 @@ var getTree = function (treeData) {
};

/*************************************************************************************************/
/* parser functionality */
/* view_tree */
/*************************************************************************************************/
// remaining functions are in parsing.js
$('#treedata2').keyup(function(){
var sentences = $(this).val();


if (sentences.split(/\s+/).length > 100) {
$('#treebtn2').attr('disabled', 'disabled');
} else {

$('#treebtn2').removeAttr('disabled');
}
})


/*************************************************************************************************/
/* parser functionality */
/* view_tree */
/*************************************************************************************************/
2 changes: 1 addition & 1 deletion parsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function initGetParsedModalButton(parse_data_id) {

// set up button that sends a request to the backend to get the new trees
closeButton = document.getElementById("get-parsed-btn");
closeButton.textContent = 'Update';
closeButton.textContent = 'View trees';
closeButton.addEventListener('click', () => {
document.getElementById('get-parsed-modal').classList.add("hidden");
document.getElementById('get-parsed-overlay').classList.add("hidden");
Expand Down
4 changes: 2 additions & 2 deletions viewtree.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<section class="upload">
<form id="upload2">
<div id="upload-2-row-1">
<label id="label-treedata2" for="treedata2"> Or enter text:</label>
<label id="label-treedata2" for="treedata2"> Or enter text (parse limit is 100 words):</label>
<br>
<textarea id="treedata2" placeholder="Each line of text will become a seperate tree."></textarea>
</div>
Expand Down Expand Up @@ -170,7 +170,7 @@
<div id="parse-overlay" class="parse-overlay-class hidden"></div>
<section id="get-parsed-modal" class="modal hidden">
<div>
<p>Sentences parsed. Please note that there is a word limit of 100.</p>
<p>Sentences parsed! Click on the button below to see the parsed sentences.</p>
</div>
<button id="get-parsed-btn" class="btn"></button>
</section>
Expand Down

0 comments on commit 7a31208

Please sign in to comment.