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
1e025a1b
Commit
1e025a1b
authored
Jul 23, 2014
by
Ujvari Gergely
Committed by
gergely-ujvari
Jul 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide viewState when not needed, kill not used code
parent
5cb065a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
23 deletions
+14
-23
controllers.coffee
h/static/scripts/controllers.coffee
+8
-11
directives.coffee
h/static/scripts/directives.coffee
+6
-4
streamsearch.coffee
h/static/scripts/streamsearch.coffee
+0
-8
No files found.
h/static/scripts/controllers.coffee
View file @
1e025a1b
...
...
@@ -5,13 +5,6 @@ imports = [
'h.searchfilters'
]
SEARCH_FACETS
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'since'
,
'user'
,
'results'
]
SEARCH_VALUES
=
group
:
[
'Public'
,
'Private'
],
since
:
[
'5 min'
,
'30 min'
,
'1 hour'
,
'12 hours'
,
'1 day'
,
'1 week'
,
'1 month'
,
'1 year'
]
class
App
scope
:
frame
:
...
...
@@ -47,8 +40,6 @@ class App
socialView
:
annotator
.
socialView
ongoingHighlightSwitch
:
false
search
:
facets
:
SEARCH_FACETS
values
:
SEARCH_VALUES
query
:
$location
.
search
()
show
:
not
angular
.
equals
(
$location
.
search
(),
{})
session
:
session
...
...
@@ -229,8 +220,6 @@ class App
$rootScope
.
applySort
"Location"
$scope
.
query
=
$location
.
search
()
$scope
.
searchFacets
=
SEARCH_FACETS
$scope
.
searchValues
=
SEARCH_VALUES
$scope
.
search
=
{}
$scope
.
search
.
update
=
angular
.
noop
...
...
@@ -241,6 +230,14 @@ class App
$rootScope
.
$on
'$routeChangeSuccess'
,
(
event
,
next
,
current
)
->
unless
next
.
$
$route
?
then
return
$scope
.
search
.
query
=
$location
.
search
()
$scope
.
search
.
show
=
not
angular
.
equals
(
$location
.
search
(),
{})
if
next
.
$
$route
.
originalPath
is
'/viewer'
$rootScope
.
viewState
.
show
=
true
else
$rootScope
.
viewState
.
show
=
false
unless
next
.
$
$route
.
originalPath
is
'/stream'
if
current
and
next
.
$
$route
.
originalPath
is
'/a/:id'
$scope
.
reloadAnnotations
()
...
...
h/static/scripts/directives.coffee
View file @
1e025a1b
...
...
@@ -400,19 +400,21 @@ fuzzytime = ['$filter', '$window', ($filter, $window) ->
simpleSearch
=
[
'$parse'
,
(
$parse
)
->
link
:
(
scope
,
elem
,
attr
,
ctrl
)
->
_search
=
$parse
(
attr
.
onsearch
)
_clear
=
$parse
(
attr
.
onclear
)
scope
.
dosearch
=
->
#_search(scope.generateSearchResults())
scope
.
search
.
update
(
scope
.
searchtext
)
_search
(
scope
,
{
"this"
:
scope
.
searchtext
})
scope
.
reset
=
(
event
)
->
event
.
preventDefault
()
scope
.
searchtext
=
''
scope
.
search
.
clear
()
_clear
(
scope
)
if
attr
.
onclear
scope
.
$watch
attr
.
query
,
(
query
)
->
if
query
.
query
?
scope
.
searchtext
=
query
.
query
scope
.
search
.
update
(
scope
.
searchtext
)
_search
(
scope
,
{
"this"
:
scope
.
searchtext
}
)
restrict
:
'C'
template
:
'''
...
...
h/static/scripts/streamsearch.coffee
View file @
1e025a1b
...
...
@@ -9,12 +9,6 @@ imports = [
'h.searchfilters'
]
SEARCH_FACETS
=
[
'text'
,
'tags'
,
'uri'
,
'quote'
,
'since'
,
'user'
,
'results'
]
SEARCH_VALUES
=
group
:
[
'Public'
,
'Private'
],
since
:
[
'5 min'
,
'30 min'
,
'1 hour'
,
'12 hours'
,
'1 day'
,
'1 week'
,
'1 month'
,
'1 year'
]
class
StreamSearch
this
.
inject
=
[
'$location'
,
'$scope'
,
'$rootScope'
,
...
...
@@ -66,6 +60,4 @@ class StreamSearch
angular
.
module
(
'h.streamsearch'
,
imports
,
configure
)
.
constant
(
'searchFacets'
,
SEARCH_FACETS
)
.
constant
(
'searchValues'
,
SEARCH_VALUES
)
.
controller
(
'StreamSearchController'
,
StreamSearch
)
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