├── .gitignore
├── LICENSE
├── OJ
├── __init__.py
├── admin.py
├── apps.py
├── forms.py
├── migrations
│ ├── 0001_initial.py
│ └── __init__.py
├── models.py
├── templates
│ ├── OJ
│ │ ├── dashboard.html
│ │ ├── description.html
│ │ ├── leaderboard.html
│ │ ├── main.html
│ │ ├── navbar.html
│ │ ├── problem.html
│ │ └── verdict.html
│ └── admin
│ │ └── base_site.html
├── tests.py
├── urls.py
└── views.py
├── README.md
├── TODO.md
├── USERS
├── __init__.py
├── admin.py
├── apps.py
├── forms.py
├── migrations
│ ├── 0001_initial.py
│ ├── 0002_submission_problem_name_alter_submission_user_code_and_more.py
│ ├── 0003_remove_submission_problem_name.py
│ ├── 0004_alter_submission_language.py
│ ├── 0005_alter_submission_language.py
│ └── __init__.py
├── models.py
├── templates
│ └── USERS
│ │ ├── account_settings.html
│ │ ├── email_confirmation.html
│ │ ├── login.html
│ │ ├── password_reset.html
│ │ ├── password_reset_done.html
│ │ ├── password_reset_form.html
│ │ ├── password_reset_sent.html
│ │ ├── register.html
│ │ └── submission.html
├── tests.py
├── tokens.py
├── urls.py
└── views.py
├── favicon.ico
├── geekjudge
├── __init__.py
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py
├── manage.py
├── requirements.txt
└── static
├── ace
├── ace.js
├── ext-language_tools.js
├── mode-c_cpp.js
├── mode-java.js
├── mode-python.js
├── theme-cobalt.js
├── theme-crimson_editor.js
├── theme-dawn.js
├── theme-eclipse.js
├── theme-gob.js
├── theme-kuroir.js
├── theme-monokai.js
├── theme-solarized_dark.js
├── theme-solarized_light.js
├── theme-terminal.js
├── theme-twilight.js
├── theme-vibrant_ink.js
└── theme-xcode.js
├── css
└── main.css
├── fonts
└── Gistesy.ttf
├── images
├── AC.png
├── CE.png
├── GeekJudge.png
├── RajatSingh08.jpg
├── RajatSingh08_SVXp0yM.jpg
├── TLE.png
├── WA.png
├── defaultpic.png
├── email.png
├── favicon.ico
├── github.png
├── instagram.png
├── linkedIn.png
├── logo.png
└── twitter.png
└── javascript
├── editor.js
└── sort.js
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | __pycache__
3 | db.sqlite3
4 | info.py
5 | staticfiles/
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Rajat Singh
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/OJ/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/OJ/__init__.py
--------------------------------------------------------------------------------
/OJ/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from .models import Problem, TestCase
3 |
4 | admin.site.register(Problem)
5 | admin.site.register(TestCase)
--------------------------------------------------------------------------------
/OJ/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class OjConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'OJ'
7 |
--------------------------------------------------------------------------------
/OJ/forms.py:
--------------------------------------------------------------------------------
1 | from django import forms
2 | from django.forms import ModelForm
3 | from USERS.models import Submission
4 |
5 | class CodeForm(ModelForm):
6 | class Meta:
7 | model = Submission
8 | fields = ['user_code']
9 | widgets = {'user_code' : forms.Textarea()}
--------------------------------------------------------------------------------
/OJ/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 4.1 on 2022-08-20 05:20
2 |
3 | from django.db import migrations, models
4 | import django.db.models.deletion
5 | import froala_editor.fields
6 |
7 |
8 | class Migration(migrations.Migration):
9 |
10 | initial = True
11 |
12 | dependencies = [
13 | ]
14 |
15 | operations = [
16 | migrations.CreateModel(
17 | name='Problem',
18 | fields=[
19 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20 | ('name', models.CharField(default='', max_length=100)),
21 | ('description', froala_editor.fields.FroalaField(default='')),
22 | ('difficulty', models.CharField(choices=[('Easy', 'Easy'), ('Medium', 'Medium'), ('Tough', 'Tough')], max_length=10)),
23 | ('time_limit', models.IntegerField(default=2, help_text='in seconds')),
24 | ('memory_limit', models.IntegerField(default=128, help_text='in kb')),
25 | ],
26 | ),
27 | migrations.CreateModel(
28 | name='TestCase',
29 | fields=[
30 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
31 | ('input', models.TextField()),
32 | ('output', models.TextField()),
33 | ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='OJ.problem')),
34 | ],
35 | ),
36 | ]
37 |
--------------------------------------------------------------------------------
/OJ/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/OJ/migrations/__init__.py
--------------------------------------------------------------------------------
/OJ/models.py:
--------------------------------------------------------------------------------
1 | from distutils.command.build_scripts import first_line_re
2 | import imp
3 | from django.db import models
4 | from froala_editor.fields import FroalaField
5 |
6 |
7 | ###############################################################################################################################
8 |
9 |
10 | class Problem(models.Model):
11 | TOUGHNESS = (("Easy", "Easy"), ("Medium", "Medium"), ("Tough", "Tough"))
12 | STATUS = (("Unsolved", "Unsolved"), ("Solved", "Solved"))
13 | name = models.CharField(max_length=100, default="")
14 | description = FroalaField(default="")
15 | difficulty = models.CharField(max_length=10, choices=TOUGHNESS)
16 | time_limit = models.IntegerField(default=2, help_text="in seconds")
17 | memory_limit = models.IntegerField(default=128, help_text="in kb")
18 |
19 | def __str__(self):
20 | return self.name
21 |
22 |
23 | ###############################################################################################################################
24 |
25 |
26 | class TestCase(models.Model):
27 | problem = models.ForeignKey(Problem, on_delete=models.CASCADE)
28 | input = models.TextField()
29 | output = models.TextField()
30 |
31 | def __str__(self):
32 | return ("TC: " + str(self.id) + " for Problem: " + str(self.problem))
--------------------------------------------------------------------------------
/OJ/templates/OJ/dashboard.html:
--------------------------------------------------------------------------------
1 | {% extends 'OJ/main.html' %}
2 |
3 | {% block content %}
4 |
Dashboard
5 |
6 |
7 |
8 |
12 |
Easy : {{easy_solve_count}}/{{easy_ques_count}}
13 |
14 |
15 |
19 |
Medium : {{medium_solve_count}}/{{medium_ques_count}}
20 |
21 |
22 |
26 |
Tough : {{tough_solve_count}}/{{tough_ques_count}}
27 |
28 |
29 |
33 |
Total : {{total_solve_count}}/{{total_ques_count}}
34 |
35 |
36 | {% endblock %}
--------------------------------------------------------------------------------
/OJ/templates/OJ/description.html:
--------------------------------------------------------------------------------
1 | {% extends 'OJ/main.html' %}
2 | {% block content %}
3 |
4 |
5 |
{{problem.name}}
6 |
Difficulty:
7 | {% if problem.difficulty == "Easy" %}
8 |
{{problem.difficulty}}
9 | {% elif problem.difficulty == "Medium" %}
10 |
{{problem.difficulty}}
11 | {% else %}
12 |
{{problem.difficulty}}
13 | {% endif %}
14 |
15 | {% autoescape off %}
16 |
{{problem.description}}
17 | {% endautoescape %}
18 |
19 |
66 |
67 |
68 |
69 | {% endblock %}
--------------------------------------------------------------------------------
/OJ/templates/OJ/leaderboard.html:
--------------------------------------------------------------------------------
1 | {% extends 'OJ/main.html' %}
2 |
3 | {% block content %}
4 | Leaderboard
5 |
6 |
7 |
9 |
10 | Username
11 | Total Score
12 |
13 |
14 |
15 | {% for coder in coders %}
16 |
17 | {{coder.username}}
18 | {{coder.total_score}}
19 |
20 | {% endfor %}
21 |
22 |
23 | {% endblock %}
--------------------------------------------------------------------------------
/OJ/templates/OJ/main.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 | Geek Judge
7 |
8 |
9 |
13 |
15 |
17 |
18 |
19 |
20 |
21 |
22 | {% include 'OJ/navbar.html' %}
23 |
24 | {% block content %}
25 | {% endblock %}
26 |
27 |
28 |
92 |
93 |
94 |
95 |
98 |
102 |
106 |
107 |
108 |
109 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/OJ/templates/OJ/navbar.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
14 |
15 |
17 | Geek Judge
18 |
21 |
22 |
23 |
36 | Hello,
37 |
39 | {% if request.user.profile_pic %}
40 |
41 | {% else %}
42 |
43 | {% endif %}
44 | {{request.user}}
45 |
46 |
47 | Logout
48 |
--------------------------------------------------------------------------------
/OJ/templates/OJ/problem.html:
--------------------------------------------------------------------------------
1 | {% extends 'OJ/main.html' %}
2 |
3 | {% block content %}
4 | Problems
5 |
6 |
7 |
9 |
10 | Name
11 | Difficulty
12 | Status
13 |
14 |
15 |
16 | {% for problem in problems %}
17 |
18 | {{problem.name}}
20 |
21 | {% if problem.difficulty == "Easy" %}
22 | {{problem.difficulty}}
23 | {% elif problem.difficulty == "Medium" %}
24 | {{problem.difficulty}}
25 | {% else %}
26 | {{problem.difficulty}}
27 | {% endif %}
28 |
29 |
30 | {% if problem.id in accepted_problems %}
31 | Solved
32 | {% else %}
33 | Unsolved
34 | {% endif %}
35 |
36 |
37 | {% endfor %}
38 |
39 |
40 | {% endblock %}
--------------------------------------------------------------------------------
/OJ/templates/OJ/verdict.html:
--------------------------------------------------------------------------------
1 | {% extends 'OJ/main.html' %}
2 | {% load static %}
3 |
4 | {% block content %}
5 |
6 |
7 |
8 |
11 |
12 |
13 |
14 | {% if verdict == "Accepted" %}
15 |
16 |
Accepted :)
17 |
18 | {% elif verdict == "Compilation Error" %}
19 |
20 |
Compilation Error :(
21 |
22 | {% elif verdict == "Runtime Error" %}
23 |
24 |
Runtime Error :(
25 |
26 | {% elif verdict == "Time Limit Exceeded" %}
27 |
28 |
Time Limit Exceeded :(
29 |
30 | {% else %}
31 |
32 |
Wrong Answer :(
33 | {% endif %}
34 |
35 |
36 |
37 |
38 |
39 |
40 | {% endblock %}
--------------------------------------------------------------------------------
/OJ/templates/admin/base_site.html:
--------------------------------------------------------------------------------
1 | {% extends "admin/base_site.html" %}
2 | {% load static %}
3 | {% block extrahead %}
4 |
5 | {% endblock %}
--------------------------------------------------------------------------------
/OJ/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/OJ/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 | from . import views
3 |
4 | urlpatterns = [
5 | path('', views.dashboardPage, name='dashboard'),
6 | path('problems/', views.problemPage, name='problems'),
7 | path('problems//', views.descriptionPage, name='description'),
8 | path('problems//verdict/', views.verdictPage, name='verdict'),
9 | path('leaderboard/', views.leaderboardPage, name='leaderboard'),
10 | ]
11 |
--------------------------------------------------------------------------------
/OJ/views.py:
--------------------------------------------------------------------------------
1 | '''
2 | List of Views:
3 | - DASHBOARD PAGE: Has a dashboard with stats.
4 | - PROBLEM PAGE: Has the list of problems with sorting & paginations.
5 | - DEESCRIPTION PAGE: Shows problem description of left side and has a text editor on roght side with code submit buttton.
6 | '''
7 |
8 | from django.shortcuts import render, get_object_or_404
9 | from django.conf import settings
10 | from django.contrib.auth.decorators import login_required
11 | from django.views.decorators.csrf import csrf_protect
12 |
13 | from USERS.models import User, Submission
14 | from OJ.models import Problem, TestCase
15 | from OJ.forms import CodeForm
16 | from datetime import datetime
17 | from time import time
18 |
19 | import os
20 | import signal
21 | import subprocess
22 | import os.path
23 | import docker
24 |
25 |
26 | ###############################################################################################################################
27 |
28 |
29 | # To show stats in dashboards
30 | @login_required(login_url='login')
31 | def dashboardPage(request):
32 | total_ques_count = len(Problem.objects.all())
33 | easy_ques_count = len(Problem.objects.filter(difficulty="Easy"))
34 | medium_ques_count = len(Problem.objects.filter(difficulty="Medium"))
35 | tough_ques_count = len(Problem.objects.filter(difficulty="Tough"))
36 |
37 | user = request.user
38 | easy_solve_count = user.easy_solve_count
39 | medium_solve_count = user.medium_solve_count
40 | tough_solve_count = user.tough_solve_count
41 | total_solve_count = user.total_solve_count
42 |
43 | easy_progress = (easy_solve_count/easy_ques_count)*100
44 | medium_progress = (medium_solve_count/medium_ques_count)*100
45 | tough_progress = (tough_solve_count/tough_ques_count)*100
46 | total_progress = (total_solve_count/total_ques_count)*100
47 |
48 | context = {"easy_progress":easy_progress,"medium_progress":medium_progress,
49 | "tough_progress":tough_progress,"total_progress":total_progress,
50 | "easy_solve_count":easy_solve_count, "medium_solve_count":medium_solve_count,
51 | "tough_solve_count":tough_solve_count,"total_solve_count":total_solve_count,
52 | "easy_ques_count":easy_ques_count, "medium_ques_count":medium_ques_count,
53 | "tough_ques_count":tough_ques_count,"total_ques_count":total_ques_count}
54 | return render(request, 'OJ/dashboard.html', context)
55 |
56 |
57 | ###############################################################################################################################
58 |
59 |
60 | # Has the list of problems with sorting & paginations
61 | @login_required(login_url='login')
62 | def problemPage(request):
63 | problems = Problem.objects.all()
64 | submissions = Submission.objects.filter(user=request.user, verdict="Accepted")
65 | accepted_problems = []
66 | for submission in submissions:
67 | accepted_problems.append(submission.problem_id)
68 | context = {'problems': problems, 'accepted_problems': accepted_problems}
69 | return render(request, 'OJ/problem.html', context)
70 |
71 |
72 |
73 | ###############################################################################################################################
74 |
75 |
76 | # Shows problem description of left side and has a text editor on roght side with code submit buttton.
77 | @login_required(login_url='login')
78 | def descriptionPage(request, problem_id):
79 | user_id = request.user.id
80 | problem = get_object_or_404(Problem, id=problem_id)
81 | user = User.objects.get(id=user_id)
82 | form = CodeForm()
83 | context = {'problem': problem, 'user': user, 'user_id': user_id, 'code_form': form}
84 | return render(request, 'OJ/description.html', context)
85 |
86 |
87 | ###############################################################################################################################
88 |
89 |
90 | # Shows the verdict to the submission
91 | @login_required(login_url='login')
92 | def verdictPage(request, problem_id):
93 | if request.method == 'POST':
94 | # setting docker-client
95 | docker_client = docker.from_env()
96 | Running = "running"
97 |
98 | problem = Problem.objects.get(id=problem_id)
99 | testcase = TestCase.objects.get(problem_id=problem_id)
100 | #replacing \r\n by \n in original output to compare it with the usercode output
101 | testcase.output = testcase.output.replace('\r\n','\n').strip()
102 |
103 | # score of a problem
104 | if problem.difficulty=="Easy":
105 | score = 10
106 | elif problem.difficulty=="Medium":
107 | score = 30
108 | else:
109 | score = 50
110 |
111 |
112 | #setting verdict to wrong by default
113 | verdict = "Wrong Answer"
114 | res = ""
115 | run_time = 0
116 |
117 | # extract data from form
118 | form = CodeForm(request.POST)
119 | user_code = ''
120 | if form.is_valid():
121 | user_code = form.cleaned_data.get('user_code')
122 | user_code = user_code.replace('\r\n','\n').strip()
123 |
124 | language = request.POST['language']
125 | submission = Submission(user=request.user, problem=problem, submission_time=datetime.now(),
126 | language=language, user_code=user_code)
127 | submission.save()
128 |
129 | filename = str(submission.id)
130 |
131 | # if user code is in C++
132 | if language == "C++":
133 | extension = ".cpp"
134 | cont_name = "oj-cpp"
135 | compile = f"g++ -o {filename} {filename}.cpp"
136 | clean = f"{filename} {filename}.cpp"
137 | docker_img = "gcc:11.2.0"
138 | exe = f"./{filename}"
139 |
140 | elif language == "C":
141 | extension = ".c"
142 | cont_name = "oj-c"
143 | compile = f"gcc -o {filename} {filename}.c"
144 | clean = f"{filename} {filename}.c"
145 | docker_img = "gcc:11.2.0"
146 | exe = f"./{filename}"
147 |
148 | elif language == "Python3":
149 | extension = ".py"
150 | cont_name = "oj-py3"
151 | compile = "python3"
152 | clean = f"{filename}.py"
153 | docker_img = "python3"
154 | exe = f"python {filename}.py"
155 |
156 | elif language == "Python2":
157 | extension = ".py"
158 | cont_name = "oj-py2"
159 | compile = "python2"
160 | clean = f"{filename}.py"
161 | docker_img = "python2"
162 | exe = f"python {filename}.py"
163 |
164 | elif language == "Java":
165 | filename = "Main"
166 | extension = ".java"
167 | cont_name = "oj-java"
168 | compile = f"javac {filename}.java"
169 | clean = f"{filename}.java {filename}.class"
170 | docker_img = "openjdk"
171 | exe = f"java {filename}"
172 |
173 |
174 | file = filename + extension
175 | filepath = settings.FILES_DIR + "/" + file
176 | code = open(filepath,"w")
177 | code.write(user_code)
178 | code.close()
179 |
180 | # checking if the docker container is running or not
181 | try:
182 | container = docker_client.containers.get(cont_name)
183 | container_state = container.attrs['State']
184 | container_is_running = (container_state['Status'] == Running)
185 | if not container_is_running:
186 | subprocess.run(f"docker start {cont_name}",shell=True)
187 | except docker.errors.NotFound:
188 | subprocess.run(f"docker run -dt --name {cont_name} {docker_img}",shell=True)
189 |
190 |
191 | # copy/paste the .cpp file in docker container
192 | subprocess.run(f"docker cp {filepath} {cont_name}:/{file}",shell=True)
193 |
194 | # compiling the code
195 | cmp = subprocess.run(f"docker exec {cont_name} {compile}", capture_output=True, shell=True)
196 | if cmp.returncode != 0:
197 | verdict = "Compilation Error"
198 | subprocess.run(f"docker exec {cont_name} rm {file}",shell=True)
199 |
200 | else:
201 | # running the code on given input and taking the output in a variable in bytes
202 | start = time()
203 | try:
204 | res = subprocess.run(f"docker exec {cont_name} sh -c 'echo \"{testcase.input}\" | {exe}'",
205 | capture_output=True, timeout=problem.time_limit, shell=True)
206 | run_time = time()-start
207 | subprocess.run(f"docker exec {cont_name} rm {clean}",shell=True)
208 | except subprocess.TimeoutExpired:
209 | run_time = time()-start
210 | verdict = "Time Limit Exceeded"
211 | subprocess.run(f"docker container kill {cont_name}", shell=True)
212 | subprocess.run(f"docker start {cont_name}",shell=True)
213 | subprocess.run(f"docker exec {cont_name} rm {clean}",shell=True)
214 |
215 |
216 | if verdict != "Time Limit Exceeded" and res.returncode != 0:
217 | verdict = "Runtime Error"
218 |
219 |
220 | user_stderr = ""
221 | user_stdout = ""
222 | if verdict == "Compilation Error":
223 | user_stderr = cmp.stderr.decode('utf-8')
224 |
225 | elif verdict == "Wrong Answer":
226 | user_stdout = res.stdout.decode('utf-8')
227 | if str(user_stdout)==str(testcase.output):
228 | verdict = "Accepted"
229 | testcase.output += '\n' # added extra line to compare user output having extra ling at the end of their output
230 | if str(user_stdout)==str(testcase.output):
231 | verdict = "Accepted"
232 |
233 |
234 | # creating Solution class objects and showing it on leaderboard
235 | user = User.objects.get(username=request.user)
236 | previous_verdict = Submission.objects.filter(user=user.id, problem=problem, verdict="Accepted")
237 | if len(previous_verdict)==0 and verdict=="Accepted":
238 | user.total_score += score
239 | user.total_solve_count += 1
240 | if problem.difficulty == "Easy":
241 | user.easy_solve_count += 1
242 | elif problem.difficulty == "Medium":
243 | user.medium_solve_count += 1
244 | else:
245 | user.tough_solve_count += 1
246 | user.save()
247 |
248 | submission.verdict = verdict
249 | submission.user_stdout = user_stdout
250 | submission.user_stderr = user_stderr
251 | submission.run_time = run_time
252 | submission.save()
253 | os.remove(filepath)
254 | context={'verdict':verdict}
255 | return render(request,'OJ/verdict.html',context)
256 |
257 |
258 | ###############################################################################################################################
259 |
260 |
261 | # Diplay the leaderboard
262 | @login_required(login_url='login')
263 | def leaderboardPage(request):
264 | coders = User.objects.all()
265 | return render(request, 'OJ/leaderboard.html', {'coders': coders})
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | An Online Judge platform that accepts a solution and judges it as Accepted, Compilation Error, Runtime Error, Time Limit Exceeded or Wrong Answer .
10 |
11 |
12 | Used Python for implementation by exploring DOCKER .
13 |
14 |
15 | Implemented using Python and Django libraries to handle some in-depth
16 | features and provided access to users to keep track of their progress in
17 | dashboard , history of submissions and leaderboard .
18 |
19 |
20 | Also added account verification and password reset via email.
21 |
22 |
23 | Currently supports C , C++ , Python3 , Python2 and Java .
24 |
25 |
26 | Deployed the project on AWS EC2 using gunicorn and nginx .
27 |
28 |
29 |
30 |
31 | Getting Started:
32 |
33 |
34 | Register and Verify your account:
35 |
36 |
37 |
38 |
39 |
40 | Update your Profile Pic:
41 |
42 |
43 |
44 |
45 |
46 | Navigation Bar:
47 |
48 |
49 |
50 |
51 | Problems List:
52 |
53 |
54 |
55 |
56 | Click, Code, Submit and get the Verdict:
57 |
58 |
59 |
60 |
61 |
62 | See Progress, Submission history and Leaderboard:
63 |
64 |
65 |
66 |
67 |
68 |
69 | Forgot Password? Don't worry, We got your back:
70 |
71 |
72 |
73 |
74 |
75 | Click, Code, Compete :muscle::muscle:
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 | # ONLINE JUDGE PROJECT
2 |
3 | ## ToDo List
4 | ✔️ Done
5 | ▶️ In progress
6 | 🔜 Remaining
7 |
8 | ## Creating the MVP ✔️✔️✔️✔️✔️✔️✔️✔️
9 | -- Learning:
10 | - ✔️ Finish Django Tutorial Part 1
11 | - ✔️ Finish Django Tutorial Part 2
12 | - ✔️ Finish Django Tutorial Part 3
13 | - ✔️ Finish Django Tutorial Part 4
14 | - ✔️ Learn Responsive Navigation bar
15 | - ✔️ Learn user authentication using Django
16 | - ✔️ Learn docker basics and how to send and recieve files from docker
17 | - ✔️ Running and compiling a code file in Docker
18 | - ✔️ Learn Deployement on AWS
19 |
20 | -- Implementing:
21 | - ✔️ Initializing the Online-Judge Project
22 | - ✔️ Initializing the Database in SQLite3
23 | - ✔️ Initializing the OJ app
24 | - ✔️ Adding User Authentication
25 | - ✔️ Designing the Home Page using Navigation Bar
26 | - ✔️ Adding the list of problems to the database
27 | - ✔️ Adding problem detail page
28 | - ✔️ Adding pagination for problem detail page
29 | - ✔️ Sorting problems using Name/Difficulty/Solved_Status/Score to problem detail page
30 | - ✔️ Adding Submit page for Submitting the code
31 | - ✔️ Getting the verdict
32 | - ✔️ Adding Docker for Security
33 | - ✔️ Getting all previous submissions
34 | - ✔️ Create dashboard page
35 | - ✔️ Buy domain name
36 | - ✔️ Deploy on AWS
37 | - ✔️ Adding Email Confirmation
38 |
39 | ## MVP done ✔️✔️✔️✔️✔️✔️✔️✔️
40 |
41 | ## Adding more to MVP
42 | -- Learning:
43 | - 🔚 Learn postgreSQL
44 |
45 | -- Implementing:
46 | - 🔚 Add leetcode-like submissions graph to dashboard
47 | - 🔚 Add leaderboard to every problem
48 | - 🔚 Add previous submissions to every problem
49 | - 🔚 Migrate to postgreSQL
50 | - ✔️ Add more languages: Python, Java, etc.
51 | - 🔚 Add multiple testcases
52 | - 🔚 Support of custom output checker program instead of simple file matcher
53 | - 🔚 Add tags to problems
54 | - 🔚 Add some good problems on OJ
55 | - 🔚 Improve the UI
56 | - 🔚 Adding a portal for user feedback
57 | - 🔚 Scaling the project
58 |
59 | -- Task to think:
60 | - ‼️ Getting users
61 |
--------------------------------------------------------------------------------
/USERS/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/USERS/__init__.py
--------------------------------------------------------------------------------
/USERS/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from .models import User, Submission
3 |
4 | admin.site.register(User)
5 | admin.site.register(Submission)
--------------------------------------------------------------------------------
/USERS/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class UsersConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'USERS'
7 |
--------------------------------------------------------------------------------
/USERS/forms.py:
--------------------------------------------------------------------------------
1 | from django.contrib.auth.forms import UserCreationForm
2 | from django import forms
3 | from django.forms import ModelForm
4 | from .models import User
5 |
6 | import email
7 | from enum import unique
8 |
9 |
10 | class CreateUserForm(UserCreationForm):
11 | email = forms.EmailField(label='Email',widget=forms.TextInput(attrs={"placeholder":"Email","id":"email"}))
12 | class Meta:
13 | model = User
14 | fields = ['username', 'first_name', 'last_name',
15 | 'email', 'password1', 'password2']
16 |
17 |
18 | class UpdateProfileForm(ModelForm):
19 | class Meta:
20 | model = User
21 | fields = ['full_name', 'profile_pic']
22 |
--------------------------------------------------------------------------------
/USERS/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 4.1 on 2022-08-20 05:18
2 |
3 | from django.conf import settings
4 | import django.contrib.auth.models
5 | import django.contrib.auth.validators
6 | from django.db import migrations, models
7 | import django.db.models.deletion
8 | import django.utils.timezone
9 |
10 |
11 | class Migration(migrations.Migration):
12 |
13 | initial = True
14 |
15 | dependencies = [
16 | ('OJ', '__first__'),
17 | ('auth', '0012_alter_user_first_name_max_length'),
18 | ]
19 |
20 | operations = [
21 | migrations.CreateModel(
22 | name='User',
23 | fields=[
24 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
25 | ('password', models.CharField(max_length=128, verbose_name='password')),
26 | ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
27 | ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
28 | ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
29 | ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
30 | ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
31 | ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
32 | ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
33 | ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
34 | ('email', models.EmailField(default='', max_length=254, unique=True)),
35 | ('total_score', models.IntegerField(default=0)),
36 | ('easy_solve_count', models.IntegerField(default=0)),
37 | ('medium_solve_count', models.IntegerField(default=0)),
38 | ('tough_solve_count', models.IntegerField(default=0)),
39 | ('total_solve_count', models.IntegerField(default=0)),
40 | ('full_name', models.CharField(default='', max_length=50)),
41 | ('profile_pic', models.ImageField(blank=True, default='defaultpic.png', null=True, upload_to='')),
42 | ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
43 | ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
44 | ],
45 | options={
46 | 'ordering': ['-total_score'],
47 | },
48 | managers=[
49 | ('objects', django.contrib.auth.models.UserManager()),
50 | ],
51 | ),
52 | migrations.CreateModel(
53 | name='Submission',
54 | fields=[
55 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
56 | ('user_code', models.TextField(default='', max_length=100000)),
57 | ('user_stdout', models.TextField(default='', max_length=1000000)),
58 | ('user_stderr', models.TextField(default='', max_length=1000000)),
59 | ('submission_time', models.DateTimeField(auto_now_add=True, null=True)),
60 | ('run_time', models.FloatField(default=0, null=True)),
61 | ('language', models.CharField(choices=[('C++', 'C++'), ('C', 's')], default='C++', max_length=10)),
62 | ('verdict', models.CharField(default='Wrong Answer', max_length=100)),
63 | ('problem', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='OJ.problem')),
64 | ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
65 | ],
66 | options={
67 | 'ordering': ['-submission_time'],
68 | },
69 | ),
70 | ]
71 |
--------------------------------------------------------------------------------
/USERS/migrations/0002_submission_problem_name_alter_submission_user_code_and_more.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 4.1 on 2022-08-20 05:20
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('USERS', '0001_initial'),
10 | ]
11 |
12 | operations = [
13 | migrations.AddField(
14 | model_name='submission',
15 | name='problem_name',
16 | field=models.CharField(default='', max_length=25),
17 | ),
18 | migrations.AlterField(
19 | model_name='submission',
20 | name='user_code',
21 | field=models.TextField(default='', max_length=10000),
22 | ),
23 | migrations.AlterField(
24 | model_name='submission',
25 | name='user_stderr',
26 | field=models.TextField(default='', max_length=10000),
27 | ),
28 | migrations.AlterField(
29 | model_name='submission',
30 | name='user_stdout',
31 | field=models.TextField(default='', max_length=10000),
32 | ),
33 | ]
34 |
--------------------------------------------------------------------------------
/USERS/migrations/0003_remove_submission_problem_name.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 4.1 on 2022-08-20 05:27
2 |
3 | from django.db import migrations
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('USERS', '0002_submission_problem_name_alter_submission_user_code_and_more'),
10 | ]
11 |
12 | operations = [
13 | migrations.RemoveField(
14 | model_name='submission',
15 | name='problem_name',
16 | ),
17 | ]
18 |
--------------------------------------------------------------------------------
/USERS/migrations/0004_alter_submission_language.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 4.0.6 on 2022-08-26 12:30
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('USERS', '0003_remove_submission_problem_name'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='submission',
15 | name='language',
16 | field=models.CharField(choices=[('C++', 'C++'), ('C', 'C'), ('Python3', 'Python3'), ('Python2', 'Python2')], default='C++', max_length=10),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/USERS/migrations/0005_alter_submission_language.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 4.1 on 2022-09-02 10:56
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('USERS', '0004_alter_submission_language'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='submission',
15 | name='language',
16 | field=models.CharField(choices=[('C++', 'C++'), ('C', 'C'), ('Python3', 'Python3'), ('Python2', 'Python2'), ('Java', 'Java')], default='C++', max_length=10),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/USERS/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/USERS/migrations/__init__.py
--------------------------------------------------------------------------------
/USERS/models.py:
--------------------------------------------------------------------------------
1 | from distutils.command.build_scripts import first_line_re
2 | from django.db import models
3 | from django.contrib.auth.models import AbstractUser
4 | from OJ.models import Problem, TestCase
5 |
6 |
7 | ###############################################################################################################################
8 |
9 |
10 | class User(AbstractUser):
11 | email = models.EmailField(unique=True, default="")
12 | total_score = models.IntegerField(default=0)
13 | easy_solve_count = models.IntegerField(default=0)
14 | medium_solve_count = models.IntegerField(default=0)
15 | tough_solve_count = models.IntegerField(default=0)
16 | total_solve_count = models.IntegerField(default=0)
17 | full_name = models.CharField(max_length=50, default="")
18 | profile_pic = models.ImageField(
19 | default="defaultpic.png", blank=True, null=True, upload_to='')
20 |
21 | class Meta:
22 | ordering = ['-total_score']
23 |
24 | def __init__(self, *args, **kwargs):
25 | super().__init__(*args, **kwargs)
26 | self.full_name = self.first_name+" "+self.last_name
27 |
28 | def __str__(self):
29 | return self.username
30 |
31 |
32 | ###############################################################################################################################
33 |
34 |
35 | class Submission(models.Model):
36 | LANGUAGES = (("C++", "C++"), ("C", "C"), ("Python3", "Python3"), ("Python2", "Python2"), ("Java", "Java"))
37 | user = models.ForeignKey(User, null=True, on_delete=models.SET_NULL)
38 | problem = models.ForeignKey(Problem, null=True, on_delete=models.SET_NULL)
39 | user_code = models.TextField(max_length=10000, default="")
40 | user_stdout = models.TextField(max_length=10000, default="")
41 | user_stderr = models.TextField(max_length=10000, default="")
42 | submission_time = models.DateTimeField(auto_now_add=True, null=True)
43 | run_time = models.FloatField(null=True, default=0)
44 | language = models.CharField(
45 | max_length=10, choices=LANGUAGES, default="C++")
46 | verdict = models.CharField(max_length=100, default="Wrong Answer")
47 |
48 | class Meta:
49 | ordering = ['-submission_time']
50 |
51 | def __str__(self):
52 | return str(self.submission_time) + " : @" + str(self.user) + " : " + self.problem.name + " : " + self.verdict + " : " + self.language
53 |
--------------------------------------------------------------------------------
/USERS/templates/USERS/account_settings.html:
--------------------------------------------------------------------------------
1 | {% extends 'OJ/main.html' %}
2 | {% load static %}
3 | {% block content %}
4 |
5 |
13 |
14 |
15 |
16 |
17 |
←
18 | Back to Dashboard
19 |
20 |
Account Settings
21 |
22 | {% if request.user.profile_pic %}
23 |
24 | {% else %}
25 |
26 | {% endif %}
27 |
28 |
29 |
30 |
31 |
32 |
33 | {% csrf_token %}
34 | {{form.as_p}}
35 |
36 |
37 |
38 |
39 |
40 |
41 | {% endblock %}
--------------------------------------------------------------------------------
/USERS/templates/USERS/email_confirmation.html:
--------------------------------------------------------------------------------
1 | {% autoescape off %}
2 | Hello {{name}},
3 |
4 | Thanks for creating the account. Please verify your email address by clicking on the link below.
5 |
6 | Confirmation Link: http://{{domain}}{% url 'activate' uidb64=uid token=token %}
7 |
8 | {% endautoescape %}
--------------------------------------------------------------------------------
/USERS/templates/USERS/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Login
5 |
9 |
11 |
15 |
16 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | {% csrf_token %}
94 |
103 |
112 |
114 |
116 |
117 |
118 |
119 |
120 | {% for message in messages %}
121 |
{{message}}
122 | {% endfor %}
123 |
124 |
125 |
126 | Don't have an account?
127 |
Sign Up
128 |
129 |
130 | Forgot password?
Reset password
131 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/USERS/templates/USERS/password_reset.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Forgot Password
5 |
9 |
11 |
15 |
16 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
Forgotten your password?
93 | Enter your email address below
94 | We’ll email instructions for setting a new one
95 |
96 |
97 |
98 | {% csrf_token %}
99 |
108 |
110 |
112 |
113 |
114 |
115 |
116 | {{form.errors}}
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/USERS/templates/USERS/password_reset_done.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Login
5 |
9 |
11 |
15 |
16 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
Your password has been changes successfully!
84 | You may go ahead and login now.
85 |
86 |
87 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/USERS/templates/USERS/password_reset_form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Forgot Password
5 |
9 |
11 |
15 |
16 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
Please enter your new password twice
93 |
94 |
95 |
96 | {% csrf_token %}
97 |
106 |
115 |
117 |
119 |
120 |
121 |
122 |
123 | {{form.errors}}
124 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/USERS/templates/USERS/password_reset_sent.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Forgot Password
5 |
9 |
11 |
15 |
16 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
We've emailed you instructions for setting your password
93 | If an account exists with the email you entered.
94 | You should receive them shortly.
95 |
96 |
97 |
98 |
99 |
If you didn't receive an email,
100 | Please make sure you've entered the email you registered with
101 | Also check your spam folder
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/USERS/templates/USERS/register.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Login
5 |
9 |
11 |
15 |
16 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | {% csrf_token %}
85 |
92 |
99 |
106 |
113 |
120 |
127 |
129 |
131 |
132 |
133 |
134 |
135 | {{form.errors}}
136 |
137 |
138 |
139 | Already have an account?
Login
141 |
142 |
143 |
144 |
145 |
146 |
165 |
166 |
--------------------------------------------------------------------------------
/USERS/templates/USERS/submission.html:
--------------------------------------------------------------------------------
1 | {% extends 'OJ/main.html' %}
2 |
3 | {% block content %}
4 | Submissions
5 |
6 |
7 |
9 |
10 | Time (UTC)
11 | Language
12 | Name
13 | Difficulty
14 | Verdict
15 |
16 |
17 |
18 | {% for submission in submissions %}
19 |
20 | {{submission.submission_time}}
21 | {{submission.language}}
22 |
23 |
25 | {{submission.problem.name}}
26 |
27 |
28 |
29 | {% if submission.problem.difficulty == "Easy" %}
30 | {{submission.problem.difficulty}}
31 | {% elif submission.problem.difficulty == "Medium" %}
32 | {{submission.problem.difficulty}}
33 | {% else %}
34 | {{submission.problem.difficulty}}
35 | {% endif %}
36 |
37 |
38 | {% if submission.verdict == "Accepted" %}
39 | {{submission.verdict}}
40 | {% elif submission.verdict == "Wrong Answer" %}
41 | {{submission.verdict}}
42 | {% else %}
43 | {{submission.verdict}}
44 | {% endif %}
45 |
46 |
47 | {% endfor %}
48 |
49 |
50 | {% endblock %}
--------------------------------------------------------------------------------
/USERS/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/USERS/tokens.py:
--------------------------------------------------------------------------------
1 | from django.contrib.auth.tokens import PasswordResetTokenGenerator
2 | from six import text_type
3 |
4 | class Tokengenerator(PasswordResetTokenGenerator):
5 | def _make_hash_value(self,user,timestamp):
6 | return (
7 | text_type(user.pk)+text_type(timestamp)+text_type(user.is_active)
8 | )
9 |
10 | account_activation_token = Tokengenerator()
--------------------------------------------------------------------------------
/USERS/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 | from django.contrib.auth import views as auth_views
3 | from . import views
4 |
5 | urlpatterns = [
6 | path('register/', views.registerPage, name='register'),
7 | path('activate//',views.activate,name='activate'),
8 |
9 | path('login/', views.loginPage, name='login'),
10 | path('logout/', views.logoutPage, name='logout'),
11 |
12 | path('reset_password/',
13 | auth_views.PasswordResetView.as_view(template_name="USERS/password_reset.html"),
14 | name="password_reset"),
15 | path('reset_password_sent/',
16 | auth_views.PasswordResetDoneView.as_view(template_name="USERS/password_reset_sent.html"),
17 | name="password_reset_done"),
18 | path('reset///',
19 | auth_views.PasswordResetConfirmView.as_view(template_name="USERS/password_reset_form.html"),
20 | name="password_reset_confirm"),
21 | path('reset_password_complete/',
22 | auth_views.PasswordResetCompleteView.as_view(template_name="USERS/password_reset_done.html"),
23 | name="password_reset_complete"),
24 |
25 | path('account/', views.accountSettings, name="account"),
26 |
27 | path('all_submissions/', views.allSubmissionPage, name='all_submissions'),
28 | ]
--------------------------------------------------------------------------------
/USERS/views.py:
--------------------------------------------------------------------------------
1 | '''
2 | List of Views:
3 | - REGISTER PAGE: To register a new user.
4 | - LOGIN PAGE: To login a registered user.
5 | - LOGOUT PAGE: To logout a registered user.
6 | - ACOOUNT SETTINGS PAGE : To update profile pic and full name.
7 | - VERDICT PAGE: Shows the verdict to the submission.
8 | - SUBMISSIONS PAGE: To view all the submissions made by current logged-in user.
9 | - LEADERBOARD: Diplay the leaderboard.
10 | '''
11 |
12 | from django.shortcuts import render, get_object_or_404, redirect
13 | from django.core.mail import EmailMessage
14 | from django.utils.http import urlsafe_base64_encode,urlsafe_base64_decode
15 | from django.conf import settings
16 | from django.contrib.auth import authenticate, login, logout
17 | from django.contrib import messages
18 | from django.contrib.auth.decorators import login_required
19 | from django.core.files.storage import FileSystemStorage
20 | from django.views.decorators.csrf import csrf_protect
21 | from django.contrib.sites.shortcuts import get_current_site
22 | from django.template.loader import render_to_string
23 | from django.utils.encoding import force_bytes,force_str
24 |
25 | from .tokens import account_activation_token
26 | from USERS.models import User, Submission
27 | from OJ.models import Problem, TestCase
28 | from .forms import CreateUserForm, UpdateProfileForm
29 | from datetime import datetime
30 | from time import time
31 |
32 | import os
33 | import sys
34 | import subprocess
35 | from subprocess import PIPE
36 | import os.path
37 | import docker
38 |
39 |
40 | ###############################################################################################################################
41 |
42 |
43 | # To register a new user
44 | def registerPage(request):
45 | if request.method == 'POST':
46 | form = CreateUserForm(request.POST)
47 | if form.is_valid():
48 | user_email = form.cleaned_data.get('email')
49 | if User.objects.filter(email=user_email).exists():
50 | messages.error(request,'Email already exist!')
51 | context = {'form': form}
52 | return render(request, 'USERS/register.html', context)
53 |
54 | user = form.save(commit=False)
55 | user.is_active = False
56 | user.save()
57 | messages.success(request, 'Account created successfully! Please verify your email by clicking on the link sent to your email address')
58 |
59 | username = form.cleaned_data.get('username')
60 | current_site = get_current_site(request)
61 | email_subject = "Confirm your email!"
62 | email_message = render_to_string('USERS/email_confirmation.html',{
63 | 'name':username,
64 | 'domain': current_site.domain,
65 | 'uid':urlsafe_base64_encode(force_bytes(user.pk)),
66 | 'token':account_activation_token.make_token(user),
67 | })
68 | to_email = form.cleaned_data.get('email')
69 | email = EmailMessage(
70 | email_subject,
71 | email_message,
72 | settings.EMAIL_HOST_USER,
73 | to=[to_email],
74 | )
75 | email.fail_silently = True
76 | email.send()
77 |
78 | return redirect('login')
79 |
80 | else:
81 | form = CreateUserForm()
82 | context = {'form': form}
83 | return render(request, 'USERS/register.html', context)
84 |
85 |
86 |
87 | ###############################################################################################################################
88 |
89 |
90 | # To login a registered user
91 | def loginPage(request):
92 | if request.user.is_authenticated:
93 | return redirect('dashboard')
94 | else:
95 | if request.method == 'POST':
96 | username = request.POST.get('username')
97 | password = request.POST.get('password')
98 |
99 | user = authenticate(request, username=username, password=password)
100 |
101 | if user is not None:
102 | login(request, user)
103 | return redirect('dashboard')
104 | else:
105 | messages.info(request, 'Username/Password is incorrect')
106 |
107 | context = {}
108 | return render(request, 'USERS/login.html', context)
109 |
110 |
111 |
112 | ###############################################################################################################################
113 |
114 |
115 | # To activate user account via email verification
116 | def activate(request,uidb64,token):
117 | try:
118 | uid=force_str(urlsafe_base64_decode(uidb64))
119 | user=User.objects.get(pk=uid)
120 | except (TypeError, ValueError, OverflowError, User.DoesNotExist):
121 | user=None
122 |
123 | if user is not None and account_activation_token.check_token(user,token):
124 | user.is_active=True
125 | user.save()
126 | login(request,user)
127 | return redirect('dashboard')
128 | else:
129 | messages.error(request,'Activation failed, Please try again!')
130 | return render(request,'USERS/register.html')
131 |
132 |
133 |
134 | ###############################################################################################################################
135 |
136 |
137 | # To logout a registered user
138 | def logoutPage(request):
139 | logout(request)
140 | return redirect('login')
141 |
142 |
143 | ###############################################################################################################################
144 |
145 |
146 | # to update prfile pic and full name
147 | @login_required(login_url='login')
148 | def accountSettings(request):
149 | form = UpdateProfileForm(instance=request.user)
150 |
151 | if request.method == 'POST':
152 | form = UpdateProfileForm(
153 | request.POST, request.FILES, instance=request.user)
154 | if form.is_valid():
155 | form.save()
156 |
157 | context = {'form': form}
158 | return render(request, 'USERS/account_settings.html', context)
159 |
160 |
161 | ###############################################################################################################################
162 |
163 |
164 | # To view all the submissions made by current logged-in user
165 | @login_required(login_url='login')
166 | def allSubmissionPage(request):
167 | submissions = Submission.objects.filter(user=request.user.id)
168 | return render(request, 'USERS/submission.html', {'submissions': submissions})
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/favicon.ico
--------------------------------------------------------------------------------
/geekjudge/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/geekjudge/__init__.py
--------------------------------------------------------------------------------
/geekjudge/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for geekjudge project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'geekjudge.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/geekjudge/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for geekjudge project.
3 |
4 | Generated by 'django-admin startproject' using Django 4.0.6.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/4.0/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/4.0/ref/settings/
11 | """
12 |
13 | import os
14 | from pathlib import Path
15 | from .info import *
16 | from django.contrib.messages import constants as messages
17 |
18 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
19 | BASE_DIR = Path(__file__).resolve().parent.parent
20 | FILES_DIR = os.path.abspath(os.path.join(BASE_DIR,'usercodes'))
21 |
22 |
23 | # Quick-start development settings - unsuitable for production
24 | # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
25 |
26 | # SECURITY WARNING: keep the secret key used in production secret!
27 | SECRET_KEY = SECRET_KEY
28 |
29 | # SECURITY WARNING: don't run with debug turned on in production!
30 | DEBUG = True
31 |
32 | ALLOWED_HOSTS = ['www.geekjudge.com', 'geekjudge.com', '43.205.86.112', 'localhost', '127.0.0.1']
33 |
34 |
35 | # Application definition
36 |
37 | INSTALLED_APPS = [
38 | 'USERS.apps.UsersConfig',
39 | 'OJ.apps.OjConfig',
40 | 'django.contrib.admin',
41 | 'django.contrib.auth',
42 | 'django.contrib.contenttypes',
43 | 'django.contrib.sessions',
44 | 'django.contrib.messages',
45 | 'django.contrib.staticfiles',
46 | 'froala_editor',
47 | ]
48 |
49 | MIDDLEWARE = [
50 | 'django.middleware.security.SecurityMiddleware',
51 | 'django.contrib.sessions.middleware.SessionMiddleware',
52 | 'django.middleware.common.CommonMiddleware',
53 | 'django.middleware.csrf.CsrfViewMiddleware',
54 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
55 | 'django.contrib.messages.middleware.MessageMiddleware',
56 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
57 | ]
58 |
59 | ROOT_URLCONF = 'geekjudge.urls'
60 |
61 | TEMPLATES = [
62 | {
63 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
64 | 'DIRS': [],
65 | 'APP_DIRS': True,
66 | 'OPTIONS': {
67 | 'context_processors': [
68 | 'django.template.context_processors.debug',
69 | 'django.template.context_processors.request',
70 | 'django.contrib.auth.context_processors.auth',
71 | 'django.contrib.messages.context_processors.messages',
72 | ],
73 | },
74 | },
75 | ]
76 |
77 | WSGI_APPLICATION = 'geekjudge.wsgi.application'
78 |
79 |
80 | # Database
81 | # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
82 |
83 | DATABASES = {
84 | 'default': {
85 | 'ENGINE': 'django.db.backends.sqlite3',
86 | 'NAME': os.path.join(BASE_DIR, "db.sqlite3"),
87 | }
88 | }
89 |
90 |
91 | # Password validation
92 | # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
93 |
94 | AUTH_USER_MODEL = 'USERS.User'
95 | AUTH_PASSWORD_VALIDATORS = [
96 | {
97 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
98 | },
99 | {
100 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
101 | },
102 | {
103 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
104 | },
105 | {
106 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
107 | },
108 | ]
109 |
110 |
111 | # Internationalization
112 | # https://docs.djangoproject.com/en/4.0/topics/i18n/
113 |
114 | LANGUAGE_CODE = 'en-us'
115 |
116 | TIME_ZONE = 'Asia/Kolkata'
117 |
118 | USE_I18N = True
119 |
120 | USE_L10N = True
121 |
122 | USE_TZ = True
123 |
124 |
125 | # Static files (CSS, JavaScript, Images)
126 | # https://docs.djangoproject.com/en/4.0/howto/static-files/
127 |
128 | STATIC_URL = 'static/'
129 | MEDIA_URL = '/images/'
130 |
131 | STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
132 | STATICFILES_DIRS = [BASE_DIR / 'static']
133 | MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')
134 |
135 | # Default primary key field type
136 | # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
137 |
138 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
139 |
140 | # smtp configurations
141 | EMAIL_BACKEND = EMAIL_BACKEND
142 | EMAIL_USE_TLS = EMAIL_USE_TLS
143 | EMAIL_HOST = EMAIL_HOST
144 | EMAIL_HOST_USER = EMAIL_HOST_USER
145 | EMAIL_HOST_PASSWORD = EMAIL_HOST_PASSWORD
146 | EMAIL_PORT = EMAIL_PORT
147 |
148 |
149 | MESSAGE_TAGS = {
150 | messages.DEBUG: 'alert-info',
151 | messages.INFO: 'alert-info',
152 | messages.SUCCESS: 'alert-success',
153 | messages.WARNING: 'alert-warning',
154 | messages.ERROR: 'alert-danger',
155 | }
--------------------------------------------------------------------------------
/geekjudge/urls.py:
--------------------------------------------------------------------------------
1 | """geekjudge URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/4.0/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.contrib import admin
17 | from django.urls import path, include
18 |
19 | from django.conf.urls.static import static
20 | from django.conf import settings
21 |
22 | admin.site.site_header = "Geek Judge Admin"
23 | admin.site.site_title = "Geek Judge Admin Portal"
24 | admin.site.index_title = "Welcome to Geek Judge Admin"
25 |
26 | urlpatterns = [
27 | path('admin/', admin.site.urls),
28 | path('', include('USERS.urls')),
29 | path('', include('OJ.urls')),
30 | ]
31 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
32 | urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
--------------------------------------------------------------------------------
/geekjudge/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for geekjudge project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'geekjudge.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | """Run administrative tasks."""
9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'geekjudge.settings')
10 | try:
11 | from django.core.management import execute_from_command_line
12 | except ImportError as exc:
13 | raise ImportError(
14 | "Couldn't import Django. Are you sure it's installed and "
15 | "available on your PYTHONPATH environment variable? Did you "
16 | "forget to activate a virtual environment?"
17 | ) from exc
18 | execute_from_command_line(sys.argv)
19 |
20 |
21 | if __name__ == '__main__':
22 | main()
23 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | asgiref==3.5.2
2 | certifi==2022.6.15
3 | charset-normalizer==2.1.1
4 | Django==4.1
5 | django-froala-editor==4.0.13
6 | docker==6.0.0
7 | gunicorn==20.1.0
8 | idna==3.3
9 | packaging==21.3
10 | Pillow==9.2.0
11 | pyparsing==3.0.9
12 | requests==2.28.1
13 | six==1.16.0
14 | sqlparse==0.4.2
15 | urllib3==1.26.11
16 | websocket-client==1.3.3
17 |
--------------------------------------------------------------------------------
/static/ace/mode-c_cpp.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2 | "use strict";
3 |
4 | var oop = require("../lib/oop");
5 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6 |
7 | var DocCommentHighlightRules = function() {
8 | this.$rules = {
9 | "start" : [ {
10 | token : "comment.doc.tag",
11 | regex : "@[\\w\\d_]+" // TODO: fix email addresses
12 | },
13 | DocCommentHighlightRules.getTagRule(),
14 | {
15 | defaultToken : "comment.doc",
16 | caseInsensitive: true
17 | }]
18 | };
19 | };
20 |
21 | oop.inherits(DocCommentHighlightRules, TextHighlightRules);
22 |
23 | DocCommentHighlightRules.getTagRule = function(start) {
24 | return {
25 | token : "comment.doc.tag.storage.type",
26 | regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
27 | };
28 | };
29 |
30 | DocCommentHighlightRules.getStartRule = function(start) {
31 | return {
32 | token : "comment.doc", // doc comment
33 | regex : "\\/\\*(?=\\*)",
34 | next : start
35 | };
36 | };
37 |
38 | DocCommentHighlightRules.getEndRule = function (start) {
39 | return {
40 | token : "comment.doc", // closing comment
41 | regex : "\\*\\/",
42 | next : start
43 | };
44 | };
45 |
46 |
47 | exports.DocCommentHighlightRules = DocCommentHighlightRules;
48 |
49 | });
50 |
51 | ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
52 | "use strict";
53 |
54 | var oop = require("../lib/oop");
55 | var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
56 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
57 | var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b";
58 |
59 | var c_cppHighlightRules = function() {
60 |
61 | var keywordControls = (
62 | "break|case|continue|default|do|else|for|goto|if|_Pragma|" +
63 | "return|switch|while|catch|operator|try|throw|using"
64 | );
65 |
66 | var storageType = (
67 | "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
68 | "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" +
69 | "class|wchar_t|template|char16_t|char32_t"
70 | );
71 |
72 | var storageModifiers = (
73 | "const|extern|register|restrict|static|volatile|inline|private|" +
74 | "protected|public|friend|explicit|virtual|export|mutable|typename|" +
75 | "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local"
76 | );
77 |
78 | var keywordOperators = (
79 | "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|" +
80 | "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace"
81 | );
82 |
83 | var builtinConstants = (
84 | "NULL|true|false|TRUE|FALSE|nullptr"
85 | );
86 |
87 | var keywordMapper = this.$keywords = this.createKeywordMapper({
88 | "keyword.control" : keywordControls,
89 | "storage.type" : storageType,
90 | "storage.modifier" : storageModifiers,
91 | "keyword.operator" : keywordOperators,
92 | "variable.language": "this",
93 | "constant.language": builtinConstants
94 | }, "identifier");
95 |
96 | var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
97 | var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source;
98 | var formatRe = "%"
99 | + /(\d+\$)?/.source // field (argument #)
100 | + /[#0\- +']*/.source // flags
101 | + /[,;:_]?/.source // separator character (AltiVec)
102 | + /((-?\d+)|\*(-?\d+\$)?)?/.source // minimum field width
103 | + /(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source // precision
104 | + /(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source // length modifier
105 | + /(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source; // conversion type
106 |
107 | this.$rules = {
108 | "start" : [
109 | {
110 | token : "comment",
111 | regex : "//$",
112 | next : "start"
113 | }, {
114 | token : "comment",
115 | regex : "//",
116 | next : "singleLineComment"
117 | },
118 | DocCommentHighlightRules.getStartRule("doc-start"),
119 | {
120 | token : "comment", // multi line comment
121 | regex : "\\/\\*",
122 | next : "comment"
123 | }, {
124 | token : "string", // character
125 | regex : "'(?:" + escapeRe + "|.)?'"
126 | }, {
127 | token : "string.start",
128 | regex : '"',
129 | stateName: "qqstring",
130 | next: [
131 | { token: "string", regex: /\\\s*$/, next: "qqstring" },
132 | { token: "constant.language.escape", regex: escapeRe },
133 | { token: "constant.language.escape", regex: formatRe },
134 | { token: "string.end", regex: '"|$', next: "start" },
135 | { defaultToken: "string"}
136 | ]
137 | }, {
138 | token : "string.start",
139 | regex : 'R"\\(',
140 | stateName: "rawString",
141 | next: [
142 | { token: "string.end", regex: '\\)"', next: "start" },
143 | { defaultToken: "string"}
144 | ]
145 | }, {
146 | token : "constant.numeric", // hex
147 | regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
148 | }, {
149 | token : "constant.numeric", // float
150 | regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
151 | }, {
152 | token : "keyword", // pre-compiler directives
153 | regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b",
154 | next : "directive"
155 | }, {
156 | token : "keyword", // special case pre-compiler directive
157 | regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"
158 | }, {
159 | token : "support.function.C99.c",
160 | regex : cFunctions
161 | }, {
162 | token : keywordMapper,
163 | regex : "[a-zA-Z_$][a-zA-Z0-9_$]*"
164 | }, {
165 | token : "keyword.operator",
166 | regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/
167 | }, {
168 | token : "punctuation.operator",
169 | regex : "\\?|\\:|\\,|\\;|\\."
170 | }, {
171 | token : "paren.lparen",
172 | regex : "[[({]"
173 | }, {
174 | token : "paren.rparen",
175 | regex : "[\\])}]"
176 | }, {
177 | token : "text",
178 | regex : "\\s+"
179 | }
180 | ],
181 | "comment" : [
182 | {
183 | token : "comment", // closing comment
184 | regex : "\\*\\/",
185 | next : "start"
186 | }, {
187 | defaultToken : "comment"
188 | }
189 | ],
190 | "singleLineComment" : [
191 | {
192 | token : "comment",
193 | regex : /\\$/,
194 | next : "singleLineComment"
195 | }, {
196 | token : "comment",
197 | regex : /$/,
198 | next : "start"
199 | }, {
200 | defaultToken: "comment"
201 | }
202 | ],
203 | "directive" : [
204 | {
205 | token : "constant.other.multiline",
206 | regex : /\\/
207 | },
208 | {
209 | token : "constant.other.multiline",
210 | regex : /.*\\/
211 | },
212 | {
213 | token : "constant.other",
214 | regex : "\\s*<.+?>",
215 | next : "start"
216 | },
217 | {
218 | token : "constant.other", // single line
219 | regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',
220 | next : "start"
221 | },
222 | {
223 | token : "constant.other", // single line
224 | regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
225 | next : "start"
226 | },
227 | {
228 | token : "constant.other",
229 | regex : /[^\\\/]+/,
230 | next : "start"
231 | }
232 | ]
233 | };
234 |
235 | this.embedRules(DocCommentHighlightRules, "doc-",
236 | [ DocCommentHighlightRules.getEndRule("start") ]);
237 | this.normalizeRules();
238 | };
239 |
240 | oop.inherits(c_cppHighlightRules, TextHighlightRules);
241 |
242 | exports.c_cppHighlightRules = c_cppHighlightRules;
243 | });
244 |
245 | ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
246 | "use strict";
247 |
248 | var Range = require("../range").Range;
249 |
250 | var MatchingBraceOutdent = function() {};
251 |
252 | (function() {
253 |
254 | this.checkOutdent = function(line, input) {
255 | if (! /^\s+$/.test(line))
256 | return false;
257 |
258 | return /^\s*\}/.test(input);
259 | };
260 |
261 | this.autoOutdent = function(doc, row) {
262 | var line = doc.getLine(row);
263 | var match = line.match(/^(\s*\})/);
264 |
265 | if (!match) return 0;
266 |
267 | var column = match[1].length;
268 | var openBracePos = doc.findMatchingBracket({row: row, column: column});
269 |
270 | if (!openBracePos || openBracePos.row == row) return 0;
271 |
272 | var indent = this.$getIndent(doc.getLine(openBracePos.row));
273 | doc.replace(new Range(row, 0, row, column-1), indent);
274 | };
275 |
276 | this.$getIndent = function(line) {
277 | return line.match(/^\s*/)[0];
278 | };
279 |
280 | }).call(MatchingBraceOutdent.prototype);
281 |
282 | exports.MatchingBraceOutdent = MatchingBraceOutdent;
283 | });
284 |
285 | ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
286 | "use strict";
287 |
288 | var oop = require("../../lib/oop");
289 | var Range = require("../../range").Range;
290 | var BaseFoldMode = require("./fold_mode").FoldMode;
291 |
292 | var FoldMode = exports.FoldMode = function(commentRegex) {
293 | if (commentRegex) {
294 | this.foldingStartMarker = new RegExp(
295 | this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
296 | );
297 | this.foldingStopMarker = new RegExp(
298 | this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
299 | );
300 | }
301 | };
302 | oop.inherits(FoldMode, BaseFoldMode);
303 |
304 | (function() {
305 |
306 | this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
307 | this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
308 | this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
309 | this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
310 | this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
311 | this._getFoldWidgetBase = this.getFoldWidget;
312 | this.getFoldWidget = function(session, foldStyle, row) {
313 | var line = session.getLine(row);
314 |
315 | if (this.singleLineBlockCommentRe.test(line)) {
316 | if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
317 | return "";
318 | }
319 |
320 | var fw = this._getFoldWidgetBase(session, foldStyle, row);
321 |
322 | if (!fw && this.startRegionRe.test(line))
323 | return "start"; // lineCommentRegionStart
324 |
325 | return fw;
326 | };
327 |
328 | this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
329 | var line = session.getLine(row);
330 |
331 | if (this.startRegionRe.test(line))
332 | return this.getCommentRegionBlock(session, line, row);
333 |
334 | var match = line.match(this.foldingStartMarker);
335 | if (match) {
336 | var i = match.index;
337 |
338 | if (match[1])
339 | return this.openingBracketBlock(session, match[1], row, i);
340 |
341 | var range = session.getCommentFoldRange(row, i + match[0].length, 1);
342 |
343 | if (range && !range.isMultiLine()) {
344 | if (forceMultiline) {
345 | range = this.getSectionRange(session, row);
346 | } else if (foldStyle != "all")
347 | range = null;
348 | }
349 |
350 | return range;
351 | }
352 |
353 | if (foldStyle === "markbegin")
354 | return;
355 |
356 | var match = line.match(this.foldingStopMarker);
357 | if (match) {
358 | var i = match.index + match[0].length;
359 |
360 | if (match[1])
361 | return this.closingBracketBlock(session, match[1], row, i);
362 |
363 | return session.getCommentFoldRange(row, i, -1);
364 | }
365 | };
366 |
367 | this.getSectionRange = function(session, row) {
368 | var line = session.getLine(row);
369 | var startIndent = line.search(/\S/);
370 | var startRow = row;
371 | var startColumn = line.length;
372 | row = row + 1;
373 | var endRow = row;
374 | var maxRow = session.getLength();
375 | while (++row < maxRow) {
376 | line = session.getLine(row);
377 | var indent = line.search(/\S/);
378 | if (indent === -1)
379 | continue;
380 | if (startIndent > indent)
381 | break;
382 | var subRange = this.getFoldWidgetRange(session, "all", row);
383 |
384 | if (subRange) {
385 | if (subRange.start.row <= startRow) {
386 | break;
387 | } else if (subRange.isMultiLine()) {
388 | row = subRange.end.row;
389 | } else if (startIndent == indent) {
390 | break;
391 | }
392 | }
393 | endRow = row;
394 | }
395 |
396 | return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
397 | };
398 | this.getCommentRegionBlock = function(session, line, row) {
399 | var startColumn = line.search(/\s*$/);
400 | var maxRow = session.getLength();
401 | var startRow = row;
402 |
403 | var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
404 | var depth = 1;
405 | while (++row < maxRow) {
406 | line = session.getLine(row);
407 | var m = re.exec(line);
408 | if (!m) continue;
409 | if (m[1]) depth--;
410 | else depth++;
411 |
412 | if (!depth) break;
413 | }
414 |
415 | var endRow = row;
416 | if (endRow > startRow) {
417 | return new Range(startRow, startColumn, endRow, line.length);
418 | }
419 | };
420 |
421 | }).call(FoldMode.prototype);
422 |
423 | });
424 |
425 | ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
426 | "use strict";
427 |
428 | var oop = require("../lib/oop");
429 | var TextMode = require("./text").Mode;
430 | var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
431 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
432 | var Range = require("../range").Range;
433 | var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
434 | var CStyleFoldMode = require("./folding/cstyle").FoldMode;
435 |
436 | var Mode = function() {
437 | this.HighlightRules = c_cppHighlightRules;
438 |
439 | this.$outdent = new MatchingBraceOutdent();
440 | this.$behaviour = new CstyleBehaviour();
441 |
442 | this.foldingRules = new CStyleFoldMode();
443 | };
444 | oop.inherits(Mode, TextMode);
445 |
446 | (function() {
447 |
448 | this.lineCommentStart = "//";
449 | this.blockComment = {start: "/*", end: "*/"};
450 |
451 | this.getNextLineIndent = function(state, line, tab) {
452 | var indent = this.$getIndent(line);
453 |
454 | var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
455 | var tokens = tokenizedLine.tokens;
456 | var endState = tokenizedLine.state;
457 |
458 | if (tokens.length && tokens[tokens.length-1].type == "comment") {
459 | return indent;
460 | }
461 |
462 | if (state == "start") {
463 | var match = line.match(/^.*[\{\(\[]\s*$/);
464 | if (match) {
465 | indent += tab;
466 | }
467 | } else if (state == "doc-start") {
468 | if (endState == "start") {
469 | return "";
470 | }
471 | var match = line.match(/^\s*(\/?)\*/);
472 | if (match) {
473 | if (match[1]) {
474 | indent += " ";
475 | }
476 | indent += "* ";
477 | }
478 | }
479 |
480 | return indent;
481 | };
482 |
483 | this.checkOutdent = function(state, line, input) {
484 | return this.$outdent.checkOutdent(line, input);
485 | };
486 |
487 | this.autoOutdent = function(state, doc, row) {
488 | this.$outdent.autoOutdent(doc, row);
489 | };
490 |
491 | this.$id = "ace/mode/c_cpp";
492 | }).call(Mode.prototype);
493 |
494 | exports.Mode = Mode;
495 | }); (function() {
496 | ace.require(["ace/mode/c_cpp"], function(m) {
497 | if (typeof module == "object" && typeof exports == "object" && module) {
498 | module.exports = m;
499 | }
500 | });
501 | })();
502 |
--------------------------------------------------------------------------------
/static/ace/mode-python.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2 | "use strict";
3 |
4 | var oop = require("../lib/oop");
5 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6 |
7 | var PythonHighlightRules = function() {
8 |
9 | var keywords = (
10 | "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" +
11 | "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" +
12 | "raise|return|try|while|with|yield|async|await|nonlocal"
13 | );
14 |
15 | var builtinConstants = (
16 | "True|False|None|NotImplemented|Ellipsis|__debug__"
17 | );
18 |
19 | var builtinFunctions = (
20 | "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
21 | "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +
22 | "binfile|bin|iter|property|tuple|bool|filter|len|range|type|bytearray|" +
23 | "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" +
24 | "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" +
25 | "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" +
26 | "__import__|complex|hash|min|apply|delattr|help|next|setattr|set|" +
27 | "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern|" +
28 | "ascii|breakpoint|bytes"
29 | );
30 | var keywordMapper = this.createKeywordMapper({
31 | "invalid.deprecated": "debugger",
32 | "support.function": builtinFunctions,
33 | "variable.language": "self|cls",
34 | "constant.language": builtinConstants,
35 | "keyword": keywords
36 | }, "identifier");
37 |
38 | var strPre = "[uU]?";
39 | var strRawPre = "[rR]";
40 | var strFormatPre = "[fF]";
41 | var strRawFormatPre = "(?:[rR][fF]|[fF][rR])";
42 | var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
43 | var octInteger = "(?:0[oO]?[0-7]+)";
44 | var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
45 | var binInteger = "(?:0[bB][01]+)";
46 | var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
47 |
48 | var exponent = "(?:[eE][+-]?\\d+)";
49 | var fraction = "(?:\\.\\d+)";
50 | var intPart = "(?:\\d+)";
51 | var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
52 | var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
53 | var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
54 |
55 | var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
56 |
57 | this.$rules = {
58 | "start" : [ {
59 | token : "comment",
60 | regex : "#.*$"
61 | }, {
62 | token : "string", // multi line """ string start
63 | regex : strPre + '"{3}',
64 | next : "qqstring3"
65 | }, {
66 | token : "string", // " string
67 | regex : strPre + '"(?=.)',
68 | next : "qqstring"
69 | }, {
70 | token : "string", // multi line ''' string start
71 | regex : strPre + "'{3}",
72 | next : "qstring3"
73 | }, {
74 | token : "string", // ' string
75 | regex : strPre + "'(?=.)",
76 | next : "qstring"
77 | }, {
78 | token: "string",
79 | regex: strRawPre + '"{3}',
80 | next: "rawqqstring3"
81 | }, {
82 | token: "string",
83 | regex: strRawPre + '"(?=.)',
84 | next: "rawqqstring"
85 | }, {
86 | token: "string",
87 | regex: strRawPre + "'{3}",
88 | next: "rawqstring3"
89 | }, {
90 | token: "string",
91 | regex: strRawPre + "'(?=.)",
92 | next: "rawqstring"
93 | }, {
94 | token: "string",
95 | regex: strFormatPre + '"{3}',
96 | next: "fqqstring3"
97 | }, {
98 | token: "string",
99 | regex: strFormatPre + '"(?=.)',
100 | next: "fqqstring"
101 | }, {
102 | token: "string",
103 | regex: strFormatPre + "'{3}",
104 | next: "fqstring3"
105 | }, {
106 | token: "string",
107 | regex: strFormatPre + "'(?=.)",
108 | next: "fqstring"
109 | },{
110 | token: "string",
111 | regex: strRawFormatPre + '"{3}',
112 | next: "rfqqstring3"
113 | }, {
114 | token: "string",
115 | regex: strRawFormatPre + '"(?=.)',
116 | next: "rfqqstring"
117 | }, {
118 | token: "string",
119 | regex: strRawFormatPre + "'{3}",
120 | next: "rfqstring3"
121 | }, {
122 | token: "string",
123 | regex: strRawFormatPre + "'(?=.)",
124 | next: "rfqstring"
125 | }, {
126 | token: "keyword.operator",
127 | regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|@|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="
128 | }, {
129 | token: "punctuation",
130 | regex: ",|:|;|\\->|\\+=|\\-=|\\*=|\\/=|\\/\\/=|%=|@=|&=|\\|=|^=|>>=|<<=|\\*\\*="
131 | }, {
132 | token: "paren.lparen",
133 | regex: "[\\[\\(\\{]"
134 | }, {
135 | token: "paren.rparen",
136 | regex: "[\\]\\)\\}]"
137 | }, {
138 | token: "text",
139 | regex: "\\s+"
140 | }, {
141 | include: "constants"
142 | }],
143 | "qqstring3": [{
144 | token: "constant.language.escape",
145 | regex: stringEscape
146 | }, {
147 | token: "string", // multi line """ string end
148 | regex: '"{3}',
149 | next: "start"
150 | }, {
151 | defaultToken: "string"
152 | }],
153 | "qstring3": [{
154 | token: "constant.language.escape",
155 | regex: stringEscape
156 | }, {
157 | token: "string", // multi line ''' string end
158 | regex: "'{3}",
159 | next: "start"
160 | }, {
161 | defaultToken: "string"
162 | }],
163 | "qqstring": [{
164 | token: "constant.language.escape",
165 | regex: stringEscape
166 | }, {
167 | token: "string",
168 | regex: "\\\\$",
169 | next: "qqstring"
170 | }, {
171 | token: "string",
172 | regex: '"|$',
173 | next: "start"
174 | }, {
175 | defaultToken: "string"
176 | }],
177 | "qstring": [{
178 | token: "constant.language.escape",
179 | regex: stringEscape
180 | }, {
181 | token: "string",
182 | regex: "\\\\$",
183 | next: "qstring"
184 | }, {
185 | token: "string",
186 | regex: "'|$",
187 | next: "start"
188 | }, {
189 | defaultToken: "string"
190 | }],
191 | "rawqqstring3": [{
192 | token: "string", // multi line """ string end
193 | regex: '"{3}',
194 | next: "start"
195 | }, {
196 | defaultToken: "string"
197 | }],
198 | "rawqstring3": [{
199 | token: "string", // multi line ''' string end
200 | regex: "'{3}",
201 | next: "start"
202 | }, {
203 | defaultToken: "string"
204 | }],
205 | "rawqqstring": [{
206 | token: "string",
207 | regex: "\\\\$",
208 | next: "rawqqstring"
209 | }, {
210 | token: "string",
211 | regex: '"|$',
212 | next: "start"
213 | }, {
214 | defaultToken: "string"
215 | }],
216 | "rawqstring": [{
217 | token: "string",
218 | regex: "\\\\$",
219 | next: "rawqstring"
220 | }, {
221 | token: "string",
222 | regex: "'|$",
223 | next: "start"
224 | }, {
225 | defaultToken: "string"
226 | }],
227 | "fqqstring3": [{
228 | token: "constant.language.escape",
229 | regex: stringEscape
230 | }, {
231 | token: "string", // multi line """ string end
232 | regex: '"{3}',
233 | next: "start"
234 | }, {
235 | token: "paren.lparen",
236 | regex: "{",
237 | push: "fqstringParRules"
238 | }, {
239 | defaultToken: "string"
240 | }],
241 | "fqstring3": [{
242 | token: "constant.language.escape",
243 | regex: stringEscape
244 | }, {
245 | token: "string", // multi line ''' string end
246 | regex: "'{3}",
247 | next: "start"
248 | }, {
249 | token: "paren.lparen",
250 | regex: "{",
251 | push: "fqstringParRules"
252 | }, {
253 | defaultToken: "string"
254 | }],
255 | "fqqstring": [{
256 | token: "constant.language.escape",
257 | regex: stringEscape
258 | }, {
259 | token: "string",
260 | regex: "\\\\$",
261 | next: "fqqstring"
262 | }, {
263 | token: "string",
264 | regex: '"|$',
265 | next: "start"
266 | }, {
267 | token: "paren.lparen",
268 | regex: "{",
269 | push: "fqstringParRules"
270 | }, {
271 | defaultToken: "string"
272 | }],
273 | "fqstring": [{
274 | token: "constant.language.escape",
275 | regex: stringEscape
276 | }, {
277 | token: "string",
278 | regex: "'|$",
279 | next: "start"
280 | }, {
281 | token: "paren.lparen",
282 | regex: "{",
283 | push: "fqstringParRules"
284 | }, {
285 | defaultToken: "string"
286 | }],
287 | "rfqqstring3": [{
288 | token: "string", // multi line """ string end
289 | regex: '"{3}',
290 | next: "start"
291 | }, {
292 | token: "paren.lparen",
293 | regex: "{",
294 | push: "fqstringParRules"
295 | }, {
296 | defaultToken: "string"
297 | }],
298 | "rfqstring3": [{
299 | token: "string", // multi line ''' string end
300 | regex: "'{3}",
301 | next: "start"
302 | }, {
303 | token: "paren.lparen",
304 | regex: "{",
305 | push: "fqstringParRules"
306 | }, {
307 | defaultToken: "string"
308 | }],
309 | "rfqqstring": [{
310 | token: "string",
311 | regex: "\\\\$",
312 | next: "rfqqstring"
313 | }, {
314 | token: "string",
315 | regex: '"|$',
316 | next: "start"
317 | }, {
318 | token: "paren.lparen",
319 | regex: "{",
320 | push: "fqstringParRules"
321 | }, {
322 | defaultToken: "string"
323 | }],
324 | "rfqstring": [{
325 | token: "string",
326 | regex: "'|$",
327 | next: "start"
328 | }, {
329 | token: "paren.lparen",
330 | regex: "{",
331 | push: "fqstringParRules"
332 | }, {
333 | defaultToken: "string"
334 | }],
335 | "fqstringParRules": [{//TODO: nested {}
336 | token: "paren.lparen",
337 | regex: "[\\[\\(]"
338 | }, {
339 | token: "paren.rparen",
340 | regex: "[\\]\\)]"
341 | }, {
342 | token: "string",
343 | regex: "\\s+"
344 | }, {
345 | token: "string",
346 | regex: "'(.)*'"
347 | }, {
348 | token: "string",
349 | regex: '"(.)*"'
350 | }, {
351 | token: "function.support",
352 | regex: "(!s|!r|!a)"
353 | }, {
354 | include: "constants"
355 | },{
356 | token: 'paren.rparen',
357 | regex: "}",
358 | next: 'pop'
359 | },{
360 | token: 'paren.lparen',
361 | regex: "{",
362 | push: "fqstringParRules"
363 | }],
364 | "constants": [{
365 | token: "constant.numeric", // imaginary
366 | regex: "(?:" + floatNumber + "|\\d+)[jJ]\\b"
367 | }, {
368 | token: "constant.numeric", // float
369 | regex: floatNumber
370 | }, {
371 | token: "constant.numeric", // long integer
372 | regex: integer + "[lL]\\b"
373 | }, {
374 | token: "constant.numeric", // integer
375 | regex: integer + "\\b"
376 | }, {
377 | token: ["punctuation", "function.support"],// method
378 | regex: "(\\.)([a-zA-Z_]+)\\b"
379 | }, {
380 | token: keywordMapper,
381 | regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
382 | }]
383 | };
384 | this.normalizeRules();
385 | };
386 |
387 | oop.inherits(PythonHighlightRules, TextHighlightRules);
388 |
389 | exports.PythonHighlightRules = PythonHighlightRules;
390 | });
391 |
392 | ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
393 | "use strict";
394 |
395 | var oop = require("../../lib/oop");
396 | var BaseFoldMode = require("./fold_mode").FoldMode;
397 |
398 | var FoldMode = exports.FoldMode = function(markers) {
399 | this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$");
400 | };
401 | oop.inherits(FoldMode, BaseFoldMode);
402 |
403 | (function() {
404 |
405 | this.getFoldWidgetRange = function(session, foldStyle, row) {
406 | var line = session.getLine(row);
407 | var match = line.match(this.foldingStartMarker);
408 | if (match) {
409 | if (match[1])
410 | return this.openingBracketBlock(session, match[1], row, match.index);
411 | if (match[2])
412 | return this.indentationBlock(session, row, match.index + match[2].length);
413 | return this.indentationBlock(session, row);
414 | }
415 | };
416 |
417 | }).call(FoldMode.prototype);
418 |
419 | });
420 |
421 | ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"], function(require, exports, module) {
422 | "use strict";
423 |
424 | var oop = require("../lib/oop");
425 | var TextMode = require("./text").Mode;
426 | var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules;
427 | var PythonFoldMode = require("./folding/pythonic").FoldMode;
428 | var Range = require("../range").Range;
429 |
430 | var Mode = function() {
431 | this.HighlightRules = PythonHighlightRules;
432 | this.foldingRules = new PythonFoldMode("\\:");
433 | this.$behaviour = this.$defaultBehaviour;
434 | };
435 | oop.inherits(Mode, TextMode);
436 |
437 | (function() {
438 |
439 | this.lineCommentStart = "#";
440 |
441 | this.getNextLineIndent = function(state, line, tab) {
442 | var indent = this.$getIndent(line);
443 |
444 | var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
445 | var tokens = tokenizedLine.tokens;
446 |
447 | if (tokens.length && tokens[tokens.length-1].type == "comment") {
448 | return indent;
449 | }
450 |
451 | if (state == "start") {
452 | var match = line.match(/^.*[\{\(\[:]\s*$/);
453 | if (match) {
454 | indent += tab;
455 | }
456 | }
457 |
458 | return indent;
459 | };
460 |
461 | var outdents = {
462 | "pass": 1,
463 | "return": 1,
464 | "raise": 1,
465 | "break": 1,
466 | "continue": 1
467 | };
468 |
469 | this.checkOutdent = function(state, line, input) {
470 | if (input !== "\r\n" && input !== "\r" && input !== "\n")
471 | return false;
472 |
473 | var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
474 |
475 | if (!tokens)
476 | return false;
477 | do {
478 | var last = tokens.pop();
479 | } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
480 |
481 | if (!last)
482 | return false;
483 |
484 | return (last.type == "keyword" && outdents[last.value]);
485 | };
486 |
487 | this.autoOutdent = function(state, doc, row) {
488 |
489 | row += 1;
490 | var indent = this.$getIndent(doc.getLine(row));
491 | var tab = doc.getTabString();
492 | if (indent.slice(-tab.length) == tab)
493 | doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
494 | };
495 |
496 | this.$id = "ace/mode/python";
497 | }).call(Mode.prototype);
498 |
499 | exports.Mode = Mode;
500 | }); (function() {
501 | ace.require(["ace/mode/python"], function(m) {
502 | if (typeof module == "object" && typeof exports == "object" && module) {
503 | module.exports = m;
504 | }
505 | });
506 | })();
507 |
--------------------------------------------------------------------------------
/static/ace/theme-cobalt.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/cobalt",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-cobalt";
5 | exports.cssText = ".ace-cobalt .ace_gutter {\
6 | background: #011e3a;\
7 | color: rgb(128,145,160)\
8 | }\
9 | .ace-cobalt .ace_print-margin {\
10 | width: 1px;\
11 | background: #555555\
12 | }\
13 | .ace-cobalt {\
14 | background-color: #002240;\
15 | color: #FFFFFF\
16 | }\
17 | .ace-cobalt .ace_cursor {\
18 | color: #FFFFFF\
19 | }\
20 | .ace-cobalt .ace_marker-layer .ace_selection {\
21 | background: rgba(179, 101, 57, 0.75)\
22 | }\
23 | .ace-cobalt.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #002240;\
25 | }\
26 | .ace-cobalt .ace_marker-layer .ace_step {\
27 | background: rgb(127, 111, 19)\
28 | }\
29 | .ace-cobalt .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid rgba(255, 255, 255, 0.15)\
32 | }\
33 | .ace-cobalt .ace_marker-layer .ace_active-line {\
34 | background: rgba(0, 0, 0, 0.35)\
35 | }\
36 | .ace-cobalt .ace_gutter-active-line {\
37 | background-color: rgba(0, 0, 0, 0.35)\
38 | }\
39 | .ace-cobalt .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid rgba(179, 101, 57, 0.75)\
41 | }\
42 | .ace-cobalt .ace_invisible {\
43 | color: rgba(255, 255, 255, 0.15)\
44 | }\
45 | .ace-cobalt .ace_keyword,\
46 | .ace-cobalt .ace_meta {\
47 | color: #FF9D00\
48 | }\
49 | .ace-cobalt .ace_constant,\
50 | .ace-cobalt .ace_constant.ace_character,\
51 | .ace-cobalt .ace_constant.ace_character.ace_escape,\
52 | .ace-cobalt .ace_constant.ace_other {\
53 | color: #FF628C\
54 | }\
55 | .ace-cobalt .ace_invalid {\
56 | color: #F8F8F8;\
57 | background-color: #800F00\
58 | }\
59 | .ace-cobalt .ace_support {\
60 | color: #80FFBB\
61 | }\
62 | .ace-cobalt .ace_support.ace_constant {\
63 | color: #EB939A\
64 | }\
65 | .ace-cobalt .ace_fold {\
66 | background-color: #FF9D00;\
67 | border-color: #FFFFFF\
68 | }\
69 | .ace-cobalt .ace_support.ace_function {\
70 | color: #FFB054\
71 | }\
72 | .ace-cobalt .ace_storage {\
73 | color: #FFEE80\
74 | }\
75 | .ace-cobalt .ace_entity {\
76 | color: #FFDD00\
77 | }\
78 | .ace-cobalt .ace_string {\
79 | color: #3AD900\
80 | }\
81 | .ace-cobalt .ace_string.ace_regexp {\
82 | color: #80FFC2\
83 | }\
84 | .ace-cobalt .ace_comment {\
85 | font-style: italic;\
86 | color: #0088FF\
87 | }\
88 | .ace-cobalt .ace_heading,\
89 | .ace-cobalt .ace_markup.ace_heading {\
90 | color: #C8E4FD;\
91 | background-color: #001221\
92 | }\
93 | .ace-cobalt .ace_list,\
94 | .ace-cobalt .ace_markup.ace_list {\
95 | background-color: #130D26\
96 | }\
97 | .ace-cobalt .ace_variable {\
98 | color: #CCCCCC\
99 | }\
100 | .ace-cobalt .ace_variable.ace_language {\
101 | color: #FF80E1\
102 | }\
103 | .ace-cobalt .ace_meta.ace_tag {\
104 | color: #9EFFFF\
105 | }\
106 | .ace-cobalt .ace_indent-guide {\
107 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y\
108 | }\
109 | ";
110 |
111 | var dom = require("../lib/dom");
112 | dom.importCssString(exports.cssText, exports.cssClass);
113 | }); (function() {
114 | ace.require(["ace/theme/cobalt"], function(m) {
115 | if (typeof module == "object" && typeof exports == "object" && module) {
116 | module.exports = m;
117 | }
118 | });
119 | })();
120 |
--------------------------------------------------------------------------------
/static/ace/theme-crimson_editor.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/crimson_editor",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 | exports.isDark = false;
3 | exports.cssText = ".ace-crimson-editor .ace_gutter {\
4 | background: #ebebeb;\
5 | color: #333;\
6 | overflow : hidden;\
7 | }\
8 | .ace-crimson-editor .ace_gutter-layer {\
9 | width: 100%;\
10 | text-align: right;\
11 | }\
12 | .ace-crimson-editor .ace_print-margin {\
13 | width: 1px;\
14 | background: #e8e8e8;\
15 | }\
16 | .ace-crimson-editor {\
17 | background-color: #FFFFFF;\
18 | color: rgb(64, 64, 64);\
19 | }\
20 | .ace-crimson-editor .ace_cursor {\
21 | color: black;\
22 | }\
23 | .ace-crimson-editor .ace_invisible {\
24 | color: rgb(191, 191, 191);\
25 | }\
26 | .ace-crimson-editor .ace_identifier {\
27 | color: black;\
28 | }\
29 | .ace-crimson-editor .ace_keyword {\
30 | color: blue;\
31 | }\
32 | .ace-crimson-editor .ace_constant.ace_buildin {\
33 | color: rgb(88, 72, 246);\
34 | }\
35 | .ace-crimson-editor .ace_constant.ace_language {\
36 | color: rgb(255, 156, 0);\
37 | }\
38 | .ace-crimson-editor .ace_constant.ace_library {\
39 | color: rgb(6, 150, 14);\
40 | }\
41 | .ace-crimson-editor .ace_invalid {\
42 | text-decoration: line-through;\
43 | color: rgb(224, 0, 0);\
44 | }\
45 | .ace-crimson-editor .ace_fold {\
46 | }\
47 | .ace-crimson-editor .ace_support.ace_function {\
48 | color: rgb(192, 0, 0);\
49 | }\
50 | .ace-crimson-editor .ace_support.ace_constant {\
51 | color: rgb(6, 150, 14);\
52 | }\
53 | .ace-crimson-editor .ace_support.ace_type,\
54 | .ace-crimson-editor .ace_support.ace_class {\
55 | color: rgb(109, 121, 222);\
56 | }\
57 | .ace-crimson-editor .ace_keyword.ace_operator {\
58 | color: rgb(49, 132, 149);\
59 | }\
60 | .ace-crimson-editor .ace_string {\
61 | color: rgb(128, 0, 128);\
62 | }\
63 | .ace-crimson-editor .ace_comment {\
64 | color: rgb(76, 136, 107);\
65 | }\
66 | .ace-crimson-editor .ace_comment.ace_doc {\
67 | color: rgb(0, 102, 255);\
68 | }\
69 | .ace-crimson-editor .ace_comment.ace_doc.ace_tag {\
70 | color: rgb(128, 159, 191);\
71 | }\
72 | .ace-crimson-editor .ace_constant.ace_numeric {\
73 | color: rgb(0, 0, 64);\
74 | }\
75 | .ace-crimson-editor .ace_variable {\
76 | color: rgb(0, 64, 128);\
77 | }\
78 | .ace-crimson-editor .ace_xml-pe {\
79 | color: rgb(104, 104, 91);\
80 | }\
81 | .ace-crimson-editor .ace_marker-layer .ace_selection {\
82 | background: rgb(181, 213, 255);\
83 | }\
84 | .ace-crimson-editor .ace_marker-layer .ace_step {\
85 | background: rgb(252, 255, 0);\
86 | }\
87 | .ace-crimson-editor .ace_marker-layer .ace_stack {\
88 | background: rgb(164, 229, 101);\
89 | }\
90 | .ace-crimson-editor .ace_marker-layer .ace_bracket {\
91 | margin: -1px 0 0 -1px;\
92 | border: 1px solid rgb(192, 192, 192);\
93 | }\
94 | .ace-crimson-editor .ace_marker-layer .ace_active-line {\
95 | background: rgb(232, 242, 254);\
96 | }\
97 | .ace-crimson-editor .ace_gutter-active-line {\
98 | background-color : #dcdcdc;\
99 | }\
100 | .ace-crimson-editor .ace_meta.ace_tag {\
101 | color:rgb(28, 2, 255);\
102 | }\
103 | .ace-crimson-editor .ace_marker-layer .ace_selected-word {\
104 | background: rgb(250, 250, 255);\
105 | border: 1px solid rgb(200, 200, 250);\
106 | }\
107 | .ace-crimson-editor .ace_string.ace_regex {\
108 | color: rgb(192, 0, 192);\
109 | }\
110 | .ace-crimson-editor .ace_indent-guide {\
111 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
112 | }";
113 |
114 | exports.cssClass = "ace-crimson-editor";
115 |
116 | var dom = require("../lib/dom");
117 | dom.importCssString(exports.cssText, exports.cssClass);
118 | }); (function() {
119 | ace.require(["ace/theme/crimson_editor"], function(m) {
120 | if (typeof module == "object" && typeof exports == "object" && module) {
121 | module.exports = m;
122 | }
123 | });
124 | })();
125 |
--------------------------------------------------------------------------------
/static/ace/theme-dawn.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/dawn",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = false;
4 | exports.cssClass = "ace-dawn";
5 | exports.cssText = ".ace-dawn .ace_gutter {\
6 | background: #ebebeb;\
7 | color: #333\
8 | }\
9 | .ace-dawn .ace_print-margin {\
10 | width: 1px;\
11 | background: #e8e8e8\
12 | }\
13 | .ace-dawn {\
14 | background-color: #F9F9F9;\
15 | color: #080808\
16 | }\
17 | .ace-dawn .ace_cursor {\
18 | color: #000000\
19 | }\
20 | .ace-dawn .ace_marker-layer .ace_selection {\
21 | background: rgba(39, 95, 255, 0.30)\
22 | }\
23 | .ace-dawn.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #F9F9F9;\
25 | }\
26 | .ace-dawn .ace_marker-layer .ace_step {\
27 | background: rgb(255, 255, 0)\
28 | }\
29 | .ace-dawn .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid rgba(75, 75, 126, 0.50)\
32 | }\
33 | .ace-dawn .ace_marker-layer .ace_active-line {\
34 | background: rgba(36, 99, 180, 0.12)\
35 | }\
36 | .ace-dawn .ace_gutter-active-line {\
37 | background-color : #dcdcdc\
38 | }\
39 | .ace-dawn .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid rgba(39, 95, 255, 0.30)\
41 | }\
42 | .ace-dawn .ace_invisible {\
43 | color: rgba(75, 75, 126, 0.50)\
44 | }\
45 | .ace-dawn .ace_keyword,\
46 | .ace-dawn .ace_meta {\
47 | color: #794938\
48 | }\
49 | .ace-dawn .ace_constant,\
50 | .ace-dawn .ace_constant.ace_character,\
51 | .ace-dawn .ace_constant.ace_character.ace_escape,\
52 | .ace-dawn .ace_constant.ace_other {\
53 | color: #811F24\
54 | }\
55 | .ace-dawn .ace_invalid.ace_illegal {\
56 | text-decoration: underline;\
57 | font-style: italic;\
58 | color: #F8F8F8;\
59 | background-color: #B52A1D\
60 | }\
61 | .ace-dawn .ace_invalid.ace_deprecated {\
62 | text-decoration: underline;\
63 | font-style: italic;\
64 | color: #B52A1D\
65 | }\
66 | .ace-dawn .ace_support {\
67 | color: #691C97\
68 | }\
69 | .ace-dawn .ace_support.ace_constant {\
70 | color: #B4371F\
71 | }\
72 | .ace-dawn .ace_fold {\
73 | background-color: #794938;\
74 | border-color: #080808\
75 | }\
76 | .ace-dawn .ace_list,\
77 | .ace-dawn .ace_markup.ace_list,\
78 | .ace-dawn .ace_support.ace_function {\
79 | color: #693A17\
80 | }\
81 | .ace-dawn .ace_storage {\
82 | font-style: italic;\
83 | color: #A71D5D\
84 | }\
85 | .ace-dawn .ace_string {\
86 | color: #0B6125\
87 | }\
88 | .ace-dawn .ace_string.ace_regexp {\
89 | color: #CF5628\
90 | }\
91 | .ace-dawn .ace_comment {\
92 | font-style: italic;\
93 | color: #5A525F\
94 | }\
95 | .ace-dawn .ace_heading,\
96 | .ace-dawn .ace_markup.ace_heading {\
97 | color: #19356D\
98 | }\
99 | .ace-dawn .ace_variable {\
100 | color: #234A97\
101 | }\
102 | .ace-dawn .ace_indent-guide {\
103 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y\
104 | }";
105 |
106 | var dom = require("../lib/dom");
107 | dom.importCssString(exports.cssText, exports.cssClass);
108 | }); (function() {
109 | ace.require(["ace/theme/dawn"], function(m) {
110 | if (typeof module == "object" && typeof exports == "object" && module) {
111 | module.exports = m;
112 | }
113 | });
114 | })();
115 |
--------------------------------------------------------------------------------
/static/ace/theme-eclipse.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/eclipse",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 | "use strict";
3 |
4 | exports.isDark = false;
5 | exports.cssText = ".ace-eclipse .ace_gutter {\
6 | background: #ebebeb;\
7 | border-right: 1px solid rgb(159, 159, 159);\
8 | color: rgb(136, 136, 136);\
9 | }\
10 | .ace-eclipse .ace_print-margin {\
11 | width: 1px;\
12 | background: #ebebeb;\
13 | }\
14 | .ace-eclipse {\
15 | background-color: #FFFFFF;\
16 | color: black;\
17 | }\
18 | .ace-eclipse .ace_fold {\
19 | background-color: rgb(60, 76, 114);\
20 | }\
21 | .ace-eclipse .ace_cursor {\
22 | color: black;\
23 | }\
24 | .ace-eclipse .ace_storage,\
25 | .ace-eclipse .ace_keyword,\
26 | .ace-eclipse .ace_variable {\
27 | color: rgb(127, 0, 85);\
28 | }\
29 | .ace-eclipse .ace_constant.ace_buildin {\
30 | color: rgb(88, 72, 246);\
31 | }\
32 | .ace-eclipse .ace_constant.ace_library {\
33 | color: rgb(6, 150, 14);\
34 | }\
35 | .ace-eclipse .ace_function {\
36 | color: rgb(60, 76, 114);\
37 | }\
38 | .ace-eclipse .ace_string {\
39 | color: rgb(42, 0, 255);\
40 | }\
41 | .ace-eclipse .ace_comment {\
42 | color: rgb(113, 150, 130);\
43 | }\
44 | .ace-eclipse .ace_comment.ace_doc {\
45 | color: rgb(63, 95, 191);\
46 | }\
47 | .ace-eclipse .ace_comment.ace_doc.ace_tag {\
48 | color: rgb(127, 159, 191);\
49 | }\
50 | .ace-eclipse .ace_constant.ace_numeric {\
51 | color: darkblue;\
52 | }\
53 | .ace-eclipse .ace_tag {\
54 | color: rgb(25, 118, 116);\
55 | }\
56 | .ace-eclipse .ace_type {\
57 | color: rgb(127, 0, 127);\
58 | }\
59 | .ace-eclipse .ace_xml-pe {\
60 | color: rgb(104, 104, 91);\
61 | }\
62 | .ace-eclipse .ace_marker-layer .ace_selection {\
63 | background: rgb(181, 213, 255);\
64 | }\
65 | .ace-eclipse .ace_marker-layer .ace_bracket {\
66 | margin: -1px 0 0 -1px;\
67 | border: 1px solid rgb(192, 192, 192);\
68 | }\
69 | .ace-eclipse .ace_meta.ace_tag {\
70 | color:rgb(25, 118, 116);\
71 | }\
72 | .ace-eclipse .ace_invisible {\
73 | color: #ddd;\
74 | }\
75 | .ace-eclipse .ace_entity.ace_other.ace_attribute-name {\
76 | color:rgb(127, 0, 127);\
77 | }\
78 | .ace-eclipse .ace_marker-layer .ace_step {\
79 | background: rgb(255, 255, 0);\
80 | }\
81 | .ace-eclipse .ace_active-line {\
82 | background: rgb(232, 242, 254);\
83 | }\
84 | .ace-eclipse .ace_gutter-active-line {\
85 | background-color : #DADADA;\
86 | }\
87 | .ace-eclipse .ace_marker-layer .ace_selected-word {\
88 | border: 1px solid rgb(181, 213, 255);\
89 | }\
90 | .ace-eclipse .ace_indent-guide {\
91 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
92 | }";
93 |
94 | exports.cssClass = "ace-eclipse";
95 |
96 | var dom = require("../lib/dom");
97 | dom.importCssString(exports.cssText, exports.cssClass);
98 | }); (function() {
99 | ace.require(["ace/theme/eclipse"], function(m) {
100 | if (typeof module == "object" && typeof exports == "object" && module) {
101 | module.exports = m;
102 | }
103 | });
104 | })();
105 |
--------------------------------------------------------------------------------
/static/ace/theme-gob.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/gob",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-gob";
5 | exports.cssText = ".ace-gob .ace_gutter {\
6 | background: #0B1818;\
7 | color: #03EE03\
8 | }\
9 | .ace-gob .ace_print-margin {\
10 | width: 1px;\
11 | background: #131313\
12 | }\
13 | .ace-gob {\
14 | background-color: #0B0B0B;\
15 | color: #00FF00\
16 | }\
17 | .ace-gob .ace_cursor {\
18 | border-color: rgba(16, 248, 255, 0.90);\
19 | background-color: rgba(16, 240, 248, 0.70);\
20 | opacity: 0.4;\
21 | }\
22 | .ace-gob .ace_marker-layer .ace_selection {\
23 | background: rgba(221, 240, 255, 0.20)\
24 | }\
25 | .ace-gob.ace_multiselect .ace_selection.ace_start {\
26 | box-shadow: 0 0 3px 0px #141414;\
27 | }\
28 | .ace-gob .ace_marker-layer .ace_step {\
29 | background: rgb(16, 128, 0)\
30 | }\
31 | .ace-gob .ace_marker-layer .ace_bracket {\
32 | margin: -1px 0 0 -1px;\
33 | border: 1px solid rgba(64, 255, 255, 0.25)\
34 | }\
35 | .ace-gob .ace_marker-layer .ace_active-line {\
36 | background: rgba(255, 255, 255, 0.04)\
37 | }\
38 | .ace-gob .ace_gutter-active-line {\
39 | background-color: rgba(255, 255, 255, 0.04)\
40 | }\
41 | .ace-gob .ace_marker-layer .ace_selected-word {\
42 | border: 1px solid rgba(192, 240, 255, 0.20)\
43 | }\
44 | .ace-gob .ace_invisible {\
45 | color: rgba(255, 255, 255, 0.25)\
46 | }\
47 | .ace-gob .ace_keyword,\
48 | .ace-gob .ace_meta {\
49 | color: #10D8E8\
50 | }\
51 | .ace-gob .ace_constant,\
52 | .ace-gob .ace_constant.ace_character,\
53 | .ace-gob .ace_constant.ace_character.ace_escape,\
54 | .ace-gob .ace_constant.ace_other,\
55 | .ace-gob .ace_heading,\
56 | .ace-gob .ace_markup.ace_heading,\
57 | .ace-gob .ace_support.ace_constant {\
58 | color: #10F0A0\
59 | }\
60 | .ace-gob .ace_invalid.ace_illegal {\
61 | color: #F8F8F8;\
62 | background-color: rgba(86, 45, 86, 0.75)\
63 | }\
64 | .ace-gob .ace_invalid.ace_deprecated {\
65 | text-decoration: underline;\
66 | font-style: italic;\
67 | color: #20F8C0\
68 | }\
69 | .ace-gob .ace_support {\
70 | color: #20E8B0\
71 | }\
72 | .ace-gob .ace_fold {\
73 | background-color: #50B8B8;\
74 | border-color: #70F8F8\
75 | }\
76 | .ace-gob .ace_support.ace_function {\
77 | color: #00F800\
78 | }\
79 | .ace-gob .ace_list,\
80 | .ace-gob .ace_markup.ace_list,\
81 | .ace-gob .ace_storage {\
82 | color: #10FF98\
83 | }\
84 | .ace-gob .ace_entity.ace_name.ace_function,\
85 | .ace-gob .ace_meta.ace_tag,\
86 | .ace-gob .ace_variable {\
87 | color: #00F868\
88 | }\
89 | .ace-gob .ace_string {\
90 | color: #10F060\
91 | }\
92 | .ace-gob .ace_string.ace_regexp {\
93 | color: #20F090;\
94 | }\
95 | .ace-gob .ace_comment {\
96 | font-style: italic;\
97 | color: #00E060;\
98 | }\
99 | .ace-gob .ace_variable {\
100 | color: #00F888;\
101 | }\
102 | .ace-gob .ace_xml-pe {\
103 | color: #488858;\
104 | }\
105 | .ace-gob .ace_indent-guide {\
106 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\
107 | }\
108 | ";
109 |
110 | var dom = require("../lib/dom");
111 | dom.importCssString(exports.cssText, exports.cssClass);
112 | }); (function() {
113 | ace.require(["ace/theme/gob"], function(m) {
114 | if (typeof module == "object" && typeof exports == "object" && module) {
115 | module.exports = m;
116 | }
117 | });
118 | })();
119 |
--------------------------------------------------------------------------------
/static/ace/theme-kuroir.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/kuroir",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = false;
4 | exports.cssClass = "ace-kuroir";
5 | exports.cssText = "\
6 | .ace-kuroir .ace_gutter {\
7 | background: #e8e8e8;\
8 | color: #333;\
9 | }\
10 | .ace-kuroir .ace_print-margin {\
11 | width: 1px;\
12 | background: #e8e8e8;\
13 | }\
14 | .ace-kuroir {\
15 | background-color: #E8E9E8;\
16 | color: #363636;\
17 | }\
18 | .ace-kuroir .ace_cursor {\
19 | color: #202020;\
20 | }\
21 | .ace-kuroir .ace_marker-layer .ace_selection {\
22 | background: rgba(245, 170, 0, 0.57);\
23 | }\
24 | .ace-kuroir.ace_multiselect .ace_selection.ace_start {\
25 | box-shadow: 0 0 3px 0px #E8E9E8;\
26 | }\
27 | .ace-kuroir .ace_marker-layer .ace_step {\
28 | background: rgb(198, 219, 174);\
29 | }\
30 | .ace-kuroir .ace_marker-layer .ace_bracket {\
31 | margin: -1px 0 0 -1px;\
32 | border: 1px solid rgba(0, 0, 0, 0.29);\
33 | }\
34 | .ace-kuroir .ace_marker-layer .ace_active-line {\
35 | background: rgba(203, 220, 47, 0.22);\
36 | }\
37 | .ace-kuroir .ace_gutter-active-line {\
38 | background-color: rgba(203, 220, 47, 0.22);\
39 | }\
40 | .ace-kuroir .ace_marker-layer .ace_selected-word {\
41 | border: 1px solid rgba(245, 170, 0, 0.57);\
42 | }\
43 | .ace-kuroir .ace_invisible {\
44 | color: #BFBFBF\
45 | }\
46 | .ace-kuroir .ace_fold {\
47 | border-color: #363636;\
48 | }\
49 | .ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224;\
50 | background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline;\
51 | font-style:italic;\
52 | color:#FD1732;\
53 | background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;\
54 | background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);\
55 | background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;\
56 | background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}\
57 | ";
58 |
59 | var dom = require("../lib/dom");
60 | dom.importCssString(exports.cssText, exports.cssClass);
61 | }); (function() {
62 | ace.require(["ace/theme/kuroir"], function(m) {
63 | if (typeof module == "object" && typeof exports == "object" && module) {
64 | module.exports = m;
65 | }
66 | });
67 | })();
68 |
--------------------------------------------------------------------------------
/static/ace/theme-monokai.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-monokai";
5 | exports.cssText = ".ace-monokai .ace_gutter {\
6 | background: #2F3129;\
7 | color: #8F908A\
8 | }\
9 | .ace-monokai .ace_print-margin {\
10 | width: 1px;\
11 | background: #555651\
12 | }\
13 | .ace-monokai {\
14 | background-color: #272822;\
15 | color: #F8F8F2\
16 | }\
17 | .ace-monokai .ace_cursor {\
18 | color: #F8F8F0\
19 | }\
20 | .ace-monokai .ace_marker-layer .ace_selection {\
21 | background: #49483E\
22 | }\
23 | .ace-monokai.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #272822;\
25 | }\
26 | .ace-monokai .ace_marker-layer .ace_step {\
27 | background: rgb(102, 82, 0)\
28 | }\
29 | .ace-monokai .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid #49483E\
32 | }\
33 | .ace-monokai .ace_marker-layer .ace_active-line {\
34 | background: #202020\
35 | }\
36 | .ace-monokai .ace_gutter-active-line {\
37 | background-color: #272727\
38 | }\
39 | .ace-monokai .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid #49483E\
41 | }\
42 | .ace-monokai .ace_invisible {\
43 | color: #52524d\
44 | }\
45 | .ace-monokai .ace_entity.ace_name.ace_tag,\
46 | .ace-monokai .ace_keyword,\
47 | .ace-monokai .ace_meta.ace_tag,\
48 | .ace-monokai .ace_storage {\
49 | color: #F92672\
50 | }\
51 | .ace-monokai .ace_punctuation,\
52 | .ace-monokai .ace_punctuation.ace_tag {\
53 | color: #fff\
54 | }\
55 | .ace-monokai .ace_constant.ace_character,\
56 | .ace-monokai .ace_constant.ace_language,\
57 | .ace-monokai .ace_constant.ace_numeric,\
58 | .ace-monokai .ace_constant.ace_other {\
59 | color: #AE81FF\
60 | }\
61 | .ace-monokai .ace_invalid {\
62 | color: #F8F8F0;\
63 | background-color: #F92672\
64 | }\
65 | .ace-monokai .ace_invalid.ace_deprecated {\
66 | color: #F8F8F0;\
67 | background-color: #AE81FF\
68 | }\
69 | .ace-monokai .ace_support.ace_constant,\
70 | .ace-monokai .ace_support.ace_function {\
71 | color: #66D9EF\
72 | }\
73 | .ace-monokai .ace_fold {\
74 | background-color: #A6E22E;\
75 | border-color: #F8F8F2\
76 | }\
77 | .ace-monokai .ace_storage.ace_type,\
78 | .ace-monokai .ace_support.ace_class,\
79 | .ace-monokai .ace_support.ace_type {\
80 | font-style: italic;\
81 | color: #66D9EF\
82 | }\
83 | .ace-monokai .ace_entity.ace_name.ace_function,\
84 | .ace-monokai .ace_entity.ace_other,\
85 | .ace-monokai .ace_entity.ace_other.ace_attribute-name,\
86 | .ace-monokai .ace_variable {\
87 | color: #A6E22E\
88 | }\
89 | .ace-monokai .ace_variable.ace_parameter {\
90 | font-style: italic;\
91 | color: #FD971F\
92 | }\
93 | .ace-monokai .ace_string {\
94 | color: #E6DB74\
95 | }\
96 | .ace-monokai .ace_comment {\
97 | color: #75715E\
98 | }\
99 | .ace-monokai .ace_indent-guide {\
100 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y\
101 | }";
102 |
103 | var dom = require("../lib/dom");
104 | dom.importCssString(exports.cssText, exports.cssClass);
105 | }); (function() {
106 | ace.require(["ace/theme/monokai"], function(m) {
107 | if (typeof module == "object" && typeof exports == "object" && module) {
108 | module.exports = m;
109 | }
110 | });
111 | })();
112 |
--------------------------------------------------------------------------------
/static/ace/theme-solarized_dark.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-solarized-dark";
5 | exports.cssText = ".ace-solarized-dark .ace_gutter {\
6 | background: #01313f;\
7 | color: #d0edf7\
8 | }\
9 | .ace-solarized-dark .ace_print-margin {\
10 | width: 1px;\
11 | background: #33555E\
12 | }\
13 | .ace-solarized-dark {\
14 | background-color: #002B36;\
15 | color: #93A1A1\
16 | }\
17 | .ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,\
18 | .ace-solarized-dark .ace_storage {\
19 | color: #93A1A1\
20 | }\
21 | .ace-solarized-dark .ace_cursor,\
22 | .ace-solarized-dark .ace_string.ace_regexp {\
23 | color: #D30102\
24 | }\
25 | .ace-solarized-dark .ace_marker-layer .ace_active-line,\
26 | .ace-solarized-dark .ace_marker-layer .ace_selection {\
27 | background: rgba(255, 255, 255, 0.1)\
28 | }\
29 | .ace-solarized-dark.ace_multiselect .ace_selection.ace_start {\
30 | box-shadow: 0 0 3px 0px #002B36;\
31 | }\
32 | .ace-solarized-dark .ace_marker-layer .ace_step {\
33 | background: rgb(102, 82, 0)\
34 | }\
35 | .ace-solarized-dark .ace_marker-layer .ace_bracket {\
36 | margin: -1px 0 0 -1px;\
37 | border: 1px solid rgba(147, 161, 161, 0.50)\
38 | }\
39 | .ace-solarized-dark .ace_gutter-active-line {\
40 | background-color: #0d3440\
41 | }\
42 | .ace-solarized-dark .ace_marker-layer .ace_selected-word {\
43 | border: 1px solid #073642\
44 | }\
45 | .ace-solarized-dark .ace_invisible {\
46 | color: rgba(147, 161, 161, 0.50)\
47 | }\
48 | .ace-solarized-dark .ace_keyword,\
49 | .ace-solarized-dark .ace_meta,\
50 | .ace-solarized-dark .ace_support.ace_class,\
51 | .ace-solarized-dark .ace_support.ace_type {\
52 | color: #859900\
53 | }\
54 | .ace-solarized-dark .ace_constant.ace_character,\
55 | .ace-solarized-dark .ace_constant.ace_other {\
56 | color: #CB4B16\
57 | }\
58 | .ace-solarized-dark .ace_constant.ace_language {\
59 | color: #B58900\
60 | }\
61 | .ace-solarized-dark .ace_constant.ace_numeric {\
62 | color: #D33682\
63 | }\
64 | .ace-solarized-dark .ace_fold {\
65 | background-color: #268BD2;\
66 | border-color: #93A1A1\
67 | }\
68 | .ace-solarized-dark .ace_entity.ace_name.ace_function,\
69 | .ace-solarized-dark .ace_entity.ace_name.ace_tag,\
70 | .ace-solarized-dark .ace_support.ace_function,\
71 | .ace-solarized-dark .ace_variable,\
72 | .ace-solarized-dark .ace_variable.ace_language {\
73 | color: #268BD2\
74 | }\
75 | .ace-solarized-dark .ace_string {\
76 | color: #2AA198\
77 | }\
78 | .ace-solarized-dark .ace_comment {\
79 | font-style: italic;\
80 | color: #657B83\
81 | }\
82 | .ace-solarized-dark .ace_indent-guide {\
83 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y\
84 | }";
85 |
86 | var dom = require("../lib/dom");
87 | dom.importCssString(exports.cssText, exports.cssClass);
88 | }); (function() {
89 | ace.require(["ace/theme/solarized_dark"], function(m) {
90 | if (typeof module == "object" && typeof exports == "object" && module) {
91 | module.exports = m;
92 | }
93 | });
94 | })();
95 |
--------------------------------------------------------------------------------
/static/ace/theme-solarized_light.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = false;
4 | exports.cssClass = "ace-solarized-light";
5 | exports.cssText = ".ace-solarized-light .ace_gutter {\
6 | background: #fbf1d3;\
7 | color: #333\
8 | }\
9 | .ace-solarized-light .ace_print-margin {\
10 | width: 1px;\
11 | background: #e8e8e8\
12 | }\
13 | .ace-solarized-light {\
14 | background-color: #FDF6E3;\
15 | color: #586E75\
16 | }\
17 | .ace-solarized-light .ace_cursor {\
18 | color: #000000\
19 | }\
20 | .ace-solarized-light .ace_marker-layer .ace_selection {\
21 | background: rgba(7, 54, 67, 0.09)\
22 | }\
23 | .ace-solarized-light.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #FDF6E3;\
25 | }\
26 | .ace-solarized-light .ace_marker-layer .ace_step {\
27 | background: rgb(255, 255, 0)\
28 | }\
29 | .ace-solarized-light .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid rgba(147, 161, 161, 0.50)\
32 | }\
33 | .ace-solarized-light .ace_marker-layer .ace_active-line {\
34 | background: #EEE8D5\
35 | }\
36 | .ace-solarized-light .ace_gutter-active-line {\
37 | background-color : #EDE5C1\
38 | }\
39 | .ace-solarized-light .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid #7f9390\
41 | }\
42 | .ace-solarized-light .ace_invisible {\
43 | color: rgba(147, 161, 161, 0.50)\
44 | }\
45 | .ace-solarized-light .ace_keyword,\
46 | .ace-solarized-light .ace_meta,\
47 | .ace-solarized-light .ace_support.ace_class,\
48 | .ace-solarized-light .ace_support.ace_type {\
49 | color: #859900\
50 | }\
51 | .ace-solarized-light .ace_constant.ace_character,\
52 | .ace-solarized-light .ace_constant.ace_other {\
53 | color: #CB4B16\
54 | }\
55 | .ace-solarized-light .ace_constant.ace_language {\
56 | color: #B58900\
57 | }\
58 | .ace-solarized-light .ace_constant.ace_numeric {\
59 | color: #D33682\
60 | }\
61 | .ace-solarized-light .ace_fold {\
62 | background-color: #268BD2;\
63 | border-color: #586E75\
64 | }\
65 | .ace-solarized-light .ace_entity.ace_name.ace_function,\
66 | .ace-solarized-light .ace_entity.ace_name.ace_tag,\
67 | .ace-solarized-light .ace_support.ace_function,\
68 | .ace-solarized-light .ace_variable,\
69 | .ace-solarized-light .ace_variable.ace_language {\
70 | color: #268BD2\
71 | }\
72 | .ace-solarized-light .ace_storage {\
73 | color: #073642\
74 | }\
75 | .ace-solarized-light .ace_string {\
76 | color: #2AA198\
77 | }\
78 | .ace-solarized-light .ace_string.ace_regexp {\
79 | color: #D30102\
80 | }\
81 | .ace-solarized-light .ace_comment,\
82 | .ace-solarized-light .ace_entity.ace_other.ace_attribute-name {\
83 | color: #93A1A1\
84 | }\
85 | .ace-solarized-light .ace_indent-guide {\
86 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y\
87 | }";
88 |
89 | var dom = require("../lib/dom");
90 | dom.importCssString(exports.cssText, exports.cssClass);
91 | }); (function() {
92 | ace.require(["ace/theme/solarized_light"], function(m) {
93 | if (typeof module == "object" && typeof exports == "object" && module) {
94 | module.exports = m;
95 | }
96 | });
97 | })();
98 |
--------------------------------------------------------------------------------
/static/ace/theme-terminal.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/terminal",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-terminal-theme";
5 | exports.cssText = ".ace-terminal-theme .ace_gutter {\
6 | background: #1a0005;\
7 | color: steelblue\
8 | }\
9 | .ace-terminal-theme .ace_print-margin {\
10 | width: 1px;\
11 | background: #1a1a1a\
12 | }\
13 | .ace-terminal-theme {\
14 | background-color: black;\
15 | color: #DEDEDE\
16 | }\
17 | .ace-terminal-theme .ace_cursor {\
18 | color: #9F9F9F\
19 | }\
20 | .ace-terminal-theme .ace_marker-layer .ace_selection {\
21 | background: #424242\
22 | }\
23 | .ace-terminal-theme.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px black;\
25 | }\
26 | .ace-terminal-theme .ace_marker-layer .ace_step {\
27 | background: rgb(0, 0, 0)\
28 | }\
29 | .ace-terminal-theme .ace_marker-layer .ace_bracket {\
30 | background: #090;\
31 | }\
32 | .ace-terminal-theme .ace_marker-layer .ace_bracket-start {\
33 | background: #090;\
34 | }\
35 | .ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched {\
36 | margin: -1px 0 0 -1px;\
37 | border: 1px solid #900\
38 | }\
39 | .ace-terminal-theme .ace_marker-layer .ace_active-line {\
40 | background: #2A2A2A\
41 | }\
42 | .ace-terminal-theme .ace_gutter-active-line {\
43 | background-color: #2A112A\
44 | }\
45 | .ace-terminal-theme .ace_marker-layer .ace_selected-word {\
46 | border: 1px solid #424242\
47 | }\
48 | .ace-terminal-theme .ace_invisible {\
49 | color: #343434\
50 | }\
51 | .ace-terminal-theme .ace_keyword,\
52 | .ace-terminal-theme .ace_meta,\
53 | .ace-terminal-theme .ace_storage,\
54 | .ace-terminal-theme .ace_storage.ace_type,\
55 | .ace-terminal-theme .ace_support.ace_type {\
56 | color: tomato\
57 | }\
58 | .ace-terminal-theme .ace_keyword.ace_operator {\
59 | color: deeppink\
60 | }\
61 | .ace-terminal-theme .ace_constant.ace_character,\
62 | .ace-terminal-theme .ace_constant.ace_language,\
63 | .ace-terminal-theme .ace_constant.ace_numeric,\
64 | .ace-terminal-theme .ace_keyword.ace_other.ace_unit,\
65 | .ace-terminal-theme .ace_support.ace_constant,\
66 | .ace-terminal-theme .ace_variable.ace_parameter {\
67 | color: #E78C45\
68 | }\
69 | .ace-terminal-theme .ace_constant.ace_other {\
70 | color: gold\
71 | }\
72 | .ace-terminal-theme .ace_invalid {\
73 | color: yellow;\
74 | background-color: red\
75 | }\
76 | .ace-terminal-theme .ace_invalid.ace_deprecated {\
77 | color: #CED2CF;\
78 | background-color: #B798BF\
79 | }\
80 | .ace-terminal-theme .ace_fold {\
81 | background-color: #7AA6DA;\
82 | border-color: #DEDEDE\
83 | }\
84 | .ace-terminal-theme .ace_entity.ace_name.ace_function,\
85 | .ace-terminal-theme .ace_support.ace_function,\
86 | .ace-terminal-theme .ace_variable {\
87 | color: #7AA6DA\
88 | }\
89 | .ace-terminal-theme .ace_support.ace_class,\
90 | .ace-terminal-theme .ace_support.ace_type {\
91 | color: #E7C547\
92 | }\
93 | .ace-terminal-theme .ace_heading,\
94 | .ace-terminal-theme .ace_string {\
95 | color: #B9CA4A\
96 | }\
97 | .ace-terminal-theme .ace_entity.ace_name.ace_tag,\
98 | .ace-terminal-theme .ace_entity.ace_other.ace_attribute-name,\
99 | .ace-terminal-theme .ace_meta.ace_tag,\
100 | .ace-terminal-theme .ace_string.ace_regexp,\
101 | .ace-terminal-theme .ace_variable {\
102 | color: #D54E53\
103 | }\
104 | .ace-terminal-theme .ace_comment {\
105 | color: orangered\
106 | }\
107 | .ace-terminal-theme .ace_indent-guide {\
108 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y;\
109 | }\
110 | ";
111 |
112 | var dom = require("../lib/dom");
113 | dom.importCssString(exports.cssText, exports.cssClass);
114 | }); (function() {
115 | ace.require(["ace/theme/terminal"], function(m) {
116 | if (typeof module == "object" && typeof exports == "object" && module) {
117 | module.exports = m;
118 | }
119 | });
120 | })();
121 |
--------------------------------------------------------------------------------
/static/ace/theme-twilight.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/twilight",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-twilight";
5 | exports.cssText = ".ace-twilight .ace_gutter {\
6 | background: #232323;\
7 | color: #E2E2E2\
8 | }\
9 | .ace-twilight .ace_print-margin {\
10 | width: 1px;\
11 | background: #232323\
12 | }\
13 | .ace-twilight {\
14 | background-color: #141414;\
15 | color: #F8F8F8\
16 | }\
17 | .ace-twilight .ace_cursor {\
18 | color: #A7A7A7\
19 | }\
20 | .ace-twilight .ace_marker-layer .ace_selection {\
21 | background: rgba(221, 240, 255, 0.20)\
22 | }\
23 | .ace-twilight.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #141414;\
25 | }\
26 | .ace-twilight .ace_marker-layer .ace_step {\
27 | background: rgb(102, 82, 0)\
28 | }\
29 | .ace-twilight .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid rgba(255, 255, 255, 0.25)\
32 | }\
33 | .ace-twilight .ace_marker-layer .ace_active-line {\
34 | background: rgba(255, 255, 255, 0.031)\
35 | }\
36 | .ace-twilight .ace_gutter-active-line {\
37 | background-color: rgba(255, 255, 255, 0.031)\
38 | }\
39 | .ace-twilight .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid rgba(221, 240, 255, 0.20)\
41 | }\
42 | .ace-twilight .ace_invisible {\
43 | color: rgba(255, 255, 255, 0.25)\
44 | }\
45 | .ace-twilight .ace_keyword,\
46 | .ace-twilight .ace_meta {\
47 | color: #CDA869\
48 | }\
49 | .ace-twilight .ace_constant,\
50 | .ace-twilight .ace_constant.ace_character,\
51 | .ace-twilight .ace_constant.ace_character.ace_escape,\
52 | .ace-twilight .ace_constant.ace_other,\
53 | .ace-twilight .ace_heading,\
54 | .ace-twilight .ace_markup.ace_heading,\
55 | .ace-twilight .ace_support.ace_constant {\
56 | color: #CF6A4C\
57 | }\
58 | .ace-twilight .ace_invalid.ace_illegal {\
59 | color: #F8F8F8;\
60 | background-color: rgba(86, 45, 86, 0.75)\
61 | }\
62 | .ace-twilight .ace_invalid.ace_deprecated {\
63 | text-decoration: underline;\
64 | font-style: italic;\
65 | color: #D2A8A1\
66 | }\
67 | .ace-twilight .ace_support {\
68 | color: #9B859D\
69 | }\
70 | .ace-twilight .ace_fold {\
71 | background-color: #AC885B;\
72 | border-color: #F8F8F8\
73 | }\
74 | .ace-twilight .ace_support.ace_function {\
75 | color: #DAD085\
76 | }\
77 | .ace-twilight .ace_list,\
78 | .ace-twilight .ace_markup.ace_list,\
79 | .ace-twilight .ace_storage {\
80 | color: #F9EE98\
81 | }\
82 | .ace-twilight .ace_entity.ace_name.ace_function,\
83 | .ace-twilight .ace_meta.ace_tag,\
84 | .ace-twilight .ace_variable {\
85 | color: #AC885B\
86 | }\
87 | .ace-twilight .ace_string {\
88 | color: #8F9D6A\
89 | }\
90 | .ace-twilight .ace_string.ace_regexp {\
91 | color: #E9C062\
92 | }\
93 | .ace-twilight .ace_comment {\
94 | font-style: italic;\
95 | color: #5F5A60\
96 | }\
97 | .ace-twilight .ace_variable {\
98 | color: #7587A6\
99 | }\
100 | .ace-twilight .ace_xml-pe {\
101 | color: #494949\
102 | }\
103 | .ace-twilight .ace_indent-guide {\
104 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\
105 | }";
106 |
107 | var dom = require("../lib/dom");
108 | dom.importCssString(exports.cssText, exports.cssClass);
109 | }); (function() {
110 | ace.require(["ace/theme/twilight"], function(m) {
111 | if (typeof module == "object" && typeof exports == "object" && module) {
112 | module.exports = m;
113 | }
114 | });
115 | })();
116 |
--------------------------------------------------------------------------------
/static/ace/theme-vibrant_ink.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/vibrant_ink",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-vibrant-ink";
5 | exports.cssText = ".ace-vibrant-ink .ace_gutter {\
6 | background: #1a1a1a;\
7 | color: #BEBEBE\
8 | }\
9 | .ace-vibrant-ink .ace_print-margin {\
10 | width: 1px;\
11 | background: #1a1a1a\
12 | }\
13 | .ace-vibrant-ink {\
14 | background-color: #0F0F0F;\
15 | color: #FFFFFF\
16 | }\
17 | .ace-vibrant-ink .ace_cursor {\
18 | color: #FFFFFF\
19 | }\
20 | .ace-vibrant-ink .ace_marker-layer .ace_selection {\
21 | background: #6699CC\
22 | }\
23 | .ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #0F0F0F;\
25 | }\
26 | .ace-vibrant-ink .ace_marker-layer .ace_step {\
27 | background: rgb(102, 82, 0)\
28 | }\
29 | .ace-vibrant-ink .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid #404040\
32 | }\
33 | .ace-vibrant-ink .ace_marker-layer .ace_active-line {\
34 | background: #333333\
35 | }\
36 | .ace-vibrant-ink .ace_gutter-active-line {\
37 | background-color: #333333\
38 | }\
39 | .ace-vibrant-ink .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid #6699CC\
41 | }\
42 | .ace-vibrant-ink .ace_invisible {\
43 | color: #404040\
44 | }\
45 | .ace-vibrant-ink .ace_keyword,\
46 | .ace-vibrant-ink .ace_meta {\
47 | color: #FF6600\
48 | }\
49 | .ace-vibrant-ink .ace_constant,\
50 | .ace-vibrant-ink .ace_constant.ace_character,\
51 | .ace-vibrant-ink .ace_constant.ace_character.ace_escape,\
52 | .ace-vibrant-ink .ace_constant.ace_other {\
53 | color: #339999\
54 | }\
55 | .ace-vibrant-ink .ace_constant.ace_numeric {\
56 | color: #99CC99\
57 | }\
58 | .ace-vibrant-ink .ace_invalid,\
59 | .ace-vibrant-ink .ace_invalid.ace_deprecated {\
60 | color: #CCFF33;\
61 | background-color: #000000\
62 | }\
63 | .ace-vibrant-ink .ace_fold {\
64 | background-color: #FFCC00;\
65 | border-color: #FFFFFF\
66 | }\
67 | .ace-vibrant-ink .ace_entity.ace_name.ace_function,\
68 | .ace-vibrant-ink .ace_support.ace_function,\
69 | .ace-vibrant-ink .ace_variable {\
70 | color: #FFCC00\
71 | }\
72 | .ace-vibrant-ink .ace_variable.ace_parameter {\
73 | font-style: italic\
74 | }\
75 | .ace-vibrant-ink .ace_string {\
76 | color: #66FF00\
77 | }\
78 | .ace-vibrant-ink .ace_string.ace_regexp {\
79 | color: #44B4CC\
80 | }\
81 | .ace-vibrant-ink .ace_comment {\
82 | color: #9933CC\
83 | }\
84 | .ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {\
85 | font-style: italic;\
86 | color: #99CC99\
87 | }\
88 | .ace-vibrant-ink .ace_indent-guide {\
89 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y\
90 | }";
91 |
92 | var dom = require("../lib/dom");
93 | dom.importCssString(exports.cssText, exports.cssClass);
94 | }); (function() {
95 | ace.require(["ace/theme/vibrant_ink"], function(m) {
96 | if (typeof module == "object" && typeof exports == "object" && module) {
97 | module.exports = m;
98 | }
99 | });
100 | })();
101 |
--------------------------------------------------------------------------------
/static/ace/theme-xcode.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = false;
4 | exports.cssClass = "ace-xcode";
5 | exports.cssText = "\
6 | .ace-xcode .ace_gutter {\
7 | background: #e8e8e8;\
8 | color: #333\
9 | }\
10 | .ace-xcode .ace_print-margin {\
11 | width: 1px;\
12 | background: #e8e8e8\
13 | }\
14 | .ace-xcode {\
15 | background-color: #FFFFFF;\
16 | color: #000000\
17 | }\
18 | .ace-xcode .ace_cursor {\
19 | color: #000000\
20 | }\
21 | .ace-xcode .ace_marker-layer .ace_selection {\
22 | background: #B5D5FF\
23 | }\
24 | .ace-xcode.ace_multiselect .ace_selection.ace_start {\
25 | box-shadow: 0 0 3px 0px #FFFFFF;\
26 | }\
27 | .ace-xcode .ace_marker-layer .ace_step {\
28 | background: rgb(198, 219, 174)\
29 | }\
30 | .ace-xcode .ace_marker-layer .ace_bracket {\
31 | margin: -1px 0 0 -1px;\
32 | border: 1px solid #BFBFBF\
33 | }\
34 | .ace-xcode .ace_marker-layer .ace_active-line {\
35 | background: rgba(0, 0, 0, 0.071)\
36 | }\
37 | .ace-xcode .ace_gutter-active-line {\
38 | background-color: rgba(0, 0, 0, 0.071)\
39 | }\
40 | .ace-xcode .ace_marker-layer .ace_selected-word {\
41 | border: 1px solid #B5D5FF\
42 | }\
43 | .ace-xcode .ace_constant.ace_language,\
44 | .ace-xcode .ace_keyword,\
45 | .ace-xcode .ace_meta,\
46 | .ace-xcode .ace_variable.ace_language {\
47 | color: #C800A4\
48 | }\
49 | .ace-xcode .ace_invisible {\
50 | color: #BFBFBF\
51 | }\
52 | .ace-xcode .ace_constant.ace_character,\
53 | .ace-xcode .ace_constant.ace_other {\
54 | color: #275A5E\
55 | }\
56 | .ace-xcode .ace_constant.ace_numeric {\
57 | color: #3A00DC\
58 | }\
59 | .ace-xcode .ace_entity.ace_other.ace_attribute-name,\
60 | .ace-xcode .ace_support.ace_constant,\
61 | .ace-xcode .ace_support.ace_function {\
62 | color: #450084\
63 | }\
64 | .ace-xcode .ace_fold {\
65 | background-color: #C800A4;\
66 | border-color: #000000\
67 | }\
68 | .ace-xcode .ace_entity.ace_name.ace_tag,\
69 | .ace-xcode .ace_support.ace_class,\
70 | .ace-xcode .ace_support.ace_type {\
71 | color: #790EAD\
72 | }\
73 | .ace-xcode .ace_storage {\
74 | color: #C900A4\
75 | }\
76 | .ace-xcode .ace_string {\
77 | color: #DF0002\
78 | }\
79 | .ace-xcode .ace_comment {\
80 | color: #008E00\
81 | }\
82 | .ace-xcode .ace_indent-guide {\
83 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y\
84 | }";
85 |
86 | var dom = require("../lib/dom");
87 | dom.importCssString(exports.cssText, exports.cssClass);
88 | }); (function() {
89 | ace.require(["ace/theme/xcode"], function(m) {
90 | if (typeof module == "object" && typeof exports == "object" && module) {
91 | module.exports = m;
92 | }
93 | });
94 | })();
95 |
--------------------------------------------------------------------------------
/static/css/main.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #00C9FF !important;
3 | background: -webkit-linear-gradient(to right, #92FE9D, #00C9FF) !important;
4 | background: linear-gradient(to right, #92FE9D, #00C9FF) !important;
5 | }
6 |
7 | .block_class{
8 | margin-top: 10px !important;
9 | margin-left: 25px !important;
10 | margin-right: 25px !important;
11 | }
12 |
13 | .description_class{
14 | text-align: left !important;
15 | width: 40% !important;
16 | }
17 |
18 | #page-container {
19 | position: relative;
20 | min-height: 100vh;
21 | overflow: auto;
22 | }
23 |
24 | #content-wrap {
25 | padding-bottom: 12.5rem; /* Footer height */
26 | }
27 |
28 | #footer {
29 | position: absolute;
30 | bottom: 0;
31 | width: 100%;
32 | height: 12.5rem; /* Footer height */
33 | color: #C0C0C0;
34 | background-color: black;
35 | }
--------------------------------------------------------------------------------
/static/fonts/Gistesy.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/fonts/Gistesy.ttf
--------------------------------------------------------------------------------
/static/images/AC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/AC.png
--------------------------------------------------------------------------------
/static/images/CE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/CE.png
--------------------------------------------------------------------------------
/static/images/GeekJudge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/GeekJudge.png
--------------------------------------------------------------------------------
/static/images/RajatSingh08.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/RajatSingh08.jpg
--------------------------------------------------------------------------------
/static/images/RajatSingh08_SVXp0yM.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/RajatSingh08_SVXp0yM.jpg
--------------------------------------------------------------------------------
/static/images/TLE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/TLE.png
--------------------------------------------------------------------------------
/static/images/WA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/WA.png
--------------------------------------------------------------------------------
/static/images/defaultpic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/defaultpic.png
--------------------------------------------------------------------------------
/static/images/email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/email.png
--------------------------------------------------------------------------------
/static/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/favicon.ico
--------------------------------------------------------------------------------
/static/images/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/github.png
--------------------------------------------------------------------------------
/static/images/instagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/instagram.png
--------------------------------------------------------------------------------
/static/images/linkedIn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/linkedIn.png
--------------------------------------------------------------------------------
/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/logo.png
--------------------------------------------------------------------------------
/static/images/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RajatSingh08/geekjudge/9050127c66008bf7a82fa8c7836004ac97b18084/static/images/twitter.png
--------------------------------------------------------------------------------
/static/javascript/editor.js:
--------------------------------------------------------------------------------
1 | // Hook up ACE editor to all textareas with data-editor attribute
2 | $(function create_editor() {
3 | $('textarea[data-editor]').each(function () {
4 | var textarea = $(this);
5 | var theme = textarea.data('editor');
6 | var editDiv = $('', {
7 | position: 'absolute',
8 | width: textarea.width(),
9 | height: textarea.height(),
10 | 'class': textarea.attr('class'),
11 | 'id':'custom-editor'
12 | }).insertBefore(textarea);
13 |
14 | textarea.css('display', 'none'); // to avoid extra space below textarea
15 | ace.require("ace/ext/language_tools"); // language tools: brackets, tabs, indentations, etc
16 | var editor = ace.edit(editDiv[0]);
17 |
18 | var editor_mode = 'c_cpp';
19 |
20 | editor.setOptions({
21 | enableBasicAutocompletion: true,
22 | enableSnippets: true,
23 | enableLiveAutocompletion: true,
24 | showGutter: true,
25 | showLineNumbers: true,
26 | fontSize: 17,
27 | theme: 'ace/theme/' + theme,
28 | mode: 'ace/mode/' + editor_mode,
29 | showPrintMargin: false,
30 | });
31 |
32 | editor.session.setValue(textarea.val());
33 |
34 | textarea.closest('form').submit(function () {
35 | textarea.val(editor.getSession().getValue());
36 | })
37 | });
38 | });
39 |
40 | // Hook up ACE editor to all textareas with data-editor attribute
41 | function update_editor() {
42 | var editDiv = $("#custom-editor");
43 | var editor = ace.edit(editDiv[0]);
44 | var editor_mode = 'c_cpp'
45 | var editor_option = $("#language").val();
46 | if(editor_option == 'C' || editor_option == 'C++') editor_mode = 'c_cpp';
47 | if(editor_option == 'Java') editor_mode = 'java';
48 | if(editor_option == 'Python2' || editor_option == 'Python3') editor_mode = 'python';
49 |
50 | editor.setOptions({
51 | mode: 'ace/mode/' + editor_mode,
52 | });
53 | }
54 |
55 | // Hook up ACE editor to all textareas with data-editor attribute
56 | function update_theme() {
57 | var editDiv = $("#custom-editor");
58 | var editor = ace.edit(editDiv[0]);
59 | var theme = $("#theme").val();
60 |
61 | editor.setOptions({
62 | theme: 'ace/theme/' + theme,
63 | });
64 | }
--------------------------------------------------------------------------------
/static/javascript/sort.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function () {
2 | $('#problem_list').DataTable();
3 | });
4 |
5 | $(document).ready(function () {
6 | $('#course_list').DataTable({
7 | ordering: false,
8 | });
9 | });
10 |
11 | $(document).ready(function () {
12 | $('#assignment_list').DataTable({
13 | ordering: false,
14 | });
15 | });
16 |
17 | $(document).ready(function () {
18 | $('#submission_list').DataTable({
19 | ordering: false,
20 | });
21 | });
22 |
23 | $(document).ready(function () {
24 | $('#leaderboard_list').DataTable({
25 | ordering: false,
26 | "searching": false
27 | });
28 | });
29 |
--------------------------------------------------------------------------------