Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
cybermajeed authored Jul 18, 2023
1 parent 89aae62 commit 4e4b1fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,23 +282,27 @@ function createNewNote(note) {

//word count
function countWord() {

let wordsArrayTemp = document
.querySelector(".noteContentInEditView.editAreaDisabled")
.innerText.replaceAll("\n", " ")
.trim()
.split(" ");
wordsArray = [];
charCount = 0;
for (let i of wordsArrayTemp) {
if (i != "") {
charCount += i.length;
wordsArray.push(i);
}
}
let wCountWrapper = document.querySelector(
".wrapper.containsNote .wordCount"
);
let Ccount = wordsArray.length;
let Ccount = charCount;
let Wcount = Ccount == 0 ? 0 : wordsArray.length;
wCountWrapper.innerHTML = `${Wcount} W; ${Ccount} C`;

}
//word count ends
//modifienOn
Expand Down

0 comments on commit 4e4b1fa

Please sign in to comment.