Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
Y Recorder
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
espory
Y Recorder
Commits
93b68087
Commit
93b68087
authored
Jul 26, 2022
by
yangbowen.x
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加 certainty.js
parent
654582cf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30293 additions
and
117 deletions
+30293
-117
.gitignore
.gitignore
+1
-1
certainty.js
certainty.js
+251
-116
package-lock.json
package-lock.json
+30041
-0
No files found.
.gitignore
View file @
93b68087
...
...
@@ -2,5 +2,5 @@
node_modules
.idea
dist
package-lock.json
#
package-lock.json
.DS_Store
\ No newline at end of file
certainty.js
View file @
93b68087
...
...
@@ -115,6 +115,141 @@
return
n
;
})
:
(
c
[
"
seed
"
+
p
]
=
n
);
})(
"
undefined
"
!=
typeof
self
?
self
:
this
,
[],
Math
);
Math
.
seedrandom
(
'
yrecord
'
);
})(
"
undefined
"
!=
typeof
self
?
self
:
this
,
[],
Math
);
Math
.
seedrandom
(
'
yrecord
'
);
//时间
(
function
(
name
,
definition
)
{
if
(
typeof
define
===
'
function
'
)
{
// AMD
define
(
definition
);
}
else
if
(
typeof
module
!==
'
undefined
'
&&
module
.
exports
)
{
// Node.js
module
.
exports
=
definition
();
}
else
{
// Browser
var
timemachine
=
definition
(),
global
=
this
,
old
=
global
[
name
];
timemachine
.
noConflict
=
function
()
{
global
[
name
]
=
old
;
return
timemachine
;
};
global
[
name
]
=
timemachine
;
}
})(
'
yrecord_timer
'
,
function
()
{
const
OriginalDate
=
Date
;
const
Timemachine
=
{
timestamp
:
0
,
tick
:
false
,
tickStartDate
:
null
,
keepTime
:
false
,
difference
:
0
,
config
:
function
(
options
)
{
this
.
timestamp
=
OriginalDate
.
parse
(
options
.
dateString
)
||
options
.
timestamp
||
this
.
timestamp
;
this
.
difference
=
options
.
difference
||
this
.
difference
;
this
.
keepTime
=
options
.
keepTime
||
this
.
keepTime
;
this
.
tick
=
options
.
tick
||
this
.
tick
;
if
(
this
.
tick
)
{
this
.
tickStartDate
=
new
OriginalDate
();
}
this
.
_apply
();
},
reset
:
function
()
{
this
.
timestamp
=
0
;
this
.
tick
=
false
;
this
.
tickStartDate
=
null
;
this
.
keepTime
=
false
;
this
.
difference
=
0
;
Date
=
OriginalDate
;
Date
.
prototype
=
OriginalDate
.
prototype
;
},
_apply
:
function
()
{
var
self
=
this
;
Date
=
function
()
{
var
date
;
if
(
self
.
keepTime
)
{
date
=
new
OriginalDate
();
}
else
if
(
arguments
.
length
===
1
)
{
date
=
new
OriginalDate
(
arguments
[
0
]);
}
else
if
(
arguments
.
length
===
2
)
{
date
=
new
OriginalDate
(
arguments
[
0
],
arguments
[
1
]);
}
else
if
(
arguments
.
length
===
3
)
{
date
=
new
OriginalDate
(
arguments
[
0
],
arguments
[
1
],
arguments
[
2
]);
}
else
if
(
arguments
.
length
===
4
)
{
date
=
new
OriginalDate
(
arguments
[
0
],
arguments
[
1
],
arguments
[
2
],
arguments
[
3
]);
}
else
if
(
arguments
.
length
===
5
)
{
date
=
new
OriginalDate
(
arguments
[
0
],
arguments
[
1
],
arguments
[
2
],
arguments
[
3
],
arguments
[
4
]);
}
else
if
(
arguments
.
length
===
6
)
{
date
=
new
OriginalDate
(
arguments
[
0
],
arguments
[
1
],
arguments
[
2
],
arguments
[
3
],
arguments
[
4
],
arguments
[
5
]);
}
else
if
(
arguments
.
length
===
7
)
{
date
=
new
OriginalDate
(
arguments
[
0
],
arguments
[
1
],
arguments
[
2
],
arguments
[
3
],
arguments
[
4
],
arguments
[
5
],
arguments
[
6
]);
}
else
{
date
=
new
OriginalDate
(
self
.
timestamp
);
}
if
(
arguments
.
length
===
0
)
{
var
difference
=
self
.
_getDifference
();
if
(
difference
!==
0
)
{
date
=
new
OriginalDate
(
date
.
getTime
()
+
difference
);
}
}
return
date
;
};
Date
.
prototype
=
OriginalDate
.
prototype
;
Date
.
now
=
function
()
{
var
timestamp
=
self
.
keepTime
?
OriginalDate
.
now
()
:
self
.
timestamp
;
return
timestamp
+
self
.
_getDifference
();
};
Date
.
OriginalDate
=
OriginalDate
;
Date
.
UTC
=
OriginalDate
.
UTC
;
},
_getDifference
:
function
()
{
var
difference
=
this
.
difference
;
if
(
this
.
tick
)
{
difference
+=
OriginalDate
.
now
()
-
this
.
tickStartDate
.
getTime
();
}
return
difference
;
},
};
Timemachine
.
_apply
();
return
Timemachine
;
});
fetch
(
"
http://localhost:7001/records/getTime
"
,
{
"
method
"
:
"
POST
"
,
"
headers
"
:
{
"
user-agent
"
:
"
vscode-restclient
"
,
"
content-type
"
:
"
application/json
"
,
"
authorization
"
:
"
Bearer eyJhbGciOiJIUzI1NiJ9.dGVzdA.GfxRk-CtH6rXPrQstXkm8pkjEhPFO1h5kFEBciCZN48
"
},
"
body
"
:
JSON
.
stringify
({
"
_id
"
:
"
628b6d4f1fde64d672cf7769
"
})
})
.
then
(
response
=>
{
response
.
text
().
then
((
res
)
=>
{
timeObj
=
JSON
.
parse
(
res
);
console
.
log
(
yrecord_timer
)
yrecord_timer
.
config
({
timestamp
:
Number
(
timeObj
.
data
),
tick
:
true
,
});
});
})
.
catch
(
err
=>
{
console
.
error
(
err
);
});
\ No newline at end of file
package-lock.json
0 → 100644
View file @
93b68087
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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