Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Cloogle
cloogle.org
Commits
2b5da708
Verified
Commit
2b5da708
authored
Nov 13, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Searching for "instance X" now returns class results with all information unfolded (resolves
#216
)
parent
cd182f61
Pipeline
#16327
passed with stage
in 15 minutes and 53 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
frontend/api.js
frontend/api.js
+9
-11
frontend/api.php
frontend/api.php
+2
-0
frontend/common.js
frontend/common.js
+2
-2
frontend/index.php
frontend/index.php
+2
-2
No files found.
frontend/api.js
View file @
2b5da708
...
@@ -16,6 +16,7 @@ var old_libs = null;
...
@@ -16,6 +16,7 @@ var old_libs = null;
var
old_include_builtins
=
-
1
;
var
old_include_builtins
=
-
1
;
var
old_include_core
=
-
1
;
var
old_include_core
=
-
1
;
var
old_include_apps
=
-
1
;
var
old_include_apps
=
-
1
;
var
unfold_more_information
=
false
;
// https://stackoverflow.com/a/4812022/1544337
// https://stackoverflow.com/a/4812022/1544337
Element
.
prototype
.
getCaretPosition
=
function
()
{
Element
.
prototype
.
getCaretPosition
=
function
()
{
...
@@ -752,6 +753,13 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
...
@@ -752,6 +753,13 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
responsedata
[
'
suggestions
'
].
length
>
0
)
{
responsedata
[
'
suggestions
'
].
length
>
0
)
{
par
.
insertBefore
(
makeSuggestions
(
responsedata
[
'
suggestions
'
]),
par
.
firstChild
);
par
.
insertBefore
(
makeSuggestions
(
responsedata
[
'
suggestions
'
]),
par
.
firstChild
);
}
}
if
(
unfold_more_information
)
{
var
togglers
=
elem
.
getElementsByClassName
(
'
toggler
'
);
for
(
var
i
=
0
;
i
<
togglers
.
length
;
i
++
)
toggle
(
togglers
[
i
],
true
);
unfold_more_information
=
false
;
}
}
}
};
};
...
@@ -814,17 +822,7 @@ function formsubmit() {
...
@@ -814,17 +822,7 @@ function formsubmit() {
return
;
return
;
}
}
}
else
if
(
q
.
indexOf
(
'
instance
'
)
==
0
)
{
}
else
if
(
q
.
indexOf
(
'
instance
'
)
==
0
)
{
var
qname
=
q
.
substr
(
9
);
unfold_more_information
=
true
;
var
sug
=
[
[
'
class
'
+
qname
,
highlightQuery
(
'
class
'
+
qname
)]
,
[
'
type
'
+
qname
,
highlightQuery
(
'
type
'
+
qname
)]
];
sresults
.
innerHTML
+=
'
<p>
'
+
'
Cloogle does not accept spaces in the input.
'
+
'
Did you mean to search for
'
+
'
<a class="hidden" href="#
'
+
sug
[
0
][
0
]
+
'
"><code>
'
+
sug
[
0
][
1
]
+
'
</code></a> or
'
+
'
<a class="hidden" href="#
'
+
sug
[
1
][
0
]
+
'
"><code>
'
+
sug
[
1
][
1
]
+
'
</code></a>?</p>
'
;
return
;
}
}
var
libs
=
getLibs
();
var
libs
=
getLibs
();
...
...
frontend/api.php
View file @
2b5da708
...
@@ -195,6 +195,8 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){
...
@@ -195,6 +195,8 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){
}
}
}
elseif
(
substr
(
$name
,
0
,
6
)
==
'class '
)
{
}
elseif
(
substr
(
$name
,
0
,
6
)
==
'class '
)
{
$command
[
'className'
]
=
substr
(
$name
,
6
);
$command
[
'className'
]
=
substr
(
$name
,
6
);
}
elseif
(
substr
(
$name
,
0
,
9
)
==
'instance '
)
{
$command
[
'className'
]
=
substr
(
$name
,
9
);
}
elseif
(
substr
(
$name
,
0
,
5
)
==
'type '
)
{
}
elseif
(
substr
(
$name
,
0
,
5
)
==
'type '
)
{
$command
[
'typeName'
]
=
substr
(
$name
,
5
);
$command
[
'typeName'
]
=
substr
(
$name
,
5
);
}
elseif
(
$name
!=
''
)
{
}
elseif
(
$name
!=
''
)
{
...
...
frontend/common.js
View file @
2b5da708
...
@@ -91,9 +91,9 @@ function highlightCallback(span, cls, str) {
...
@@ -91,9 +91,9 @@ function highlightCallback(span, cls, str) {
function
highlightQuery
(
query
)
{
function
highlightQuery
(
query
)
{
var
highlighter
=
highlightClean
;
var
highlighter
=
highlightClean
;
if
(
query
==
'
class
'
||
query
==
'
type
'
||
query
==
'
using
'
)
{
if
(
query
==
'
class
'
||
query
==
'
instance
'
||
query
==
'
type
'
||
query
==
'
using
'
)
{
return
'
<span class="keyword">
'
+
query
+
'
</span>
'
;
return
'
<span class="keyword">
'
+
query
+
'
</span>
'
;
}
else
if
(
query
.
match
(
/^class
\s
/
))
{
}
else
if
(
query
.
match
(
/^class
\s
/
)
||
query
.
match
(
/^instance
\s
/
)
)
{
highlighter
=
highlightClean
;
highlighter
=
highlightClean
;
}
else
if
(
query
.
match
(
/^type
\s
/
))
{
}
else
if
(
query
.
match
(
/^type
\s
/
))
{
highlighter
=
function
(
q
)
{
highlighter
=
function
(
q
)
{
...
...
frontend/index.php
View file @
2b5da708
...
@@ -107,11 +107,11 @@
...
@@ -107,11 +107,11 @@
</tr>
</tr>
<tr>
<tr>
<td
class=
'code'
>
type Maybe
</td>
<td
class=
'code'
>
type Maybe
</td>
<td
class=
'description'
>
T
he type definition of
<code>
Maybe
x
</code></td>
<td
class=
'description'
>
T
ypes with the exact name
<code>
Maybe
</code></td>
</tr>
</tr>
<tr>
<tr>
<td
class=
'code'
>
class Text
</td>
<td
class=
'code'
>
class Text
</td>
<td
class=
'description'
>
The class definition of
<code>
Text
</code></td>
<td
class=
'description'
>
Classes with the exact name
<code>
Text
</code></td>
</tr>
</tr>
</table>
</table>
<p>
Besides this web app, there are
<a
href=
"https://gitlab.science.ru.nl/cloogle/cloogle-org/#frontends"
>
other frontends
</a>
available.
</p>
<p>
Besides this web app, there are
<a
href=
"https://gitlab.science.ru.nl/cloogle/cloogle-org/#frontends"
>
other frontends
</a>
available.
</p>
...
...
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