Browse Source

Добавить обучение

dev
parent
commit
bafec2efa3
8 changed files with 82 additions and 0 deletions
  1. +20
    -0
      обучение/01.HelloWorld.html
  2. BIN
      обучение/01.HelloWorld.png
  3. +3
    -0
      обучение/01.div.html
  4. +3
    -0
      обучение/01.module.js
  5. +30
    -0
      обучение/02.Loader.html
  6. BIN
      обучение/02.Loader.png
  7. +23
    -0
      обучение/02.loader.js
  8. +3
    -0
      обучение/02.no-borders.js

+ 20
- 0
обучение/01.HelloWorld.html View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<script>
var MM = [

[
"HelloWorld",
"dmFyIGRpdiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwpkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGRpdik7CmRpdi5pbm5lckhUTUwgPSAiPHA+SGVsbG8sIFdvcmxkITwvcD4iOw==",
],

];
var module = MM[0];
var code = atob(module[1]);
eval(code);
</script>
</body>
</html>

BIN
обучение/01.HelloWorld.png View File

Before After
Width: 490  |  Height: 506  |  Size: 51KB

+ 3
- 0
обучение/01.div.html View File

@@ -0,0 +1,3 @@
<div>
<p>Hello, World!</p>
</div>

+ 3
- 0
обучение/01.module.js View File

@@ -0,0 +1,3 @@
var div = document.createElement("div");
document.body.appendChild(div);
div.innerHTML = "<p>Hello, World!</p>";

+ 30
- 0
обучение/02.Loader.html View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<script>
var MM = [

[
"Loader",
"ZnVuY3Rpb24gTXVyb20oKQp7Cn0KTXVyb20ucHJvdG90eXBlLmxvYWRNb2R1bGVzID0gZnVuY3Rpb24oKQp7CiAgICAvLyBTa2lwIGAwYCBtb2R1bGUgYmVjYXVzZSBpdCdzIHVzLgogICAgZm9yICh2YXIgaSA9IDE7IGkgPCBNTS5sZW5ndGg7ICsraSkKICAgIHsKICAgICAgICB2YXIgbW9kdWxlID0gTU1baV07CiAgICAgICAgdmFyIG5hbWUgPSBtb2R1bGVbMF07CiAgICAgICAgdmFyIGNvZGUgPSBhdG9iKG1vZHVsZVsxXSk7CiAgICAgICAgdHJ5CiAgICAgICAgewogICAgICAgICAgICBldmFsKGNvZGUpOwogICAgICAgIH0KICAgICAgICBjYXRjaCAoZSkKICAgICAgICB7CiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoIkNvdWxkIG5vdCBsb2FkICciICsgbmFtZSArICInIG1vZHVsZTogJyIgKyBlICsgIiciKTsKICAgICAgICB9CiAgICB9Cn07CnZhciBNID0gbmV3IE11cm9tKCk7Ck0ubG9hZE1vZHVsZXMoKTsK",
],

[
"HelloWorld",
"dmFyIGRpdiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwpkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGRpdik7CmRpdi5pbm5lckhUTUwgPSAiPHA+SGVsbG8sIFdvcmxkITwvcD4iOw==",
],

[
"NoBorders",
"dmFyIGRpdiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwpkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGRpdik7CmRpdi5pbm5lckhUTUwgPSAiPHA+TGV0IDxzdHJvbmc+TVVST008L3N0cm9uZz4gc2hvdyB5b3Ugbm8gYm9yZGVyczwvcD4iOwo=",
],

];
var module = MM[0];
var code = atob(module[1]);
eval(code);
</script>
</body>
</html>

BIN
обучение/02.Loader.png View File

Before After
Width: 460  |  Height: 611  |  Size: 62KB

+ 23
- 0
обучение/02.loader.js View File

@@ -0,0 +1,23 @@
function Murom()
{
}
Murom.prototype.loadModules = function()
{
// Skip `0` module because it's us.
for (var i = 1; i < MM.length; ++i)
{
var module = MM[i];
var name = module[0];
var code = atob(module[1]);
try
{
eval(code);
}
catch (e)
{
console.error("Could not load '" + name + "' module: '" + e + "'");
}
}
};
var M = new Murom();
M.loadModules();

+ 3
- 0
обучение/02.no-borders.js View File

@@ -0,0 +1,3 @@
var div = document.createElement("div");
document.body.appendChild(div);
div.innerHTML = "<p>Let <strong>MUROM</strong> show you no borders</p>";

Loading…
Cancel
Save