webfast 0.1.83 → 0.1.84
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/README.md +19 -0
- package/app/content/js/webfast.js +19 -9
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -112,6 +112,25 @@ routes
|
|
112
112
|
Within these folders, you can establish a dynamic setup, as exemplified in the module itself.
|
113
113
|
|
114
114
|
```
|
115
|
+
## program.modules.dependOn
|
116
|
+
example :
|
117
|
+
```
|
118
|
+
module.exports = {
|
119
|
+
dependOn: ['express.app','modules.data'],
|
120
|
+
name: '{UNIQUE_NAME}',
|
121
|
+
run: async function (program, name,functions) {
|
122
|
+
},
|
123
|
+
functions : {
|
124
|
+
}
|
125
|
+
}
|
126
|
+
```
|
127
|
+
To add an dependOn function
|
128
|
+
```
|
129
|
+
program.modules.dependOn({REQUIRE},program,`{UNIQUE_NAME}-sync`,function(){
|
130
|
+
console.log(`Depend On CallBack`);
|
131
|
+
});
|
132
|
+
```
|
133
|
+
|
115
134
|
## License
|
116
135
|
|
117
136
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
@@ -127,6 +127,16 @@ web.fast.connectWebSocket = function(socketURL,maxRetries = 40, retries = 0) {
|
|
127
127
|
web.fast.que.state = true;
|
128
128
|
|
129
129
|
//alert(web.fast.tools.isMobile);
|
130
|
+
var generateRandomId = async function(length) {
|
131
|
+
var result = '';
|
132
|
+
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
133
|
+
var charactersLength = characters.length;
|
134
|
+
for (var i = 0; i < length; i++) {
|
135
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
136
|
+
}
|
137
|
+
return result;
|
138
|
+
};
|
139
|
+
|
130
140
|
function arraySend() {
|
131
141
|
try {
|
132
142
|
if (web.fast.user != undefined && web.fast.inial == undefined || window.Telegram.WebApp.initData == `` && web.fast.inial == undefined) {
|
@@ -134,16 +144,8 @@ web.fast.connectWebSocket = function(socketURL,maxRetries = 40, retries = 0) {
|
|
134
144
|
jQuery(`[webfast-get]`).each(async function(){
|
135
145
|
const type = jQuery(this).attr(`webfast-get`);
|
136
146
|
let id = jQuery(this).attr(`id`);
|
147
|
+
console.log(`THE GET`);
|
137
148
|
if (id == undefined) {
|
138
|
-
var generateRandomId = async function(length) {
|
139
|
-
var result = '';
|
140
|
-
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
141
|
-
var charactersLength = characters.length;
|
142
|
-
for (var i = 0; i < length; i++) {
|
143
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
144
|
-
}
|
145
|
-
return result;
|
146
|
-
};
|
147
149
|
id = await generateRandomId(8); // Generate a random ID of length 8
|
148
150
|
}
|
149
151
|
arraySend.push({
|
@@ -183,6 +185,7 @@ web.fast.connectWebSocket = function(socketURL,maxRetries = 40, retries = 0) {
|
|
183
185
|
// We have user data
|
184
186
|
console.log(`Set User Data`);
|
185
187
|
web.fast.user = json;
|
188
|
+
|
186
189
|
// Now go Through to set all data
|
187
190
|
// Get all webfast client
|
188
191
|
jQuery(`[webfast-client]`).each(function(){
|
@@ -224,6 +227,13 @@ web.fast.connectWebSocket = function(socketURL,maxRetries = 40, retries = 0) {
|
|
224
227
|
|
225
228
|
web.fast.que.state = Date.now();
|
226
229
|
web.fast.receive(`socket`,event.data); // Placeholder for processing response
|
230
|
+
jQuery(document).ready(function(){
|
231
|
+
try {
|
232
|
+
web.fast.tools.on.connect();
|
233
|
+
} catch (err) {
|
234
|
+
console.error(`error getting connect data`);
|
235
|
+
}
|
236
|
+
})
|
227
237
|
} catch (err) {
|
228
238
|
console.error(`Error Receiving`);
|
229
239
|
console.error(event);
|
package/index.js
CHANGED
@@ -112,7 +112,7 @@ module.exports = async function (array) {
|
|
112
112
|
|
113
113
|
// Now include this thing then
|
114
114
|
try {
|
115
|
-
program.modules[reqFunc.name] = await reqFunc.run(program,reqFunc.name);
|
115
|
+
program.modules[reqFunc.name] = await reqFunc.run(program,reqFunc.name,reqFunc.functions);
|
116
116
|
if (callback != undefined) {
|
117
117
|
return callback(program,name)
|
118
118
|
} else {
|