script.io.js 2026.124.1620 → 2026.125.1832
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.
- package/index.js +2 -0
- package/node_packages/html.js +257 -0
- package/node_packages/script.js +15 -174
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xxx
|
|
3
|
+
*
|
|
4
|
+
* title
|
|
5
|
+
* description
|
|
6
|
+
* sub description
|
|
7
|
+
*
|
|
8
|
+
* xxx://xxx.xxx.xxx/xxx
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
function Define ($, key, value, option = {}) {
|
|
12
|
+
if (key) Object.defineProperty ($, key, {enumerable: option.enumerable || false, configurable: option.configurable || false, writable: option.writable || false, value});
|
|
13
|
+
else return new Define.properties ($);
|
|
14
|
+
}
|
|
15
|
+
Define.properties = class {
|
|
16
|
+
constructor (property) {
|
|
17
|
+
this.property = property;
|
|
18
|
+
}
|
|
19
|
+
export (data) {
|
|
20
|
+
return this.property.exports = data;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* markup
|
|
26
|
+
*
|
|
27
|
+
* title
|
|
28
|
+
* description
|
|
29
|
+
* sub description
|
|
30
|
+
*
|
|
31
|
+
* xxx://xxx.xxx.xxx/xxx
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
Define (Function, "markup", class {
|
|
35
|
+
constructor (markup = [], tab) {
|
|
36
|
+
if (typeof markup === "string") this.markup = markup.split ("\n");
|
|
37
|
+
else this.markup = markup;
|
|
38
|
+
this.tab = tab || 0;
|
|
39
|
+
}
|
|
40
|
+
push (content, tab) {
|
|
41
|
+
if (tab) this.markup.push (("\t").repeat (tab) + content);
|
|
42
|
+
else this.markup.push (content);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
render (tab) {
|
|
46
|
+
return this.markup.filter (function (markup) { if (markup) return true; else return false; }).map (function (markup) { return ("\t").repeat (this.tab) + markup; }.bind ({tab: tab || this.tab})).join ("\n");
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
Define (Function.markup, "render", function (markup, tab) {
|
|
51
|
+
return new Function.markup (markup, tab).render ();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* html
|
|
56
|
+
*
|
|
57
|
+
* title
|
|
58
|
+
* description
|
|
59
|
+
* sub description
|
|
60
|
+
*
|
|
61
|
+
* xxx://xxx.xxx.xxx/xxx
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
Define (Function, "html", class {
|
|
65
|
+
constructor () {
|
|
66
|
+
this.populated = false;
|
|
67
|
+
this.head = new Function.html.head (this);
|
|
68
|
+
this.config = {}
|
|
69
|
+
this.var = {
|
|
70
|
+
"html:attribute": {},
|
|
71
|
+
title: "UnTitled",
|
|
72
|
+
description: "",
|
|
73
|
+
charset: "UTF-8",
|
|
74
|
+
meta: [],
|
|
75
|
+
link: {style: []},
|
|
76
|
+
google: {font: [], "tag:manager": "G-6JM1DVVQPT"},
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
set (key, value) {
|
|
80
|
+
if (key === "html:attribute") for (var i in value) this.var ["html:attribute"][i] = value [i];
|
|
81
|
+
else if (key === "language") this.var ["html:attribute"]["lang"] = value;
|
|
82
|
+
else if (key === "meta") this.var.meta.push (value);
|
|
83
|
+
else if (key === "link:style") this.var.link.style.push (value);
|
|
84
|
+
else if (key === "google:font") this.var.google.font.push (value);
|
|
85
|
+
else this.var [key] = value;
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
delete (key, value) {
|
|
89
|
+
if (key === "html:attribute") delete this.var ["html:attribute"][value];
|
|
90
|
+
else if (key === "language") delete this.var ["html:attribute"]["lang"];
|
|
91
|
+
else delete this.var [key];
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
populate (variable = {}) {
|
|
95
|
+
for (var i in variable) this.set (i, variable [i]);
|
|
96
|
+
this.populated = true;
|
|
97
|
+
this.head.meta ({charset: this.var.charset});
|
|
98
|
+
this.head.meta ({"http-equiv": "X-UA-Compatible", content: "IE=edge"});
|
|
99
|
+
this.head.meta ({"http-equiv": "X-Cross-Origin", content: "*"});
|
|
100
|
+
this.head.meta ({name: "viewport", content: this.var ["viewport"] || "width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=1"});
|
|
101
|
+
this.head.meta ({name: "generator", content: this.var ["generator"] || "Netizen" || "Express (5.2.1) Vue (3.5.27)"});
|
|
102
|
+
this.head.meta ({name: "author", content: this.var ["author"] || "Netizen"});
|
|
103
|
+
this.head.meta ({name: "description", content: this.var.description});
|
|
104
|
+
this.head.meta ({name: "keywords", content: this.var ["keyword"]});
|
|
105
|
+
this.head.meta ({name: "robots", content: this.var ["robot"] || "index, follow, max-snippet:-1, max-video-preview:-1, max-image-preview:large"});
|
|
106
|
+
this.head.meta ({name: "rating", content: this.var ["rating"] || "general"});
|
|
107
|
+
this.head.meta ({name: "google", content: "notranslate"});
|
|
108
|
+
this.head.meta ({name: "googlebot", content: "notranslate"});
|
|
109
|
+
this.head.meta ({name: "googlebot-news", content: this.var ["google-bot:article"] || "index, follow"});
|
|
110
|
+
if (this.var ["google-site-verification"]) this.head.meta ({name: "google-site-verification", content: this.var ["google-site-verification"]});
|
|
111
|
+
if (this.var ["yandex-verification"]) this.head.meta ({name: "yandex-verification", content: this.var ["yandex-verification"]});
|
|
112
|
+
this.head.meta ({name: "twitter:card", content: this.var ["twitter:card"] || "summary_large_image"});
|
|
113
|
+
this.head.meta ({name: "twitter:title", content: this.var ["twitter:title"]});
|
|
114
|
+
this.head.meta ({name: "twitter:description", content: this.var ["twitter:description"] || this.var.description});
|
|
115
|
+
this.head.meta ({name: "twitter:image", content: this.var ["twitter:image"]});
|
|
116
|
+
this.head.meta ({property: "og:site_name", content: this.var ["og:site_name"]});
|
|
117
|
+
this.head.meta ({property: "og:site_description", content: this.var ["og:site_description"]});
|
|
118
|
+
this.head.meta ({property: "og:title", content: this.var ["og:title"] || this.var.title});
|
|
119
|
+
this.head.meta ({property: "og:description", content: this.var ["og:description"] || this.var.description});
|
|
120
|
+
this.head.meta ({property: "og:url", content: this.var ["og:url"] || this.var.canonical});
|
|
121
|
+
this.head.meta ({property: "og:image", content: this.var ["og:image"]});
|
|
122
|
+
this.head.meta ({property: "og:type", content: this.var ["og:type"] || "website"});
|
|
123
|
+
this.head.meta ({property: "og:locale", content: this.var ["og:locale"] || this.var ["html:attribute"]["lang"] || "en"});
|
|
124
|
+
for (var i in this.var.meta) this.head.meta (this.var.meta [i].attribute, this.var.meta [i].prop);
|
|
125
|
+
this.head.link ({rel: "icon", href: this.var ["favorite.ico"] || "/favicon.ico"});
|
|
126
|
+
this.head.link ({rel: "canonical", href: this.var.canonical || "/"});
|
|
127
|
+
if (this.config ["manifest.json"]) this.head.link ({rel: "manifest", href: this.var ["manifest.json"] || "/manifest.json"});
|
|
128
|
+
if (this.config ["feed.xml"]) this.head.link ({rel: "alternate", href: "/feed/", type: "application/rss+xml", title: "{{ site:name }} » Feed"});
|
|
129
|
+
if (this.config ["feed.xml:atom"]) this.head.link ({rel: "alternate", href: "/feed/atom/", type: "application/rss+xml", title: "{{ site:name }} » Feed (Atom)"});
|
|
130
|
+
this.head.link ({rel: "dns-prefetch", href: "https://www.google-analytics.com"});
|
|
131
|
+
this.head.link ({rel: "dns-prefetch", href: "https://www.googletagmanager.com"});
|
|
132
|
+
this.head.link ({rel: "preconnect", href: "https://fonts.gstatic.com"}, "crossorigin");
|
|
133
|
+
this.head.link ({rel: "preconnect", href: "https://fonts.googleapis.com"}, "crossorigin");
|
|
134
|
+
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"});
|
|
135
|
+
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"});
|
|
136
|
+
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"});
|
|
137
|
+
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"});
|
|
138
|
+
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,slnt,wdth,wght,GRAD,ROND@6..144,-10..0,25..151,1..1000,0..100,0..100&display=swap"});
|
|
139
|
+
for (var i in this.var.google.font) this.head.link ({rel: "stylesheet", href: this.var.google.font [i]});
|
|
140
|
+
for (var i in this.var.link.style) this.head.link ({rel: "stylesheet", href: this.var.link.style [i]});
|
|
141
|
+
this.head.link ({rel: "stylesheet", href: "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css"});
|
|
142
|
+
this.head.link ({rel: "stylesheet", href: "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css"});
|
|
143
|
+
if (this.var ["style.css"]) this.head.link ({rel: "stylesheet", href: this.var ["style.css"]});
|
|
144
|
+
if (this.var ["theme:style.css"]) this.head.link ({rel: "stylesheet", href: this.var ["theme:style.css"]});
|
|
145
|
+
if (this.var ["google-tag-manager"]) this.head.script ({src: "https://www.googletagmanager.com/gtag/js?id=" + this.var ["google-tag-manager"]}, "async");
|
|
146
|
+
this.head.script ({src: "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"});
|
|
147
|
+
this.head.script ({src: "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"});
|
|
148
|
+
this.head.script ({src: "https://unpkg.com/lodash@4.17.21/core.min.js"});
|
|
149
|
+
this.head.script ({src: "https://unpkg.com/vue@3.5.27/dist/vue.global.prod.js"});
|
|
150
|
+
this.head.script ({src: "https://unpkg.com/vue-router@4.6.4/dist/vue-router.global.prod.js"});
|
|
151
|
+
if (this.var ["prototype.js"]) this.head.script ({src: this.var ["prototype.js"]});
|
|
152
|
+
if (this.var ["vue.js:core"]) this.head.script ({src: this.var ["vue.js:core"]});
|
|
153
|
+
if (this.var ["vue.js:layout"]) this.head.script ({src: this.var ["vue.js:layout"]});
|
|
154
|
+
if (this.var ["vue.js:component"]) this.head.script ({src: this.var ["vue.js:component"]});
|
|
155
|
+
if (this.var ["vue.js:element"]) this.head.script ({src: this.var ["vue.js:element"]});
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
render (body) {
|
|
159
|
+
if (this.populated) {}
|
|
160
|
+
else this.populate (variable);
|
|
161
|
+
this.markup = new Function.html.markup (`<!DOCTYPE html>`);
|
|
162
|
+
this.markup.push (0, `<html${Function.html.attribute (this.var ["html:attribute"], {space: true})}>`);
|
|
163
|
+
this.markup.push (1, `<head>`);
|
|
164
|
+
this.markup.push (2, `<title>${this.var.title}</title>`);
|
|
165
|
+
for (var i in this.head.data.meta) this.markup.push (2, `<meta${Function.html.attribute (this.head.data.meta [i].attribute, {space: true, prop: this.head.data.meta [i].prop})}>`);
|
|
166
|
+
for (var i in this.head.data.link) this.markup.push (2, `<link${Function.html.attribute (this.head.data.link [i].attribute, {space: true, prop: this.head.data.link [i].prop})}>`);
|
|
167
|
+
for (var i in this.head.data.style) this.markup.push (2, `<style${Function.html.attribute (this.head.data.style [i].attribute, {space: true, prop: this.head.data.style [i].prop})}>${this.head.data.style [i].css}</style>`);
|
|
168
|
+
for (var i in this.head.data.script) this.markup.push (2, `<script${Function.html.attribute (this.head.data.script [i].attribute, {space: true, prop: this.head.data.script [i].prop})}></script>`);
|
|
169
|
+
if (this.var ["google-tag-manager"]) this.markup.push (2, `<script>window.dataLayer = window.dataLayer || []; function gtag () { dataLayer.push (arguments); gtag ("js", new Date ()); gtag ("config", "${this.var ['google-tag-manager']}"); }</script>`);
|
|
170
|
+
this.markup.push (2, `<script>vue.app.theme = {{ vue.app.theme }}</script>`);
|
|
171
|
+
this.markup.push (2, `<script>vue.app.var = {{ vue.app.var }}</script>`);
|
|
172
|
+
this.markup.push (2, `<style>[application] { opacity: 0; }</style>`);
|
|
173
|
+
this.markup.push (1, `</head>`);
|
|
174
|
+
this.markup.push (1, `<body>`);
|
|
175
|
+
this.markup.push (0, Function.markup.render (body, 2));
|
|
176
|
+
if (this.var ["vue.js"]) this.markup.push (2, `<script src="${this.var ["vue.js"]}"></script>`);
|
|
177
|
+
this.markup.push (1, `</body>`);
|
|
178
|
+
this.markup.push (0, `</html>`);
|
|
179
|
+
if (this.var.debug) {
|
|
180
|
+
this.markup.push (0, `<!--`);
|
|
181
|
+
this.markup.push (0, (this.var.debug || ""));
|
|
182
|
+
this.markup.push (0, `-->`);
|
|
183
|
+
}
|
|
184
|
+
return this.markup.string ().format (this.var);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
Define (Function.html, "template", function () {});
|
|
189
|
+
Define (Function.html.template, "test", function () {
|
|
190
|
+
var markup = new Function.markup (`
|
|
191
|
+
<div>
|
|
192
|
+
<p>hello</p>
|
|
193
|
+
</div>
|
|
194
|
+
`);
|
|
195
|
+
return markup.render ();
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
Define (Function.html, "head", class {
|
|
199
|
+
constructor () {
|
|
200
|
+
this.data = {meta: [], link: [], style: [], script: []}
|
|
201
|
+
}
|
|
202
|
+
meta (attribute, prop) {
|
|
203
|
+
this.data.meta.push ({attribute, prop});
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
206
|
+
link (attribute, prop) {
|
|
207
|
+
this.data.link.push ({attribute, prop});
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
210
|
+
style (attribute, prop, css) {
|
|
211
|
+
this.data.style.push ({attribute, prop, css});
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
script (attribute, prop) {
|
|
215
|
+
this.data.script.push ({attribute, prop});
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
Define (Function.html, "attribute", function (attribute, option = {}) {
|
|
221
|
+
var result = [];
|
|
222
|
+
for (var i in attribute) result.push (`${i}="${attribute [i] || ''}"`);
|
|
223
|
+
if (option.prop) result.push (option.prop);
|
|
224
|
+
if (result = result.join (" ")) return (option.space ? " " : "") + result;
|
|
225
|
+
else return "";
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
Define (Function.html, "markup", class {
|
|
229
|
+
constructor (... markup) {
|
|
230
|
+
this.markup = [... markup];
|
|
231
|
+
}
|
|
232
|
+
push (tab, content) {
|
|
233
|
+
this.markup.push (("\t").repeat (tab) + content);
|
|
234
|
+
}
|
|
235
|
+
string (ln = "\n") {
|
|
236
|
+
return this.markup.join (ln);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* xxx
|
|
242
|
+
*
|
|
243
|
+
* title
|
|
244
|
+
* description
|
|
245
|
+
* sub description
|
|
246
|
+
*
|
|
247
|
+
* xxx://xxx.xxx.xxx/xxx
|
|
248
|
+
*/
|
|
249
|
+
|
|
250
|
+
Symbol.export.markup = Function.markup;
|
|
251
|
+
Symbol.export.html = Function.html;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* the end
|
|
255
|
+
*
|
|
256
|
+
* xxx://xxx.xxx.xxx/xxx
|
|
257
|
+
*/
|
package/node_packages/script.js
CHANGED
|
@@ -148,8 +148,8 @@ Define (String.prototype, "clone", function () { return this.trim (); });
|
|
|
148
148
|
Define (String.prototype, "format", function (format) { var string = this.trim (); for (var i in format) string = string.split (`{{ ${i} }}`).join (format [i]); return string; });
|
|
149
149
|
Define (String.prototype, "small", function () { return this.toLowerCase (); });
|
|
150
150
|
Define (String.prototype, "big", function () { return this.toUpperCase (); });
|
|
151
|
-
Define (String.prototype, "first", function (input = 1) { if (typeof input === "number") return this.substr (0, input); else return this.startsWith (input); });
|
|
152
|
-
Define (String.prototype, "last", function (input = 1) { if (typeof input === "number") return this.substr (- input); else return this.endsWith (input); });
|
|
151
|
+
Define (String.prototype, "first", function (input = 1) { if (typeof input === "number") return this.substr (0, input); else return this.startsWith (input); }); Define (String.prototype, "begin", function (input = 1) { return this.first (input); });
|
|
152
|
+
Define (String.prototype, "last", function (input = 1) { if (typeof input === "number") return this.substr (- input); else return this.endsWith (input); }); Define (String.prototype, "end", function (input = 1) { return this.last (input); });
|
|
153
153
|
Define (String.prototype, "after", function (input, offset) { if ((offset = this.indexOf (input, offset)) >= 0) return this.substr (offset + input.length); else return ""; });
|
|
154
154
|
Define (String.prototype, "before", function (input, offset) { if ((offset = this.indexOf (input, offset)) >= 0) return this.substr (0, offset); else return ""; });
|
|
155
155
|
Define (String.prototype, "pop", function (length = 1) { return this.substr (0, (this.length - length)); });
|
|
@@ -213,7 +213,7 @@ Define (Date, "io", class {
|
|
|
213
213
|
var date = {
|
|
214
214
|
"Y": this.year (),
|
|
215
215
|
"M": this.month (), "m": Date.month.name [this.month ()],
|
|
216
|
-
"D": this.day (), "d": Date.
|
|
216
|
+
"D": this.day (), "d": Date.day.name [this.week ()], "W": this.week (),
|
|
217
217
|
"H": this.hour (), "h": this.hour ("meredian"),
|
|
218
218
|
"I": this.minute (),
|
|
219
219
|
"S": this.second (),
|
|
@@ -226,7 +226,7 @@ Define (Date, "io", class {
|
|
|
226
226
|
year () { return this.date.getFullYear (); }
|
|
227
227
|
month () { return (this.date.getMonth () + 1).toString ().padStart (2, "0"); }
|
|
228
228
|
day () { return this.date.getDate ().toString ().padStart (2, "0"); }
|
|
229
|
-
week () { return this.date.getDay ().toString ().padStart (2, "0"); }
|
|
229
|
+
week () { return (this.date.getDay () + 1).toString ().padStart (2, "0"); }
|
|
230
230
|
hour (meredian) { if (meredian) { var hour = this.date.getHours (); if (this.meredian () === "PM") if (hour === 12) return hour.toString (); else return (hour - 12).toString ().padStart (2, "0"); else return hour.toString ().padStart (2, "0"); } else return this.date.getHours ().toString ().padStart (2, "0"); }
|
|
231
231
|
minute () { return this.date.getMinutes ().toString ().padStart (2, "0"); }
|
|
232
232
|
second () { return this.date.getSeconds ().toString ().padStart (2, "0"); }
|
|
@@ -291,7 +291,7 @@ Define (Date.embed, "minute", function (input) { var minute = Math.floor (input
|
|
|
291
291
|
|
|
292
292
|
Define (Event, "io", class {
|
|
293
293
|
constructor () {
|
|
294
|
-
this.data =
|
|
294
|
+
this.data = Object.create (null);
|
|
295
295
|
}
|
|
296
296
|
on (key, value) {
|
|
297
297
|
if (this.data [key]) this.data [key].push (value);
|
|
@@ -307,6 +307,8 @@ Define (Event, "io", class {
|
|
|
307
307
|
});
|
|
308
308
|
|
|
309
309
|
Define (Event, "proto", function (proto) {
|
|
310
|
+
if (proto) {}
|
|
311
|
+
else proto = Object.create (null);
|
|
310
312
|
proto.event = proto.event || Object.create (null);
|
|
311
313
|
proto.on = function (key, value) {
|
|
312
314
|
if (proto.event [key]) proto.event [key].push (value);
|
|
@@ -563,168 +565,7 @@ Define (Function.hash, "md5", function (input) { return Function.hash.crypto.api
|
|
|
563
565
|
*/
|
|
564
566
|
|
|
565
567
|
/**
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
* title
|
|
569
|
-
* description
|
|
570
|
-
* sub description
|
|
571
|
-
*
|
|
572
|
-
* xxx://xxx.xxx.xxx/xxx
|
|
573
|
-
*/
|
|
574
|
-
|
|
575
|
-
Define (Function, "html", class {
|
|
576
|
-
constructor () {
|
|
577
|
-
this.head = new Function.html.head (this);
|
|
578
|
-
this.config = {}
|
|
579
|
-
this.var = {
|
|
580
|
-
"html:attribute": {},
|
|
581
|
-
title: "UnTitled",
|
|
582
|
-
description: "",
|
|
583
|
-
charset: "UTF-8",
|
|
584
|
-
meta: [],
|
|
585
|
-
link: {style: []},
|
|
586
|
-
google: {font: [], "tag:manager": "G-6JM1DVVQPT"},
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
set (key, value) {
|
|
590
|
-
if (key === "html:attribute") for (var i in value) this.var ["html:attribute"][i] = value [i];
|
|
591
|
-
else if (key === "language") this.var ["html:attribute"]["lang"] = value;
|
|
592
|
-
else if (key === "meta") this.var.meta.push (value);
|
|
593
|
-
else if (key === "link:style") this.var.link.style.push (value);
|
|
594
|
-
else if (key === "google:font") this.var.google.font.push (value);
|
|
595
|
-
else this.var [key] = value;
|
|
596
|
-
return this;
|
|
597
|
-
}
|
|
598
|
-
delete (key, value) {
|
|
599
|
-
if (key === "html:attribute") delete this.var ["html:attribute"][value];
|
|
600
|
-
else if (key === "language") delete this.var ["html:attribute"]["lang"];
|
|
601
|
-
else delete this.var [key];
|
|
602
|
-
return this;
|
|
603
|
-
}
|
|
604
|
-
populate () {
|
|
605
|
-
this.populated = true;
|
|
606
|
-
this.head.meta ({charset: this.var.charset});
|
|
607
|
-
this.head.meta ({"http-equiv": "X-UA-Compatible", content: "IE=edge"});
|
|
608
|
-
this.head.meta ({"http-equiv": "X-Cross-Origin", content: "*"});
|
|
609
|
-
this.head.meta ({name: "viewport", content: this.var ["viewport"] || "width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=1"});
|
|
610
|
-
this.head.meta ({name: "generator", content: this.var ["generator"] || "Netizen" || "Express (5.2.1) Vue (3.5.27)"});
|
|
611
|
-
this.head.meta ({name: "author", content: this.var ["author"] || "Netizen"});
|
|
612
|
-
this.head.meta ({name: "description", content: this.var.description});
|
|
613
|
-
this.head.meta ({name: "keywords", content: this.var ["keyword"]});
|
|
614
|
-
this.head.meta ({name: "robots", content: this.var ["robot"] || "index, follow, max-snippet:-1, max-video-preview:-1, max-image-preview:large"});
|
|
615
|
-
this.head.meta ({name: "rating", content: this.var ["rating"] || "general"});
|
|
616
|
-
this.head.meta ({name: "google", content: "notranslate"});
|
|
617
|
-
this.head.meta ({name: "googlebot", content: "notranslate"});
|
|
618
|
-
this.head.meta ({name: "googlebot-news", content: this.var ["google-bot:article"] || "index, follow"});
|
|
619
|
-
if (this.var ["google-site-verification"]) this.head.meta ({name: "google-site-verification", content: this.var ["google-site-verification"]});
|
|
620
|
-
if (this.var ["yandex-verification"]) this.head.meta ({name: "yandex-verification", content: this.var ["yandex-verification"]});
|
|
621
|
-
this.head.meta ({name: "twitter:card", content: this.var ["twitter:card"] || "summary_large_image"});
|
|
622
|
-
this.head.meta ({name: "twitter:title", content: this.var ["twitter:title"]});
|
|
623
|
-
this.head.meta ({name: "twitter:description", content: this.var ["twitter:description"] || this.var.description});
|
|
624
|
-
this.head.meta ({name: "twitter:image", content: this.var ["twitter:image"]});
|
|
625
|
-
this.head.meta ({property: "og:site_name", content: this.var ["og:site_name"]});
|
|
626
|
-
this.head.meta ({property: "og:site_description", content: this.var ["og:site_description"]});
|
|
627
|
-
this.head.meta ({property: "og:title", content: this.var ["og:title"] || this.var.title});
|
|
628
|
-
this.head.meta ({property: "og:description", content: this.var ["og:description"] || this.var.description});
|
|
629
|
-
this.head.meta ({property: "og:url", content: this.var ["og:url"] || this.var.canonical});
|
|
630
|
-
this.head.meta ({property: "og:image", content: this.var ["og:image"]});
|
|
631
|
-
this.head.meta ({property: "og:type", content: this.var ["og:type"] || "website"});
|
|
632
|
-
this.head.meta ({property: "og:locale", content: this.var ["og:locale"] || this.var ["html:attribute"]["lang"] || "en"});
|
|
633
|
-
for (var i in this.var.meta) this.head.meta (this.var.meta [i].attribute, this.var.meta [i].prop);
|
|
634
|
-
this.head.link ({rel: "icon", href: this.var ["favorite.ico"] || "/favicon.ico"});
|
|
635
|
-
this.head.link ({rel: "canonical", href: this.var.canonical || "/"});
|
|
636
|
-
if (this.config ["manifest.json"]) this.head.link ({rel: "manifest", href: this.var ["manifest.json"] || "/manifest.json"});
|
|
637
|
-
if (this.config ["feed.xml"]) this.head.link ({rel: "alternate", href: "/feed/", type: "application/rss+xml", title: "{{ site:name }} » Feed"});
|
|
638
|
-
if (this.config ["feed.xml:atom"]) this.head.link ({rel: "alternate", href: "/feed/atom/", type: "application/rss+xml", title: "{{ site:name }} » Feed (Atom)"});
|
|
639
|
-
this.head.link ({rel: "dns-prefetch", href: "https://www.google-analytics.com"});
|
|
640
|
-
this.head.link ({rel: "dns-prefetch", href: "https://www.googletagmanager.com"});
|
|
641
|
-
this.head.link ({rel: "preconnect", href: "https://fonts.gstatic.com"}, "crossorigin");
|
|
642
|
-
this.head.link ({rel: "preconnect", href: "https://fonts.googleapis.com"}, "crossorigin");
|
|
643
|
-
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"});
|
|
644
|
-
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"});
|
|
645
|
-
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"});
|
|
646
|
-
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"});
|
|
647
|
-
this.head.link ({rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,slnt,wdth,wght,GRAD,ROND@6..144,-10..0,25..151,1..1000,0..100,0..100&display=swap"});
|
|
648
|
-
for (var i in this.var.google.font) this.head.link ({rel: "stylesheet", href: this.var.google.font [i]});
|
|
649
|
-
for (var i in this.var.link.style) this.head.link ({rel: "stylesheet", href: this.var.link.style [i]});
|
|
650
|
-
this.head.link ({rel: "stylesheet", href: "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css"});
|
|
651
|
-
this.head.link ({rel: "stylesheet", href: "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css"});
|
|
652
|
-
if (this.var.google ["tag:manager"]) this.head.script ({src: "https://www.googletagmanager.com/gtag/js?id=" + this.var.google ["tag:manager"]}, "async");
|
|
653
|
-
this.head.script ({src: "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"});
|
|
654
|
-
this.head.script ({src: "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"});
|
|
655
|
-
this.head.script ({src: "https://unpkg.com/lodash@4.17.21/core.min.js"});
|
|
656
|
-
this.head.script ({src: "https://unpkg.com/vue@3.5.27/dist/vue.global.prod.js"});
|
|
657
|
-
this.head.script ({src: "https://unpkg.com/vue-router@4.6.4/dist/vue-router.global.prod.js"});
|
|
658
|
-
this.head.script ({src: "/test.js?123"});
|
|
659
|
-
return this;
|
|
660
|
-
}
|
|
661
|
-
render (variable = {}) {
|
|
662
|
-
if (!this.populated) this.populate ();
|
|
663
|
-
this.markup = new Function.html.markup (`<!DOCTYPE html>`);
|
|
664
|
-
this.markup.push (0, `<html${Function.html.attribute (this.var ["html:attribute"], {space: true})}>`);
|
|
665
|
-
this.markup.push (1, `<head>`);
|
|
666
|
-
this.markup.push (2, `<title>${this.var.title}</title>`);
|
|
667
|
-
for (var i in this.head.data.meta) this.markup.push (2, `<meta${Function.html.attribute (this.head.data.meta [i].attribute, {space: true, prop: this.head.data.meta [i].prop})}>`);
|
|
668
|
-
for (var i in this.head.data.link) this.markup.push (2, `<link${Function.html.attribute (this.head.data.link [i].attribute, {space: true, prop: this.head.data.link [i].prop})}>`);
|
|
669
|
-
for (var i in this.head.data.script) this.markup.push (2, `<script${Function.html.attribute (this.head.data.script [i].attribute, {space: true, prop: this.head.data.script [i].prop})}></script>`);
|
|
670
|
-
for (var i in this.head.data.style) this.markup.push (2, `<style${Function.html.attribute (this.head.data.style [i].attribute, {space: true, prop: this.head.data.style [i].prop})}>${this.head.data.style [i].css}</style>`);
|
|
671
|
-
this.markup.push (1, `</head>`);
|
|
672
|
-
this.markup.push (1, `<body>`);
|
|
673
|
-
this.markup.push (1, `</body>`);
|
|
674
|
-
this.markup.push (0, `</html>`);
|
|
675
|
-
if (this.var.debug) {
|
|
676
|
-
this.markup.push (0, `<!--`);
|
|
677
|
-
this.markup.push (0, (this.var.debug || ""));
|
|
678
|
-
this.markup.push (0, `-->`);
|
|
679
|
-
}
|
|
680
|
-
return this.markup.string ().format (variable);
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
|
|
684
|
-
Define (Function.html, "head", class {
|
|
685
|
-
constructor () {
|
|
686
|
-
this.data = {meta: [], link: [], style: [], script: []}
|
|
687
|
-
}
|
|
688
|
-
meta (attribute, prop) {
|
|
689
|
-
this.data.meta.push ({attribute, prop});
|
|
690
|
-
return this;
|
|
691
|
-
}
|
|
692
|
-
link (attribute, prop) {
|
|
693
|
-
this.data.link.push ({attribute, prop});
|
|
694
|
-
return this;
|
|
695
|
-
}
|
|
696
|
-
style (attribute, prop, css) {
|
|
697
|
-
this.data.style.push ({attribute, prop, css});
|
|
698
|
-
return this;
|
|
699
|
-
}
|
|
700
|
-
script (attribute, prop) {
|
|
701
|
-
this.data.script.push ({attribute, prop});
|
|
702
|
-
return this;
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
|
|
706
|
-
Define (Function.html, "attribute", function (attribute, option = {}) {
|
|
707
|
-
var result = [];
|
|
708
|
-
for (var i in attribute) result.push (`${i}="${attribute [i] || ''}"`);
|
|
709
|
-
if (option.prop) result.push (option.prop);
|
|
710
|
-
if (result = result.join (" ")) return (option.space ? " " : "") + result;
|
|
711
|
-
else return "";
|
|
712
|
-
});
|
|
713
|
-
|
|
714
|
-
Define (Function.html, "markup", class {
|
|
715
|
-
constructor (... markup) {
|
|
716
|
-
this.markup = [... markup];
|
|
717
|
-
}
|
|
718
|
-
push (tab, content) {
|
|
719
|
-
this.markup.push (("\t").repeat (tab) + content);
|
|
720
|
-
}
|
|
721
|
-
string (ln = "\n") {
|
|
722
|
-
return this.markup.join (ln);
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* xxx
|
|
568
|
+
* 3rd party
|
|
728
569
|
*
|
|
729
570
|
* title
|
|
730
571
|
* description
|
|
@@ -1001,7 +842,7 @@ Define (Function.appwrite.db, "select", class {
|
|
|
1001
842
|
if (typeof this.prop.filter !== "object") this.prop.filter = {serial: (serial = this.prop.filter)}
|
|
1002
843
|
var __ = function (db) {
|
|
1003
844
|
return new Promise (async function (resolve, reject) {
|
|
1004
|
-
var data;
|
|
845
|
+
var data = [];
|
|
1005
846
|
var error = false;
|
|
1006
847
|
var database, result, query = [];
|
|
1007
848
|
if (serial) query = [Function.appwrite.api.Query.limit (1)]
|
|
@@ -1046,14 +887,14 @@ Symbol.export = {
|
|
|
1046
887
|
define: Object.define,
|
|
1047
888
|
object: Object, array: Array, string: String, number: Number, function: Function,
|
|
1048
889
|
date: Date, time: Date.time, event: Event, promise: Promise,
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
html: Function.html,
|
|
1053
|
-
hash: Function.hash, unique: Function.unique,
|
|
890
|
+
cookie: Function.cookie, session: Function.session, ls: Function.ls,
|
|
891
|
+
url: URL, path: Function.path, file: Function.file, dir: Function.dir,
|
|
892
|
+
markup: Function.markup, html: Function.html, css: Function.css, js: Function.js, json: JSON, xml: Function.xml, serialize: Function.serialize,
|
|
1054
893
|
help: Function.help, next: function (resolve) { return Promise.resolve (resolve); },
|
|
894
|
+
hash: Function.hash, unique: Function.unique,
|
|
1055
895
|
ajax: Function.ajax, owl: Function.owl,
|
|
1056
|
-
express: Function.express,
|
|
896
|
+
express: Function.express, mongo: Function.mongo, firebase: Function.firebase, appwrite: Function.appwrite,
|
|
897
|
+
cloudflare: Function.cloudflare, google: Function.google,
|
|
1057
898
|
}
|
|
1058
899
|
|
|
1059
900
|
/**
|
package/package.json
CHANGED