Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
628d84f4
Commit
628d84f4
authored
Jan 15, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
romain_dev: thread reader use page language inqtead of local
parent
d24f824d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.js
...thTemplateItem/web_page_module/romain_thread_reader_js.js
+17
-12
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.xml
...hTemplateItem/web_page_module/romain_thread_reader_js.xml
+2
-2
No files found.
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.js
View file @
628d84f4
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
loading_class_list
=
[
'
ui-icon-spinner
'
,
'
ui-btn-icon-left
'
],
loading_class_list
=
[
'
ui-icon-spinner
'
,
'
ui-btn-icon-left
'
],
disabled_class
=
'
ui-disabled
'
;
disabled_class
=
'
ui-disabled
'
;
function
getRelativeTimeString
(
current_date
,
date
)
{
function
getRelativeTimeString
(
language
,
current_date
,
date
)
{
var
diff
,
var
diff
,
abs
,
abs
,
second
=
1000
,
second
=
1000
,
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
hour
=
minute
*
60
,
hour
=
minute
*
60
,
day
=
hour
*
24
,
day
=
hour
*
24
,
week
=
day
*
7
,
week
=
day
*
7
,
time_format
=
new
Intl
.
RelativeTimeFormat
();
time_format
=
new
Intl
.
RelativeTimeFormat
(
language
);
diff
=
date
.
getFullYear
()
-
current_date
.
getFullYear
();
diff
=
date
.
getFullYear
()
-
current_date
.
getFullYear
();
if
(
diff
!==
0
)
{
if
(
diff
!==
0
)
{
...
@@ -373,6 +373,7 @@
...
@@ -373,6 +373,7 @@
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
.
declareAcquiredMethod
(
'
getSelectedLanguage
'
,
'
getSelectedLanguage
'
)
//////////////////////////////////////////////
//////////////////////////////////////////////
// initialize the gadget content
// initialize the gadget content
...
@@ -384,7 +385,10 @@
...
@@ -384,7 +385,10 @@
// Cancel previous line rendering to not conflict with the asynchronous render for now
// Cancel previous line rendering to not conflict with the asynchronous render for now
gadget
.
fetchLineContent
(
true
);
gadget
.
fetchLineContent
(
true
);
return
gadget
.
getSelectedLanguage
()
.
push
(
function
(
language
)
{
return
gadget
.
changeState
({
return
gadget
.
changeState
({
language
:
language
,
query_string
:
new
URI
(
options
.
query
).
query
(
true
).
query
||
''
,
query_string
:
new
URI
(
options
.
query
).
query
(
true
).
query
||
''
,
begin_from
:
0
,
begin_from
:
0
,
lines
:
options
.
lines
||
1
,
lines
:
options
.
lines
||
1
,
...
@@ -392,6 +396,7 @@
...
@@ -392,6 +396,7 @@
render_timestamp
:
new
Date
().
getTime
(),
render_timestamp
:
new
Date
().
getTime
(),
allDocs_result
:
undefined
allDocs_result
:
undefined
});
});
});
})
})
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
...
@@ -442,7 +447,7 @@
...
@@ -442,7 +447,7 @@
datetime
:
entry
.
value
.
modification_date
,
datetime
:
entry
.
value
.
modification_date
,
title
:
entry
.
value
.
modification_date
,
title
:
entry
.
value
.
modification_date
,
text
:
getRelativeTimeString
(
text
:
getRelativeTimeString
(
now
,
new
Date
(
entry
.
value
.
modification_date
)
gadget
.
state
.
language
,
now
,
new
Date
(
entry
.
value
.
modification_date
)
)
)
}),
}),
domsugar
(
'
br
'
),
domsugar
(
'
br
'
),
...
@@ -830,7 +835,7 @@
...
@@ -830,7 +835,7 @@
this
.
element
.
querySelectorAll
(
"
div.post_content > time
"
).
forEach
(
this
.
element
.
querySelectorAll
(
"
div.post_content > time
"
).
forEach
(
function
(
element
)
{
function
(
element
)
{
element
.
textContent
=
getRelativeTimeString
(
element
.
textContent
=
getRelativeTimeString
(
now
,
new
Date
(
element
.
getAttribute
(
'
datetime
'
))
gadget
.
state
.
language
,
now
,
new
Date
(
element
.
getAttribute
(
'
datetime
'
))
);
);
}
}
);
);
...
...
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.xml
View file @
628d84f4
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
989.2
1883.22115.61832
</string>
</value>
<value>
<string>
989.2
2938.36309.58180
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1610
641779.85
</float>
<float>
1610
705058.31
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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