Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
marcus-lodspeakr
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
uib-ub
Spesialsamlingene
marcus-lodspeakr
Commits
c15a7d49
Commit
c15a7d49
authored
12 years ago
by
alvaro
Browse files
Options
Downloads
Patches
Plain Diff
Improved query testing and layout
parent
1a812168
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/modules/adminModule.php
+2
-0
2 additions, 0 deletions
classes/modules/adminModule.php
doc/examples/originalComponents/static/admin/js/editor.js
+19
-10
19 additions, 10 deletions
doc/examples/originalComponents/static/admin/js/editor.js
with
21 additions
and
10 deletions
classes/modules/adminModule.php
+
2
−
0
View file @
c15a7d49
...
...
@@ -571,6 +571,7 @@ class AdminModule extends abstractModule{
<h2>Query results preview</h2>
<span class='alert alert-error hide' id='results-msg'></span>
<table class='table' id='results'></table>
<div style='height:300px'></div>
</div>
</div>
</div>
...
...
@@ -837,6 +838,7 @@ class AdminModule extends abstractModule{
if
(
!
(
$data
=
$this
->
http_digest_parse
(
$_SERVER
[
'PHP_AUTH_DIGEST'
]))
||
!
isset
(
$users
[
$data
[
'username'
]]))
return
FALSE
;
//die('Wrong Credentials!');
// generate the valid response
$A1
=
md5
(
$data
[
'username'
]
.
':'
.
$realm
.
':'
.
$users
[
$data
[
'username'
]]);
...
...
This diff is collapsed.
Click to expand it.
doc/examples/originalComponents/static/admin/js/editor.js
+
19
−
10
View file @
c15a7d49
$
(
document
).
ready
(
function
(){
var
relPos
=
"
../lodspeakr/components/
"
;
var
currentXhr
=
null
;
var
templateBuffer
=
''
;
var
queryBuffer
=
''
;
CodeMirror
.
defineMode
(
'
mustache
'
,
function
(
config
,
parserConfig
)
{
...
...
@@ -42,11 +42,16 @@ $(document).ready(function(){
});
$
(
"
#query-test-button
"
).
on
(
'
click
'
,
function
(
e
){
var
query
=
queryEditor
.
getValue
();
var
endpoint
=
$
(
"
#endpoint-list>option:selected
"
).
val
();
$
(
"
#results
"
).
empty
();
$
(
"
#query-test-button
"
).
addClass
(
'
disabled
'
).
html
(
'
<img src="../img/wait.gif"/>
'
);
executeQuery
(
query
,
endpoint
);
if
(
$
(
this
).
hasClass
(
"
btn-success
"
)){
var
query
=
queryEditor
.
getValue
();
var
endpoint
=
$
(
"
#endpoint-list>option:selected
"
).
val
();
$
(
"
#query-test-button
"
).
removeClass
(
'
btn-success
'
).
html
(
'
<img src="../img/wait.gif"/> Stop
'
);
currentXhr
=
executeQuery
(
query
,
endpoint
);
}
else
{
currentXhr
.
abort
();
$
(
this
).
addClass
(
'
btn-success
'
).
html
(
'
Test this query against
'
);
}
});
$
(
"
.component-li
"
).
on
({
mouseenter
:
function
(){
...
...
@@ -163,7 +168,7 @@ $(document).ready(function(){
});
function
executeQuery
(
q
,
e
){
$
.
ajax
({
return
$
.
ajax
({
dataType
:
'
jsonp
'
,
data
:
{
query
:
q
,
...
...
@@ -181,15 +186,19 @@ $(document).ready(function(){
$
(
data
.
results
.
bindings
).
each
(
function
(
i
,
item
){
var
row
=
$
(
"
<tr></tr>
"
);
$
.
each
(
variables
,
function
(
j
,
jtem
){
row
.
append
(
"
<td>
"
+
item
[
jtem
].
value
+
"
</td>
"
);
var
value
=
""
;
if
(
item
[
jtem
]
!=
undefined
){
value
=
item
[
jtem
].
value
;
}
row
.
append
(
"
<td>
"
+
value
+
"
</td>
"
);
});
$
(
"
#results
"
).
append
(
row
);
});
$
(
"
#query-test-button
"
).
remove
Class
(
'
disabled
'
).
html
(
'
Test this query against
'
);
$
(
"
#query-test-button
"
).
add
Class
(
'
btn-success
'
).
html
(
'
Test this query against
'
);
},
error
:
function
(
e
){
$
(
"
#results-msg
"
).
html
(
"
An error occurred when sending a query to the endpoint
"
).
show
().
delay
(
2000
).
fadeOut
(
"
slow
"
);
$
(
"
#query-test-button
"
).
remove
Class
(
'
disabled
'
).
html
(
'
Test this query against
'
);
$
(
"
#query-test-button
"
).
add
Class
(
'
btn-success
'
).
html
(
'
Test this query against
'
);
},
timeout
:
20000
,
});
...
...
@@ -246,7 +255,7 @@ $(document).ready(function(){
$
(
"
#query-save-button
"
).
attr
(
"
data-url
"
,
fileUrl
).
addClass
(
"
disabled
"
);
$
(
'
html, body
'
).
stop
().
animate
({
scrollTop
:
$
(
'
.bs-docs-query
'
).
offset
().
top
-
100
},
100
0
);
},
100
);
}
});
});
...
...
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