@onetype/framework 2.0.31 → 2.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
transforms.Fn('runtime', function()
|
|
2
|
+
{
|
|
3
|
+
this.methods.process = (node) =>
|
|
4
|
+
{
|
|
5
|
+
const id = node.getAttribute('ot');
|
|
6
|
+
|
|
7
|
+
if(!id)
|
|
8
|
+
{
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
node.removeAttribute('ot');
|
|
13
|
+
transforms.Fn('run', id, node);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
this.methods.scan = () =>
|
|
17
|
+
{
|
|
18
|
+
document.querySelectorAll('[ot]').forEach(node =>
|
|
19
|
+
{
|
|
20
|
+
this.methods.process(node);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.methods.observe = () =>
|
|
25
|
+
{
|
|
26
|
+
new MutationObserver((mutations) =>
|
|
27
|
+
{
|
|
28
|
+
for(const mutation of mutations)
|
|
29
|
+
{
|
|
30
|
+
for(const node of mutation.addedNodes)
|
|
31
|
+
{
|
|
32
|
+
if(node.nodeType !== 1)
|
|
33
|
+
{
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if(node.hasAttribute('ot'))
|
|
38
|
+
{
|
|
39
|
+
this.methods.process(node);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
node.querySelectorAll('[ot]').forEach(child =>
|
|
43
|
+
{
|
|
44
|
+
this.methods.process(child);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}).observe(document.body, { childList: true, subtree: true });
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
if(document.readyState === 'loading')
|
|
52
|
+
{
|
|
53
|
+
document.addEventListener('DOMContentLoaded', () =>
|
|
54
|
+
{
|
|
55
|
+
this.methods.scan();
|
|
56
|
+
this.methods.observe();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
{
|
|
61
|
+
this.methods.scan();
|
|
62
|
+
this.methods.observe();
|
|
63
|
+
}
|
|
64
|
+
});
|
|
@@ -51,10 +51,10 @@ onetype.AddonReady('elements', (elements) =>
|
|
|
51
51
|
<i class="logo-arrow">keyboard_arrow_down</i>
|
|
52
52
|
</a>
|
|
53
53
|
<div class="tabs">
|
|
54
|
-
<a ot-for="item in left" :class="'tab' + (item.active ? ' active' : '')" :href="item.href"><i>{{ item.icon }}</i> {{ item.label }}</a>
|
|
54
|
+
<a ot-for="item in left" :class="'tab' + (item.active ? ' active' : '')" :href="item.href" :target="item.target || null"><i>{{ item.icon }}</i> {{ item.label }}</a>
|
|
55
55
|
</div>
|
|
56
56
|
<div class="right">
|
|
57
|
-
<a ot-for="item in right" :class="'tab' + (item.active ? ' active' : '')" :href="item.href"><i>{{ item.icon }}</i> {{ item.label }}</a>
|
|
57
|
+
<a ot-for="item in right" :class="'tab' + (item.active ? ' active' : '')" :href="item.href" :target="item.target || null"><i>{{ item.icon }}</i> {{ item.label }}</a>
|
|
58
58
|
</div>
|
|
59
59
|
</nav>
|
|
60
60
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onetype/framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.32",
|
|
4
4
|
"description": "OneType Framework — Full-stack isomorphic JavaScript framework built from scratch. One addon abstraction powers databases, servers, commands, pages, directives, queues, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/load.js",
|