Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e-share
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
vaclab
e-share
Commits
cf0adf1b
Commit
cf0adf1b
authored
12 years ago
by
wactbprot
Browse files
Options
Downloads
Patches
Plain Diff
duplicate doc show
parent
22ddcf41
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shows/dup.js
+30
-5
30 additions, 5 deletions
shows/dup.js
with
30 additions
and
5 deletions
shows/dup.js
+
30
−
5
View file @
cf0adf1b
function
(
doc
,
req
)
{
var
dupDoc
=
{},
dc
=
doc
.
Calibration
,
ds
=
doc
.
Sign
;
// example url:
// http://localhost:5984/vaclab_db/_design/e-share/_show/dup/73eda2bf9694bb4f78edaecba90cdc49
var
dc
=
doc
.
Calibration
,
ds
=
dc
.
Sign
,
ss
=
ds
.
split
(
/
[
-_
]
+/
),
nd
=
new
Date
(),
s0
=
ss
[
0
],
// main sign
s1
=
ss
[
1
],
// sub sign
ns1
=
""
;
// new sub sign
if
(
doc
&&
dc
&&
typeof
dc
==
"
object
"
&&
ds
){
var
tn1
=
""
+
(
parseInt
(
"
1
"
+
s1
,
10
)
+
1
);
tn1
=
tn1
.
substr
(
1
,
tn1
.
length
-
1
);
var
dupd
=
{
Calibration
:{
Sign
:
s0
+
"
_
"
+
tn1
,
Type
:
req
.
query
.
type
||
dc
.
Type
,
Year
:
""
+
nd
.
getFullYear
(),
Standard
:
req
.
query
.
standard
||
dc
.
Standard
,
Presettings
:{
}
}
};
}
else
{
dupDoc
.
error
=
"
Doc seems to be no calibration
"
;
var
dupd
=
{
error
:
"
Doc seems to be no calibration
"
}
;
}
return
dupDoc
;
return
toJSON
(
dupd
)
;
};
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