Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mynij
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
mynij
Commits
8f9368a1
Commit
8f9368a1
authored
Nov 20, 2020
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_mynij_search: clean a bit more result content page
parent
cb98a3c9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
14 deletions
+29
-14
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_parser.js.js
...athTemplateItem/web_page_module/gadget_mynij_parser.js.js
+3
-3
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_parser.js.xml
...thTemplateItem/web_page_module/gadget_mynij_parser.js.xml
+2
-2
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_result.js.js
...athTemplateItem/web_page_module/gadget_mynij_result.js.js
+22
-7
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_result.js.xml
...thTemplateItem/web_page_module/gadget_mynij_result.js.xml
+2
-2
No files found.
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_parser.js.js
View file @
8f9368a1
...
...
@@ -313,10 +313,10 @@
// remove all <script> sections
.
replace
(
/
(
<script
[^
>
]
*>
[^
>
]
*.*<
\/
script>
)
/gm
,
''
);
// remove footers, headers
tmp_div
.
querySelectorAll
(
'
link, style, script, footer, header
'
)
tmp_div
.
querySelectorAll
(
'
link, style, script, footer, header, noscript, picture
'
)
.
forEach
(
function
(
item
)
{
let
parent
=
item
.
parentNode
;
parent
.
remove
(
item
);
item
.
remove
();
});
}
if
(
!
tmp_div
)
...
...
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_parser.js.xml
View file @
8f9368a1
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
7.50963.40839.11502
</string>
</value>
<value>
<string>
98
8.6617.37252.48349
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
160
4610243.41
</float>
<float>
160
5884721.12
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_result.js.js
View file @
8f9368a1
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80*/
/*global window, RSVP, rJS, document, DOMParser*/
(
function
(
window
,
RSVP
,
rJS
,
document
,
DOMParser
)
{
/*global window, RSVP, rJS, document, DOMParser
, URL
*/
(
function
(
window
,
RSVP
,
rJS
,
document
,
DOMParser
,
URL
)
{
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
);
...
...
@@ -60,7 +60,7 @@
title
.
href
=
item
.
link
;
list_item
.
appendChild
(
title
);
link
=
document
.
createElement
(
"
a
"
);
link
.
appendChild
(
document
.
createTextNode
(
item
.
link
));
link
.
appendChild
(
document
.
createTextNode
(
cut_
link
));
link
.
href
=
item
.
link
;
link
.
className
=
"
link
"
;
link_par
=
document
.
createElement
(
'
p
'
);
...
...
@@ -245,12 +245,27 @@
return
extract_description
(
result
[
0
]);
})
.
declareMethod
(
"
cut_link
"
,
function
(
link
)
{
var
url
,
short_url
=
""
,
page_name
,
ext
;
if
(
link
===
undefined
)
return
""
;
if
(
link
.
length
>
70
)
return
link
.
slice
(
0
,
70
)
+
"
...
"
;
else
if
(
link
.
length
<
70
)
{
return
link
;
}
url
=
new
URL
(
link
);
short_url
=
url
.
origin
+
'
/.../
'
;
page_name
=
url
.
pathname
.
split
(
'
/
'
).
pop
();
if
(
page_name
.
length
>
50
)
{
ext
=
page_name
.
split
(
'
.
'
).
pop
();
short_url
+=
page_name
.
slice
(
0
,
40
)
+
'
....
'
+
ext
;
}
else
{
short_url
+=
page_name
;
}
return
short_url
;
});
}(
window
,
RSVP
,
rJS
,
document
,
DOMParser
));
\ No newline at end of file
}(
window
,
RSVP
,
rJS
,
document
,
DOMParser
,
URL
));
\ No newline at end of file
bt5/erp5_web_mynij_search/PathTemplateItem/web_page_module/gadget_mynij_result.js.xml
View file @
8f9368a1
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
7.31610.30930.31436
</string>
</value>
<value>
<string>
98
8.6676.48485.45158
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
160
4431247.07
</float>
<float>
160
5883520.14
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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