Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
74ee07ea
Commit
74ee07ea
authored
Feb 14, 2012
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small change on layout and escaping CRLF on text
parent
e7c45f9e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
chat.html
misc/examples/chat.html
+7
-4
chat_longpolling.html
misc/examples/chat_longpolling.html
+7
-4
No files found.
misc/examples/chat.html
View file @
74ee07ea
...
...
@@ -4,12 +4,15 @@
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<title>
Chat - Push Stream Module Example
</title>
<style
type=
"text/css"
>
form
p
{
min-height
:
20px
;}
</style>
</head>
<body>
<form
action=
"/pub"
method=
"POST"
>
<p>
<span
style=
"display: block; float: left; width: 55px;"
>
mode:
</span>
<span
id=
"mode"
style=
"display:none;"
></span>
<span
id=
"mode"
></span>
</p>
<p>
<span
style=
"display: block; float: left; width: 55px;"
>
satus:
</span>
...
...
@@ -77,11 +80,11 @@
if
(
state
==
PushStream
.
OPEN
)
{
$
(
"
.offline
"
).
hide
();
$
(
"
.online
"
).
show
();
$
(
"
#mode
"
).
html
(
pushstream
.
wrapper
.
type
)
.
show
()
;
$
(
"
#mode
"
).
html
(
pushstream
.
wrapper
.
type
);
}
else
{
$
(
"
.offline
"
).
show
();
$
(
"
.online
"
).
hide
();
$
(
"
#mode
"
).
html
(
""
)
.
hide
()
;
$
(
"
#mode
"
).
html
(
""
);
}
};
...
...
@@ -97,7 +100,7 @@
$
(
"
#sendButton
"
).
click
(
function
(){
if
((
$
(
"
#nick
"
).
val
()
!=
""
)
&&
(
$
(
"
#message
"
).
val
()
!=
""
)
&&
(
$
(
"
#room
"
).
val
()
!=
""
))
{
pushstream
.
sendMessage
(
'
{"nick":"
'
+
$
(
"
#nick
"
).
val
()
+
'
", "text":"
'
+
$
(
"
#message
"
).
val
()
+
'
"}
'
,
onSendText
);
pushstream
.
sendMessage
(
'
{"nick":"
'
+
$
(
"
#nick
"
).
val
()
+
'
", "text":"
'
+
$
(
"
#message
"
).
val
()
.
replace
(
/
\r
/g
,
'
\\\\
r
'
).
replace
(
/
\n
/g
,
'
\\\\
n
'
)
+
'
"}
'
,
onSendText
);
}
else
{
alert
(
"
nick, room and text are required
"
);
}
...
...
misc/examples/chat_longpolling.html
View file @
74ee07ea
...
...
@@ -4,12 +4,15 @@
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<title>
Chat Long Polling - Push Stream Module Example
</title>
<style
type=
"text/css"
>
form
p
{
min-height
:
20px
;}
</style>
</head>
<body>
<form
action=
"/pub"
method=
"POST"
>
<p>
<span
style=
"display: block; float: left; width: 55px;"
>
mode:
</span>
<span
id=
"mode"
style=
"display:none;"
></span>
<span
id=
"mode"
></span>
</p>
<p>
<span
style=
"display: block; float: left; width: 55px;"
>
satus:
</span>
...
...
@@ -77,11 +80,11 @@
if
(
state
==
PushStream
.
OPEN
)
{
$
(
"
.offline
"
).
hide
();
$
(
"
.online
"
).
show
();
$
(
"
#mode
"
).
html
(
pushstream
.
wrapper
.
type
)
.
show
()
;
$
(
"
#mode
"
).
html
(
pushstream
.
wrapper
.
type
);
}
else
{
$
(
"
.offline
"
).
show
();
$
(
"
.online
"
).
hide
();
$
(
"
#mode
"
).
html
(
""
)
.
hide
()
;
$
(
"
#mode
"
).
html
(
""
);
}
};
...
...
@@ -97,7 +100,7 @@
$
(
"
#sendButton
"
).
click
(
function
(){
if
((
$
(
"
#nick
"
).
val
()
!=
""
)
&&
(
$
(
"
#message
"
).
val
()
!=
""
)
&&
(
$
(
"
#room
"
).
val
()
!=
""
))
{
pushstream
.
sendMessage
(
'
{"nick":"
'
+
$
(
"
#nick
"
).
val
()
+
'
", "text":"
'
+
$
(
"
#message
"
).
val
()
+
'
"}
'
,
onSendText
);
pushstream
.
sendMessage
(
'
{"nick":"
'
+
$
(
"
#nick
"
).
val
()
+
'
", "text":"
'
+
$
(
"
#message
"
).
val
()
.
replace
(
/
\r
/g
,
'
\\\\
r
'
).
replace
(
/
\n
/g
,
'
\\\\
n
'
)
+
'
"}
'
,
onSendText
);
}
else
{
alert
(
"
nick, room and text are required
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment