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
4f28b30a
Commit
4f28b30a
authored
Jan 18, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
romain_dev: forum jslint
parent
291f097b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
226 deletions
+74
-226
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.js
...n_dev/PathTemplateItem/web_page_module/romain_forum_js.js
+52
-181
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.xml
..._dev/PathTemplateItem/web_page_module/romain_forum_js.xml
+2
-2
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.js
...thTemplateItem/web_page_module/romain_thread_reader_js.js
+18
-41
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_forum_js.js
View file @
4f28b30a
This diff is collapsed.
Click to expand it.
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.xml
View file @
4f28b30a
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
989.2
3331.40399.10871
</string>
</value>
<value>
<string>
989.2
7664.22728.10274
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
1610
728771.86
</float>
<float>
1610
988520.24
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.js
View file @
4f28b30a
/*jslint indent: 2, maxerr: 3, nomen: true */
/*global window, document, rJS, URI, RSVP, isEmpty, console, domsugar*/
/*global window, document, rJS, URI, RSVP, isEmpty, console, domsugar
, Intl
*/
(
function
()
{
"
use strict
"
;
var
variable
=
{},
loading_class_list
=
[
'
ui-icon-spinner
'
,
'
ui-btn-icon-left
'
],
disabled_class
=
'
ui-disabled
'
;
function
getRelativeTimeString
(
language
,
current_date
,
date
)
{
var
diff
,
abs
,
...
...
@@ -28,36 +24,14 @@
console
.
log
(
current_date
,
date
,
abs
,
week
,
day
);
if
(
abs
>
(
week
*
2
))
{
return
time_format
.
format
(
Math
.
floor
(
diff
/
week
),
'
week
'
);
}
else
if
(
abs
>
(
day
*
2
))
{
}
if
(
abs
>
(
day
*
2
))
{
return
time_format
.
format
(
Math
.
floor
(
diff
/
day
),
'
day
'
);
}
else
if
(
abs
>
(
hour
*
2
))
{
return
time_format
.
format
(
Math
.
floor
(
diff
/
hour
),
'
hour
'
);
}
else
{
return
time_format
.
format
(
Math
.
floor
(
diff
/
minute
),
'
minute
'
);
}
return
date
;
}
function
buildFieldGadgetParam
(
value
)
{
var
field_gadget_param
;
if
((
value
!==
undefined
)
&&
(
value
!==
null
)
&&
(
value
.
constructor
===
Object
))
{
if
(
value
.
field_gadget_param
)
{
field_gadget_param
=
value
.
field_gadget_param
;
}
else
{
field_gadget_param
=
{
'
editable
'
:
0
,
'
default
'
:
value
.
default
};
}
}
else
{
field_gadget_param
=
{
'
editable
'
:
0
,
'
default
'
:
value
};
if
(
abs
>
(
hour
*
2
))
{
return
time_format
.
format
(
Math
.
floor
(
diff
/
hour
),
'
hour
'
);
}
return
field_gadget_param
;
return
time_format
.
format
(
Math
.
floor
(
diff
/
minute
),
'
minute
'
);
}
function
setPaginationElement
(
gadget
,
count
,
url_list
)
{
...
...
@@ -166,7 +140,7 @@
domsugar
(
gadget
.
element
.
querySelector
(
'
:scope > nav > span
'
),
{
class
:
"
ui-icon-spinner ui-btn-icon-left
"
,
text
:
''
})
})
;
return
gadget
.
fetchLineContent
(
false
);
}
...
...
@@ -221,7 +195,7 @@
text
:
source_short_title
}),
domsugar
(
'
div
'
,
{
class
:
'
post_content
'
,
class
:
'
post_content
'
},
[
domsugar
(
'
strong
'
,
{
text
:
source_title
}),
"
"
,
...
...
@@ -229,18 +203,20 @@
datetime
:
entry
.
value
.
modification_date
,
title
:
entry
.
value
.
modification_date
,
text
:
getRelativeTimeString
(
gadget
.
state
.
language
,
now
,
new
Date
(
entry
.
value
.
modification_date
)
gadget
.
state
.
language
,
now
,
new
Date
(
entry
.
value
.
modification_date
)
)
}),
domsugar
(
'
br
'
),
result_dict
.
viewer_list
[
i
].
element
,
result_dict
.
viewer_list
[
i
].
element
// domsugar('hr')
])
]);
}));
setPaginationElement
(
gadget
,
allDocs_result
.
data
.
total_rows
,
result_dict
.
url_list
);
setPaginationElement
(
gadget
,
allDocs_result
.
data
.
total_rows
,
result_dict
.
url_list
);
});
return
;
}
})
...
...
@@ -251,7 +227,9 @@
this
.
element
.
querySelectorAll
(
"
div.post_content > time
"
).
forEach
(
function
(
element
)
{
element
.
textContent
=
getRelativeTimeString
(
gadget
.
state
.
language
,
now
,
new
Date
(
element
.
getAttribute
(
'
datetime
'
))
gadget
.
state
.
language
,
now
,
new
Date
(
element
.
getAttribute
(
'
datetime
'
))
);
}
);
...
...
@@ -267,8 +245,7 @@
}
var
gadget
=
this
,
limit_options
=
[],
i
;
limit_options
=
[];
if
(
gadget
.
state
.
lines
===
0
)
{
limit_options
=
undefined
;
...
...
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.xml
View file @
4f28b30a
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
989.2
3313.49582.17834
</string>
</value>
<value>
<string>
989.2
7674.58520.17527
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
1610
727867.53
</float>
<float>
1610
989162.51
</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