Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
electron-hal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent MAZENOD
electron-hal
Commits
833a5868
There was a problem fetching the pipeline summary.
Commit
833a5868
authored
7 years ago
by
mazenovi
Browse files
Options
Downloads
Patches
Plain Diff
normalise module import
parent
a9fa6436
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/app.js
+3
-3
3 additions, 3 deletions
js/app.js
js/hal.js
+43
-41
43 additions, 41 deletions
js/hal.js
js/me.js
+3
-3
3 additions, 3 deletions
js/me.js
with
49 additions
and
47 deletions
js/app.js
+
3
−
3
View file @
833a5868
...
...
@@ -7,6 +7,8 @@ dblp = require("./dblp");
dissem_in
=
require
(
"
./dissem_in
"
);
me
=
require
(
"
./me
"
);
me
.
author
();
// open links with default browser in app
// see also https://github.com/electron/electron/issues/1344#issuecomment-171516636
var
shell
=
require
(
'
electron
'
).
shell
;
...
...
@@ -16,8 +18,6 @@ $(document).on('click', 'a[href^="http"]', function(event) {
shell
.
openExternal
(
this
.
href
);
});
me
.
author
();
$
(
document
).
on
(
'
blur
'
,
'
.autosave input
'
,
function
(
event
)
{
config
.
update
();
me
.
author
();
...
...
@@ -31,5 +31,5 @@ $(document).on('keypress', '.autosave input', function(event) {
});
$
(
document
).
on
(
'
click
'
,
'
#halQueryBtn
'
,
function
(
event
)
{
hal
(
$
(
'
#halQuery
'
).
val
());
hal
.
search
(
$
(
'
#halQuery
'
).
val
());
});
This diff is collapsed.
Click to expand it.
js/hal.js
+
43
−
41
View file @
833a5868
...
...
@@ -7,53 +7,55 @@
config
=
require
(
'
./config
'
);
module
.
exports
=
function
(
query
)
{
module
.
exports
=
{
console
.
log
(
'
hal("
'
+
query
+
'
")
'
);
search
:
function
(
query
)
{
$
(
'
#hal .docs tbody
'
).
html
(
nunjucks
.
render
(
'
partials/doc_row_hal_progress.njk
'
)
)
console
.
log
(
'
hal("
'
+
query
+
'
")
'
);
$
.
ajax
({
url
:
"
http://api.archives-ouvertes.fr/search
"
,
dataType
:
'
json
'
,
type
:
'
get
'
,
data
:
{
"
q
"
:
query
,
"
fl
"
:
"
title_s, fileMain_s,halId_s,authLastNameFirstName_s,collCode_s,docType_s,ePublicationDate_s,journalDate_s,producedDate_s,submittedDate_s,releasedDate_s,writingDate_s,authIdHal_i
"
,
// why? authIdHal_s,authOrcidIdExt_id",
"
sort
"
:
"
submittedDate_s desc
"
},
success
:
function
(
data
){
console
.
log
(
data
);
if
(
data
.
response
.
docs
.
length
){
console
.
log
(
'
update rows tpl
'
);
$
(
'
#hal .docs tbody
'
).
html
(
data
.
response
.
docs
.
reduce
(
function
(
docs
,
curr
,
ind
,
arr
){
if
(
ind
==
1
)
{
docs
=
nunjucks
.
render
(
$
(
'
#hal .docs tbody
'
).
html
(
nunjucks
.
render
(
'
partials/doc_row_hal_progress.njk
'
)
)
$
.
ajax
({
url
:
"
http://api.archives-ouvertes.fr/search
"
,
dataType
:
'
json
'
,
type
:
'
get
'
,
data
:
{
"
q
"
:
query
,
"
fl
"
:
"
title_s, fileMain_s,halId_s,authLastNameFirstName_s,collCode_s,docType_s,ePublicationDate_s,journalDate_s,producedDate_s,submittedDate_s,releasedDate_s,writingDate_s,authIdHal_i
"
,
// why? authIdHal_s,authOrcidIdExt_id",
"
sort
"
:
"
submittedDate_s desc
"
},
success
:
function
(
data
){
console
.
log
(
data
);
if
(
data
.
response
.
docs
.
length
){
console
.
log
(
'
update rows tpl
'
);
$
(
'
#hal .docs tbody
'
).
html
(
data
.
response
.
docs
.
reduce
(
function
(
docs
,
curr
,
ind
,
arr
){
if
(
ind
==
1
)
{
docs
=
nunjucks
.
render
(
'
partials/doc_row_hal.njk
'
,
{
elt
:
arr
[
ind
-
1
],
regExp
:
new
RegExp
(
config
.
collection
,
'
g
'
)
}
);
}
return
docs
+=
nunjucks
.
render
(
'
partials/doc_row_hal.njk
'
,
{
elt
:
arr
[
ind
-
1
]
,
elt
:
curr
,
regExp
:
new
RegExp
(
config
.
collection
,
'
g
'
)
}
);
}
return
docs
+=
nunjucks
.
render
(
'
partials/doc_row_hal.njk
'
,
{
elt
:
curr
,
regExp
:
new
RegExp
(
config
.
collection
,
'
g
'
)
}
);
})
);
$
(
'
#hal .count
'
).
html
(
data
.
response
.
numFound
+
"
docs found (
"
+
data
.
response
.
docs
.
length
+
"
displayed)
"
,
""
);
}
else
{
// comprends pas
console
.
log
(
'
delete rows tpl
'
);
$
(
'
#hal .docs tbody
'
).
html
(
""
);
$
(
'
#hal .count
'
).
html
(
"
0 docs found (0 displayed)
"
);
})
);
$
(
'
#hal .count
'
).
html
(
data
.
response
.
numFound
+
"
docs found (
"
+
data
.
response
.
docs
.
length
+
"
displayed)
"
,
""
);
}
else
{
console
.
log
(
'
delete rows tpl
'
);
$
(
'
#hal .docs tbody
'
).
html
(
""
);
$
(
'
#hal .count
'
).
html
(
"
0 docs found (0 displayed)
"
);
}
}
}
}
);
}
);
}
};
This diff is collapsed.
Click to expand it.
js/me.js
+
3
−
3
View file @
833a5868
...
...
@@ -54,8 +54,8 @@ module.exports = {
}
});
},
halUpdateShow
:
function
(
hal_id
)
{
hal
(
"
authIdHal_i:
"
+
hal_id
);
hal
Tab
Update
And
Show
:
function
(
hal_id
)
{
hal
.
search
(
"
authIdHal_i:
"
+
hal_id
);
$
(
'
#halQuery
'
).
val
(
"
authIdHal_i:
"
+
hal_id
);
$
(
'
#search a[href="#hal"]
'
).
tab
(
'
show
'
);
}
...
...
@@ -81,7 +81,7 @@ function docsByHalId(hal_id) {
$
(
'
.numFound-
'
+
hal_id
).
html
(
data
.
response
.
numFound
+
"
<a href=
\"
https://hal.archives-ouvertes.fr/search/index/?qa[authIdHal_i][]=
"
+
hal_id
+
"
\"
><i class=
\"
fa fa-link
\"
></i></a>
"
+
"
<a onClick=
\"
me.halUpdateShow(
"
+
hal_id
+
"
)
\"
><i class=
\"
fa fa-chevron-circle-right
\"
aria-hidden=
\"
true
\"
></i></a>
"
+
"
<a onClick=
\"
me.hal
Tab
Update
And
Show(
"
+
hal_id
+
"
)
\"
><i class=
\"
fa fa-chevron-circle-right
\"
aria-hidden=
\"
true
\"
></i></a>
"
);
},
error
:
function
(
err
)
{
...
...
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