layerpro 0.0.64 → 0.0.68

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.
Files changed (67) hide show
  1. package/{dist/LICENSE.txt → LICENSE.txt} +0 -0
  2. package/{dist/README.md → README.md} +0 -0
  3. package/index.js +2 -7
  4. package/package.json +142 -138
  5. package/.editorconfig +0 -13
  6. package/.env +0 -3
  7. package/.eslintignore +0 -12
  8. package/.eslintrc.json +0 -110
  9. package/.gitattributes +0 -2
  10. package/.github/FUNDING.yml +0 -12
  11. package/.github/dependabot.yml +0 -12
  12. package/.jsbeautifyrc +0 -26
  13. package/.prettierignore +0 -2
  14. package/.prettierrc +0 -7
  15. package/.vscode/launch.json +0 -22
  16. package/.vscode/settings.json +0 -84
  17. package/.vscodeignore +0 -28
  18. package/__mocks__/fileMock.js +0 -3
  19. package/__mocks__/styleMock.js +0 -3
  20. package/babel.config.js +0 -34
  21. package/backup.bat +0 -43
  22. package/coverage/coverage-final.json +0 -1
  23. package/coverage/lcov-report/base.css +0 -224
  24. package/coverage/lcov-report/block-navigation.js +0 -87
  25. package/coverage/lcov-report/favicon.png +0 -0
  26. package/coverage/lcov-report/index.html +0 -101
  27. package/coverage/lcov-report/prettify.css +0 -1
  28. package/coverage/lcov-report/prettify.js +0 -2
  29. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  30. package/coverage/lcov-report/sorter.js +0 -196
  31. package/coverage/lcov.info +0 -0
  32. package/documents/LICENSE.txt +0 -21
  33. package/documents/README.md +0 -7
  34. package/documents/SECURITY.md +0 -3
  35. package/init.js +0 -33
  36. package/jest.config.js +0 -61
  37. package/jsconfig.json +0 -10
  38. package/node/createTag.js +0 -7
  39. package/node/gitDeploy.js +0 -7
  40. package/node/goLive.js +0 -7
  41. package/scripts/genLayer.jsx +0 -234
  42. package/scripts/message.jsx +0 -280
  43. package/scripts/mouseCoords.jsx +0 -45
  44. package/scripts/popup.jsx +0 -612
  45. package/scripts/purge.jsx +0 -29
  46. package/scripts/smoothScroll.js +0 -69
  47. package/scripts/window.js +0 -28
  48. package/styles/dock.scss +0 -100
  49. package/styles/general.scss +0 -241
  50. package/styles/icons.scss +0 -33
  51. package/styles/input.scss +0 -35
  52. package/styles/messages.scss +0 -76
  53. package/styles/resize.scss +0 -99
  54. package/styles/root.scss +0 -14
  55. package/styles/scrollbar.scss +0 -24
  56. package/tests/setupJest.tsx +0 -4
  57. package/tsconfig.json +0 -69
  58. package/typings/cordova.d.ts +0 -12
  59. package/typings/dphelper.d.ts +0 -29
  60. package/typings/image.d.ts +0 -9
  61. package/typings/index.d.ts +0 -7
  62. package/typings/layerpro.d.ts +0 -23
  63. package/typings/menupro.d.ts +0 -18
  64. package/typings/namespace.d.ts +0 -7
  65. package/typings/styles.d.ts +0 -27
  66. package/typings/vscode.d.ts +0 -14724
  67. package/webpack.config.js +0 -239
@@ -1,196 +0,0 @@
1
- /* eslint-disable */
2
- var addSorting = (function() {
3
- 'use strict';
4
- var cols,
5
- currentSort = {
6
- index: 0,
7
- desc: false
8
- };
9
-
10
- // returns the summary table element
11
- function getTable() {
12
- return document.querySelector('.coverage-summary');
13
- }
14
- // returns the thead element of the summary table
15
- function getTableHeader() {
16
- return getTable().querySelector('thead tr');
17
- }
18
- // returns the tbody element of the summary table
19
- function getTableBody() {
20
- return getTable().querySelector('tbody');
21
- }
22
- // returns the th element for nth column
23
- function getNthColumn(n) {
24
- return getTableHeader().querySelectorAll('th')[n];
25
- }
26
-
27
- function onFilterInput() {
28
- const searchValue = document.getElementById('fileSearch').value;
29
- const rows = document.getElementsByTagName('tbody')[0].children;
30
- for (let i = 0; i < rows.length; i++) {
31
- const row = rows[i];
32
- if (
33
- row.textContent
34
- .toLowerCase()
35
- .includes(searchValue.toLowerCase())
36
- ) {
37
- row.style.display = '';
38
- } else {
39
- row.style.display = 'none';
40
- }
41
- }
42
- }
43
-
44
- // loads the search box
45
- function addSearchBox() {
46
- var template = document.getElementById('filterTemplate');
47
- var templateClone = template.content.cloneNode(true);
48
- templateClone.getElementById('fileSearch').oninput = onFilterInput;
49
- template.parentElement.appendChild(templateClone);
50
- }
51
-
52
- // loads all columns
53
- function loadColumns() {
54
- var colNodes = getTableHeader().querySelectorAll('th'),
55
- colNode,
56
- cols = [],
57
- col,
58
- i;
59
-
60
- for (i = 0; i < colNodes.length; i += 1) {
61
- colNode = colNodes[i];
62
- col = {
63
- key: colNode.getAttribute('data-col'),
64
- sortable: !colNode.getAttribute('data-nosort'),
65
- type: colNode.getAttribute('data-type') || 'string'
66
- };
67
- cols.push(col);
68
- if (col.sortable) {
69
- col.defaultDescSort = col.type === 'number';
70
- colNode.innerHTML =
71
- colNode.innerHTML + '<span class="sorter"></span>';
72
- }
73
- }
74
- return cols;
75
- }
76
- // attaches a data attribute to every tr element with an object
77
- // of data values keyed by column name
78
- function loadRowData(tableRow) {
79
- var tableCols = tableRow.querySelectorAll('td'),
80
- colNode,
81
- col,
82
- data = {},
83
- i,
84
- val;
85
- for (i = 0; i < tableCols.length; i += 1) {
86
- colNode = tableCols[i];
87
- col = cols[i];
88
- val = colNode.getAttribute('data-value');
89
- if (col.type === 'number') {
90
- val = Number(val);
91
- }
92
- data[col.key] = val;
93
- }
94
- return data;
95
- }
96
- // loads all row data
97
- function loadData() {
98
- var rows = getTableBody().querySelectorAll('tr'),
99
- i;
100
-
101
- for (i = 0; i < rows.length; i += 1) {
102
- rows[i].data = loadRowData(rows[i]);
103
- }
104
- }
105
- // sorts the table using the data for the ith column
106
- function sortByIndex(index, desc) {
107
- var key = cols[index].key,
108
- sorter = function(a, b) {
109
- a = a.data[key];
110
- b = b.data[key];
111
- return a < b ? -1 : a > b ? 1 : 0;
112
- },
113
- finalSorter = sorter,
114
- tableBody = document.querySelector('.coverage-summary tbody'),
115
- rowNodes = tableBody.querySelectorAll('tr'),
116
- rows = [],
117
- i;
118
-
119
- if (desc) {
120
- finalSorter = function(a, b) {
121
- return -1 * sorter(a, b);
122
- };
123
- }
124
-
125
- for (i = 0; i < rowNodes.length; i += 1) {
126
- rows.push(rowNodes[i]);
127
- tableBody.removeChild(rowNodes[i]);
128
- }
129
-
130
- rows.sort(finalSorter);
131
-
132
- for (i = 0; i < rows.length; i += 1) {
133
- tableBody.appendChild(rows[i]);
134
- }
135
- }
136
- // removes sort indicators for current column being sorted
137
- function removeSortIndicators() {
138
- var col = getNthColumn(currentSort.index),
139
- cls = col.className;
140
-
141
- cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
142
- col.className = cls;
143
- }
144
- // adds sort indicators for current column being sorted
145
- function addSortIndicators() {
146
- getNthColumn(currentSort.index).className += currentSort.desc
147
- ? ' sorted-desc'
148
- : ' sorted';
149
- }
150
- // adds event listeners for all sorter widgets
151
- function enableUI() {
152
- var i,
153
- el,
154
- ithSorter = function ithSorter(i) {
155
- var col = cols[i];
156
-
157
- return function() {
158
- var desc = col.defaultDescSort;
159
-
160
- if (currentSort.index === i) {
161
- desc = !currentSort.desc;
162
- }
163
- sortByIndex(i, desc);
164
- removeSortIndicators();
165
- currentSort.index = i;
166
- currentSort.desc = desc;
167
- addSortIndicators();
168
- };
169
- };
170
- for (i = 0; i < cols.length; i += 1) {
171
- if (cols[i].sortable) {
172
- // add the click event handler on the th so users
173
- // dont have to click on those tiny arrows
174
- el = getNthColumn(i).querySelector('.sorter').parentElement;
175
- if (el.addEventListener) {
176
- el.addEventListener('click', ithSorter(i));
177
- } else {
178
- el.attachEvent('onclick', ithSorter(i));
179
- }
180
- }
181
- }
182
- }
183
- // adds sorting functionality to the UI
184
- return function() {
185
- if (!getTable()) {
186
- return;
187
- }
188
- cols = loadColumns();
189
- loadData();
190
- addSearchBox();
191
- addSortIndicators();
192
- enableUI();
193
- };
194
- })();
195
-
196
- window.addEventListener('load', addSorting);
File without changes
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Dario Passariello
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,7 +0,0 @@
1
- # NOTE
2
-
3
- ![TypeScript](https://img.shields.io/badge/TypeScript-006b98?logo=TypeScript&logoColor=white)
4
- ![React-js](https://img.shields.io/badge/React-js-006b98?logo=React-js&logoColor=white)
5
- ![dpHelper](https://img.shields.io/badge/dpHelper-npm-green?logo=dpHelper&logoColor=white)
6
-
7
- This package is unde construction...
@@ -1,3 +0,0 @@
1
- # Security
2
-
3
- Please email [@passariello](https://github.com/passariello) or see https://dario.passariello.ca/contact/ if you have a potential security vulnerability to report.
package/init.js DELETED
@@ -1,33 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- (function () {
7
-
8
- var layerpro = window.layerpro = {}
9
-
10
- // LOAD SETUP
11
- const pjson = require('./package.json')
12
-
13
- // LOAD SCRIPTS
14
- require(__dirname + '/scripts/purge.jsx')
15
- require(__dirname + '/scripts/popup.jsx')
16
- require(__dirname + '/scripts/smoothScroll.js')
17
- require(__dirname + '/scripts/window.js')
18
-
19
- // FIRST MESSAGE
20
- console.groupCollapsed(`%c${pjson.name} v${pjson.version}%c`, "color:orange", "")
21
- console.debug(`%c${pjson.name} v${pjson.version}%c by Dario Passariello started`, "color:orange", "")
22
- console.debug(`%cType ${pjson.name} in this console to see it`, "color:gray", "")
23
- console.debug("%cFor help visit: " + pjson.repository.help, "color:gray", "")
24
- console.debug('name: %c' + pjson.name, "color:orange", "")
25
- console.debug('version: %c' + pjson.version, "color:orange", "")
26
- console.debug('description: %c' + pjson.description, "color:orange", "")
27
- console.debug('license: %c' + pjson.license, "color:orange", "")
28
- console.debug('repository: %c' + pjson.repository.url, "color:orange", "")
29
- console.debug('author: %c' + pjson.author.name, "color:orange", "")
30
- console.debug('email: %c' + pjson.author.email, "color:orange", "")
31
- console.groupEnd()
32
-
33
- })()
package/jest.config.js DELETED
@@ -1,61 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: CC BY-NC-ND 4.0
4
- */
5
-
6
- module.exports = {
7
- preset: 'ts-jest',
8
- globals: {
9
- 'ts-jest': {
10
- // ts-jest configuration goes here
11
- tsconfig: 'tests/tsconfig.json',
12
- },
13
- },
14
- testEnvironment: 'node',
15
- testRegex: 'tests/.*\\.test\\.ts$',
16
- collectCoverageFrom: ['src/**/*.ts'],
17
- automock: true,
18
- moduleFileExtensions: ['jsx', 'tsx', 'ts', 'js', 'json'],
19
- unmockedModulePathPatterns: [
20
- 'jest-editor-support/node_modules',
21
- 'color-convert',
22
- 'chalk',
23
- 'snapdragon',
24
- 'ansi-styles',
25
- 'core-js',
26
- 'debug',
27
- '@babel/template',
28
- 'graceful-fs',
29
- '@babel/core',
30
- ],
31
- moduleNameMapper: {
32
- '\\.(svg)$': '<rootDir>/tests/fileMock.ts',
33
- },
34
- }
35
-
36
- // module.export = {
37
- // roots: ['<rootDir>/src'],
38
- // transform: {
39
- // '\\.(js|jsx|ts|tsx)?$': 'babel-jest',
40
- // },
41
- // testMatch: ['<rootDir>/src/**/>(*.)test.{js, jsx, ts, tsx}'],
42
- // moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
43
- // testPathIgnorePatterns: ['/node_modules/', '/public/', '*/.OLD/'],
44
- // setupFilesAfterEnv: [
45
- // '@testing-library/jest-dom/extend-expect',
46
- // '@testing-library/react/cleanup-after-each'
47
- // ],
48
- // moduleNameMapper: {
49
- // "^Root/(.*)$": "<rootDir>/src$1",
50
- // "^Data/(.*)$": "<rootDir>/src/data$1",
51
- // "^Assets/(.*)$": "<rootDir>/src/assets$1",
52
- // "^Pages/(.*)$": "<rootDir>/src/pages$1",
53
- // "^Components/(.*)$": "<rootDir>/scr/components$1",
54
- // "^Scripts/(.*)$": "<rootDir>/scr/scripts$1",
55
- // "^Styles/(.*)$": "<rootDir>/scr/styles$1",
56
-
57
- // ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$": "identity-obj-proxy",
58
- // }
59
- // }
60
-
61
-
package/jsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- // See https://go.microsoft.com/fwlink/?LinkId=759670
3
- // for the documentation about the jsconfig.json format
4
- "compilerOptions": {
5
- "target": "es6",
6
- "module": "commonjs",
7
- "allowSyntheticDefaultImports": true
8
- },
9
- "exclude": ["node_modules", "bower_components", "jspm_packages", "tmp", "temp"]
10
- }
package/node/createTag.js DELETED
@@ -1,7 +0,0 @@
1
- const moment = require('moment')
2
- const execSync = require('node:child_process').execSync
3
- const dateTime = moment().format('YYYYMMDDHHmmss')
4
- const pjson = require('../package.json')
5
-
6
- //https://stackoverflow.com/questions/55021363/how-to-pass-current-datetime-in-npm-script-for-git-commit-message-in-windows-and
7
- execSync(`git tag \"v${pjson.version}\" -am \"Modify content\" && git push --tags`, { stdio: [0, 1, 2] })
package/node/gitDeploy.js DELETED
@@ -1,7 +0,0 @@
1
- const moment = require('moment')
2
- const execSync = require('node:child_process').execSync
3
- const dateTime = moment().format('YYYYMMDDHHmmss')
4
- const pjson = require('../package.json')
5
-
6
- //https://stackoverflow.com/questions/55021363/how-to-pass-current-datetime-in-npm-script-for-git-commit-message-in-windows-and
7
- execSync(`cd .. && git add . && git commit -m \"ver. ${pjson.version} / ${dateTime}\" && git pull && git push --all`, { stdio: [0, 1, 2] })
package/node/goLive.js DELETED
@@ -1,7 +0,0 @@
1
- const moment = require('moment')
2
- const execSync = require('node:child_process').execSync
3
- const dateTime = moment().format('YYYYMMDDHHmmss')
4
- const pjson = require('../package.json')
5
-
6
- //https://stackoverflow.com/questions/55021363/how-to-pass-current-datetime-in-npm-script-for-git-commit-message-in-windows-and
7
- execSync(`cli-confirm \"Do you want go live?\" && npm version patch --force && cd.. && webpack --progress --color --mode production --config webpack.config.js && cd dist && npm publish`, { stdio: [0, 1, 2] })
@@ -1,234 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- import { createRoot } from 'react-dom/client'
7
-
8
- export const genLayer = (p) => {
9
-
10
- var root // FUCKYOU FACEBOOK!
11
-
12
- let pContainer = p.raised === true ? '.popup_raised_' + p.id : '#popup'
13
-
14
- $('[class^="popup_window_"]', pContainer).removeClass('zHigh')
15
- $('[class^="popup_bar_"]', pContainer).removeClass('pupup_bar_selected')
16
- $('[class^="icon_"]', pContainer).removeClass('pupup_bar_selected')
17
-
18
- if (p.raised === true) {
19
- $('<div class="popup_raised_' + p.id + '">', pContainer)
20
- .appendTo('#popup')
21
- .css({
22
- 'pointer-events': 'auto',
23
- 'z-index': layerpro.popup.zIndex($('[class^="popup_overflow_"]', pContainer)) + 1000
24
- })
25
- }
26
-
27
- $('<div class="popup_overflow_' + p.id + '">', pContainer)
28
- .appendTo(pContainer)
29
- .css({
30
- 'top': p.top,
31
- 'left': p.left,
32
- 'right': p.right,
33
- 'bottom': p.bottom,
34
- 'width': p.width,
35
- 'height': p.height,
36
- 'min-width': p.minWidth,
37
- 'min-height': p.minHeight,
38
- 'pointer-events': 'auto',
39
- 'z-index': layerpro.popup.zIndex($('[class^="popup_overflow_"]', pContainer)) + 1
40
- })
41
- .on("mousedown", function (e) { layerpro.popup.index(p) })
42
- .hide()
43
- .fadeIn(p.fadeIn)
44
-
45
- let item = $('<div class="popup_window_' + p.id + '">', pContainer)
46
- //.on("mouseup", function( e ){ layerpro.popup.index( p ); })
47
- .appendTo('.popup_overflow_' + p.id)
48
- .css({ 'pointer-events': 'auto' })
49
- .addClass('zHigh')
50
-
51
- /*******************************************************************/
52
- // CHECK IF NEED CENTERED
53
-
54
- const pos = [p.top, p.left, p.bottom, p.right]
55
- const sum = pos.reduce((sumSoFar, nextValue) => {
56
- if (typeof nextValue === "number" && isFinite(nextValue)) { return sumSoFar + nextValue }
57
- return sumSoFar
58
- }, 0)
59
-
60
- if (sum === 0) layerpro.popup.center(p)
61
-
62
- /*******************************************************************/
63
- // BAR
64
-
65
- $('<div class="popup_bar_' + p.id + '">', pContainer)
66
- .appendTo(item)
67
- .addClass('pupup_bar_selected')
68
-
69
- $('<div class="popup_icon_' + p.id + '">' + p.icon + '</div>', pContainer)
70
- .appendTo(".popup_bar_" + p.id)
71
-
72
- $('<div class="popup_drag_' + p.id + '">' + p.name + '</div>', pContainer)
73
- .appendTo(".popup_bar_" + p.id)
74
-
75
- $('<div class="popup_option_' + p.id + '">', pContainer)
76
- .appendTo(".popup_bar_" + p.id)
77
-
78
- /*******************************************************************/
79
- // DOCK GENERATION
80
-
81
- if (p.iconize === true && $('#popup_dock').length === 0) {
82
-
83
- $('#root').css('margin', '0 0 var( --dock-height ) 0')
84
-
85
- let dock = `<div id="popup_dock">
86
- <div id="popup_dock_icon"></div>
87
- <div id="popup_dock_list"></div>
88
- <div id="popup_dock_options"></div>
89
- </div>`
90
-
91
- $(dock)
92
- .appendTo('#popup')
93
- .css({
94
- 'pointer-events': 'auto',
95
- 'z-index': layerpro.popup.zIndex($('#popup')) + 1000
96
- })
97
-
98
- }
99
-
100
- /*******************************************************************/
101
- // DOCK BEHAVIOR
102
-
103
- if ($('#popup_dock').length > 0 && p.dockable === true) {
104
- let dock_icon = `
105
- <div class="icon_${p.id}">
106
- <span>${p.icon}</span>
107
- <span>${p.name}</span>
108
- `
109
-
110
- $(dock_icon, '#popup_dock')
111
- .appendTo('#popup_dock_list')
112
- .addClass('pupup_bar_selected')
113
- .find("span")
114
- .on('click', function () {
115
-
116
- if ($(".popup_overflow_" + p.id + ':hidden')) {
117
- layerpro.popup.iconize(p)
118
- layerpro.popup.index(p)
119
- } else {
120
- layerpro.popup.iconize(p)
121
- }
122
-
123
- layerpro.popup.index(p)
124
-
125
- })
126
-
127
- $(`<button class="icon_close_${p.id}">X</button>`, '#popup_dock')
128
- .appendTo(`.icon_${p.id}`)
129
- .on('click', function () { layerpro.popup.close(p) })
130
- }
131
-
132
- /*******************************************************************/
133
- // ICONIFICATION
134
-
135
- if (p.iconize === true) {
136
- $('<button class="button_iconize_' + p.id + ' iconize">', '#popup')
137
- .appendTo(".popup_option_" + p.id)
138
- .on('click', function () { layerpro.popup.iconize(p) })
139
- }
140
-
141
- /*******************************************************************/
142
- // MAXIMIZATION
143
-
144
- if (p.maximize === true) {
145
- $('<button class="button_maximize_' + p.id + ' maximize">', '#popup')
146
- .appendTo(".popup_option_" + p.id)
147
- .on('click', function () { layerpro.popup.maximize(p) })
148
- }
149
-
150
- /*******************************************************************/
151
- // CLOSE
152
-
153
- if (p.close === true) {
154
- $('<button class="button_close_' + p.id + ' close">', '#popup')
155
- .appendTo(".popup_option_" + p.id)
156
- .on('click', function () { layerpro.popup.close(p) })
157
- }
158
-
159
- /*******************************************************************/
160
- // BODY
161
-
162
- let _overflow = $('<div class="popup_overflow_' + p.id + '">', '#popup')
163
-
164
- $('<div class="popup_internal_' + p.id + '">', _overflow)
165
- .appendTo(item)
166
-
167
- $('<div class="popup_body_' + p.id + '">', _overflow)
168
- .appendTo(".popup_internal_" + p.id)
169
- .hide()
170
- .fadeIn(p.fadeIn, function () { showBody() })
171
-
172
- const showBody = () => {
173
- if (p.body && !p.source) {
174
- if (p.body.props) {
175
-
176
- if (!p?.body?.props?.children) return (console.debug('You need to pass a component to LayerPro'))
177
-
178
- if (!root) root = createRoot($('.popup_body_' + p.id)[0])
179
- root.render(p.body.props.children)
180
- $('.popup_body_' + p.id).delay(900).fadeIn(100)
181
-
182
- //createRoot( $('.popup_body_' + p.id )[0] ).render( p.body.props.children );
183
-
184
- } else {
185
-
186
- $('.popup_body_' + p.id).html(p.body)
187
-
188
- }
189
- }
190
- return false
191
- }
192
-
193
- /*******************************************************************/
194
- // SOURCE
195
-
196
- if (p.source) {
197
-
198
- $('.popup_body_' + p.id).load(p.source, function (responseTxt, statusTxt, jqXHR) {
199
-
200
- if (statusTxt === "success") {
201
- $(this)
202
- .hide()
203
- .html(responseTxt)
204
- .fadeIn(p.fadeIn)
205
- /*.animate({ scrollTop:0 }, 500, 'swing'); */
206
- //console.log( responseTxt );
207
- }
208
-
209
- if (statusTxt === "error") {
210
- console.log("Error: " + jqXHR.status + " " + jqXHR.statusText)
211
- }
212
-
213
- })
214
-
215
- }
216
-
217
- /*******************************************************************/
218
- // MOVABLE
219
-
220
- if (p.movable) layerpro.popup.movable(p)
221
-
222
- /*******************************************************************/
223
- // RESIZE
224
-
225
- if (p.resizable) layerpro.popup.resizable(p)
226
-
227
- /*******************************************************************/
228
- // START MAXIMIZED
229
-
230
- if (p.isMaximize) layerpro.popup.maximize(p)
231
-
232
- return false
233
-
234
- }