PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.24
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.24
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / assets / js / utils / form-builder-assets.js

form-builder-assets.js in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.24, at assets/js/utils/form-builder-assets.js

83 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Returns file paths of vue assets
3 */
4
5 /* global module, require */
6 function assets() {
7 'use strict';
8
9 // const grunt = require('grunt');
10 const fs = require('fs');
11 let paths = {
12 mixins: ['assets/js/utils/jquery-siaf-start.js'],
13 components: ['assets/js/utils/jquery-siaf-start.js'],
14 componentTemplates: [],
15 spa: {
16 app: [],
17 components: [],
18 mixins: [],
19 templates: []
20 }
21 };
22
23 // mixins
24 // const mixinsPath = './admin/form-builder/assets/js/mixins/';
25 // let mixins = fs.readdirSync(mixinsPath);
26
27 // mixins.forEach((mixin) => {
28 // const path = `${mixinsPath}${mixin}`;
29
30 // if (grunt.file.isFile(path)) {
31 // paths.mixins.push(path);
32 // }
33 // });
34
35 // components
36 const componentPath = './assets/components/';
37 let components = fs.readdirSync(componentPath);
38
39 components.forEach((component) => {
40 const path = `${componentPath}${component}`;
41
42 if (fs.lstatSync(path).isDirectory()) {
43 paths.components.push(path + '/index.js');
44 paths.componentTemplates.push(path + '/template.php');
45 }
46 });
47
48 paths.mixins.push('assets/js/utils/jquery-siaf-end.js');
49 paths.components.push('assets/js/utils/jquery-siaf-end.js');
50
51 // SPA component paths
52 const spaComponentPath = './assets/spa/components/';
53 let spaComponents = fs.readdirSync(spaComponentPath);
54
55 spaComponents.forEach((component) => {
56 const path = `${spaComponentPath}${component}`;
57
58 if (fs.lstatSync(path).isDirectory()) {
59 paths.spa.components.push(path + '/index.js');
60 paths.spa.templates.push(path + '/template.php');
61 }
62 });
63
64 // spa mixins
65 const spaMixinsPath = './assets/spa/mixins/';
66 let spaMixins = fs.readdirSync(spaMixinsPath);
67
68 spaMixins.forEach((mixin) => {
69 const path = `${spaMixinsPath}${mixin}`;
70
71 paths.spa.mixins.push(path);
72 });
73
74 let app = paths.spa.app.concat( paths.spa.components );
75 app.push( './assets/spa/app.js' );
76
77 paths.spa.app = app;
78
79 return paths;
80 }
81
82 module.exports = assets();
83