layerpro 0.0.60 → 0.0.63

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/init.js CHANGED
@@ -7,8 +7,6 @@ License: MIT
7
7
 
8
8
  var layerpro = window.layerpro = {}
9
9
 
10
- require(__dirname + '/typings/layerpro.d.ts')
11
-
12
10
  // LOAD SETUP
13
11
  const pjson = require('./package.json')
14
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layerpro",
3
- "version": "0.0.60",
3
+ "version": "0.0.63",
4
4
  "description": "Manage your popups and customize them",
5
5
  "deprecated": false,
6
6
  "appCode": "layerpro",
@@ -5,7 +5,7 @@ License: MIT
5
5
 
6
6
  import { createRoot } from 'react-dom/client'
7
7
 
8
- export const GenLayer = (p) => {
8
+ export const genLayer = (p) => {
9
9
 
10
10
  var root // FUCKYOU FACEBOOK!
11
11
 
@@ -30,7 +30,7 @@ export const getMouseDirection = function (e) {
30
30
  oldX = e.pageX
31
31
  oldY = e.pageY
32
32
 
33
- console.log(xDirection)
33
+ //console.log(xDirection)
34
34
 
35
35
  return xDirection
36
36
 
package/scripts/popup.jsx CHANGED
@@ -5,7 +5,7 @@ License: MIT
5
5
 
6
6
  //import React, { useState, useEffect } from "react";
7
7
 
8
- import { GenLayer } from "./GenLayer.jsx"
8
+ import { genLayer } from "./genLayer.jsx"
9
9
  import { mouseCoord } from "./mouseCoords.jsx"
10
10
  import "./message.jsx"
11
11
 
@@ -19,7 +19,7 @@ $.ajaxSetup({
19
19
 
20
20
  const larX = 300
21
21
  const larY = 150
22
- // const prefs = localStorage.getItem('layerpro')
22
+ const prefs = localStorage.getItem('layerpro')
23
23
 
24
24
  let isdresizableRes
25
25
  let highIndex = 1
@@ -46,7 +46,7 @@ export const popup = {
46
46
  if (!p) return false
47
47
 
48
48
  p.id = p.id || Math.round(Math.random() * 1000)
49
- p.body = p.body || null
49
+ p.body = p.body
50
50
  p.width = p.width || 640
51
51
  p.height = p.height || 480
52
52
  p.name = p.name || 'popUp_' + p.id
@@ -55,7 +55,7 @@ export const popup = {
55
55
  p.iconize = p.iconize || null
56
56
  p.maximize = p.maximize || null
57
57
  p.isMaximize = p.isMaximize || null
58
- p.dockable = p.dockable || null
58
+ p.dockable = p.dockable
59
59
  p.close = p.close || null
60
60
  p.raised = p.raised || null
61
61
  p.movable = p.movable || null
@@ -93,7 +93,7 @@ export const popup = {
93
93
 
94
94
  // Creation of final PopUp (avoid to recreate if same id exist)
95
95
  if ($('.popup_window_' + p.id, '#popup').length === 0) {
96
- GenLayer(p)
96
+ genLayer(p)
97
97
  }
98
98
 
99
99
  /*******************************************************************/
@@ -348,15 +348,15 @@ export const popup = {
348
348
  }
349
349
  })
350
350
 
351
- _dragger.on('dblclick', function (p) {
351
+ _dragger.on('dblclick', function (e) {
352
352
  layerpro.popup.maximize(p)
353
353
  })
354
354
 
355
355
  function dragMouseDown(e) {
356
356
  pos3 = e.clientX
357
357
  pos4 = e.clientY
358
- document.addEventListener('mousemove', elementDrag)
359
- document.addEventListener('mouseup', elementDragEnd)
358
+ document.onmousemove = elementDrag
359
+ document.onmouseup = elementDragEnd
360
360
  return false
361
361
  }
362
362
 
@@ -423,8 +423,8 @@ export const popup = {
423
423
 
424
424
  popup.vfx(_parent, false)
425
425
 
426
- document.addEventListener('mousemove', (e) => { popup.doRes(e, id) })
427
- document.addEventListener('mouseup', () => { popup.stopRes(id) })
426
+ document.onmousemove = (e) => { popup.doRes(e, id) }
427
+ document.onmouseup = () => { popup.stopRes(id) }
428
428
 
429
429
  startX = cords[0]
430
430
  startY = cords[1]
@@ -463,27 +463,35 @@ export const popup = {
463
463
  /********************************************************************************************************************************************/
464
464
 
465
465
  // TOP DRAG
466
- if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1 && _sizer.hasClass("resize_0")) {
467
- if (_parent.height() >= larY) { _parent.css({ 'top': Number.parseInt(startBottom - Y1), 'height': Number.parseInt(Y1) }) }
468
- if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': Number.parseInt(larY + 1) }) }
466
+ if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1) {
467
+ if (_sizer.hasClass("resize_0")) {
468
+ if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
469
+ if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
470
+ }
469
471
  }
470
472
 
471
- if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1 && // RIGHT DRAG
472
- _sizer.hasClass("resize_1")) {
473
- if (_parent.width() >= larX) { _parent.css({ 'width': Number.parseInt(X), 'right': Number.parseInt(startLeft - X) }) }
474
- if (_parent.width() <= larX) { _parent.css({ 'width': Number.parseInt(larX + 1) }) }
473
+ if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1) {
474
+ // RIGHT DRAG
475
+ if (_sizer.hasClass("resize_1")) {
476
+ if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
477
+ if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
478
+ }
475
479
  }
476
480
 
477
- if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1 && // BOTTOM DRAG
478
- _sizer.hasClass("resize_2")) {
479
- if (_parent.height() >= larY) { _parent.css({ 'height': Number.parseInt(Y) }) }
480
- if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': Number.parseInt(larY + 1) }) }
481
+ if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1) {
482
+ // BOTTOM DRAG
483
+ if (_sizer.hasClass("resize_2")) {
484
+ if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
485
+ if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
486
+ }
481
487
  }
482
488
 
483
- if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1 && // LEFT DRAG
484
- _sizer.hasClass("resize_3")) {
485
- if (_parent.width() >= larX) { _parent.css({ 'width': Number.parseInt(X1), 'left': Number.parseInt(startRight - X1) }) }
486
- if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': Number.parseInt(larX + 1) }) }
489
+ if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1) {
490
+ // LEFT DRAG
491
+ if (_sizer.hasClass("resize_3")) {
492
+ if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
493
+ if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
494
+ }
487
495
  }
488
496
 
489
497
  /********************************************************************************************************************************************/
@@ -497,34 +505,34 @@ export const popup = {
497
505
 
498
506
  // TOP LEFT
499
507
  if (_sizer.hasClass("resize_corner_0")) {
500
- if (_parent.height() >= larY) { _parent.css({ 'top': Number.parseInt(startBottom - Y1), 'height': Number.parseInt(Y1) }) }
501
- if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': Number.parseInt(larY + 1) }) }
502
- if (_parent.width() >= larX) { _parent.css({ 'width': Number.parseInt(X1), 'left': Number.parseInt(startRight - X1) }) }
503
- if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': Number.parseInt(larX + 1) }) }
508
+ if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
509
+ if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
510
+ if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
511
+ if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
504
512
  }
505
513
 
506
514
  // TOP RIGHT
507
515
  if (_sizer.hasClass("resize_corner_1")) {
508
- if (_parent.height() >= larY) { _parent.css({ 'top': Number.parseInt(startBottom - Y1), 'height': Number.parseInt(Y1) }) }
509
- if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': Number.parseInt(larY + 1) }) }
510
- if (_parent.width() >= larX) { _parent.css({ 'width': Number.parseInt(X), 'right': Number.parseInt(startLeft - X) }) }
511
- if (_parent.width() <= larX) { _parent.css({ 'width': Number.parseInt(larX + 1) }) }
516
+ if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
517
+ if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
518
+ if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
519
+ if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
512
520
  }
513
521
 
514
522
  // BOTTOM RIGHT
515
523
  if (_sizer.hasClass("resize_corner_2")) {
516
- if (_parent.height() >= larY) { _parent.css({ 'height': Number.parseInt(Y) }) }
517
- if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': Number.parseInt(larY + 1) }) }
518
- if (_parent.width() >= larX) { _parent.css({ 'width': Number.parseInt(X), 'right': Number.parseInt(startLeft - X) }) }
519
- if (_parent.width() <= larX) { _parent.css({ 'width': Number.parseInt(larX + 1) }) }
524
+ if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
525
+ if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
526
+ if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
527
+ if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
520
528
  }
521
529
 
522
530
  // BOTTOM LEFT
523
531
  if (_sizer.hasClass("resize_corner_3")) {
524
- if (_parent.height() >= larY) { _parent.css({ 'height': Number.parseInt(Y) }) }
525
- if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': Number.parseInt(larY + 1) }) }
526
- if (_parent.width() >= larX) { _parent.css({ 'width': Number.parseInt(X1), 'left': Number.parseInt(startRight - X1) }) }
527
- if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': Number.parseInt(larX + 1) }) }
532
+ if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
533
+ if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
534
+ if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
535
+ if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
528
536
  }
529
537
 
530
538
  }
@@ -584,7 +592,7 @@ export const popup = {
584
592
  zIndex: function (els) {
585
593
 
586
594
  els.each(function () {
587
- let currentIndex = Number.parseInt($(this, '#popup').css("zIndex"), 10)
595
+ let currentIndex = parseInt($(this, '#popup').css("zIndex"), 10)
588
596
 
589
597
  if (currentIndex > highIndex) {
590
598
  highIndex = currentIndex
@@ -0,0 +1,12 @@
1
+ /*
2
+ Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
+ License: CC BY-NC-ND 4.0
4
+ */
5
+
6
+ declare global {
7
+ interface Window {
8
+ cordova: any
9
+ }
10
+ }
11
+
12
+ cordova = window.cordova || false
@@ -0,0 +1,29 @@
1
+ /*
2
+ Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
+ License: CC BY-NC-ND 4.0
4
+ */
5
+
6
+ declare module 'dphelper'
7
+ declare var dphelper: any
8
+ declare var store: any
9
+ declare var state: any
10
+ // declare var _dph: any;
11
+
12
+ declare module 'jquery'
13
+ declare var $: any
14
+
15
+ ////////////////////////////////////////////////////////////////
16
+
17
+ declare global {
18
+ interface Window {
19
+ dphelper: any
20
+ store: any
21
+ state: any
22
+ //_dph:any
23
+ }
24
+ }
25
+
26
+ dphelper = window.dphelper || []
27
+ store = window.store || []
28
+ state = window.state || []
29
+ //_dph = window._dph || [];
@@ -6,7 +6,7 @@ License: CC BY-NC-ND 4.0
6
6
  declare module 'layerpro'
7
7
  declare var layerpro: any
8
8
 
9
- // Remove confirm error about number of paramentes
9
+ // Remove popup errors about number of paramentes or existence
10
10
  declare function confirm(f1?, func1?, func2?)
11
11
  declare function prompt(f1?, string?)
12
12
  declare function message(f1?)
@@ -20,3 +20,4 @@ declare global {
20
20
  }
21
21
 
22
22
  layerpro = window.layerpro || {}
23
+
@@ -0,0 +1,18 @@
1
+ /*
2
+ Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
+ License: CC BY-NC-ND 4.0
4
+ */
5
+
6
+ declare module 'menupro'
7
+ declare var menupro: any
8
+
9
+ ////////////////////////////////////////////////////////////////
10
+
11
+ declare global {
12
+ interface Window {
13
+ menupro: any
14
+ }
15
+ }
16
+
17
+ menupro = window.menupro || {}
18
+
@@ -0,0 +1,7 @@
1
+
2
+ declare namespace JSX {
3
+ export interface IntrinsicElements {
4
+ 'x-foo': any
5
+ }
6
+ }
7
+