diff --git a/db.sqlite3 b/db.sqlite3 index 8ac810ba..30b69d08 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/templates/analyze.html b/templates/analyze.html index 4bb031ff..bbdcee2a 100644 --- a/templates/analyze.html +++ b/templates/analyze.html @@ -1,114 +1,138 @@ - - - - - - - - - Text Utils-Results - - - - - - + + + + + + + - + Text Utils-Results + + + + + + + -

Your Analyzed Text - {{ purpose }}

-
-

- -

{{ analyzed_text }}

-

-
- - - - - - - - - - + + + + - - + + } + + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 10f597d1..35bf9179 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,159 +1,170 @@ - - - - - - - - - - - Text Utils - - - - - - - +
+
{% csrf_token %} -
- {% csrf_token %} +
+

+ -
-

+ +

+ 0 Characters + +

+
- exampleFormControlTextarea1.addEventListener("keyup",function(){ - var characters = exampleFormControlTextarea1.value.split(''); - wordCount.innerText = characters.length; - }); - -

-
+
+ + +
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
+
+ + +
+ +
+ + +
+ +
+ + +
- +
+ + +
+ + -
- -
- + +
+
+ + var typed = new Typed('#typed', { + strings: ["You can do anything with your text here!", "Enter your text here and let Text Utils do the magic!"], + backSpeed: 15, + smartBackspace: true, + backDelay: 1200, + startDelay: 1000, + typeSpeed: 25, + loop: false, + + }); + - - - - - - - - + + + - + + } + + + \ No newline at end of file diff --git a/textutils/views.py b/textutils/views.py index 40cad6dd..ac6d54b6 100644 --- a/textutils/views.py +++ b/textutils/views.py @@ -2,6 +2,11 @@ from django.http import HttpResponse from django.shortcuts import render +def color(a): + if a=="on": + return "green" + else: + return "red" def index(request): return render(request, 'index.html') @@ -26,7 +31,6 @@ def analyze(request): if char not in punctuations: analyzed = analyzed + char - params = {'purpose':'Removed Punctuations', 'analyzed_text': analyzed} djtext = analyzed if(fullcaps=="on"): @@ -34,7 +38,6 @@ def analyze(request): for char in djtext: analyzed = analyzed + char.upper() - params = {'purpose': 'Changed to Uppercase', 'analyzed_text': analyzed} djtext = analyzed if(extraspaceremover=="on"): @@ -48,7 +51,6 @@ def analyze(request): elif not(djtext[index] == " " and djtext[index+1]==" "): analyzed = analyzed + char - params = {'purpose': 'Removed NewLines', 'analyzed_text': analyzed} djtext = analyzed if (newlineremover == "on"): @@ -57,8 +59,7 @@ def analyze(request): if char != "\n" and char!="\r": analyzed = analyzed + char - params = {'purpose': 'Removed NewLines', 'analyzed_text': analyzed} - + if (numberremover == "on"): analyzed = "" numbers = '0123456789' @@ -67,13 +68,21 @@ def analyze(request): if char not in numbers: analyzed = analyzed + char - params = {'purpose': 'Removed NewLines', 'analyzed_text': analyzed} djtext = analyzed if(removepunc != "on" and newlineremover!="on" and extraspaceremover!="on" and fullcaps!="on" and numberremover != "on"): return HttpResponse("please select any operation and try again") + params = { + 'analyzed_text': analyzed, + 'rempunc_sts' : color(removepunc), + 'fullcaps_sts' : color(fullcaps), + 'remnew_sts' : color(newlineremover), + 'remspace_sts' : color(extraspaceremover), + 'remnum_sts' : color(numberremover), + } + return render(request, 'analyze.html', params) def about(request):