Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95273737
encBackground.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Dec 14, 06:42
Size
1 KB
Mime Type
text/html
Expires
Mon, Dec 16, 06:42 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
22960380
Attached To
R2664 SHRINE MedCo Fork
encBackground.html
View Options
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<script
type=
"text/javascript"
src=
"scripts/cryptolib.js"
></script>
<script
type=
"text/javascript"
src=
"scripts/workersController.js"
></script>
<title>
Encypt/Decrypt in background
</title>
<script>
// a counter to show when the page freezes
var
counter
=
0
;
setInterval
(
function
()
{
counter
+=
1
;
document
.
querySelector
(
"#counter"
).
innerHTML
=
counter
;
},
100
);
// i2b2.MedCo.model.panels[0].sensitive = {}
var
to_be_encrypted
=
[
"123"
,
"5678"
,
"-36586578456"
,
"13"
,
"66"
,
"23444"
,
"-124523632"
,
"151"
,
"5552"
,
"352"
,
"-12426324634"
,
"235423"
,
"62235"
,
"-633455"
];
// initialize 5 workers
i2b2
.
MedCo
.
ctrlr
.
background
.
initWorkers
(
5
);
// initialize the parameters of the encryption
i2b2
.
MedCo
.
ctrlr
.
background
.
initEncrypt
();
</script>
</head>
<body>
<div>
Now the page does not freeze
</div>
<div
id=
"counter"
></div>
<br>
<input
type=
"button"
onclick=
"i2b2.MedCo.ctrlr.background.toBeEncrypted(to_be_encrypted)"
value=
"start encryption"
>
<br>
<div
id=
"encrypted"
></div>
</body>
</html>
Event Timeline
Log In to Comment