-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
32 lines (25 loc) · 969 Bytes
/
script.js
File metadata and controls
32 lines (25 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// ==UserScript==
// @name Interactive console storage
// @namespace https://github.com/poliakustyczny/gcloudInteractiveConsoleStorage
// @updateURL https://raw.githubusercontent.com/poliakustyczny/gcloudInteractiveConsoleStorage/master/script.js
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://effictory-prep.appspot.com/admin/_ah/interactive
// @grant none
// ==/UserScript==
(function() {
'use strict';
const STORAGE_ITEM = 'interactive_console_code';
let getContent = () => {
return document.getElementById("code").value
}
let saveContent = () => {
localStorage.setItem(STORAGE_ITEM, getContent());
}
let loadContent = () => {
return localStorage.getItem(STORAGE_ITEM);
}
document.getElementById("code").addEventListener("keyup", saveContent);
document.getElementById("code").innerHTML = loadContent();
})();