Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
d355a43f
Commit
d355a43f
authored
May 15, 2013
by
Ujvari Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error field for invalid searchbar expressions
parent
e7c22922
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
common.scss
h/css/common.scss
+4
-0
streamer.coffee
h/js/streamer.coffee
+10
-7
No files found.
h/css/common.scss
View file @
d355a43f
...
...
@@ -919,6 +919,10 @@ blockquote {
width
:
0em
;
}
.searchbar-error
{
color
:
red
;
}
pre
{
outline
:
1px
solid
#ccc
;
padding
:
5px
;
margin
:
5px
;
}
.string
{
color
:
green
;
}
.number
{
color
:
darkorange
;
}
...
...
h/js/streamer.coffee
View file @
d355a43f
...
...
@@ -30,6 +30,7 @@ class Streamer
$scope
.
streaming
=
false
$scope
.
annotations
=
[]
$scope
.
bads
=
[]
$scope
.
matchPolicy
=
'exclude_any'
$scope
.
action
=
...
...
@@ -58,10 +59,13 @@ class Streamer
$scope
.
start_streaming
=
->
if
$scope
.
streaming
$scope
.
sock
.
close
$scope
.
sock
.
close
()
$scope
.
streaming
=
false
$scope
.
json_content
=
syntaxHighlight
$scope
.
generate_json
()
unless
$scope
.
bads
.
length
is
0
return
transports
=
[
'xhr-streaming'
,
'iframe-eventsource'
,
'iframe-htmlfile'
,
'xhr-polling'
,
'iframe-xhr-polling'
,
'jsonp-polling'
]
$scope
.
sock
=
new
SockJS
(
window
.
location
.
protocol
+
'//'
+
window
.
location
.
hostname
+
':'
+
window
.
location
.
port
+
'/__streamer__'
,
transports
)
...
...
@@ -85,11 +89,11 @@ class Streamer
$scope
.
annotations
.
splice
0
,
0
,
annotation
$scope
.
stop_streaming
=
->
$scope
.
sock
.
close
$scope
.
sock
.
close
()
$scope
.
streaming
=
false
$scope
.
parse_clauses
=
->
bads
=
[]
$scope
.
bads
=
[]
structure
=
[]
unless
$scope
.
clauses
return
...
...
@@ -101,11 +105,11 @@ class Streamer
parts
=
clause
.
split
/:(.+)/
unless
parts
.
length
>
1
bads
.
push
[
clause
,
'Filter clause is not well separated'
]
$scope
.
bads
.
push
[
clause
,
'Filter clause is not well separated'
]
continue
unless
parts
[
0
]
in
$scope
.
filter_fields
bads
.
push
[
clause
,
'Unknown filter field'
]
$scope
.
bads
.
push
[
clause
,
'Unknown filter field'
]
continue
field
=
parts
[
0
]
...
...
@@ -121,14 +125,13 @@ class Streamer
break
unless
operator_found
bads
.
push
[
clause
,
'Unknown operator'
]
$scope
.
bads
.
push
[
clause
,
'Unknown operator'
]
continue
structure
.
push
'field'
:
'/'
+
field
'operator'
:
oper
'value'
:
value
structure
$scope
.
show_sidebar_json
=
->
...
...
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