Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
9f215d76
Commit
9f215d76
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Add socketio javascript
parent
a4440725
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/main/views.py
+8
-4
8 additions, 4 deletions
app/main/views.py
app/static/js/socket.io.js
+9
-0
9 additions, 0 deletions
app/static/js/socket.io.js
app/templates/base.html.j2
+7
-0
7 additions, 0 deletions
app/templates/base.html.j2
with
24 additions
and
4 deletions
app/main/views.py
+
8
−
4
View file @
9f215d76
from
flask
import
(
abort
,
current_app
,
flash
,
redirect
,
request
,
render_template
,
url_for
,
send_from_directory
)
from
flask_login
import
current_user
,
login_required
from
..models
import
Corpus
,
User
from
..tables
import
AdminUserTable
,
AdminUserItem
from
.
import
main
from
.forms
import
CreateCorpusForm
from
..
decorators
import
admin_required
from
..
import
db
from
..
import
db
,
socketio
from
..
models
import
Corpus
import
os
...
...
@@ -15,6 +13,12 @@ def index():
return
render_template
(
'
main/index.html.j2
'
,
title
=
'
Opaque
'
)
@socketio.on
(
'
my event
'
)
@login_required
def
handle_message
(
message
):
print
(
'
received message:
'
+
str
(
message
))
@main.route
(
'
/corpora/<int:corpus_id>
'
)
@login_required
def
corpus
(
corpus_id
):
...
...
This diff is collapsed.
Click to expand it.
app/static/js/socket.io.js
0 → 100644
+
9
−
0
View file @
9f215d76
This diff is collapsed.
Click to expand it.
app/templates/base.html.j2
+
7
−
0
View file @
9f215d76
...
...
@@ -27,6 +27,13 @@
<script
src=
"{{ url_for('static', filename='js/jsondiffpatch.umd.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/polls.js') }}"
></script>
{% endif %}
<script
src=
"{{ url_for('static', filename='js/socket.io.js') }}"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
>
var
socket
=
io
();
socket
.
on
(
'
connect
'
,
function
()
{
socket
.
emit
(
'
my event
'
,
{
data
:
'
I
\'
m connected!
'
});
});
</script>
<script
src=
"{{ url_for('static', filename='js/list.min.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/utils.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/CorpusList.js') }}"
></script>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment