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 +0 -2
- package/package.json +1 -1
- package/scripts/{GenLayer.jsx → genLayer.jsx} +1 -1
- package/scripts/mouseCoords.jsx +1 -1
- package/scripts/popup.jsx +50 -42
- package/typings/cordova.d.ts +12 -0
- package/typings/dphelper.d.ts +29 -0
- package/typings/layerpro.d.ts +2 -1
- package/typings/menupro.d.ts +18 -0
- package/typings/namespace.d.ts +7 -0
package/init.js
CHANGED
package/package.json
CHANGED
package/scripts/mouseCoords.jsx
CHANGED
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 {
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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 (
|
|
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.
|
|
359
|
-
document.
|
|
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.
|
|
427
|
-
document.
|
|
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
|
|
467
|
-
if (
|
|
468
|
-
|
|
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
|
|
472
|
-
|
|
473
|
-
if (
|
|
474
|
-
|
|
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
|
|
478
|
-
|
|
479
|
-
if (
|
|
480
|
-
|
|
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
|
|
484
|
-
|
|
485
|
-
if (
|
|
486
|
-
|
|
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':
|
|
501
|
-
if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height':
|
|
502
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
503
|
-
if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width':
|
|
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':
|
|
509
|
-
if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height':
|
|
510
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
511
|
-
if (_parent.width() <= larX) { _parent.css({ 'width':
|
|
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':
|
|
517
|
-
if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height':
|
|
518
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
519
|
-
if (_parent.width() <= larX) { _parent.css({ 'width':
|
|
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':
|
|
525
|
-
if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height':
|
|
526
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
527
|
-
if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width':
|
|
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 =
|
|
595
|
+
let currentIndex = parseInt($(this, '#popup').css("zIndex"), 10)
|
|
588
596
|
|
|
589
597
|
if (currentIndex > highIndex) {
|
|
590
598
|
highIndex = currentIndex
|
|
@@ -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 || [];
|
package/typings/layerpro.d.ts
CHANGED
|
@@ -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
|
|
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
|
+
|