Version Description
(July 23, 2021) = * [Feature] We have improved the inline editor UI and UX. This is to give a better experience while editing the text. More improvements to the editing experience will follow soon. * [Feature] Retina Image option enabled for Image and Image Box widgets. * [Feature] Added option for custom thumbnail in posts and archive posts widgets. * [Feature] The Map widget has been further improved for Google map v3. We recommend you use version 3 as Google is deprecating version 2, or Google may discontinue version 2 maps at any time. * [Feature] Added Enter and Backspace key handler, now on press enter key inside title widget, we will break widget content from current cursor position and open new title widget with same content and by clicking backspace we will merge it again. * [Improvement] Added col margin option in the posts and archive posts widget. * [Improvement] Added space between option in image slider widget. * [Improvement] Added the "download file name" option to the download button widget. Now user can set the custom name of the download file. * [Improvement] Added alignment, size and max width options for the Row and Column parallax image. * [Improvement] Image drop zone UI has beed further fixed. * [Improvement] Added alt and title attributes for the site logo and post author image. * [Bug-Fix] The image media modal headings styles have been further fixed. * [Bug-Fix] In the image hotspot, quote and list widgets, the icon styles were applied for all the I (italics) tag. This is fixed. * [Bug-Fix] When editing the tooltip text through the inline editor, the tooltip was hidden when hovered out. This is fixed. * [Bug-Fix] In certain case while resizing the window, the primary menu was not working properly. This is fixed. * [Bug-Fix] While adding Tab widget inside the Tab widget, the Tab widgets were not working properly. This is fixed. * [Bug-Fix] Clicking on the close alert icon in the editor will hide the alert widget. Due to this we were not able to edit the alert widget again. This is fixed. * [Bug-Fix] While editing the slider content through the inline editor, we were unable to select content. This is fixed. * [Bug-Fix] On window resizing the scroll effects was not working properly. This is fixed. * [Bug-Fix] While pasting the content, the widgets were pasted. This is fixed. * [Bug-Fix] In certain cases, the video widget was not working properly. This is fixed. * [Bug-Fix] In certain cases, the video mute option was not working properly. This is fixed. * [Bug-Fix] Post widget copy-paste and duplicate was not working properly. This is fixed. * [Bug-Fix] In certain cases, the audio widget was not working properly. This is fixed.
Release Info
Developer | pagelayer |
Plugin | Page Builder: PageLayer – Drag and Drop website builder |
Version | 1.5.2 |
Comparing to | |
See all releases |
Code changes from version 1.5.1 to 1.5.2
- css/combined.css +1 -1
- css/givecss.php +1 -2
- css/pagelayer-editor-frontend.css +35 -1
- css/pagelayer-editor.css +19 -3
- css/pagelayer-frontend.css +1 -1
- css/pagelayer-pen.css +350 -0
- init.php +2 -1
- js/combined.js +62 -13
- js/givejs.php +1 -6
- js/pagelayer-editor.js +241 -29
- js/pagelayer-frontend.js +62 -13
- js/pagelayer-pen.js +1301 -0
- js/properties.js +427 -73
- js/widgets.js +130 -52
- languages/en.json +49 -1
- main/ajax.php +5 -4
- main/class.php +1 -0
- main/functions.php +82 -12
- main/import.php +2 -2
- main/live.php +3 -2
- main/settings.php +40 -12
- main/shortcode_functions.php +147 -70
- main/shortcodes.php +309 -27
- pagelayer.php +1 -1
- readme.txt +28 -2
@@ -3308,7 +3308,7 @@ display:block;
|
|
3308 |
display:none;
|
3309 |
}
|
3310 |
|
3311 |
-
.pagelayer-wp_menu-close
|
3312 |
position:absolute;
|
3313 |
z-index:99;
|
3314 |
}
|
3308 |
display:none;
|
3309 |
}
|
3310 |
|
3311 |
+
.pagelayer-wp_menu-close i{
|
3312 |
position:absolute;
|
3313 |
z-index:99;
|
3314 |
}
|
@@ -29,8 +29,6 @@ $files = array(
|
|
29 |
'pagelayer-editor.css',
|
30 |
'pagelayer-icons.css',
|
31 |
'pagelayer-editor-frontend.css',
|
32 |
-
'trumbowyg.min.css',
|
33 |
-
'pen.css',
|
34 |
// Enduser CSS
|
35 |
'font-awesome5.min.css',
|
36 |
'font-awesome5-v4shims.css',
|
@@ -41,6 +39,7 @@ $files = array(
|
|
41 |
'premium-frontend.css',
|
42 |
'animate.min.css',
|
43 |
'chartist.min.css',
|
|
|
44 |
);
|
45 |
|
46 |
// What files to give
|
29 |
'pagelayer-editor.css',
|
30 |
'pagelayer-icons.css',
|
31 |
'pagelayer-editor-frontend.css',
|
|
|
|
|
32 |
// Enduser CSS
|
33 |
'font-awesome5.min.css',
|
34 |
'font-awesome5-v4shims.css',
|
39 |
'premium-frontend.css',
|
40 |
'animate.min.css',
|
41 |
'chartist.min.css',
|
42 |
+
'pagelayer-pen.css'
|
43 |
);
|
44 |
|
45 |
// What files to give
|
@@ -402,13 +402,18 @@ transform: translateY(-50%);
|
|
402 |
}
|
403 |
|
404 |
.pagelayer-image-drop-zone div *{
|
405 |
-
color:white;
|
|
|
406 |
}
|
407 |
|
408 |
.pagelayer-image-drop-zone div i{
|
409 |
font-size:50px;
|
410 |
}
|
411 |
|
|
|
|
|
|
|
|
|
412 |
.pagelayer-img-up-progress {
|
413 |
width: 30%;
|
414 |
margin-left: auto;
|
@@ -427,6 +432,12 @@ line-height: 7px;
|
|
427 |
text-align: center;
|
428 |
border-radius: 30px;
|
429 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
/* image drop zone css start */
|
431 |
|
432 |
.pagelayer-pro-req{
|
@@ -439,3 +450,26 @@ margin-left: 4px;
|
|
439 |
border-radius: 2px;
|
440 |
cursor: pointer;
|
441 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
}
|
403 |
|
404 |
.pagelayer-image-drop-zone div *{
|
405 |
+
color: white !important;
|
406 |
+
line-height: 1;
|
407 |
}
|
408 |
|
409 |
.pagelayer-image-drop-zone div i{
|
410 |
font-size:50px;
|
411 |
}
|
412 |
|
413 |
+
.pagelayer-image-drop-zone h4{
|
414 |
+
margin: 20px;
|
415 |
+
}
|
416 |
+
|
417 |
.pagelayer-img-up-progress {
|
418 |
width: 30%;
|
419 |
margin-left: auto;
|
432 |
text-align: center;
|
433 |
border-radius: 30px;
|
434 |
}
|
435 |
+
|
436 |
+
@media screen and (max-width: 600px) {
|
437 |
+
.pagelayer-img-up-progress {
|
438 |
+
width: 54%;
|
439 |
+
}
|
440 |
+
}
|
441 |
/* image drop zone css start */
|
442 |
|
443 |
.pagelayer-pro-req{
|
450 |
border-radius: 2px;
|
451 |
cursor: pointer;
|
452 |
}
|
453 |
+
|
454 |
+
/* Media upload box css */
|
455 |
+
.media-modal .media-modal-content h1{
|
456 |
+
font-size: 22px !important;
|
457 |
+
line-height: 2.27 !important;
|
458 |
+
}
|
459 |
+
|
460 |
+
.media-modal .media-modal-content h2{
|
461 |
+
font-size: 13px !important;
|
462 |
+
line-height: 1 !important;
|
463 |
+
}
|
464 |
+
|
465 |
+
.media-modal .media-modal-content .uploader-inline h2{
|
466 |
+
font-size: 20px !important;
|
467 |
+
line-height: 1.4 !important;
|
468 |
+
font-weight: 400 !important;
|
469 |
+
}
|
470 |
+
/* Media upload box css end */
|
471 |
+
|
472 |
+
/*Tooltip widget*/
|
473 |
+
.pagelayer-tooltip-text[contenteditable="true"]{
|
474 |
+
visibility: visible;
|
475 |
+
}
|
@@ -902,7 +902,9 @@ background-color: #00A0D2bf;
|
|
902 |
border-color: #00A0D2;
|
903 |
}
|
904 |
|
905 |
-
.pagelayer-elp-image-div
|
|
|
|
|
906 |
padding:7px;
|
907 |
width:90%;
|
908 |
margin:5px auto;
|
@@ -945,6 +947,10 @@ color:white;
|
|
945 |
font-size:20px;
|
946 |
}
|
947 |
|
|
|
|
|
|
|
|
|
948 |
.pagelayer-elp-img-up-progress {
|
949 |
width: 50%;
|
950 |
margin-left: auto;
|
@@ -1069,7 +1075,10 @@ background-position: 50%;
|
|
1069 |
cursor:pointer;
|
1070 |
}
|
1071 |
|
1072 |
-
.pagelayer-elp-image-delete
|
|
|
|
|
|
|
1073 |
cursor: pointer;
|
1074 |
position: absolute;
|
1075 |
top: 4px;
|
@@ -1084,7 +1093,14 @@ box-sizing: content-box;
|
|
1084 |
border-radius: 2px;
|
1085 |
}
|
1086 |
|
1087 |
-
.pagelayer-elp-image-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1088 |
color: #fff;
|
1089 |
}
|
1090 |
|
902 |
border-color: #00A0D2;
|
903 |
}
|
904 |
|
905 |
+
.pagelayer-elp-image-div,
|
906 |
+
.pagelayer-elp-retina-image-div,
|
907 |
+
.pagelayer-elp-retina-mobile-image-div{
|
908 |
padding:7px;
|
909 |
width:90%;
|
910 |
margin:5px auto;
|
947 |
font-size:20px;
|
948 |
}
|
949 |
|
950 |
+
.pagelayer-elp-drop-zone div h4{
|
951 |
+
margin: 12px;
|
952 |
+
}
|
953 |
+
|
954 |
.pagelayer-elp-img-up-progress {
|
955 |
width: 50%;
|
956 |
margin-left: auto;
|
1075 |
cursor:pointer;
|
1076 |
}
|
1077 |
|
1078 |
+
.pagelayer-elp-image-delete,
|
1079 |
+
.pagelayer-elp-retina-delete,
|
1080 |
+
.pagelayer-elp-retina-mobile-delete,
|
1081 |
+
.pagelayer-elp-image-retina{
|
1082 |
cursor: pointer;
|
1083 |
position: absolute;
|
1084 |
top: 4px;
|
1093 |
border-radius: 2px;
|
1094 |
}
|
1095 |
|
1096 |
+
.pagelayer-elp-image-retina{
|
1097 |
+
right:50px;
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
.pagelayer-elp-image-delete .pli,
|
1101 |
+
.pagelayer-elp-retina-delete .pli,
|
1102 |
+
.pagelayer-elp-retina-mobile-delete .pli,
|
1103 |
+
.pagelayer-elp-image-retina .pli{
|
1104 |
color: #fff;
|
1105 |
}
|
1106 |
|
@@ -3308,7 +3308,7 @@ display:block;
|
|
3308 |
display:none;
|
3309 |
}
|
3310 |
|
3311 |
-
.pagelayer-wp_menu-close
|
3312 |
position:absolute;
|
3313 |
z-index:99;
|
3314 |
}
|
3308 |
display:none;
|
3309 |
}
|
3310 |
|
3311 |
+
.pagelayer-wp_menu-close i{
|
3312 |
position:absolute;
|
3313 |
z-index:99;
|
3314 |
}
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Pagelayer Pen editor*/
|
2 |
+
.pagelayer-pen-holder{
|
3 |
+
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
|
4 |
+
background-color: #ffffff;
|
5 |
+
position: fixed;
|
6 |
+
z-index: 9999999999;
|
7 |
+
top: 50px;
|
8 |
+
left: 0;
|
9 |
+
transform: translateY(-100%);
|
10 |
+
box-shadow: 0 4px 5px 0 rgb(0 0 0 / 14%), 0 1px 10px 0 rgb(0 0 0 / 12%), 0 2px 4px -1px rgb(0 0 0 / 20%);
|
11 |
+
border-radius: 2px;
|
12 |
+
line-height: 1;
|
13 |
+
padding: 8px 2px;
|
14 |
+
font-size: 15px !important;
|
15 |
+
display: none;
|
16 |
+
}
|
17 |
+
|
18 |
+
.pagelayer-pen-toolbar{
|
19 |
+
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
|
20 |
+
box-sizing: border-box;
|
21 |
+
width: max-content;
|
22 |
+
max-width: 90vw;
|
23 |
+
background: none;
|
24 |
+
cursor: pointer;
|
25 |
+
}
|
26 |
+
|
27 |
+
.pagelayer-pen-toolbar .pagelayer-pen-formats{
|
28 |
+
display: inline-block;
|
29 |
+
vertical-align: middle;
|
30 |
+
padding-right: 7px;
|
31 |
+
padding-left: 7px;
|
32 |
+
border-left:1px solid #ccc;
|
33 |
+
font-weight: 700;
|
34 |
+
}
|
35 |
+
|
36 |
+
.pagelayer-pen-toolbar button{
|
37 |
+
background: none;
|
38 |
+
border: none;
|
39 |
+
cursor: pointer;
|
40 |
+
display: inline-block;
|
41 |
+
float: left;
|
42 |
+
height: 24px;
|
43 |
+
padding: 3px 5px;
|
44 |
+
width: 28px;
|
45 |
+
font-size: 14px !important;
|
46 |
+
font-weight: 700 !important;
|
47 |
+
}
|
48 |
+
|
49 |
+
.pagelayer-pen-toolbar button strong{
|
50 |
+
font-weight: bold !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
.pagelayer-pen-toolbar .pagelayer-pen-formats:first-child {
|
54 |
+
padding-left: 0px !important;
|
55 |
+
border-left: 0px;
|
56 |
+
}
|
57 |
+
/* Start Dropdown picker*/
|
58 |
+
.pagelayer-pen-picker{
|
59 |
+
color: #444;
|
60 |
+
display: inline-block;
|
61 |
+
float: left;
|
62 |
+
height: 24px;
|
63 |
+
position: relative;
|
64 |
+
vertical-align: middle;
|
65 |
+
padding:3px 5px;
|
66 |
+
font-size: 14px !important;
|
67 |
+
font-weight: 500 !important;
|
68 |
+
}
|
69 |
+
|
70 |
+
.pagelayer-pen-picker-label {
|
71 |
+
cursor: pointer;
|
72 |
+
display: inline-block;
|
73 |
+
height: 100%;
|
74 |
+
position: relative;
|
75 |
+
width: 100%;
|
76 |
+
}
|
77 |
+
|
78 |
+
.pagelayer-pen-picker .pagelayer-pen-picker-label:after {
|
79 |
+
content: "\f0dc";
|
80 |
+
padding-left: 15px;
|
81 |
+
font-weight: 600;
|
82 |
+
font-family: "Font Awesome 5 Free";
|
83 |
+
font-size: 12px;
|
84 |
+
}
|
85 |
+
|
86 |
+
.pagelayer-pen-picker.pagelayer-pen-font .pagelayer-pen-picker-label:after,
|
87 |
+
.pagelayer-pen-picker.pagelayer-pen-lineheight .pagelayer-pen-picker-label:after,
|
88 |
+
.pagelayer-pen-picker.pagelayer-pen-color-picker .pagelayer-pen-picker-label:after {
|
89 |
+
content: "";
|
90 |
+
padding-left: 0;
|
91 |
+
}
|
92 |
+
|
93 |
+
.pagelayer-pen-picker-label::before {
|
94 |
+
display: inline-block;
|
95 |
+
}
|
96 |
+
|
97 |
+
.pagelayer-pen-picker-options {
|
98 |
+
background-color: #fff;
|
99 |
+
display: none;
|
100 |
+
min-width: 100%;
|
101 |
+
padding: 4px 8px;
|
102 |
+
position: absolute;
|
103 |
+
white-space: nowrap;
|
104 |
+
margin-left: -8px;
|
105 |
+
max-height: 200px;
|
106 |
+
overflow: auto;
|
107 |
+
}
|
108 |
+
|
109 |
+
.pagelayer-pen-picker-options::-webkit-scrollbar {
|
110 |
+
width:3px;
|
111 |
+
}
|
112 |
+
|
113 |
+
.pagelayer-pen-picker-options::-webkit-scrollbar-track {
|
114 |
+
background: #f1f1f1;
|
115 |
+
}
|
116 |
+
|
117 |
+
.pagelayer-pen-picker-options::-webkit-scrollbar-thumb {
|
118 |
+
background: #888;
|
119 |
+
}
|
120 |
+
|
121 |
+
.pagelayer-pen-picker-options::-webkit-scrollbar-thumb:hover {
|
122 |
+
background: #555;
|
123 |
+
cursor:context-menu;
|
124 |
+
}
|
125 |
+
|
126 |
+
.pagelayer-pen-picker-options .pagelayer-pen-picker-item {
|
127 |
+
cursor: pointer;
|
128 |
+
display: block;
|
129 |
+
padding-bottom: 5px;
|
130 |
+
padding-top: 5px;
|
131 |
+
}
|
132 |
+
|
133 |
+
.pagelayer-pen-picker.pagelayer-pen-expanded .pagelayer-pen-picker-label {
|
134 |
+
color: #ccc;
|
135 |
+
z-index: 2;
|
136 |
+
}
|
137 |
+
|
138 |
+
.pagelayer-pen-picker.pagelayer-pen-expanded .pagelayer-pen-picker-label .pagelayer-pen-fill {
|
139 |
+
fill: #ccc;
|
140 |
+
}
|
141 |
+
|
142 |
+
.pagelayer-pen-picker.pagelayer-pen-expanded .pagelayer-pen-picker-label .pagelayer-pen-stroke {
|
143 |
+
stroke: #ccc;
|
144 |
+
}
|
145 |
+
|
146 |
+
.pagelayer-pen-picker.pagelayer-pen-expanded .pagelayer-pen-picker-options {
|
147 |
+
display: block;
|
148 |
+
margin-top: -1px;
|
149 |
+
top: 100%;
|
150 |
+
z-index: 1;
|
151 |
+
box-shadow: 0px 0px 1px 1px #e4e4e4;
|
152 |
+
}
|
153 |
+
|
154 |
+
.pagelayer-pen-color-picker .pagelayer-pen-picker-labe{
|
155 |
+
padding: 2px 4px;
|
156 |
+
}
|
157 |
+
|
158 |
+
.pagelayer-pen-icon-picker .pagelayer-pen-picker-options {
|
159 |
+
padding: 4px 0px;
|
160 |
+
}
|
161 |
+
|
162 |
+
.pagelayer-pen-icon-picker .pagelayer-pen-picker-item {
|
163 |
+
height: 24px;
|
164 |
+
width: 24px;
|
165 |
+
padding: 2px 4px;
|
166 |
+
}
|
167 |
+
|
168 |
+
.pagelayer-pen-color-picker .pagelayer-pen-picker-options {
|
169 |
+
padding: 3px 5px;
|
170 |
+
width: 152px;
|
171 |
+
}
|
172 |
+
|
173 |
+
.pagelayer-pen-color-picker .pagelayer-pen-picker-item {
|
174 |
+
border: 1px solid transparent;
|
175 |
+
float: left;
|
176 |
+
height: 16px;
|
177 |
+
margin: 2px;
|
178 |
+
padding: 0px;
|
179 |
+
width: 16px;
|
180 |
+
}
|
181 |
+
|
182 |
+
.pagelayer-pen-size-picker .pagelayer-pen-picker-label:before,
|
183 |
+
.pagelayer-pen-picker:not(.pagelayer-pen-color-picker) .pagelayer-pen-picker-item:empty:before{
|
184 |
+
content: attr(data-value);
|
185 |
+
}
|
186 |
+
|
187 |
+
.pagelayer-pen-link-tooltip{
|
188 |
+
padding-left:8px;
|
189 |
+
}
|
190 |
+
|
191 |
+
.pagelayer-pen-unlink-btn,
|
192 |
+
.pagelayer-pen-link-btn{
|
193 |
+
padding:8px;
|
194 |
+
color: #007bff !important;
|
195 |
+
cursor: pointer;
|
196 |
+
}
|
197 |
+
|
198 |
+
/* End Dropdown picker*/
|
199 |
+
/* Start HTML viewer*/
|
200 |
+
.pagelayer-pen-html-viewer{
|
201 |
+
position: fixed;
|
202 |
+
top: 0;
|
203 |
+
bottom: 0;
|
204 |
+
left: 0;
|
205 |
+
right: 0;
|
206 |
+
display: none;
|
207 |
+
background: #0000009c;
|
208 |
+
z-index:999999;
|
209 |
+
}
|
210 |
+
|
211 |
+
.pagelayer-pen-html-viewer .pagelayer-pen-html-holder{
|
212 |
+
width: 90%;
|
213 |
+
height: 80vh;
|
214 |
+
margin: auto;
|
215 |
+
top: 50%;
|
216 |
+
position: relative;
|
217 |
+
transform: translateY(-50%);
|
218 |
+
background: #fff;
|
219 |
+
box-shadow: 0px 0px 7px 0px #fff;
|
220 |
+
}
|
221 |
+
|
222 |
+
.pagelayer-pen-html-viewer .pagelayer-pen-html-area{
|
223 |
+
resize: none;
|
224 |
+
width: 100%;
|
225 |
+
height: calc(100% - 50px);
|
226 |
+
border-radius: 0;
|
227 |
+
padding: 10px;
|
228 |
+
}
|
229 |
+
|
230 |
+
.pagelayer-pen-html-viewer .pagelayer-pen-html-btn{
|
231 |
+
height: 40px;
|
232 |
+
text-align: center;
|
233 |
+
display: flex;
|
234 |
+
align-items: center;
|
235 |
+
justify-content: center;
|
236 |
+
}
|
237 |
+
|
238 |
+
.pagelayer-pen-html-viewer .pagelayer-pen-html-btn button{
|
239 |
+
margin-right: 10px;
|
240 |
+
padding: 7px 20px !important;
|
241 |
+
font-size: 15px !important;
|
242 |
+
}
|
243 |
+
|
244 |
+
.pagelayer-pen-html-viewer .pagelayer-pen-html-area:focus{
|
245 |
+
border:none;
|
246 |
+
outline:none;
|
247 |
+
}
|
248 |
+
|
249 |
+
/* End HTML viewer*/
|
250 |
+
.pagelayer-pen-toolbar .pagelayer-pen-close{
|
251 |
+
background: #e6e6e6;
|
252 |
+
position: absolute;
|
253 |
+
top: 0;
|
254 |
+
right: 0;
|
255 |
+
width: auto;
|
256 |
+
height: auto;
|
257 |
+
border-radius: 0;
|
258 |
+
}
|
259 |
+
|
260 |
+
.pagelayer-pen-toolbar .pagelayer-pen-close .fas{
|
261 |
+
font-size: 10px !important;
|
262 |
+
color: #fb0101;
|
263 |
+
margin:0;
|
264 |
+
padding:0;
|
265 |
+
}
|
266 |
+
|
267 |
+
.pagelayer-pen-toolbar svg{
|
268 |
+
width:18px;
|
269 |
+
float:left;
|
270 |
+
}
|
271 |
+
|
272 |
+
.pagelayer-pen-stroke{
|
273 |
+
fill: none;
|
274 |
+
stroke: #444;
|
275 |
+
stroke-linecap: round;
|
276 |
+
stroke-linejoin: round;
|
277 |
+
stroke-width: 2;
|
278 |
+
}
|
279 |
+
|
280 |
+
.pagelayer-pen-active,
|
281 |
+
.pagelayer-pen-toolbar button:hover,
|
282 |
+
.pagelayer-pen-picker-label:hover,
|
283 |
+
.pagelayer-pen-picker-item:hover,
|
284 |
+
.pagelayer-pen-active .fas,
|
285 |
+
.pagelayer-pen-toolbar button:hover .fas,
|
286 |
+
.pagelayer-pen-picker-label:hover .fas,
|
287 |
+
.pagelayer-pen-picker-item:hover .fas{
|
288 |
+
color: #06c;
|
289 |
+
}
|
290 |
+
|
291 |
+
.pagelayer-pen-active .pagelayer-pen-fill,
|
292 |
+
.pagelayer-pen-toolbar button:hover .pagelayer-pen-fill,
|
293 |
+
.pagelayer-pen-picker-label:hover .pagelayer-pen-fill,
|
294 |
+
.pagelayer-pen-picker-item:hover .pagelayer-pen-fill{
|
295 |
+
fill: #06c;
|
296 |
+
}
|
297 |
+
|
298 |
+
.pagelayer-pen-active .pagelayer-pen-stroke,
|
299 |
+
.pagelayer-pen-toolbar button:hover .pagelayer-pen-stroke,
|
300 |
+
.pagelayer-pen-picker-label:hover .pagelayer-pen-stroke,
|
301 |
+
.pagelayer-pen-picker-item:hover .pagelayer-pen-stroke{
|
302 |
+
stroke: #06c;
|
303 |
+
}
|
304 |
+
|
305 |
+
.pagelayer-pen-custom-input{
|
306 |
+
display: block;
|
307 |
+
width: 100%;
|
308 |
+
min-width: 75px;
|
309 |
+
height: 25px;
|
310 |
+
margin-top: 5px;
|
311 |
+
margin-bottom: 5px;
|
312 |
+
font-size: 12px !important;
|
313 |
+
}
|
314 |
+
|
315 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="h1"]:before{
|
316 |
+
content: "Heading 1" !important;
|
317 |
+
font-size: 2em;
|
318 |
+
}
|
319 |
+
|
320 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="h2"]:before{
|
321 |
+
content: "Heading 2" !important;
|
322 |
+
font-size: 1.5em;
|
323 |
+
}
|
324 |
+
|
325 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="h3"]:before{
|
326 |
+
content: "Heading 3" !important;
|
327 |
+
font-size: 1em;
|
328 |
+
}
|
329 |
+
|
330 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="h4"]:before{
|
331 |
+
content: "Heading 4" !important;
|
332 |
+
}
|
333 |
+
|
334 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="h5"]:before{
|
335 |
+
content: "Heading 5" !important;
|
336 |
+
font-size: 0.83em;
|
337 |
+
}
|
338 |
+
|
339 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="h6"]:before{
|
340 |
+
content: "Heading 6" !important;
|
341 |
+
font-size: 0.67em;
|
342 |
+
}
|
343 |
+
|
344 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="p"]:before{
|
345 |
+
content: "Paragraph" !important;
|
346 |
+
}
|
347 |
+
|
348 |
+
.pagelayer-pen-formating .pagelayer-pen-picker-item[data-value="blockquote"]:before{
|
349 |
+
content: "Blockquote" !important;
|
350 |
+
}
|
@@ -5,7 +5,7 @@ if (!defined('ABSPATH')) exit;
|
|
5 |
|
6 |
define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
|
7 |
define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
|
8 |
-
define('PAGELAYER_VERSION', '1.5.
|
9 |
define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
|
10 |
define('PAGELAYER_SLUG', 'pagelayer');
|
11 |
define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
|
@@ -584,6 +584,7 @@ function pagelayer_enqueue_frontend($force = false){
|
|
584 |
if($is_audio || pagelayer_is_live_iframe()){
|
585 |
wp_enqueue_script('wp-mediaelement');
|
586 |
wp_enqueue_style( 'wp-mediaelement' );
|
|
|
587 |
}
|
588 |
}
|
589 |
|
5 |
|
6 |
define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
|
7 |
define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
|
8 |
+
define('PAGELAYER_VERSION', '1.5.2');
|
9 |
define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
|
10 |
define('PAGELAYER_SLUG', 'pagelayer');
|
11 |
define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
|
584 |
if($is_audio || pagelayer_is_live_iframe()){
|
585 |
wp_enqueue_script('wp-mediaelement');
|
586 |
wp_enqueue_style( 'wp-mediaelement' );
|
587 |
+
$pagelayer->sc_audio_enqueued = 1;
|
588 |
}
|
589 |
}
|
590 |
|
@@ -118,6 +118,11 @@ jQuery(document).ready(function(){
|
|
118 |
// For automatic row change
|
119 |
jQuery(window).resize(function() {
|
120 |
|
|
|
|
|
|
|
|
|
|
|
121 |
var new_vw = jQuery(document).width();
|
122 |
|
123 |
if(new_vw == pagelayer_doc_width){
|
@@ -138,11 +143,6 @@ jQuery(window).resize(function() {
|
|
138 |
|
139 |
}, 200);
|
140 |
|
141 |
-
// Primary Menu
|
142 |
-
jQuery('.pagelayer-wp_menu').each(function(){
|
143 |
-
pagelayer_primary_menu(jQuery(this));
|
144 |
-
});
|
145 |
-
|
146 |
});
|
147 |
|
148 |
// Check if element is visible
|
@@ -264,9 +264,22 @@ function pagelayer_pl_image_slider(jEle){
|
|
264 |
|
265 |
}
|
266 |
|
267 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
jQuery('[pagelayer-id='+pl_id+']').show();
|
271 |
|
272 |
jQuery(el).parent().find('.pagelayer-tablinks').each(function(){
|
@@ -281,7 +294,10 @@ var pagelayer_tab_timers = {};
|
|
281 |
function pagelayer_pl_tabs(jEle) {
|
282 |
|
283 |
var default_active = '';
|
284 |
-
var
|
|
|
|
|
|
|
285 |
|
286 |
// Loop thru
|
287 |
children.each(function(){
|
@@ -300,7 +316,7 @@ function pagelayer_pl_tabs(jEle) {
|
|
300 |
default_active = pl_id;
|
301 |
}
|
302 |
|
303 |
-
jEle.
|
304 |
});
|
305 |
|
306 |
// Set the default tab
|
@@ -313,7 +329,7 @@ function pagelayer_pl_tabs(jEle) {
|
|
313 |
}
|
314 |
|
315 |
try{
|
316 |
-
clearInterval(pagelayer_tab_timers[
|
317 |
}catch(e){};
|
318 |
|
319 |
var rotate = parseInt(jEle.attr('pagelayer-tabs-rotate'));
|
@@ -322,13 +338,15 @@ function pagelayer_pl_tabs(jEle) {
|
|
322 |
if(rotate > 0){
|
323 |
|
324 |
var i= 0;
|
325 |
-
pagelayer_tab_timers[
|
326 |
|
327 |
if(i >= children.length){
|
328 |
i = 0;
|
329 |
}
|
330 |
|
331 |
-
var
|
|
|
|
|
332 |
var tmp_btn_ele = jEle.find('.pagelayer-tablinks')[i]
|
333 |
var tmp_pl_id = jQuery(tmp_pl_ele).attr('pagelayer-id');
|
334 |
|
@@ -337,7 +355,7 @@ function pagelayer_pl_tabs(jEle) {
|
|
337 |
});
|
338 |
|
339 |
jQuery(tmp_btn_ele).addClass("active");
|
340 |
-
pagelayer_tab_show(
|
341 |
|
342 |
i++;
|
343 |
|
@@ -520,6 +538,11 @@ function pagelayer_progress(){
|
|
520 |
|
521 |
// Dismiss Alert Function
|
522 |
function pagelayer_dismiss_alert(x){
|
|
|
|
|
|
|
|
|
|
|
523 |
jQuery(x).parent().parent().fadeOut();
|
524 |
}
|
525 |
|
@@ -693,6 +716,16 @@ function pagelayer_pl_grid_lightbox(jEle){
|
|
693 |
});
|
694 |
}
|
695 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
696 |
// PHP equivalent empty()
|
697 |
function pagelayer_empty(mixed_var) {
|
698 |
|
@@ -830,6 +863,22 @@ function pagelayer_owl_init(jEle, ul, options){
|
|
830 |
owlCar.trigger('refresh.owl.carousel');
|
831 |
},700);
|
832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
// Set that we have setup everything
|
834 |
jEle.attr('pagelayer-setup', 1);
|
835 |
|
118 |
// For automatic row change
|
119 |
jQuery(window).resize(function() {
|
120 |
|
121 |
+
// Primary Menu
|
122 |
+
jQuery('.pagelayer-wp_menu').each(function(){
|
123 |
+
pagelayer_primary_menu(jQuery(this));
|
124 |
+
});
|
125 |
+
|
126 |
var new_vw = jQuery(document).width();
|
127 |
|
128 |
if(new_vw == pagelayer_doc_width){
|
143 |
|
144 |
}, 200);
|
145 |
|
|
|
|
|
|
|
|
|
|
|
146 |
});
|
147 |
|
148 |
// Check if element is visible
|
264 |
|
265 |
}
|
266 |
|
267 |
+
function pagelayer_get_tab_ele(temp_tabCont){
|
268 |
+
|
269 |
+
if(!pagelayer_empty(temp_tabCont.children('.pagelayer-ele-wrap').length)){
|
270 |
+
return temp_tabCont.children('.pagelayer-ele-wrap').children('.pagelayer-tab');
|
271 |
+
}else{
|
272 |
+
return temp_tabCont.children('.pagelayer-tab');
|
273 |
+
}
|
274 |
+
}
|
275 |
|
276 |
+
function pagelayer_tab_show(el, pl_id) {
|
277 |
+
|
278 |
+
var parent_id = jQuery(el).closest('.pagelayer-tabs').attr('pagelayer-id');
|
279 |
+
|
280 |
+
var temp_tabCont = jQuery('[pagelayer-id='+pl_id+']').closest('.pagelayer-tabcontainer');
|
281 |
+
pagelayer_get_tab_ele(temp_tabCont).hide();
|
282 |
+
|
283 |
jQuery('[pagelayer-id='+pl_id+']').show();
|
284 |
|
285 |
jQuery(el).parent().find('.pagelayer-tablinks').each(function(){
|
294 |
function pagelayer_pl_tabs(jEle) {
|
295 |
|
296 |
var default_active = '';
|
297 |
+
var jEle_id = jEle.attr('pagelayer-id');
|
298 |
+
|
299 |
+
var tabCont = jEle.children('.pagelayer-tabcontainer');
|
300 |
+
var children = pagelayer_get_tab_ele(tabCont);
|
301 |
|
302 |
// Loop thru
|
303 |
children.each(function(){
|
316 |
default_active = pl_id;
|
317 |
}
|
318 |
|
319 |
+
jEle.children('.pagelayer-tabs-holder').append('<span tab-id="'+pl_id+'" class="pagelayer-tablinks" onclick="'+func+'"> <i class="'+icon+'"></i> <span>'+title+'</span></span>');
|
320 |
});
|
321 |
|
322 |
// Set the default tab
|
329 |
}
|
330 |
|
331 |
try{
|
332 |
+
clearInterval(pagelayer_tab_timers[jEle_id]);
|
333 |
}catch(e){};
|
334 |
|
335 |
var rotate = parseInt(jEle.attr('pagelayer-tabs-rotate'));
|
338 |
if(rotate > 0){
|
339 |
|
340 |
var i= 0;
|
341 |
+
pagelayer_tab_timers[jEle_id] = setInterval(function () {
|
342 |
|
343 |
if(i >= children.length){
|
344 |
i = 0;
|
345 |
}
|
346 |
|
347 |
+
var tabCont = jEle.children('.pagelayer-tabcontainer');
|
348 |
+
var tmp_pl_ele = pagelayer_get_tab_ele(tabCont)[i];
|
349 |
+
|
350 |
var tmp_btn_ele = jEle.find('.pagelayer-tablinks')[i]
|
351 |
var tmp_pl_id = jQuery(tmp_pl_ele).attr('pagelayer-id');
|
352 |
|
355 |
});
|
356 |
|
357 |
jQuery(tmp_btn_ele).addClass("active");
|
358 |
+
pagelayer_tab_show(tmp_btn_ele, tmp_pl_id);
|
359 |
|
360 |
i++;
|
361 |
|
538 |
|
539 |
// Dismiss Alert Function
|
540 |
function pagelayer_dismiss_alert(x){
|
541 |
+
|
542 |
+
if(!pagelayer_empty(pagelayer_is_live)){
|
543 |
+
return;
|
544 |
+
}
|
545 |
+
|
546 |
jQuery(x).parent().parent().fadeOut();
|
547 |
}
|
548 |
|
716 |
});
|
717 |
}
|
718 |
|
719 |
+
// Is string?
|
720 |
+
function pagelayer_is_string(str){
|
721 |
+
|
722 |
+
if(typeof str == 'string'){
|
723 |
+
return true;
|
724 |
+
}
|
725 |
+
|
726 |
+
return false;
|
727 |
+
}
|
728 |
+
|
729 |
// PHP equivalent empty()
|
730 |
function pagelayer_empty(mixed_var) {
|
731 |
|
863 |
owlCar.trigger('refresh.owl.carousel');
|
864 |
},700);
|
865 |
|
866 |
+
// To prevent slider drag inside the editable area
|
867 |
+
jEle.on('mousedown', function(e){
|
868 |
+
var target = e.target;
|
869 |
+
|
870 |
+
var isEditable = jQuery(target).closest('[contenteditable="true"]');
|
871 |
+
|
872 |
+
if(isEditable.length < 1){
|
873 |
+
return;
|
874 |
+
}
|
875 |
+
|
876 |
+
isEditable.on('mousedown.owl.core dragstart.owl.core selectstart.owl.core touchstart.owl.core touchcancel.owl.core', function(e){
|
877 |
+
e.stopPropagation();
|
878 |
+
});
|
879 |
+
|
880 |
+
});
|
881 |
+
|
882 |
// Set that we have setup everything
|
883 |
jEle.attr('pagelayer-setup', 1);
|
884 |
|
@@ -37,13 +37,8 @@ $files = array(
|
|
37 |
'base-64.min.js',
|
38 |
'slimscroll.js',
|
39 |
'vanilla-picker.min.js',
|
40 |
-
'trumbowyg.min.js',
|
41 |
-
'trumbowyg.js',
|
42 |
-
'trumbowyg.fontfamily.js',
|
43 |
-
'trumbowyg.fontsize.min.js',
|
44 |
-
'trumbowyg-pagelayer.js',
|
45 |
-
'pen.js',
|
46 |
'tlite.min.js',
|
|
|
47 |
// Enduser JS
|
48 |
'imagesloaded.min.js',
|
49 |
'nivo-lightbox.min.js',
|
37 |
'base-64.min.js',
|
38 |
'slimscroll.js',
|
39 |
'vanilla-picker.min.js',
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
'tlite.min.js',
|
41 |
+
'pagelayer-pen.js',
|
42 |
// Enduser JS
|
43 |
'imagesloaded.min.js',
|
44 |
'nivo-lightbox.min.js',
|
@@ -2022,6 +2022,81 @@ pagelayer.gDocument.keydown(function(event){
|
|
2022 |
//alert(String.fromCharCode(event.which));
|
2023 |
|
2024 |
var tEle = jQuery(event.target);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025 |
|
2026 |
// ctrl+s handle
|
2027 |
if(event.keyCode == 83 && event.ctrlKey){
|
@@ -2029,8 +2104,97 @@ pagelayer.gDocument.keydown(function(event){
|
|
2029 |
pagelayer.$$('.pagelayer-bottombar-holder').find('.pagelayer-update-button').click();
|
2030 |
}
|
2031 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2032 |
// Is this in the editable area ?
|
2033 |
-
if (tEle.is('input, textarea') ||
|
2034 |
return;
|
2035 |
}
|
2036 |
|
@@ -2049,16 +2213,6 @@ pagelayer.gDocument.keydown(function(event){
|
|
2049 |
pagelayer_do_history('redo');
|
2050 |
}
|
2051 |
|
2052 |
-
// ctrl+d handle
|
2053 |
-
if(event.keyCode == 68 && event.ctrlKey){
|
2054 |
-
|
2055 |
-
// If we have an active element
|
2056 |
-
if( pagelayer_active.el && pagelayer_active.el.id ){
|
2057 |
-
event.preventDefault();
|
2058 |
-
pagelayer_copy_element('[pagelayer-id='+pagelayer_active.el.id+']');
|
2059 |
-
}
|
2060 |
-
|
2061 |
-
}
|
2062 |
});
|
2063 |
|
2064 |
// Handle Copy of content
|
@@ -2099,8 +2253,8 @@ jQuery(document).on('paste', function(pasteEvent){
|
|
2099 |
var contenteditable = false;
|
2100 |
var pasteWidget = false;
|
2101 |
|
2102 |
-
if(
|
2103 |
-
pEle_target = pEle_target.closest('[contenteditable]');
|
2104 |
contenteditable = true;
|
2105 |
}
|
2106 |
|
@@ -2227,7 +2381,7 @@ jQuery(document).on('paste', function(pasteEvent){
|
|
2227 |
if(pagelayer_empty(findImg) && pagelayer_empty(contenteditable) || pasteWidget){
|
2228 |
|
2229 |
// Check the active element
|
2230 |
-
if(pagelayer_active.el && pagelayer_active.el.id){
|
2231 |
|
2232 |
var jEle = jQuery("[pagelayer-id='"+pagelayer_active.el.id+"']");
|
2233 |
|
@@ -3088,14 +3242,14 @@ function pagelayer_set_atts(jEle, atts, val){
|
|
3088 |
|
3089 |
// Remove the attribute if its BLANK and there is no default for it
|
3090 |
// If there is a default, we set it to blank to keep record of the current val
|
3091 |
-
if(atts[x]
|
3092 |
|
3093 |
// Remove values which are not defaults
|
3094 |
if(!(x in defaults)){
|
3095 |
delete ref_data['attr'][x];
|
3096 |
// Otherwise keep value set for avoiding resetting
|
3097 |
}else{
|
3098 |
-
ref_data['attr'][x] =
|
3099 |
}
|
3100 |
|
3101 |
// Remove the tmp atts anyway
|
@@ -3103,7 +3257,7 @@ function pagelayer_set_atts(jEle, atts, val){
|
|
3103 |
|
3104 |
// Set the value
|
3105 |
}else{
|
3106 |
-
ref_data['attr'][x] = pagelayer_trim(
|
3107 |
}
|
3108 |
|
3109 |
// Are you the active element
|
@@ -3142,9 +3296,7 @@ function pagelayer_set_tmp_atts(jEle, atts, val){
|
|
3142 |
var ref_data = pagelayer_el_data_ref(jEle);
|
3143 |
|
3144 |
for(var x in atts){
|
3145 |
-
|
3146 |
-
atts[x] = String(atts[x]);
|
3147 |
-
|
3148 |
// Record history
|
3149 |
if(pagelayer.history_action){
|
3150 |
|
@@ -3236,7 +3388,11 @@ function pagelayer_css_render(css, val, seperator){
|
|
3236 |
|
3237 |
// If there is an array
|
3238 |
if(css.match(/val\[\d/)){
|
3239 |
-
|
|
|
|
|
|
|
|
|
3240 |
for(var i in val){
|
3241 |
css = css.split('{{val['+i+']}}').join(pagelayer_hex8_to_rgba(val[i]));
|
3242 |
}
|
@@ -3339,8 +3495,8 @@ function pagelayer_sc_render(jEle){
|
|
3339 |
// pagelayer_data will return attributes even if they are BLANK e.g. attr=""
|
3340 |
// Render doesnt consider BLANK values as values, and we are unsetting them now
|
3341 |
// If in any situation you need to consider blank values, please handle in the JS / PHP function of the Shortcode
|
3342 |
-
if(x in el.atts && el.atts[x]
|
3343 |
-
|
3344 |
}
|
3345 |
|
3346 |
// Any editor ?
|
@@ -3826,7 +3982,7 @@ function pagelayer_save(){
|
|
3826 |
// hiding and showing loading animation
|
3827 |
pagelayer.$$('.pagelayer-update-text').hide();
|
3828 |
pagelayer.$$('.pagelayer-update-loader').show();
|
3829 |
-
|
3830 |
pagelayer_trigger_action('pagelayer_save');
|
3831 |
|
3832 |
var pagelayerajaxurl = pagelayer_ajax_url+'&action=pagelayer_save_content&postID='+pagelayer_postID;
|
@@ -5197,12 +5353,14 @@ function pagelayer_randInt(max) {
|
|
5197 |
}
|
5198 |
|
5199 |
// Convert the regular URL of a Video to a Embed URL
|
5200 |
-
function pagelayer_video_url(src){
|
5201 |
-
|
|
|
5202 |
var youtubeRegExp = /youtube\.com|youtu\.be/;
|
5203 |
var vimeoRegExp = /vimeo\.com/;
|
5204 |
var match = '';
|
5205 |
var videoId = '';
|
|
|
5206 |
|
5207 |
if (youtubeRegExp.exec(src)) {
|
5208 |
match = 'youtube';
|
@@ -5231,7 +5389,11 @@ function pagelayer_video_url(src){
|
|
5231 |
videoId = src.split('.be/');
|
5232 |
}
|
5233 |
|
5234 |
-
|
|
|
|
|
|
|
|
|
5235 |
|
5236 |
break;
|
5237 |
|
@@ -5246,12 +5408,26 @@ function pagelayer_video_url(src){
|
|
5246 |
videoId = src.split('.com/');
|
5247 |
}
|
5248 |
|
5249 |
-
|
|
|
|
|
|
|
|
|
5250 |
|
5251 |
break;
|
5252 |
default:
|
5253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5254 |
}
|
|
|
|
|
5255 |
};
|
5256 |
|
5257 |
// Add widget section
|
@@ -6038,3 +6214,39 @@ function pagelayer_ucwords(str) {
|
|
6038 |
return $1.toUpperCase();
|
6039 |
});
|
6040 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022 |
//alert(String.fromCharCode(event.which));
|
2023 |
|
2024 |
var tEle = jQuery(event.target);
|
2025 |
+
var editable = tEle.closest('[contenteditable="true"]');
|
2026 |
+
|
2027 |
+
// Enter handle
|
2028 |
+
if(event.keyCode == 13 && !event.shiftKey){
|
2029 |
+
|
2030 |
+
var jEle = tEle.closest('.pagelayer-ele');
|
2031 |
+
var tag = pagelayer_tag(jEle);
|
2032 |
+
|
2033 |
+
if(tag != 'pl_heading' || editable.length < 1){
|
2034 |
+
return;
|
2035 |
+
}
|
2036 |
+
|
2037 |
+
event.preventDefault();
|
2038 |
+
|
2039 |
+
var selection = window.getSelection();
|
2040 |
+
var range = selection.getRangeAt(0);
|
2041 |
+
|
2042 |
+
// We are within the list tag
|
2043 |
+
if(jQuery(range.startContainer).closest('[pagelayer-editable] li').length > 0){
|
2044 |
+
return;
|
2045 |
+
}
|
2046 |
+
|
2047 |
+
var lastChild = editable[0].lastChild;
|
2048 |
+
var startContainer = range.startContainer;
|
2049 |
+
|
2050 |
+
if(startContainer.nodeType == Node.TEXT_NODE && startContainer.parentNode != editable[0]){
|
2051 |
+
startContainer = startContainer.parentNode;
|
2052 |
+
}
|
2053 |
+
|
2054 |
+
range.setEndAfter(lastChild);
|
2055 |
+
|
2056 |
+
var val = range.cloneContents();
|
2057 |
+
var selfEle = jQuery('<div>').append(val);
|
2058 |
+
var selContent = selfEle.html();
|
2059 |
+
var selfFC = selfEle[0].firstChild;
|
2060 |
+
|
2061 |
+
if(selfFC == null || pagelayer_empty(selContent)){
|
2062 |
+
selContent = '<p><br></p>';
|
2063 |
+
}else if(selfFC.nodeType == Node.TEXT_NODE){
|
2064 |
+
selContent = '<p>'+selContent+'</p>';
|
2065 |
+
}else if(selfEle.text() == '' && selfEle.find('br').length < 1){
|
2066 |
+
range.collapse(true);
|
2067 |
+
var br = document.createElement('br');
|
2068 |
+
range.insertNode(br);
|
2069 |
+
range.setStartBefore(br);
|
2070 |
+
range.setEndAfter(lastChild);
|
2071 |
+
val = range.cloneContents();
|
2072 |
+
selContent = jQuery('<div>').append(val).html();
|
2073 |
+
}
|
2074 |
+
|
2075 |
+
range.deleteContents();
|
2076 |
+
|
2077 |
+
if( jQuery(startContainer).is(':first-child') && jQuery(startContainer).is(':empty') ){
|
2078 |
+
jQuery(startContainer).html('<br>');
|
2079 |
+
}else if( jQuery(startContainer).is(':empty') ){
|
2080 |
+
jQuery(startContainer).remove();
|
2081 |
+
}
|
2082 |
+
|
2083 |
+
// If editor is empty
|
2084 |
+
if( editable.is(':empty') ){
|
2085 |
+
editable.html('<p><br></p>');
|
2086 |
+
}
|
2087 |
+
|
2088 |
+
editable.trigger('input');
|
2089 |
+
editable.blur();
|
2090 |
+
|
2091 |
+
var id = pagelayer_copy_element(jEle);
|
2092 |
+
var ele = pagelayer_ele_by_id(id);
|
2093 |
+
ele.click();
|
2094 |
+
var editorArea = ele.find('[pagelayer-editable]');
|
2095 |
+
editorArea.html(selContent);
|
2096 |
+
editorArea.find('p:empty').remove();
|
2097 |
+
editorArea.click();
|
2098 |
+
editorArea.focus().trigger('input');
|
2099 |
+
}
|
2100 |
|
2101 |
// ctrl+s handle
|
2102 |
if(event.keyCode == 83 && event.ctrlKey){
|
2104 |
pagelayer.$$('.pagelayer-bottombar-holder').find('.pagelayer-update-button').click();
|
2105 |
}
|
2106 |
|
2107 |
+
// ctrl+d handle
|
2108 |
+
if(event.keyCode == 68 && event.ctrlKey){
|
2109 |
+
|
2110 |
+
// If we have an active element
|
2111 |
+
if( pagelayer_active.el && pagelayer_active.el.id ){
|
2112 |
+
event.preventDefault();
|
2113 |
+
pagelayer_copy_element('[pagelayer-id='+pagelayer_active.el.id+']');
|
2114 |
+
}
|
2115 |
+
|
2116 |
+
}
|
2117 |
+
|
2118 |
+
// Backspace handler
|
2119 |
+
if(event.keyCode == 8 && editable.length > 0){
|
2120 |
+
var jEle = tEle.closest('.pagelayer-ele-wrap');
|
2121 |
+
var tag = pagelayer_tag(jEle);
|
2122 |
+
var prev = jEle.prev();
|
2123 |
+
|
2124 |
+
if(tag != 'pl_heading' || prev.length < 1){
|
2125 |
+
return;
|
2126 |
+
}
|
2127 |
+
|
2128 |
+
var pTag = pagelayer_tag(prev);
|
2129 |
+
var selection = window.getSelection();
|
2130 |
+
|
2131 |
+
if (selection == null || selection.rangeCount <= 0) return null;
|
2132 |
+
|
2133 |
+
var range1 = selection.getRangeAt(0);
|
2134 |
+
|
2135 |
+
if(pTag != tag || range1.startOffset != 0){
|
2136 |
+
return;
|
2137 |
+
}
|
2138 |
+
|
2139 |
+
var getCaretCharacterOffsetWithin = function(element){ // http://jsfiddle.net/TjXEG/900/
|
2140 |
+
var caretOffset = 0;
|
2141 |
+
var doc = element.ownerDocument || element.document;
|
2142 |
+
var win = doc.defaultView || doc.parentWindow;
|
2143 |
+
var sel;
|
2144 |
+
if( typeof win.getSelection != "undefined" ){
|
2145 |
+
sel = win.getSelection();
|
2146 |
+
if (sel.rangeCount > 0) {
|
2147 |
+
var range = win.getSelection().getRangeAt(0);
|
2148 |
+
var preCaretRange = range.cloneRange();
|
2149 |
+
preCaretRange.selectNodeContents(element);
|
2150 |
+
preCaretRange.setEnd(range.endContainer, range.endOffset);
|
2151 |
+
caretOffset = preCaretRange.toString().length;
|
2152 |
+
}
|
2153 |
+
}else if( (sel = doc.selection) && sel.type != "Control" ){
|
2154 |
+
var textRange = sel.createRange();
|
2155 |
+
var preCaretTextRange = doc.body.createTextRange();
|
2156 |
+
preCaretTextRange.moveToElementText(element);
|
2157 |
+
preCaretTextRange.setEndPoint("EndToEnd", textRange);
|
2158 |
+
caretOffset = preCaretTextRange.text.length;
|
2159 |
+
}
|
2160 |
+
return caretOffset;
|
2161 |
+
}
|
2162 |
+
|
2163 |
+
if( getCaretCharacterOffsetWithin(editable[0]) != 0 ){
|
2164 |
+
return;
|
2165 |
+
}
|
2166 |
+
|
2167 |
+
//event.preventDefault();
|
2168 |
+
var html = editable[0].innerHTML;
|
2169 |
+
html = jQuery('<div>').append(html).html();
|
2170 |
+
editable.blur();
|
2171 |
+
prev.children('.pagelayer-ele').click();
|
2172 |
+
|
2173 |
+
var prevArea = prev.find('[pagelayer-editable="text"]');
|
2174 |
+
prevArea.click();
|
2175 |
+
|
2176 |
+
var newSel = window.getSelection();
|
2177 |
+
var newRange = newSel.getRangeAt(0);
|
2178 |
+
|
2179 |
+
var lastChild = prevArea.children().last();
|
2180 |
+
|
2181 |
+
prevArea.append(html);
|
2182 |
+
prevArea.trigger('input');
|
2183 |
+
|
2184 |
+
if(lastChild.length > 0 ){
|
2185 |
+
newRange.setStartAfter(lastChild[0]);
|
2186 |
+
}
|
2187 |
+
|
2188 |
+
newRange.collapse(true);
|
2189 |
+
newSel.removeAllRanges();
|
2190 |
+
newSel.addRange(newRange);
|
2191 |
+
|
2192 |
+
pagelayer_delete_element(jEle.children('.pagelayer-ele'));
|
2193 |
+
|
2194 |
+
}
|
2195 |
+
|
2196 |
// Is this in the editable area ?
|
2197 |
+
if (tEle.is('input, textarea') || editable.length > 0) {
|
2198 |
return;
|
2199 |
}
|
2200 |
|
2213 |
pagelayer_do_history('redo');
|
2214 |
}
|
2215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2216 |
});
|
2217 |
|
2218 |
// Handle Copy of content
|
2253 |
var contenteditable = false;
|
2254 |
var pasteWidget = false;
|
2255 |
|
2256 |
+
if( pEle_target.closest('[contenteditable="true"]').length > 0 || pEle_target.is('input, textarea') ){
|
2257 |
+
pEle_target = pEle_target.closest('[contenteditable="true"], input, textarea');
|
2258 |
contenteditable = true;
|
2259 |
}
|
2260 |
|
2381 |
if(pagelayer_empty(findImg) && pagelayer_empty(contenteditable) || pasteWidget){
|
2382 |
|
2383 |
// Check the active element
|
2384 |
+
if(pagelayer_active.el && pagelayer_active.el.id && pagelayer_active.el.tag != 'pl_post_props'){
|
2385 |
|
2386 |
var jEle = jQuery("[pagelayer-id='"+pagelayer_active.el.id+"']");
|
2387 |
|
3242 |
|
3243 |
// Remove the attribute if its BLANK and there is no default for it
|
3244 |
// If there is a default, we set it to blank to keep record of the current val
|
3245 |
+
if(pagelayer_length(atts[x]) < 1){
|
3246 |
|
3247 |
// Remove values which are not defaults
|
3248 |
if(!(x in defaults)){
|
3249 |
delete ref_data['attr'][x];
|
3250 |
// Otherwise keep value set for avoiding resetting
|
3251 |
}else{
|
3252 |
+
ref_data['attr'][x] = atts[x];
|
3253 |
}
|
3254 |
|
3255 |
// Remove the tmp atts anyway
|
3257 |
|
3258 |
// Set the value
|
3259 |
}else{
|
3260 |
+
ref_data['attr'][x] = pagelayer_trim(atts[x]);
|
3261 |
}
|
3262 |
|
3263 |
// Are you the active element
|
3296 |
var ref_data = pagelayer_el_data_ref(jEle);
|
3297 |
|
3298 |
for(var x in atts){
|
3299 |
+
|
|
|
|
|
3300 |
// Record history
|
3301 |
if(pagelayer.history_action){
|
3302 |
|
3388 |
|
3389 |
// If there is an array
|
3390 |
if(css.match(/val\[\d/)){
|
3391 |
+
|
3392 |
+
if(typeof val != 'object' || val === null){
|
3393 |
+
val = String(val).split(seperator);
|
3394 |
+
}
|
3395 |
+
|
3396 |
for(var i in val){
|
3397 |
css = css.split('{{val['+i+']}}').join(pagelayer_hex8_to_rgba(val[i]));
|
3398 |
}
|
3495 |
// pagelayer_data will return attributes even if they are BLANK e.g. attr=""
|
3496 |
// Render doesnt consider BLANK values as values, and we are unsetting them now
|
3497 |
// If in any situation you need to consider blank values, please handle in the JS / PHP function of the Shortcode
|
3498 |
+
if(x in el.atts && pagelayer_length(el.atts[x]) < 1){
|
3499 |
+
delete el.atts[x];
|
3500 |
}
|
3501 |
|
3502 |
// Any editor ?
|
3982 |
// hiding and showing loading animation
|
3983 |
pagelayer.$$('.pagelayer-update-text').hide();
|
3984 |
pagelayer.$$('.pagelayer-update-loader').show();
|
3985 |
+
|
3986 |
pagelayer_trigger_action('pagelayer_save');
|
3987 |
|
3988 |
var pagelayerajaxurl = pagelayer_ajax_url+'&action=pagelayer_save_content&postID='+pagelayer_postID;
|
5353 |
}
|
5354 |
|
5355 |
// Convert the regular URL of a Video to a Embed URL
|
5356 |
+
function pagelayer_video_url(src, no_url){
|
5357 |
+
|
5358 |
+
no_url = no_url || false;
|
5359 |
var youtubeRegExp = /youtube\.com|youtu\.be/;
|
5360 |
var vimeoRegExp = /vimeo\.com/;
|
5361 |
var match = '';
|
5362 |
var videoId = '';
|
5363 |
+
var vid_params = {};
|
5364 |
|
5365 |
if (youtubeRegExp.exec(src)) {
|
5366 |
match = 'youtube';
|
5389 |
videoId = src.split('.be/');
|
5390 |
}
|
5391 |
|
5392 |
+
vid_params = {
|
5393 |
+
type : 'youtube',
|
5394 |
+
src : '//youtube.com/embed/'+videoId[1],
|
5395 |
+
id : videoId[1]
|
5396 |
+
};
|
5397 |
|
5398 |
break;
|
5399 |
|
5408 |
videoId = src.split('.com/');
|
5409 |
}
|
5410 |
|
5411 |
+
vid_params = {
|
5412 |
+
type : 'vimeo',
|
5413 |
+
src : '//player.vimeo.com/video/'+videoId[1],
|
5414 |
+
id : videoId[1]
|
5415 |
+
};
|
5416 |
|
5417 |
break;
|
5418 |
default:
|
5419 |
+
vid_params = {
|
5420 |
+
type : 'local',
|
5421 |
+
src : src
|
5422 |
+
};
|
5423 |
+
|
5424 |
+
}
|
5425 |
+
|
5426 |
+
if(!no_url){
|
5427 |
+
return vid_params.src;
|
5428 |
}
|
5429 |
+
|
5430 |
+
return vid_params;
|
5431 |
};
|
5432 |
|
5433 |
// Add widget section
|
6214 |
return $1.toUpperCase();
|
6215 |
});
|
6216 |
}
|
6217 |
+
|
6218 |
+
// Check length for string and object
|
6219 |
+
function pagelayer_length(mixed_var) {
|
6220 |
+
|
6221 |
+
var length = 0;
|
6222 |
+
var undef, key, i, len;
|
6223 |
+
var emptyValues = [undef, null, false];
|
6224 |
+
|
6225 |
+
for(i = 0, len = emptyValues.length; i < len; i++) {
|
6226 |
+
if (mixed_var === emptyValues[i]) {
|
6227 |
+
return length;
|
6228 |
+
}
|
6229 |
+
}
|
6230 |
+
|
6231 |
+
// Is array, object or jQuery object?
|
6232 |
+
if(typeof mixed_var === 'object'){
|
6233 |
+
|
6234 |
+
// If is jQuery object
|
6235 |
+
if( mixed_var.hasOwnProperty('length')){
|
6236 |
+
return mixed_var.length;
|
6237 |
+
}
|
6238 |
+
|
6239 |
+
for (key in mixed_var) {
|
6240 |
+
// TODO: should we check for own properties only?
|
6241 |
+
//if ( .hasOwnProperty(key)) {
|
6242 |
+
length++;
|
6243 |
+
//}
|
6244 |
+
}
|
6245 |
+
|
6246 |
+
return length;
|
6247 |
+
}
|
6248 |
+
|
6249 |
+
length = String(mixed_var).length;
|
6250 |
+
|
6251 |
+
return length;
|
6252 |
+
};
|
@@ -118,6 +118,11 @@ jQuery(document).ready(function(){
|
|
118 |
// For automatic row change
|
119 |
jQuery(window).resize(function() {
|
120 |
|
|
|
|
|
|
|
|
|
|
|
121 |
var new_vw = jQuery(document).width();
|
122 |
|
123 |
if(new_vw == pagelayer_doc_width){
|
@@ -138,11 +143,6 @@ jQuery(window).resize(function() {
|
|
138 |
|
139 |
}, 200);
|
140 |
|
141 |
-
// Primary Menu
|
142 |
-
jQuery('.pagelayer-wp_menu').each(function(){
|
143 |
-
pagelayer_primary_menu(jQuery(this));
|
144 |
-
});
|
145 |
-
|
146 |
});
|
147 |
|
148 |
// Check if element is visible
|
@@ -264,9 +264,22 @@ function pagelayer_pl_image_slider(jEle){
|
|
264 |
|
265 |
}
|
266 |
|
267 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
jQuery('[pagelayer-id='+pl_id+']').show();
|
271 |
|
272 |
jQuery(el).parent().find('.pagelayer-tablinks').each(function(){
|
@@ -281,7 +294,10 @@ var pagelayer_tab_timers = {};
|
|
281 |
function pagelayer_pl_tabs(jEle) {
|
282 |
|
283 |
var default_active = '';
|
284 |
-
var
|
|
|
|
|
|
|
285 |
|
286 |
// Loop thru
|
287 |
children.each(function(){
|
@@ -300,7 +316,7 @@ function pagelayer_pl_tabs(jEle) {
|
|
300 |
default_active = pl_id;
|
301 |
}
|
302 |
|
303 |
-
jEle.
|
304 |
});
|
305 |
|
306 |
// Set the default tab
|
@@ -313,7 +329,7 @@ function pagelayer_pl_tabs(jEle) {
|
|
313 |
}
|
314 |
|
315 |
try{
|
316 |
-
clearInterval(pagelayer_tab_timers[
|
317 |
}catch(e){};
|
318 |
|
319 |
var rotate = parseInt(jEle.attr('pagelayer-tabs-rotate'));
|
@@ -322,13 +338,15 @@ function pagelayer_pl_tabs(jEle) {
|
|
322 |
if(rotate > 0){
|
323 |
|
324 |
var i= 0;
|
325 |
-
pagelayer_tab_timers[
|
326 |
|
327 |
if(i >= children.length){
|
328 |
i = 0;
|
329 |
}
|
330 |
|
331 |
-
var
|
|
|
|
|
332 |
var tmp_btn_ele = jEle.find('.pagelayer-tablinks')[i]
|
333 |
var tmp_pl_id = jQuery(tmp_pl_ele).attr('pagelayer-id');
|
334 |
|
@@ -337,7 +355,7 @@ function pagelayer_pl_tabs(jEle) {
|
|
337 |
});
|
338 |
|
339 |
jQuery(tmp_btn_ele).addClass("active");
|
340 |
-
pagelayer_tab_show(
|
341 |
|
342 |
i++;
|
343 |
|
@@ -520,6 +538,11 @@ function pagelayer_progress(){
|
|
520 |
|
521 |
// Dismiss Alert Function
|
522 |
function pagelayer_dismiss_alert(x){
|
|
|
|
|
|
|
|
|
|
|
523 |
jQuery(x).parent().parent().fadeOut();
|
524 |
}
|
525 |
|
@@ -693,6 +716,16 @@ function pagelayer_pl_grid_lightbox(jEle){
|
|
693 |
});
|
694 |
}
|
695 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
696 |
// PHP equivalent empty()
|
697 |
function pagelayer_empty(mixed_var) {
|
698 |
|
@@ -830,6 +863,22 @@ function pagelayer_owl_init(jEle, ul, options){
|
|
830 |
owlCar.trigger('refresh.owl.carousel');
|
831 |
},700);
|
832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
// Set that we have setup everything
|
834 |
jEle.attr('pagelayer-setup', 1);
|
835 |
|
118 |
// For automatic row change
|
119 |
jQuery(window).resize(function() {
|
120 |
|
121 |
+
// Primary Menu
|
122 |
+
jQuery('.pagelayer-wp_menu').each(function(){
|
123 |
+
pagelayer_primary_menu(jQuery(this));
|
124 |
+
});
|
125 |
+
|
126 |
var new_vw = jQuery(document).width();
|
127 |
|
128 |
if(new_vw == pagelayer_doc_width){
|
143 |
|
144 |
}, 200);
|
145 |
|
|
|
|
|
|
|
|
|
|
|
146 |
});
|
147 |
|
148 |
// Check if element is visible
|
264 |
|
265 |
}
|
266 |
|
267 |
+
function pagelayer_get_tab_ele(temp_tabCont){
|
268 |
+
|
269 |
+
if(!pagelayer_empty(temp_tabCont.children('.pagelayer-ele-wrap').length)){
|
270 |
+
return temp_tabCont.children('.pagelayer-ele-wrap').children('.pagelayer-tab');
|
271 |
+
}else{
|
272 |
+
return temp_tabCont.children('.pagelayer-tab');
|
273 |
+
}
|
274 |
+
}
|
275 |
|
276 |
+
function pagelayer_tab_show(el, pl_id) {
|
277 |
+
|
278 |
+
var parent_id = jQuery(el).closest('.pagelayer-tabs').attr('pagelayer-id');
|
279 |
+
|
280 |
+
var temp_tabCont = jQuery('[pagelayer-id='+pl_id+']').closest('.pagelayer-tabcontainer');
|
281 |
+
pagelayer_get_tab_ele(temp_tabCont).hide();
|
282 |
+
|
283 |
jQuery('[pagelayer-id='+pl_id+']').show();
|
284 |
|
285 |
jQuery(el).parent().find('.pagelayer-tablinks').each(function(){
|
294 |
function pagelayer_pl_tabs(jEle) {
|
295 |
|
296 |
var default_active = '';
|
297 |
+
var jEle_id = jEle.attr('pagelayer-id');
|
298 |
+
|
299 |
+
var tabCont = jEle.children('.pagelayer-tabcontainer');
|
300 |
+
var children = pagelayer_get_tab_ele(tabCont);
|
301 |
|
302 |
// Loop thru
|
303 |
children.each(function(){
|
316 |
default_active = pl_id;
|
317 |
}
|
318 |
|
319 |
+
jEle.children('.pagelayer-tabs-holder').append('<span tab-id="'+pl_id+'" class="pagelayer-tablinks" onclick="'+func+'"> <i class="'+icon+'"></i> <span>'+title+'</span></span>');
|
320 |
});
|
321 |
|
322 |
// Set the default tab
|
329 |
}
|
330 |
|
331 |
try{
|
332 |
+
clearInterval(pagelayer_tab_timers[jEle_id]);
|
333 |
}catch(e){};
|
334 |
|
335 |
var rotate = parseInt(jEle.attr('pagelayer-tabs-rotate'));
|
338 |
if(rotate > 0){
|
339 |
|
340 |
var i= 0;
|
341 |
+
pagelayer_tab_timers[jEle_id] = setInterval(function () {
|
342 |
|
343 |
if(i >= children.length){
|
344 |
i = 0;
|
345 |
}
|
346 |
|
347 |
+
var tabCont = jEle.children('.pagelayer-tabcontainer');
|
348 |
+
var tmp_pl_ele = pagelayer_get_tab_ele(tabCont)[i];
|
349 |
+
|
350 |
var tmp_btn_ele = jEle.find('.pagelayer-tablinks')[i]
|
351 |
var tmp_pl_id = jQuery(tmp_pl_ele).attr('pagelayer-id');
|
352 |
|
355 |
});
|
356 |
|
357 |
jQuery(tmp_btn_ele).addClass("active");
|
358 |
+
pagelayer_tab_show(tmp_btn_ele, tmp_pl_id);
|
359 |
|
360 |
i++;
|
361 |
|
538 |
|
539 |
// Dismiss Alert Function
|
540 |
function pagelayer_dismiss_alert(x){
|
541 |
+
|
542 |
+
if(!pagelayer_empty(pagelayer_is_live)){
|
543 |
+
return;
|
544 |
+
}
|
545 |
+
|
546 |
jQuery(x).parent().parent().fadeOut();
|
547 |
}
|
548 |
|
716 |
});
|
717 |
}
|
718 |
|
719 |
+
// Is string?
|
720 |
+
function pagelayer_is_string(str){
|
721 |
+
|
722 |
+
if(typeof str == 'string'){
|
723 |
+
return true;
|
724 |
+
}
|
725 |
+
|
726 |
+
return false;
|
727 |
+
}
|
728 |
+
|
729 |
// PHP equivalent empty()
|
730 |
function pagelayer_empty(mixed_var) {
|
731 |
|
863 |
owlCar.trigger('refresh.owl.carousel');
|
864 |
},700);
|
865 |
|
866 |
+
// To prevent slider drag inside the editable area
|
867 |
+
jEle.on('mousedown', function(e){
|
868 |
+
var target = e.target;
|
869 |
+
|
870 |
+
var isEditable = jQuery(target).closest('[contenteditable="true"]');
|
871 |
+
|
872 |
+
if(isEditable.length < 1){
|
873 |
+
return;
|
874 |
+
}
|
875 |
+
|
876 |
+
isEditable.on('mousedown.owl.core dragstart.owl.core selectstart.owl.core touchstart.owl.core touchcancel.owl.core', function(e){
|
877 |
+
e.stopPropagation();
|
878 |
+
});
|
879 |
+
|
880 |
+
});
|
881 |
+
|
882 |
// Set that we have setup everything
|
883 |
jEle.attr('pagelayer-setup', 1);
|
884 |
|
@@ -0,0 +1,1301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Pagelayer Pen editor */
|
2 |
+
var pagelayer_customColor = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"];
|
3 |
+
|
4 |
+
var pagelayer_pen_sizeList = ['normal', 'x-small', 'small', 'medium', 'large', 'x-large'];
|
5 |
+
var pagelayer_pen_lineHeight = ['0.9', '1', '1.5', '2.0', '2.5','3.0', '3.5', '4.0', '4.5', '5.0'];
|
6 |
+
|
7 |
+
class PagelayerPen{
|
8 |
+
|
9 |
+
constructor(jEle, options) {
|
10 |
+
var t = this;
|
11 |
+
|
12 |
+
t.editor = jQuery(jEle);
|
13 |
+
t.options = options;
|
14 |
+
|
15 |
+
// Get the document of the element. It use to makes the plugin
|
16 |
+
// compatible on iframes.
|
17 |
+
t.doc = jEle.ownerDocument || document;
|
18 |
+
t.tagToButton = {};
|
19 |
+
t.optionsCounter = 0;
|
20 |
+
t.destroyEd = true;
|
21 |
+
t.semantic = null;
|
22 |
+
t.DEFAULT_SEMANTIC_MAP = {
|
23 |
+
'b': 'strong',
|
24 |
+
'i': 'em',
|
25 |
+
's': 'strike',
|
26 |
+
//'strike': 'del',
|
27 |
+
'div': 'p'
|
28 |
+
};
|
29 |
+
|
30 |
+
// Init editor
|
31 |
+
t.addHandlers();
|
32 |
+
t.init();
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
init(){
|
37 |
+
var t = this;
|
38 |
+
// Init Editor
|
39 |
+
t.editor.addClass('pagelayer-pen');
|
40 |
+
t.penHolder = t.addContainer();
|
41 |
+
t.addEvents();
|
42 |
+
}
|
43 |
+
|
44 |
+
addHandlers(){
|
45 |
+
// TODO : Add for custom plugins
|
46 |
+
// TODO remove all execCommands
|
47 |
+
this.handlers = {
|
48 |
+
bold:{
|
49 |
+
tag: 'STRONG',
|
50 |
+
icon: '<strong><i class="fas fa-bold"></i></strong>'
|
51 |
+
},
|
52 |
+
italic:{
|
53 |
+
tag: 'EM',
|
54 |
+
icon: '<strong><i class="fas fa-italic"></i></strong>'
|
55 |
+
},
|
56 |
+
underline:{
|
57 |
+
tag: 'U',
|
58 |
+
icon: '<strong><i class="fas fa-underline"></i></strong>'
|
59 |
+
},
|
60 |
+
strike:{
|
61 |
+
tag: 'strike',
|
62 |
+
fn: 'strikethrough',
|
63 |
+
icon: '<strong><i class="fas fa-strikethrough"></i></strong>'
|
64 |
+
},
|
65 |
+
h1:{
|
66 |
+
fn: 'formatBlock',
|
67 |
+
icon: '<strong>H<sub>1</sub></strong>'
|
68 |
+
},
|
69 |
+
h2:{
|
70 |
+
fn: 'formatBlock',
|
71 |
+
icon: '<strong>H<sub>2</sub></strong>'
|
72 |
+
},
|
73 |
+
h3:{
|
74 |
+
fn: 'formatBlock',
|
75 |
+
icon: '<strong>H<sub>3</sub></strong>'
|
76 |
+
},
|
77 |
+
h4:{
|
78 |
+
fn: 'formatBlock',
|
79 |
+
icon: '<strong>H<sub>4</sub></strong>'
|
80 |
+
},
|
81 |
+
h5:{
|
82 |
+
fn: 'formatBlock',
|
83 |
+
icon: '<strong>H<sub>5</sub></strong>'
|
84 |
+
},
|
85 |
+
h6:{
|
86 |
+
fn: 'formatBlock',
|
87 |
+
icon: '<strong>H<sub>6</sub></strong>'
|
88 |
+
},
|
89 |
+
p:{
|
90 |
+
fn: 'formatBlock',
|
91 |
+
icon: '<strong><i class="fas fa-paragraph"></i></strong>'
|
92 |
+
},
|
93 |
+
blockquote:{
|
94 |
+
fn: 'formatBlock',
|
95 |
+
icon: '<strong><i class="fas fa-quote-right"></i></strong>'
|
96 |
+
},
|
97 |
+
formating:{
|
98 |
+
fn: 'formatBlock',
|
99 |
+
fixIcon: '<strong><i class="fas fa-paragraph"></i></strong>'
|
100 |
+
},
|
101 |
+
unorderedlist:{
|
102 |
+
tag: 'UL',
|
103 |
+
fn: 'insertUnorderedList',
|
104 |
+
icon: '<strong><i class="fas fa-list-ul"></i></i></strong>'
|
105 |
+
},
|
106 |
+
orderedlist:{
|
107 |
+
tag: 'OL',
|
108 |
+
fn: 'insertOrderedList',
|
109 |
+
icon: '<strong><i class="fas fa-list-ol"></i></i></strong>'
|
110 |
+
},
|
111 |
+
sub:{
|
112 |
+
tag: 'sub',
|
113 |
+
fn: 'subscript',
|
114 |
+
icon: '<strong><i class="fas fa-subscript"></i></strong>'
|
115 |
+
},
|
116 |
+
super:{
|
117 |
+
tag: 'sup',
|
118 |
+
fn: 'superscript',
|
119 |
+
icon: '<strong><i class="fas fa-superscript"></i></strong>'
|
120 |
+
},
|
121 |
+
link:{
|
122 |
+
fn: 'setLinkHandler',
|
123 |
+
tag: 'a',
|
124 |
+
icon: '<strong><i class="fas fa-link"></i></strong>',
|
125 |
+
},
|
126 |
+
image:{
|
127 |
+
fn: 'imageBtnHandler',
|
128 |
+
icon: '<i class="far fa-image"></i>'
|
129 |
+
},
|
130 |
+
align:{
|
131 |
+
style: 'text-align',
|
132 |
+
fn: 'alignHandler',
|
133 |
+
icon: {
|
134 |
+
'left': '<i class="fas fa-align-left"></i>',
|
135 |
+
'center': '<i class="fas fa-align-center"></i>',
|
136 |
+
'right': '<i class="fas fa-align-right"></i>',
|
137 |
+
'justify': '<i class="fas fa-align-justify"></i>',
|
138 |
+
}
|
139 |
+
},
|
140 |
+
color:{
|
141 |
+
class: 'pagelayer-pen-color-picker',
|
142 |
+
style: 'color',
|
143 |
+
fn: 'commandHandler',
|
144 |
+
fixIcon: '<svg viewbox=\"0 0 18 18\"> <line class=\"pagelayer-pen-color-label pagelayer-pen-stroke pagelayer-pen-transparent\" x1=3 x2=15 y1=15 y2=15></line> <polyline class=pagelayer-pen-stroke points=\"5.5 11 9 3 12.5 11\"></polyline> <line class=pagelayer-pen-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>',
|
145 |
+
buildBtn : 'buildColorBtnHandler',
|
146 |
+
default : pagelayer_customColor,
|
147 |
+
customInpute: true
|
148 |
+
},
|
149 |
+
background:{
|
150 |
+
class: 'pagelayer-pen-color-picker',
|
151 |
+
style: 'background-color',
|
152 |
+
fn: 'commandHandler',
|
153 |
+
fixIcon: '<svg viewbox=\"0 0 18 18\"> <g class=\"pagelayer-pen-fill pagelayer-pen-color-label\"> <polygon points=\"6 6.868 6 6 5 6 5 7 5.942 7 6 6.868\"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points=\"6.817 5 6 5 6 6 6.38 6 6.817 5\"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points=\"4 11.439 4 11 3 11 3 12 3.755 12 4 11.439\"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points=\"4.63 10 4 10 4 11 4.192 11 4.63 10\"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points=\"13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174\"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points=\"12 6.868 12 6 11.62 6 12 6.868\"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points=\"12.933 9 13 9 13 8 12.495 8 12.933 9\"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=pagelayer-pen-stroke points=\"5.5 13 9 5 12.5 13\"></polyline> <line class=pagelayer-pen-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>',
|
154 |
+
buildBtn: 'buildColorBtnHandler',
|
155 |
+
default : pagelayer_customColor,
|
156 |
+
customInpute: true
|
157 |
+
},
|
158 |
+
size:{
|
159 |
+
class: 'pagelayer-pen-size-picker',
|
160 |
+
style: 'font-size',
|
161 |
+
fn: 'commandHandler',
|
162 |
+
default : pagelayer_pen_sizeList,
|
163 |
+
customInpute: true
|
164 |
+
},
|
165 |
+
lineheight:{
|
166 |
+
style: 'line-height',
|
167 |
+
fn: 'commandHandler',
|
168 |
+
fixIcon: '<svg viewBox="0 0 22 18" version="1.1"><g><path class="pagelayer-pen-fill" d="M 21.527344 7.875 L 9.269531 7.875 C 9.011719 7.875 8.800781 8.125 8.800781 8.4375 L 8.800781 9.5625 C 8.800781 9.875 9.011719 10.125 9.269531 10.125 L 21.527344 10.125 C 21.789062 10.125 22 9.875 22 9.5625 L 22 8.4375 C 22 8.125 21.789062 7.875 21.527344 7.875 Z M 21.527344 13.5 L 9.269531 13.5 C 9.011719 13.5 8.800781 13.75 8.800781 14.0625 L 8.800781 15.1875 C 8.800781 15.5 9.011719 15.75 9.269531 15.75 L 21.527344 15.75 C 21.789062 15.75 22 15.5 22 15.1875 L 22 14.0625 C 22 13.75 21.789062 13.5 21.527344 13.5 Z M 21.527344 2.25 L 9.269531 2.25 C 9.011719 2.25 8.800781 2.5 8.800781 2.8125 L 8.800781 3.9375 C 8.800781 4.25 9.011719 4.5 9.269531 4.5 L 21.527344 4.5 C 21.789062 4.5 22 4.25 22 3.9375 L 22 2.8125 C 22 2.5 21.789062 2.25 21.527344 2.25 Z M 6.050781 5.0625 C 6.542969 5.0625 6.785156 4.453125 6.4375 4.101562 L 3.6875 1.289062 C 3.472656 1.070312 3.125 1.070312 2.910156 1.289062 L 0.160156 4.101562 C -0.160156 4.429688 0.0117188 5.0625 0.550781 5.0625 L 2.199219 5.0625 L 2.199219 12.9375 L 0.550781 12.9375 C 0.0585938 12.9375 -0.183594 13.546875 0.160156 13.898438 L 2.910156 16.710938 C 3.125 16.929688 3.476562 16.929688 3.691406 16.710938 L 6.441406 13.898438 C 6.757812 13.570312 6.585938 12.9375 6.050781 12.9375 L 4.398438 12.9375 L 4.398438 5.0625 Z M 6.050781 5.0625 "/></g></svg>',
|
169 |
+
default : pagelayer_pen_lineHeight,
|
170 |
+
customInpute: true
|
171 |
+
},
|
172 |
+
font:{
|
173 |
+
style: 'font-family',
|
174 |
+
fn: 'commandHandler',
|
175 |
+
fixIcon: '<i class="fas fa-font"></i>',
|
176 |
+
default : pagelayer_fonts,
|
177 |
+
},
|
178 |
+
viewHTML:{
|
179 |
+
fn: 'viewHTMLBtnHandler',
|
180 |
+
icon: '<i class="fas fa-code"></i>'
|
181 |
+
},
|
182 |
+
removeformat:{
|
183 |
+
icon: '<i class="fas fa-remove-format"></i>'
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
+
addContainer(className){
|
189 |
+
|
190 |
+
className = className || false;
|
191 |
+
|
192 |
+
// Add Container
|
193 |
+
var container = jQuery('.pagelayer-pen-holder');
|
194 |
+
|
195 |
+
if(container.length < 1){
|
196 |
+
jQuery('body').append('<div class="pagelayer-pen-holder"></div>');
|
197 |
+
container = jQuery('.pagelayer-pen-holder');
|
198 |
+
}
|
199 |
+
|
200 |
+
if(!className){
|
201 |
+
return container;
|
202 |
+
}
|
203 |
+
|
204 |
+
if(container.find('.'+className).length < 1){
|
205 |
+
container.append('<div class="'+className+'"></div>');
|
206 |
+
}
|
207 |
+
|
208 |
+
return container.find('.'+className);
|
209 |
+
|
210 |
+
}
|
211 |
+
|
212 |
+
addToolbar(){
|
213 |
+
|
214 |
+
// Add Toolbar
|
215 |
+
var t = this;
|
216 |
+
var groups = t.options.toolbar;
|
217 |
+
var toolbar = t.toolbar = t.addContainer('pagelayer-pen-toolbar');
|
218 |
+
|
219 |
+
// Make it empty
|
220 |
+
toolbar.empty();
|
221 |
+
|
222 |
+
if (!Array.isArray(groups[0])) {
|
223 |
+
groups = [groups];
|
224 |
+
}
|
225 |
+
|
226 |
+
var addButton = function(container, format, value){
|
227 |
+
|
228 |
+
var btn = t.handlers[format];
|
229 |
+
var icon = '';
|
230 |
+
|
231 |
+
if('icon' in btn){
|
232 |
+
var _icon = btn['icon'];
|
233 |
+
|
234 |
+
if(typeof _icon == 'object' && !pagelayer_empty(_icon[value])){
|
235 |
+
icon = _icon[value];
|
236 |
+
}else if(typeof icon == 'string'){
|
237 |
+
icon = _icon;
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
var input = document.createElement('button');
|
242 |
+
input.setAttribute('type', 'button');
|
243 |
+
input.setAttribute('data-format', format);
|
244 |
+
input.classList.add('pagelayer-pen-' + format);
|
245 |
+
|
246 |
+
if('class' in btn){
|
247 |
+
input.classList.add(btn['class']);
|
248 |
+
}
|
249 |
+
|
250 |
+
if( pagelayer_empty(value) && 'default' in btn ){
|
251 |
+
value = btn['default'];
|
252 |
+
}
|
253 |
+
|
254 |
+
input.innerHTML = icon;
|
255 |
+
if(value != null) {
|
256 |
+
input.value = value;
|
257 |
+
}
|
258 |
+
container.appendChild(input);
|
259 |
+
}
|
260 |
+
|
261 |
+
var createoption = function(val, lang, type){
|
262 |
+
type = type || '';
|
263 |
+
var lang = pagelayer_empty(lang) ? 'Default' : lang;
|
264 |
+
return '<option value="'+val+'" type="'+type+'">'+lang+'</option>';
|
265 |
+
}
|
266 |
+
|
267 |
+
var addSelect = function(container, format, values) {
|
268 |
+
|
269 |
+
var input = document.createElement('select');
|
270 |
+
input.classList.add('pagelayer-pen-' + format);
|
271 |
+
|
272 |
+
if('class' in t.handlers[format]){
|
273 |
+
input.classList.add(t.handlers[format]['class']);
|
274 |
+
}
|
275 |
+
|
276 |
+
input.setAttribute('data-format', format);
|
277 |
+
|
278 |
+
if( pagelayer_empty(values) && 'default' in t.handlers[format] ){
|
279 |
+
values = t.handlers[format]['default'];
|
280 |
+
}
|
281 |
+
|
282 |
+
for(var kk in values){
|
283 |
+
var options = '';
|
284 |
+
var value = values[kk];
|
285 |
+
|
286 |
+
if(typeof value == 'object') {
|
287 |
+
if(kk != 'default'){
|
288 |
+
options += '<optgroup label="'+pagelayer_ucwords(kk)+'">';
|
289 |
+
}
|
290 |
+
for(y in value){
|
291 |
+
options += createoption((jQuery.isNumeric(y) ? value[y] : x), value[y], kk);
|
292 |
+
}
|
293 |
+
}else if(value !== false) {
|
294 |
+
options += createoption(value, value);
|
295 |
+
} else {
|
296 |
+
options += createoption('', '');
|
297 |
+
}
|
298 |
+
|
299 |
+
jQuery(input).append(options);
|
300 |
+
}
|
301 |
+
|
302 |
+
container.appendChild(input);
|
303 |
+
}
|
304 |
+
|
305 |
+
groups.forEach(function(controls){
|
306 |
+
var group = document.createElement('span');
|
307 |
+
group.classList.add('pagelayer-pen-formats');
|
308 |
+
|
309 |
+
controls.forEach(function (control){
|
310 |
+
var format = control;
|
311 |
+
|
312 |
+
if(typeof control === 'object'){
|
313 |
+
format = Object.keys(control)[0];
|
314 |
+
}
|
315 |
+
|
316 |
+
if( pagelayer_empty(t.handlers[format]) ){
|
317 |
+
return;
|
318 |
+
}
|
319 |
+
|
320 |
+
if( typeof control === 'string' ){
|
321 |
+
addButton(group, control);
|
322 |
+
} else {
|
323 |
+
var value = control[format];
|
324 |
+
if (Array.isArray(value)) {
|
325 |
+
addSelect(group, format, value);
|
326 |
+
} else {
|
327 |
+
addButton(group, format, value);
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
var btn = t.handlers[format];
|
332 |
+
t.tagToButton[(btn.tag || btn.style || format).toLowerCase()] = format;
|
333 |
+
});
|
334 |
+
|
335 |
+
// TODO skip if format is not exist
|
336 |
+
toolbar[0].appendChild(group);
|
337 |
+
});
|
338 |
+
|
339 |
+
toolbar.find('button').on('click', function(){
|
340 |
+
var bEle = jQuery(this);
|
341 |
+
var format = bEle.data('format');
|
342 |
+
|
343 |
+
if(! format in t.handlers){
|
344 |
+
return;
|
345 |
+
}
|
346 |
+
|
347 |
+
var btn = t.handlers[format];
|
348 |
+
t.currentFormat = format;
|
349 |
+
t.execCmd(btn.fn || format, btn.param || format, btn.forceCss);
|
350 |
+
});
|
351 |
+
|
352 |
+
toolbar.find('select').on('change', function(e){
|
353 |
+
var bEle = jQuery(this);
|
354 |
+
var format = bEle.data('format');
|
355 |
+
var val = bEle.val();
|
356 |
+
|
357 |
+
if(! format in t.handlers){
|
358 |
+
return;
|
359 |
+
}
|
360 |
+
|
361 |
+
var btn = t.handlers[format];
|
362 |
+
t.currentFormat = format;
|
363 |
+
t.execCmd(btn.fn || format, val, btn.forceCss);
|
364 |
+
});
|
365 |
+
|
366 |
+
toolbar.find('select').each(function(){
|
367 |
+
var format = jQuery(this).data('format');
|
368 |
+
|
369 |
+
if('buildBtn' in t.handlers[format]){
|
370 |
+
|
371 |
+
try{
|
372 |
+
t[t.handlers[format]['buildBtn']](this);
|
373 |
+
}catch(e){
|
374 |
+
try{
|
375 |
+
t.handlers[format]['buildBtn'](this);
|
376 |
+
}catch(e2){
|
377 |
+
t.buildDropdown(this);
|
378 |
+
}
|
379 |
+
}
|
380 |
+
|
381 |
+
return true;
|
382 |
+
}
|
383 |
+
|
384 |
+
t.buildDropdown(this);
|
385 |
+
});
|
386 |
+
|
387 |
+
// Add close button
|
388 |
+
toolbar.append('<span class="pagelayer-pen-formats"><button class="pagelayer-pen-close"><i class="fas fa-times"></i></button></span>');
|
389 |
+
|
390 |
+
// Hide editor on click close tool handler
|
391 |
+
toolbar.find('.pagelayer-pen-close').on('mousedown', function(e){
|
392 |
+
//e.preventDefault();
|
393 |
+
t.destroyEd = true;
|
394 |
+
t.editor.trigger('blur');
|
395 |
+
});
|
396 |
+
|
397 |
+
}
|
398 |
+
|
399 |
+
execCmd(cmd, param, forceCss, skipPen){
|
400 |
+
var t = this;
|
401 |
+
skipPen = !!skipPen || '';
|
402 |
+
|
403 |
+
if(cmd !== 'dropdown'){
|
404 |
+
t.focus();
|
405 |
+
t.restoreRange();
|
406 |
+
}
|
407 |
+
|
408 |
+
try{
|
409 |
+
document.execCommand('styleWithCSS', false, forceCss || false);
|
410 |
+
}catch(c){}
|
411 |
+
|
412 |
+
try{
|
413 |
+
t[cmd + skipPen](param);
|
414 |
+
}catch(c){
|
415 |
+
try{
|
416 |
+
cmd(param);
|
417 |
+
}catch(e2){
|
418 |
+
if(cmd === 'insertHorizontalRule'){
|
419 |
+
param = undefined;
|
420 |
+
}else if (cmd === 'formatBlock'){ // TODO: check for && t.isIE
|
421 |
+
param = '<' + param + '>';
|
422 |
+
}
|
423 |
+
|
424 |
+
document.execCommand(cmd, false, param);
|
425 |
+
t.semanticCode();
|
426 |
+
t.restoreRange();
|
427 |
+
}
|
428 |
+
}
|
429 |
+
|
430 |
+
if(cmd !== 'dropdown'){
|
431 |
+
t.updateButtonStatus();
|
432 |
+
t.editor.trigger('input');
|
433 |
+
}
|
434 |
+
|
435 |
+
}
|
436 |
+
|
437 |
+
commandHandler(value){
|
438 |
+
var t = this;
|
439 |
+
var format = t.currentFormat;
|
440 |
+
|
441 |
+
if( pagelayer_empty(format) ){
|
442 |
+
return;
|
443 |
+
}
|
444 |
+
|
445 |
+
var btn = t.handlers[format];
|
446 |
+
var sel = window.getSelection();
|
447 |
+
var text = t.range.commonAncestorContainer;
|
448 |
+
var selectedText = t.range.cloneContents();
|
449 |
+
selectedText = jQuery('<div>').append(selectedText).html();
|
450 |
+
|
451 |
+
// Also select the tag
|
452 |
+
if(text.nodeType === Node.TEXT_NODE){
|
453 |
+
text = text.parentNode;
|
454 |
+
}
|
455 |
+
|
456 |
+
if (text.innerHTML === selectedText && text != t.editor[0]) {
|
457 |
+
var ele = jQuery(text);
|
458 |
+
if('tag' in btn){
|
459 |
+
// Replace tag
|
460 |
+
}else if('style' in btn){
|
461 |
+
var style = {};
|
462 |
+
style[btn.style] = value;
|
463 |
+
|
464 |
+
ele.css(style);
|
465 |
+
}else if('atts' in btn){
|
466 |
+
// Add attribute or toggle the element
|
467 |
+
}
|
468 |
+
} else {
|
469 |
+
|
470 |
+
// TODO for toggle tags and add tags
|
471 |
+
var html = jQuery('<span style="'+btn.style+':' + value + ';">' + selectedText + '</span>');
|
472 |
+
|
473 |
+
// Remove style from all childrend
|
474 |
+
var style = {};
|
475 |
+
style[btn.style] = '';
|
476 |
+
html.find('[style]').css(style);
|
477 |
+
// TODO: remove span element that have no atts
|
478 |
+
var node = html[0];
|
479 |
+
var firstInsertedNode = node.firstChild;
|
480 |
+
var lastInsertedNode = node.lastChild;
|
481 |
+
t.range.deleteContents();
|
482 |
+
t.range.insertNode(node);
|
483 |
+
|
484 |
+
if(firstInsertedNode) {
|
485 |
+
t.range.setStartBefore(firstInsertedNode);
|
486 |
+
t.range.setEndAfter(lastInsertedNode);
|
487 |
+
}
|
488 |
+
|
489 |
+
// Is previous element empty?
|
490 |
+
var prev = jQuery(node).prev();
|
491 |
+
|
492 |
+
if( prev.length > 0 && prev.is(':empty') ){
|
493 |
+
prev.remove();
|
494 |
+
}
|
495 |
+
}
|
496 |
+
|
497 |
+
sel.removeAllRanges();
|
498 |
+
sel.addRange(t.range);
|
499 |
+
|
500 |
+
}
|
501 |
+
|
502 |
+
semanticCode(){
|
503 |
+
var t = this;
|
504 |
+
t.semanticTag('b');
|
505 |
+
t.semanticTag('i');
|
506 |
+
t.semanticTag('s');
|
507 |
+
t.semanticTag('strike');
|
508 |
+
t.semanticTag('div', true);
|
509 |
+
}
|
510 |
+
|
511 |
+
semanticTag(oldTag, copyAttributes){
|
512 |
+
var t = this;
|
513 |
+
var newTag;
|
514 |
+
|
515 |
+
if(t.semantic != null && typeof t.semantic === 'object' && t.semantic.hasOwnProperty(oldTag)){
|
516 |
+
newTag = t.semantic[oldTag];
|
517 |
+
} else if (t.DEFAULT_SEMANTIC_MAP.hasOwnProperty(oldTag)) {
|
518 |
+
newTag = t.DEFAULT_SEMANTIC_MAP[oldTag];
|
519 |
+
} else {
|
520 |
+
return;
|
521 |
+
}
|
522 |
+
|
523 |
+
jQuery(oldTag, t.editor).each(function () {
|
524 |
+
var $oldTag = jQuery(this);
|
525 |
+
if($oldTag.contents().length === 0) {
|
526 |
+
return false;
|
527 |
+
}
|
528 |
+
|
529 |
+
$oldTag.wrap('<' + newTag + '/>');
|
530 |
+
if (copyAttributes) {
|
531 |
+
jQuery.each($oldTag.prop('attributes'), function () {
|
532 |
+
$oldTag.parent().attr(this.name, this.value);
|
533 |
+
});
|
534 |
+
}
|
535 |
+
$oldTag.contents().unwrap();
|
536 |
+
});
|
537 |
+
}
|
538 |
+
|
539 |
+
addEvents(){
|
540 |
+
// Add Events
|
541 |
+
var t = this,
|
542 |
+
editor = t.editor,
|
543 |
+
ctrl = false,
|
544 |
+
debounceButtonStatus;
|
545 |
+
|
546 |
+
var showToolBar = function(){
|
547 |
+
|
548 |
+
var jEle = t.penHolder.children(':visible');
|
549 |
+
|
550 |
+
if(jEle.length < 1){
|
551 |
+
jEle = t.toolbar;
|
552 |
+
}
|
553 |
+
|
554 |
+
t.showPen(jEle);
|
555 |
+
};
|
556 |
+
|
557 |
+
// Save rage
|
558 |
+
editor.on('focusout', function(e){
|
559 |
+
|
560 |
+
if(t.destroyEd){
|
561 |
+
t.editor.removeClass('pagelayer-pen-focused');
|
562 |
+
t.range = null;
|
563 |
+
return;
|
564 |
+
}
|
565 |
+
|
566 |
+
t.saveRange();
|
567 |
+
|
568 |
+
});
|
569 |
+
|
570 |
+
// Prevent to hide toolbar
|
571 |
+
t.penHolder.on('mousedown', function(e){
|
572 |
+
// TODO: taget only require Element
|
573 |
+
t.destroyEd = false;
|
574 |
+
});
|
575 |
+
|
576 |
+
// On editor blur
|
577 |
+
editor.on('blur', function(){
|
578 |
+
|
579 |
+
if(!t.destroyEd){
|
580 |
+
return;
|
581 |
+
}
|
582 |
+
|
583 |
+
t.destroy();
|
584 |
+
});
|
585 |
+
|
586 |
+
editor.on('keydown', function(){
|
587 |
+
t.penHolder.hide();
|
588 |
+
});
|
589 |
+
|
590 |
+
editor.on('mousedown', function(){
|
591 |
+
if(t.editor.attr('contenteditable') == 'true'){
|
592 |
+
t.showPen();
|
593 |
+
}
|
594 |
+
});
|
595 |
+
|
596 |
+
editor.on('mouseup keyup keydown', function(e){
|
597 |
+
if ((!e.ctrlKey && !e.metaKey) || e.altKey) {
|
598 |
+
setTimeout(function () { // "hold on" to the ctrl key for 50ms
|
599 |
+
ctrl = false;
|
600 |
+
}, 50);
|
601 |
+
}
|
602 |
+
|
603 |
+
clearTimeout(debounceButtonStatus);
|
604 |
+
debounceButtonStatus = setTimeout(function () {
|
605 |
+
t.updateButtonStatus();
|
606 |
+
}, 50);
|
607 |
+
|
608 |
+
});
|
609 |
+
|
610 |
+
// Set focus on editor
|
611 |
+
editor.on('click', function(e){
|
612 |
+
|
613 |
+
if(t.editor.attr('contenteditable') == 'true'){
|
614 |
+
return;
|
615 |
+
}
|
616 |
+
|
617 |
+
t.editor.attr('contenteditable', 'true');
|
618 |
+
t.editor.focus();
|
619 |
+
});
|
620 |
+
|
621 |
+
// Set focus on editor
|
622 |
+
editor.on('focus', function(){
|
623 |
+
t.destroyEd = true;
|
624 |
+
t.addToolbar();
|
625 |
+
t.showPen();
|
626 |
+
t.editor.addClass('pagelayer-pen-focused');
|
627 |
+
jQuery(window).unbind('scroll.penToobar');
|
628 |
+
jQuery(window).on('scroll.penToobar', showToolBar);
|
629 |
+
jQuery(document).unbind('mousemove.penToobar');
|
630 |
+
jQuery(document).on('mousemove.penToobar', showToolBar);
|
631 |
+
});
|
632 |
+
|
633 |
+
t.semanticCode();
|
634 |
+
}
|
635 |
+
|
636 |
+
destroy(){
|
637 |
+
var t = this;
|
638 |
+
t.editor.attr('contenteditable', '');
|
639 |
+
t.penHolder.hide();
|
640 |
+
// Removing event listeners
|
641 |
+
jQuery(document).unbind('mousemove.penToobar');
|
642 |
+
jQuery(window).unbind('scroll.penToobar');
|
643 |
+
}
|
644 |
+
|
645 |
+
hasFocus(){
|
646 |
+
var t = this;
|
647 |
+
return (
|
648 |
+
t.doc.activeElement === t.editor ||
|
649 |
+
t.contains( t.editor[0], t.doc.activeElement)
|
650 |
+
);
|
651 |
+
}
|
652 |
+
|
653 |
+
contains(parent, descendant) {
|
654 |
+
try {
|
655 |
+
// Firefox inserts inaccessible nodes around video elements
|
656 |
+
descendant.parentNode; // eslint-disable-line no-unused-expressions
|
657 |
+
} catch (e) {
|
658 |
+
return false;
|
659 |
+
}
|
660 |
+
return parent.contains(descendant);
|
661 |
+
}
|
662 |
+
|
663 |
+
saveRange(){
|
664 |
+
var t = this,
|
665 |
+
selection = t.doc.getSelection();
|
666 |
+
|
667 |
+
t.range = null;
|
668 |
+
|
669 |
+
if (!selection || !selection.rangeCount) {
|
670 |
+
return;
|
671 |
+
}
|
672 |
+
|
673 |
+
var savedRange = t.range = selection.getRangeAt(0),
|
674 |
+
range = t.doc.createRange(),
|
675 |
+
rangeStart;
|
676 |
+
range.selectNodeContents(t.editor[0]);
|
677 |
+
range.setEnd(savedRange.startContainer, savedRange.startOffset);
|
678 |
+
rangeStart = (range + '').length;
|
679 |
+
t.metaRange = {
|
680 |
+
start: rangeStart,
|
681 |
+
end: rangeStart + (savedRange + '').length
|
682 |
+
};
|
683 |
+
}
|
684 |
+
|
685 |
+
restoreRange(){
|
686 |
+
var t = this,
|
687 |
+
metaRange = t.metaRange,
|
688 |
+
savedRange = t.range,
|
689 |
+
selection = t.doc.getSelection(),
|
690 |
+
range;
|
691 |
+
|
692 |
+
if(!savedRange){
|
693 |
+
return;
|
694 |
+
}
|
695 |
+
|
696 |
+
if(metaRange && metaRange.start !== metaRange.end){ // Algorithm from http://jsfiddle.net/WeWy7/3/
|
697 |
+
var charIndex = 0,
|
698 |
+
nodeStack = [t.editor[0]],
|
699 |
+
node,
|
700 |
+
foundStart = false,
|
701 |
+
stop = false;
|
702 |
+
|
703 |
+
range = t.doc.createRange();
|
704 |
+
|
705 |
+
while(!stop && (node = nodeStack.pop())){
|
706 |
+
if (node.nodeType === 3){
|
707 |
+
var nextCharIndex = charIndex + node.length;
|
708 |
+
if (!foundStart && metaRange.start >= charIndex && metaRange.start <= nextCharIndex) {
|
709 |
+
range.setStart(node, metaRange.start - charIndex);
|
710 |
+
foundStart = true;
|
711 |
+
}
|
712 |
+
if (foundStart && metaRange.end >= charIndex && metaRange.end <= nextCharIndex) {
|
713 |
+
range.setEnd(node, metaRange.end - charIndex);
|
714 |
+
stop = true;
|
715 |
+
}
|
716 |
+
charIndex = nextCharIndex;
|
717 |
+
} else {
|
718 |
+
var cn = node.childNodes,
|
719 |
+
i = cn.length;
|
720 |
+
|
721 |
+
while (i > 0) {
|
722 |
+
i -= 1;
|
723 |
+
nodeStack.push(cn[i]);
|
724 |
+
}
|
725 |
+
}
|
726 |
+
}
|
727 |
+
}
|
728 |
+
|
729 |
+
selection.removeAllRanges();
|
730 |
+
selection.addRange(range || savedRange);
|
731 |
+
}
|
732 |
+
|
733 |
+
getRange(){
|
734 |
+
var t = this;
|
735 |
+
var selection = t.doc.getSelection();
|
736 |
+
if (selection == null || selection.rangeCount <= 0) return null;
|
737 |
+
var range = selection.getRangeAt(0);
|
738 |
+
if(range == null) return null;
|
739 |
+
|
740 |
+
return range;
|
741 |
+
}
|
742 |
+
|
743 |
+
getRangeText(range){
|
744 |
+
return range + '';
|
745 |
+
}
|
746 |
+
|
747 |
+
focus(){
|
748 |
+
var t = this;
|
749 |
+
if(t.hasFocus()) return;
|
750 |
+
t.editor.click();
|
751 |
+
t.editor.focus();
|
752 |
+
t.restoreRange();
|
753 |
+
}
|
754 |
+
|
755 |
+
getBounds(range){
|
756 |
+
var rect = range.getBoundingClientRect();
|
757 |
+
return {
|
758 |
+
bottom: rect.top + rect.height,
|
759 |
+
height: rect.height,
|
760 |
+
left: rect.left,
|
761 |
+
right: rect.right,
|
762 |
+
top: rect.top,
|
763 |
+
width: 0
|
764 |
+
};
|
765 |
+
}
|
766 |
+
|
767 |
+
showPen(jEle){
|
768 |
+
var t = this;
|
769 |
+
jEle = jEle || jQuery(t.toolbar);
|
770 |
+
|
771 |
+
var toolBar = jQuery(t.penHolder);
|
772 |
+
var tooltipHeight = parseInt(toolBar.css('height'));
|
773 |
+
var range = null;
|
774 |
+
|
775 |
+
if(! t.hasFocus() && t.range != null){
|
776 |
+
range = t.range;
|
777 |
+
}else{
|
778 |
+
range = t.getRange();
|
779 |
+
}
|
780 |
+
|
781 |
+
if(range == null){
|
782 |
+
toolBar.hide();
|
783 |
+
return;
|
784 |
+
}
|
785 |
+
|
786 |
+
// Set left of toolbar
|
787 |
+
var editorOffset = t.editor.offset();
|
788 |
+
var editorTop = editorOffset.top;
|
789 |
+
var editorLeft = editorOffset.left;
|
790 |
+
var toolBarTop = editorTop;
|
791 |
+
var bound = t.getBounds(range);
|
792 |
+
|
793 |
+
if(bound.height == 0 && bound.top == 0 && bound.left == 0){
|
794 |
+
toolBar.hide();
|
795 |
+
return;
|
796 |
+
}
|
797 |
+
|
798 |
+
var boundTop = bound.top - 15;
|
799 |
+
editorLeft = bound.left;
|
800 |
+
|
801 |
+
// Set top of toolbar
|
802 |
+
if( boundTop - tooltipHeight > 0){
|
803 |
+
toolBarTop = boundTop;
|
804 |
+
}else{
|
805 |
+
toolBarTop = bound.bottom + tooltipHeight + 15;
|
806 |
+
}
|
807 |
+
|
808 |
+
// Show Toolbar
|
809 |
+
toolBar.children().hide();
|
810 |
+
toolBar.show();
|
811 |
+
jEle.show();
|
812 |
+
|
813 |
+
// Set top of toolbar
|
814 |
+
toolBar.css('top', toolBarTop);
|
815 |
+
|
816 |
+
if(!range.collapsed){
|
817 |
+
return;
|
818 |
+
}
|
819 |
+
|
820 |
+
// Set left of toobar
|
821 |
+
var docW = jQuery(window).width() - 10;
|
822 |
+
var toolW = toolBar.width();
|
823 |
+
|
824 |
+
editorLeft = editorLeft - toolW / 2;
|
825 |
+
|
826 |
+
toolBar.css('left', editorLeft+'px');
|
827 |
+
|
828 |
+
var tooltipLeft = toolBar.offset().left;
|
829 |
+
|
830 |
+
if(tooltipLeft < 0){
|
831 |
+
toolBar.css('left', '1px');
|
832 |
+
}
|
833 |
+
|
834 |
+
var toolRight = tooltipLeft + toolW;
|
835 |
+
if(docW < toolRight){
|
836 |
+
toolBar.css('left', tooltipLeft - (toolRight - docW)+'px');
|
837 |
+
}
|
838 |
+
|
839 |
+
}
|
840 |
+
|
841 |
+
getContent(){
|
842 |
+
var editor = this.editor;
|
843 |
+
var html = editor.html();
|
844 |
+
|
845 |
+
return html;
|
846 |
+
}
|
847 |
+
|
848 |
+
setContent(html){
|
849 |
+
var t = this;
|
850 |
+
html = html || '';
|
851 |
+
t.editor.html(html);
|
852 |
+
t.editor.trigger('input');
|
853 |
+
}
|
854 |
+
|
855 |
+
updateButtonStatus(){
|
856 |
+
var t = this,
|
857 |
+
toolbar = jQuery(t.toolbar),
|
858 |
+
tags = t.getTagsRecursive(t.doc.getSelection().focusNode),
|
859 |
+
activeClasses = 'pagelayer-pen-active';
|
860 |
+
|
861 |
+
jQuery('.' + activeClasses, toolbar).removeClass(activeClasses);
|
862 |
+
jQuery.each(tags, function (i, tag){
|
863 |
+
var btnName;
|
864 |
+
|
865 |
+
if(pagelayer_is_string(tag)){
|
866 |
+
btnName = t.tagToButton[tag.toLowerCase()];
|
867 |
+
}else{
|
868 |
+
btnName = t.tagToButton[Object.keys(tag)[0].toLowerCase()]
|
869 |
+
}
|
870 |
+
|
871 |
+
var $btn = jQuery('[data-format="'+btnName+'"]', toolbar);
|
872 |
+
|
873 |
+
if($btn.length < 1){
|
874 |
+
return;
|
875 |
+
}
|
876 |
+
|
877 |
+
if($btn.find('.pagelayer-pen-picker-label').length > 0){
|
878 |
+
$btn.find('.pagelayer-pen-picker-label').addClass(activeClasses);
|
879 |
+
return;
|
880 |
+
}
|
881 |
+
|
882 |
+
$btn.addClass(activeClasses);
|
883 |
+
});
|
884 |
+
}
|
885 |
+
|
886 |
+
getTagsRecursive(element, tags) {
|
887 |
+
var t = this;
|
888 |
+
var jEle = jQuery(element);
|
889 |
+
tags = tags || (element && element.tagName ? [element.tagName] : []);
|
890 |
+
|
891 |
+
if (element && element.parentNode) {
|
892 |
+
element = element.parentNode;
|
893 |
+
} else {
|
894 |
+
return tags;
|
895 |
+
}
|
896 |
+
|
897 |
+
var tag = element.tagName;
|
898 |
+
// Is this editor
|
899 |
+
if (tag === 'DIV') {
|
900 |
+
return tags;
|
901 |
+
}
|
902 |
+
|
903 |
+
// TODO: for all block element
|
904 |
+
if (tag === 'P' && element.style.textAlign !== '') {
|
905 |
+
tags.push(element.style.textAlign);
|
906 |
+
}
|
907 |
+
|
908 |
+
jQuery.each(t.tagHandlers, function (i, tagHandler) {
|
909 |
+
tags = tags.concat(tagHandler(element, t));
|
910 |
+
});
|
911 |
+
|
912 |
+
tags.push(tag);
|
913 |
+
var styles = jEle.attr('style');
|
914 |
+
|
915 |
+
if(!pagelayer_empty(styles)){
|
916 |
+
var styles = styles.split(';');
|
917 |
+
|
918 |
+
jQuery.each(styles, function(i, style){
|
919 |
+
style = style.split(':');
|
920 |
+
var ss = String(style[0]).trim();
|
921 |
+
var vv = String(style[1]).trim();
|
922 |
+
|
923 |
+
if(pagelayer_empty(ss) || ss in tags && !pagelayer_empty(tags[ss])){
|
924 |
+
return;
|
925 |
+
}
|
926 |
+
|
927 |
+
var obj = {};
|
928 |
+
obj[ss] = vv;
|
929 |
+
|
930 |
+
tags.push(obj);
|
931 |
+
});
|
932 |
+
}
|
933 |
+
|
934 |
+
return t.getTagsRecursive(element, tags).filter(function (tag) {
|
935 |
+
return tag != null;
|
936 |
+
});
|
937 |
+
}
|
938 |
+
|
939 |
+
buildDropdown(select){
|
940 |
+
|
941 |
+
var t = this;
|
942 |
+
var fixIcon = '';
|
943 |
+
|
944 |
+
select = jQuery(select);
|
945 |
+
var format = select.data('format');
|
946 |
+
|
947 |
+
var selAtts = '';
|
948 |
+
var options = '';
|
949 |
+
var optId = `pagelayer-pen-picker-options-${t.optionsCounter}`;
|
950 |
+
t.optionsCounter += 1;
|
951 |
+
|
952 |
+
Array.from(select[0].attributes).forEach(item => {
|
953 |
+
selAtts += ' '+item.name+'="'+ item.value +'"';
|
954 |
+
});
|
955 |
+
|
956 |
+
Array.from(select[0].options).forEach(option => {
|
957 |
+
|
958 |
+
var attrs = '';
|
959 |
+
var val = '';
|
960 |
+
var itemInner = '';
|
961 |
+
|
962 |
+
if(option.hasAttribute('value')){
|
963 |
+
val = option.getAttribute('value');
|
964 |
+
attrs += ' data-value="'+val+'"';
|
965 |
+
}
|
966 |
+
|
967 |
+
if(option.textContent){
|
968 |
+
attrs += ' data-label="'+option.textContent+'"';
|
969 |
+
}
|
970 |
+
|
971 |
+
// Set icon
|
972 |
+
if('icon' in t.handlers[format] && typeof t.handlers[format]['icon'] == 'object' && !pagelayer_empty(t.handlers[format]['icon'][val])){
|
973 |
+
itemInner = t.handlers[format]['icon'][val];
|
974 |
+
}
|
975 |
+
|
976 |
+
options += `<span class="pagelayer-pen-picker-item" tabindex="0" role="button" ${attrs}>${itemInner}</span>`;
|
977 |
+
});
|
978 |
+
|
979 |
+
if('fixIcon' in t.handlers[format]){
|
980 |
+
fixIcon = t.handlers[format]['fixIcon'];
|
981 |
+
}
|
982 |
+
|
983 |
+
var customInpute = '';
|
984 |
+
|
985 |
+
if('customInpute' in t.handlers[format] && !pagelayer_empty(t.handlers[format]['customInpute'])){
|
986 |
+
customInpute = '<input type="text" class="pagelayer-pen-custom-input" placeholder="Custom value">';
|
987 |
+
}
|
988 |
+
|
989 |
+
var container = jQuery(`<span ${selAtts}>
|
990 |
+
<span class="pagelayer-pen-picker-label" tabindex="0" role="button" aria-expanded="false">${fixIcon}</span>
|
991 |
+
<span class="pagelayer-pen-picker-options" aria-hidden="true" tabindex="-1" id="${optId}" aria-controls="${optId}">
|
992 |
+
${options}
|
993 |
+
${customInpute}
|
994 |
+
</span>
|
995 |
+
</span>`);
|
996 |
+
|
997 |
+
container.addClass('pagelayer-pen-picker');
|
998 |
+
|
999 |
+
select.before(container);
|
1000 |
+
select.hide();
|
1001 |
+
|
1002 |
+
var close = function(cEle){
|
1003 |
+
cEle.removeClass('pagelayer-pen-expanded');
|
1004 |
+
cEle.find('.pagelayer-pen-picker-label').attr('aria-expanded', 'false');
|
1005 |
+
cEle.find('.pagelayer-pen-picker-options').attr('aria-hidden', 'true');
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
var selectItem = function(item, trigger = false){
|
1009 |
+
var selected = container.find('.pagelayer-pen-selected');
|
1010 |
+
var label = container.find('.pagelayer-pen-picker-label');
|
1011 |
+
var val = '';
|
1012 |
+
|
1013 |
+
if (item === selected) return;
|
1014 |
+
if (selected != null) {
|
1015 |
+
selected.removeClass('pagelayer-pen-selected');
|
1016 |
+
}
|
1017 |
+
if(item == null) return;
|
1018 |
+
item.classList.add('pagelayer-pen-selected');
|
1019 |
+
select.selectedIndex = Array.from(item.parentNode.children).indexOf(
|
1020 |
+
item,
|
1021 |
+
);
|
1022 |
+
if (item.hasAttribute('data-value')) {
|
1023 |
+
val = item.getAttribute('data-value');
|
1024 |
+
label.attr('data-value', val);
|
1025 |
+
} else {
|
1026 |
+
label.attr('data-value', val);
|
1027 |
+
}
|
1028 |
+
if (item.hasAttribute('data-label')) {
|
1029 |
+
label.attr('data-label', item.getAttribute('data-label'));
|
1030 |
+
} else {
|
1031 |
+
label.attr('data-label', '');
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
if(!fixIcon){
|
1035 |
+
label.html(item.innerHTML);
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
if(trigger) {
|
1039 |
+
select.val(val);
|
1040 |
+
select.trigger('change');
|
1041 |
+
close(container);
|
1042 |
+
}
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
var toggleAriaAttribute = function(element, attribute) {
|
1046 |
+
element.setAttribute(
|
1047 |
+
attribute,
|
1048 |
+
!(element.getAttribute(attribute) === 'true'),
|
1049 |
+
);
|
1050 |
+
}
|
1051 |
+
var togglePicker = function() {
|
1052 |
+
container.toggleClass('pagelayer-pen-expanded');
|
1053 |
+
// Toggle aria-expanded and aria-hidden to make the picker accessible
|
1054 |
+
toggleAriaAttribute(container.find('.pagelayer-pen-picker-label')[0], 'aria-expanded');
|
1055 |
+
toggleAriaAttribute(container.find('.pagelayer-pen-picker-options')[0], 'aria-hidden');
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
container.find('.pagelayer-pen-picker-item').on('click', function(){
|
1059 |
+
selectItem(this, true);
|
1060 |
+
close(container);
|
1061 |
+
});
|
1062 |
+
|
1063 |
+
container.find('.pagelayer-pen-picker-label').on('click', function(){
|
1064 |
+
togglePicker();
|
1065 |
+
});
|
1066 |
+
|
1067 |
+
container.find('.pagelayer-pen-custom-input').on('focusout keydown', function(e){
|
1068 |
+
|
1069 |
+
if(e.type == 'keydown' && e.keyCode != 13){
|
1070 |
+
return;
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
e.preventDefault();
|
1074 |
+
|
1075 |
+
var val = jQuery(this).val();
|
1076 |
+
|
1077 |
+
if(pagelayer_empty(val)){
|
1078 |
+
return;
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
var opt = select.find('option.pagelayer-pen-custom-value');
|
1082 |
+
|
1083 |
+
if(opt.length < 1){
|
1084 |
+
select.append('<option class="pagelayer-pen-custom-value"></option>');
|
1085 |
+
opt = select.find('option.pagelayer-pen-custom-value');
|
1086 |
+
}
|
1087 |
+
|
1088 |
+
opt.val(val);
|
1089 |
+
select.val(val);
|
1090 |
+
select.trigger('change');
|
1091 |
+
close(container);
|
1092 |
+
});
|
1093 |
+
|
1094 |
+
jQuery(t.toolbar).on('mousedown', function(e){
|
1095 |
+
var tEle = jQuery(this);
|
1096 |
+
var target = jQuery(e.target);
|
1097 |
+
var tPicker = target.closest('.pagelayer-pen-picker');
|
1098 |
+
|
1099 |
+
if(target.closest('.pagelayer-pen-picker-item').length > 0) return;
|
1100 |
+
|
1101 |
+
tEle.find('.pagelayer-pen-picker.pagelayer-pen-expanded').each(function(){
|
1102 |
+
var picker = jQuery(this);
|
1103 |
+
if(tPicker.length > 0 && tPicker.is(picker))return;
|
1104 |
+
close(picker);
|
1105 |
+
});
|
1106 |
+
|
1107 |
+
});
|
1108 |
+
|
1109 |
+
// TODO need to correct this function update the select
|
1110 |
+
container.on('update', function(){
|
1111 |
+
var item = container.find('.pagelayer-pen-selected');
|
1112 |
+
|
1113 |
+
if(item.length < 1){
|
1114 |
+
item = container.find('.pagelayer-pen-picker-item').first();
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
selectItem(item[0]);
|
1118 |
+
});
|
1119 |
+
|
1120 |
+
container.trigger('update');
|
1121 |
+
|
1122 |
+
return container;
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
buildColorBtnHandler(item){
|
1126 |
+
var t = this;
|
1127 |
+
var select = t.buildDropdown(item);
|
1128 |
+
var format = select.data('format');
|
1129 |
+
|
1130 |
+
// Set color
|
1131 |
+
select.find('.pagelayer-pen-picker-item').each(function(){
|
1132 |
+
var opt = jQuery(this);
|
1133 |
+
var color = opt.data('value');
|
1134 |
+
|
1135 |
+
opt.css({'background': color});
|
1136 |
+
|
1137 |
+
// TODO remove this and add on selecttion
|
1138 |
+
opt.on('click', function(){
|
1139 |
+
if(format == 'color'){
|
1140 |
+
opt.closest('.pagelayer-pen-picker-label').css({'text-color': color});
|
1141 |
+
}else{
|
1142 |
+
opt.closest('.pagelayer-pen-picker-label').css({'background-color': color});
|
1143 |
+
}
|
1144 |
+
});
|
1145 |
+
});
|
1146 |
+
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
setLinkHandler(){
|
1150 |
+
var t = this,
|
1151 |
+
documentSelection = t.doc.getSelection(),
|
1152 |
+
node = documentSelection.focusNode,
|
1153 |
+
text = new XMLSerializer().serializeToString(documentSelection.getRangeAt(0).cloneContents()),
|
1154 |
+
url = '';
|
1155 |
+
|
1156 |
+
while (['A', 'DIV'].indexOf(node.nodeName) < 0) {
|
1157 |
+
node = node.parentNode;
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
if(node && node.nodeName === 'A'){
|
1161 |
+
var $a = jQuery(node);
|
1162 |
+
url = $a.attr('href');
|
1163 |
+
}
|
1164 |
+
|
1165 |
+
t.saveRange();
|
1166 |
+
|
1167 |
+
var tooltip = this.addContainer('pagelayer-pen-link-tooltip');
|
1168 |
+
t.linkTooltip = tooltip;
|
1169 |
+
|
1170 |
+
var html = '<input type="text" name="url" placeholder="https://example.com" value="'+url+'" autocomplete="off"><span class="pagelayer-pen-link-btn">Link</span><span class="pagelayer-pen-unlink-btn">Unlink</span>';
|
1171 |
+
tooltip.html(html);
|
1172 |
+
|
1173 |
+
var input = tooltip.find('input[name="url"]');
|
1174 |
+
|
1175 |
+
t.linkTooltip.find('.pagelayer-pen-link-btn').on('click', function(){
|
1176 |
+
var url = input.val();
|
1177 |
+
|
1178 |
+
t.restoreRange();
|
1179 |
+
|
1180 |
+
t.execCmd('createLink', url, true );
|
1181 |
+
t.editor.trigger('input');
|
1182 |
+
t.showPen();
|
1183 |
+
});
|
1184 |
+
|
1185 |
+
t.linkTooltip.find('.pagelayer-pen-unlink-btn').on('click', function(){
|
1186 |
+
t.restoreRange();
|
1187 |
+
t.execCmd('unlink', undefined, undefined, true);
|
1188 |
+
t.showPen();
|
1189 |
+
});
|
1190 |
+
|
1191 |
+
t.showPen(t.linkTooltip);
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
// TODO change this with commandHandler function
|
1195 |
+
alignHandler(val){
|
1196 |
+
var t = this;
|
1197 |
+
var cmd = 'justifyLeft';
|
1198 |
+
|
1199 |
+
switch(val){
|
1200 |
+
case 'center':
|
1201 |
+
cmd = 'justifyCenter';
|
1202 |
+
break;
|
1203 |
+
case 'right':
|
1204 |
+
cmd = 'justifyRight';
|
1205 |
+
break;
|
1206 |
+
case 'justify':
|
1207 |
+
cmd = 'justifyFull';
|
1208 |
+
break;
|
1209 |
+
}
|
1210 |
+
|
1211 |
+
t.execCmd(cmd, val, true);
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
imageBtnHandler(){
|
1215 |
+
var t = this;
|
1216 |
+
t.destroyEd = false;
|
1217 |
+
t.destroy();
|
1218 |
+
|
1219 |
+
var frame = pagelayer_select_frame('image');
|
1220 |
+
|
1221 |
+
// On select update the stuff
|
1222 |
+
frame.on({'select': function(){
|
1223 |
+
var state = frame.state();
|
1224 |
+
var url = '', alt = '', id = '';
|
1225 |
+
|
1226 |
+
// External URL
|
1227 |
+
if('props' in state){
|
1228 |
+
|
1229 |
+
url = state.props.attributes.url;
|
1230 |
+
alt = state.props.attributes.alt;
|
1231 |
+
|
1232 |
+
// Internal from gallery
|
1233 |
+
}else{
|
1234 |
+
|
1235 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
1236 |
+
//console.log(attachment);
|
1237 |
+
|
1238 |
+
// Set the new and URL
|
1239 |
+
url = attachment.url;
|
1240 |
+
alt = attachment.alt;
|
1241 |
+
id = attachment.id;
|
1242 |
+
|
1243 |
+
}
|
1244 |
+
t.editor.click();
|
1245 |
+
t.restoreRange();
|
1246 |
+
t.execCmd('insertImage', url, false, true);
|
1247 |
+
var $img = jQuery('img[src="' + url + '"]:not([alt])', t.editor);
|
1248 |
+
|
1249 |
+
$img.attr('alt', alt);
|
1250 |
+
$img.attr('pl-media-id', id);
|
1251 |
+
}
|
1252 |
+
});
|
1253 |
+
|
1254 |
+
frame.open();
|
1255 |
+
}
|
1256 |
+
|
1257 |
+
viewHTMLBtnHandler(param){
|
1258 |
+
var t = this;
|
1259 |
+
var html = t.getContent();
|
1260 |
+
t.destroyEd = false;
|
1261 |
+
t.destroy();
|
1262 |
+
|
1263 |
+
// Add Container
|
1264 |
+
var HTMLviewer = jQuery('.pagelayer-pen-html-viewer');
|
1265 |
+
|
1266 |
+
if(HTMLviewer.length < 1){
|
1267 |
+
jQuery('body').append('<div class="pagelayer-pen-html-viewer">'+
|
1268 |
+
'<div class="pagelayer-pen-html-holder">'+
|
1269 |
+
'<textarea class="pagelayer-pen-html-area"></textarea>'+
|
1270 |
+
'<div class="pagelayer-pen-html-btn">'+
|
1271 |
+
'<button class="pagelayer-pen-html-btn-update pagelayer-btn-success">Update</button>'+
|
1272 |
+
'<button class="pagelayer-pen-html-btn-cancel pagelayer-btn-secondary">Cancel</button>'+
|
1273 |
+
'</div>'+
|
1274 |
+
'</div>'+
|
1275 |
+
'</div>');
|
1276 |
+
|
1277 |
+
HTMLviewer = jQuery('.pagelayer-pen-html-viewer');
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
HTMLviewer.find('.pagelayer-pen-html-area').val(html);
|
1281 |
+
HTMLviewer.show();
|
1282 |
+
|
1283 |
+
HTMLviewer.find('.pagelayer-pen-html-btn-update').unbind('click');
|
1284 |
+
HTMLviewer.find('.pagelayer-pen-html-btn-update').on('click', function(){
|
1285 |
+
var html = HTMLviewer.find('.pagelayer-pen-html-area').val();
|
1286 |
+
t.range = null;
|
1287 |
+
t.editor.click();
|
1288 |
+
t.setContent(html);
|
1289 |
+
t.editor.trigger('focus');
|
1290 |
+
HTMLviewer.hide();
|
1291 |
+
});
|
1292 |
+
|
1293 |
+
HTMLviewer.find('.pagelayer-pen-html-btn-cancel').unbind('click');
|
1294 |
+
HTMLviewer.find('.pagelayer-pen-html-btn-cancel').on('click', function(){
|
1295 |
+
t.editor.click();
|
1296 |
+
t.focus();
|
1297 |
+
HTMLviewer.hide();
|
1298 |
+
});
|
1299 |
+
|
1300 |
+
}
|
1301 |
+
}
|
@@ -967,7 +967,9 @@ function pagelayer_elp_label(row, prop){
|
|
967 |
if(!(pagelayer_empty(tmp_val))){
|
968 |
|
969 |
for(var i in prop['units']){
|
970 |
-
if(tmp_val.search(prop['units'][i]) != -1){
|
|
|
|
|
971 |
default_unit = i;
|
972 |
}
|
973 |
}
|
@@ -1232,45 +1234,153 @@ function pagelayer_elp_radio(row, prop){
|
|
1232 |
|
1233 |
// The Image Property
|
1234 |
function pagelayer_elp_image(row, prop){
|
1235 |
-
|
1236 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1237 |
var tmp = prop.c['name']+'-url';
|
1238 |
var def = pagelayer.blank_img;
|
1239 |
-
|
1240 |
-
|
|
|
|
|
1241 |
// Do we have a URL set ?
|
1242 |
-
style = 'style="background-image:url(\''+src+'\')"';
|
1243 |
|
1244 |
var div = '<div class="pagelayer-elp-image-div">'+
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1252 |
'</div>'+
|
1253 |
'</div>'+
|
1254 |
-
|
1255 |
-
|
1256 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1257 |
|
1258 |
row.append(div);
|
1259 |
|
1260 |
-
if(def == src && jQuery.isNumeric(
|
1261 |
-
wp.media.attachment(
|
1262 |
-
var fetch_url = wp.media.attachment(
|
1263 |
-
row.find('.pagelayer-elp-image').css('background-image', 'url(\''+fetch_url+'\')');
|
1264 |
_pagelayer_set_tmp_atts(row, 'url', fetch_url);
|
1265 |
}).fail(function(){
|
1266 |
-
row.find('.pagelayer-elp-image').css('background-image', 'url(\''+src+'\')')
|
1267 |
});
|
1268 |
}
|
1269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1270 |
// Set an Image
|
1271 |
row.find('.pagelayer-elp-image').on('click', function(){
|
1272 |
|
1273 |
var button = jQuery(this);
|
|
|
|
|
1274 |
|
1275 |
// Load the frame
|
1276 |
var frame = pagelayer_select_frame('image');
|
@@ -1291,26 +1401,75 @@ function pagelayer_elp_image(row, prop){
|
|
1291 |
}else{
|
1292 |
|
1293 |
var attachment = frame.state().get('selection').first().toJSON();
|
1294 |
-
//console.log(attachment);
|
1295 |
|
1296 |
// Set the new ID and URL
|
1297 |
id = attachment.id;
|
1298 |
-
url = attachment.url;
|
1299 |
-
|
1300 |
-
// To remove past temp attr so that they are not involve in future temp values
|
1301 |
var old = _pagelayer_img_tmp_atts(row);
|
1302 |
-
delete old[prop.c['name']+'-url'];
|
1303 |
|
1304 |
-
//
|
1305 |
-
|
1306 |
-
|
1307 |
-
delete old[prop.c['name']+'-
|
1308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1309 |
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1314 |
}
|
1315 |
|
1316 |
// Update thumbnail
|
@@ -1318,14 +1477,36 @@ function pagelayer_elp_image(row, prop){
|
|
1318 |
|
1319 |
// Save and render
|
1320 |
_pagelayer_set_tmp_atts(row, 'no-image-set', '');
|
1321 |
-
|
1322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1323 |
|
1324 |
},
|
1325 |
// On open select the appropriate images in the media manager
|
1326 |
'open': function() {
|
1327 |
var selection = frame.state().get('selection');
|
1328 |
var wp_id = pagelayer_get_att(prop.el.$, prop.c['name']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1329 |
selection.reset( wp_id ? [ wp.media.attachment( wp_id ) ] : [] );
|
1330 |
}
|
1331 |
});
|
@@ -1343,20 +1524,57 @@ function pagelayer_elp_image(row, prop){
|
|
1343 |
// Inserting values in image drag and drop function
|
1344 |
pagelayer_img_dragAndDrop(dropzoneParent, dropZone, '', row);
|
1345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1346 |
// Delete this
|
1347 |
row.find('.pagelayer-elp-image-delete').on('click', function(){
|
1348 |
|
1349 |
// Update thumbnail
|
1350 |
-
|
1351 |
|
1352 |
// Set to blank and render
|
1353 |
_pagelayer_set_atts(row, '', true);
|
|
|
|
|
1354 |
|
1355 |
_pagelayer_set_tmp_atts(row, 'no-image-set', 1);
|
1356 |
_pagelayer_set_tmp_atts(row, 'url', def);
|
1357 |
-
_pagelayer_set_atts(row,
|
1358 |
});
|
1359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1360 |
}
|
1361 |
|
1362 |
// Main image drag and drop function
|
@@ -1488,12 +1706,15 @@ function pagelayer_elp_multi_image(row, prop){
|
|
1488 |
|
1489 |
// Any IDs ?
|
1490 |
if(!pagelayer_empty(prop.c['val'])){
|
1491 |
-
ids = prop.c['val']
|
|
|
|
|
|
|
1492 |
//console.log(ids);
|
1493 |
}
|
1494 |
|
1495 |
// Do we have a URL set ?
|
1496 |
-
if(ids
|
1497 |
if(tmp in prop.el.tmp){
|
1498 |
var images = JSON.parse(prop.el.tmp[tmp]);
|
1499 |
//console.log(images);
|
@@ -1562,7 +1783,7 @@ function pagelayer_elp_multi_image(row, prop){
|
|
1562 |
'open': function(){
|
1563 |
|
1564 |
// Do we have anything
|
1565 |
-
if(ids
|
1566 |
|
1567 |
var selection = '';
|
1568 |
|
@@ -1659,8 +1880,8 @@ function pagelayer_elp_multi_image(row, prop){
|
|
1659 |
});
|
1660 |
|
1661 |
row.find('.pagelayer-elp-button').on('click', function(){
|
1662 |
-
|
1663 |
-
if(ids
|
1664 |
if(isNaN(ids[0])){
|
1665 |
pagelayer_init_frame('embed');
|
1666 |
}else{
|
@@ -1925,8 +2146,10 @@ function pagelayer_elp_slider(row, prop){
|
|
1925 |
// The Editor proprety
|
1926 |
function pagelayer_elp_editor(row, prop){
|
1927 |
|
|
|
|
|
1928 |
var div = '<div class="pagelayer-elp-editor-div">'+
|
1929 |
-
'<textarea class="pagelayer-elp-editor"></textarea>'+
|
1930 |
'</div>';
|
1931 |
|
1932 |
row.append(div);
|
@@ -1934,6 +2157,12 @@ function pagelayer_elp_editor(row, prop){
|
|
1934 |
var editor = row.find('.pagelayer-elp-editor');
|
1935 |
editor.val(prop.c['val']);
|
1936 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1937 |
// No SVG Icons for now
|
1938 |
jQuery.trumbowyg.svgPath = false;
|
1939 |
|
@@ -2161,22 +2390,109 @@ function pagelayer_make_editable(jEle, e){
|
|
2161 |
return true;
|
2162 |
}
|
2163 |
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2169 |
|
2170 |
var options = {
|
2171 |
class: 'pagelayer-pen',
|
2172 |
-
editor: jEle
|
2173 |
-
|
2174 |
-
stay: false
|
2175 |
}
|
2176 |
|
2177 |
// Setup the editor
|
2178 |
pagelayer_editor[eId] = {};
|
2179 |
-
pagelayer_editor[eId].pen = new
|
2180 |
pagelayer_editor[eId].$ = jEle;
|
2181 |
|
2182 |
// Are we the clicked object, then set the focus
|
@@ -2189,7 +2505,11 @@ function pagelayer_make_editable(jEle, e){
|
|
2189 |
|
2190 |
// Reverse setup the event
|
2191 |
jEle.on('blur', function(){
|
|
|
2192 |
//pagelayer_editor[eId].pen.destroy();
|
|
|
|
|
|
|
2193 |
|
2194 |
var cEle = pEle;
|
2195 |
|
@@ -2774,7 +3094,7 @@ function pagelayer_elp_group(row, prop){
|
|
2774 |
});
|
2775 |
|
2776 |
// Find the existing items
|
2777 |
-
prop.el.$.find('[pagelayer-
|
2778 |
var jEle = jQuery(this);
|
2779 |
var id = pagelayer_assign_id(jEle);
|
2780 |
show_item(id);
|
@@ -2838,9 +3158,11 @@ function pagelayer_elp_datetime(row, prop){
|
|
2838 |
function pagelayer_elp_padding(row, prop){
|
2839 |
var val = ['', '', '', ''];
|
2840 |
|
2841 |
-
if(prop.c['val']
|
2842 |
-
val = prop.c['val']
|
2843 |
-
|
|
|
|
|
2844 |
}
|
2845 |
|
2846 |
var div = '<div class="pagelayer-elp-padding-div">'+
|
@@ -2920,7 +3242,10 @@ function pagelayer_elp_shadow(row, prop){
|
|
2920 |
|
2921 |
// Do we have a val ?
|
2922 |
if(!pagelayer_empty(prop.c['val'])){
|
2923 |
-
val = prop.c['val']
|
|
|
|
|
|
|
2924 |
}
|
2925 |
|
2926 |
//var val = {color: '', blur: '', horizontal: '', vertical: ''};
|
@@ -3016,7 +3341,10 @@ function pagelayer_elp_box_shadow(row, prop){
|
|
3016 |
|
3017 |
// Do we have a val ?
|
3018 |
if(!pagelayer_empty(prop.c['val'])){
|
3019 |
-
val = prop.c['val']
|
|
|
|
|
|
|
3020 |
}
|
3021 |
|
3022 |
var val_pos = ['horizontal','vertical','blur','color','spread','inset'];
|
@@ -3125,7 +3453,10 @@ function pagelayer_elp_filter(row, prop){
|
|
3125 |
|
3126 |
// Do we have a val ?
|
3127 |
if(!pagelayer_empty(prop.c['val'])){
|
3128 |
-
val = prop.c['val']
|
|
|
|
|
|
|
3129 |
}
|
3130 |
|
3131 |
var filters = [['blur','10','0.1'],['brightness','200','1'],['contrast','200','1'],['grayscale','200','1'],['hue','360','1'],['opacity','100','1'],['saturate','200','1']];
|
@@ -3168,7 +3499,10 @@ function pagelayer_elp_gradient(row, prop){
|
|
3168 |
|
3169 |
// Do we have a val ?
|
3170 |
if(!pagelayer_empty(prop.c['val'])){
|
3171 |
-
val = prop.c['val']
|
|
|
|
|
|
|
3172 |
}
|
3173 |
|
3174 |
//var val = {color: '', blur: '', horizontal: '', vertical: ''};
|
@@ -3358,7 +3692,10 @@ function pagelayer_elp_typography(row, prop){
|
|
3358 |
|
3359 |
// Do we have a val ?
|
3360 |
if(!pagelayer_empty(prop.c['val'])){
|
3361 |
-
val = prop.c['val']
|
|
|
|
|
|
|
3362 |
}
|
3363 |
|
3364 |
var select = { 'style' : ['', 'Normal', 'Italic', 'Oblique'],
|
@@ -3552,9 +3889,14 @@ function pagelayer_elp_dimension(row, prop){
|
|
3552 |
|
3553 |
var val = ['', ''];
|
3554 |
|
3555 |
-
if(prop.c['val']
|
3556 |
-
|
3557 |
-
|
|
|
|
|
|
|
|
|
|
|
3558 |
}
|
3559 |
|
3560 |
var div = '<div class="pagelayer-elp-dimension-div">'+
|
@@ -3655,8 +3997,14 @@ function pagelayer_elp_postCategory(row, prop){
|
|
3655 |
$div.find('input[type=checkbox]').attr('checked', false);
|
3656 |
|
3657 |
if(!pagelayer_empty(prop.c['val'])){
|
3658 |
-
|
3659 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3660 |
}
|
3661 |
}
|
3662 |
|
@@ -3779,7 +4127,6 @@ function pagelayer_elp_postTags(row, prop){
|
|
3779 |
return;
|
3780 |
}
|
3781 |
|
3782 |
-
|
3783 |
var div = '<div class="pagelayer-elp-postTags" >'+
|
3784 |
'<div class="pagelayer-post-tags" >'+
|
3785 |
'<input type="text" autocomplete="off" class="pagelayer-elp-postTags-inp" autofocus="autofocus"/>'+
|
@@ -3939,8 +4286,14 @@ function pagelayer_elp_postTags(row, prop){
|
|
3939 |
|
3940 |
// Create array for needed term_id with corresponding to the name.
|
3941 |
if(!pagelayer_empty(prop.c['val'])){
|
3942 |
-
|
3943 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3944 |
i++;
|
3945 |
}
|
3946 |
}
|
@@ -4292,8 +4645,9 @@ function pagelayer_show_default_button(row, prop, value){
|
|
4292 |
// value is an object or not
|
4293 |
if(typeof value == 'object'){
|
4294 |
// Checking value for NaN, empty and default.
|
4295 |
-
|
4296 |
-
|
|
|
4297 |
row.find('.pagelayer-elp-default').attr('data_show',true);
|
4298 |
break;
|
4299 |
}
|
967 |
if(!(pagelayer_empty(tmp_val))){
|
968 |
|
969 |
for(var i in prop['units']){
|
970 |
+
if(pagelayer_is_string(tmp_val) && tmp_val.search(prop['units'][i]) != -1){
|
971 |
+
default_unit = i;
|
972 |
+
}else if(tmp_val[0].search(prop['units'][i]) != -1 ){
|
973 |
default_unit = i;
|
974 |
}
|
975 |
}
|
1234 |
|
1235 |
// The Image Property
|
1236 |
function pagelayer_elp_image(row, prop){
|
1237 |
+
|
1238 |
+
var imgObj = {};
|
1239 |
+
var isRetina = false;
|
1240 |
+
|
1241 |
+
// Is retina images options?
|
1242 |
+
if('retina' in prop && !pagelayer_empty(prop['retina'])){
|
1243 |
+
isRetina = true;
|
1244 |
+
}
|
1245 |
+
|
1246 |
+
// Previously saved values
|
1247 |
+
if(typeof prop.c['val'] === 'object'){
|
1248 |
+
imgObj = prop.c['val'];
|
1249 |
+
}else{
|
1250 |
+
imgObj['img'] = prop.c['val'];
|
1251 |
+
}
|
1252 |
+
|
1253 |
var tmp = prop.c['name']+'-url';
|
1254 |
var def = pagelayer.blank_img;
|
1255 |
+
|
1256 |
+
// Background image URls
|
1257 |
+
var src = (tmp in prop.el.tmp) ? prop.el.tmp[tmp] : ((!pagelayer_empty(imgObj['img']) && imgObj['img'].search(/http(|s):\/\//i) == 0) ? imgObj['img'] : def );
|
1258 |
+
|
1259 |
// Do we have a URL set ?
|
1260 |
+
var style = 'style="background-image:url(\''+src+'\')"';
|
1261 |
|
1262 |
var div = '<div class="pagelayer-elp-image-div">'+
|
1263 |
+
'<div class="pagelayer-elp-drop-zone">'+
|
1264 |
+
'<div>'+
|
1265 |
+
'<i class="fas fa-upload"></i>'+
|
1266 |
+
'<h4>'+pagelayer_l('drop_file')+'</h4>'+
|
1267 |
+
'<div class="pagelayer-elp-img-up-progress">'+
|
1268 |
+
'<div class="pagelayer-elp-img-up-bar"></div>'+
|
1269 |
+
'</div>'+
|
1270 |
+
'</div>'+
|
1271 |
+
'</div>'+
|
1272 |
+
'<div class="pagelayer-elp-image" '+style+'></div>'+
|
1273 |
+
'<div class="pagelayer-elp-image-delete"><i class="pli pli-trashcan" ></i></div>';
|
1274 |
+
|
1275 |
+
// Retina image icon
|
1276 |
+
if(isRetina){
|
1277 |
+
div += '<div class="pagelayer-elp-image-retina"><i class="pli pli-eye" ></i></div>';
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
div +='</div>';
|
1281 |
+
|
1282 |
+
// Add retina images option
|
1283 |
+
if(isRetina){
|
1284 |
+
|
1285 |
+
var tmp_retina = prop.c['name']+'-retina-url';
|
1286 |
+
var tmp_retina_mobile = prop.c['name']+'-retina-mobile-url';
|
1287 |
+
|
1288 |
+
var srcRetina = (tmp_retina in prop.el.tmp) ? prop.el.tmp[tmp_retina] : (('retina' in imgObj && !pagelayer_empty(imgObj['retina']) && imgObj['retina'].search(/http(|s):\/\//i) == 0) ? imgObj['retina'] : def );
|
1289 |
+
|
1290 |
+
var srcRetinaMobile = (tmp_retina_mobile in prop.el.tmp) ? prop.el.tmp[tmp_retina_mobile] : (('retina_mobile' in imgObj && !pagelayer_empty(imgObj['retina_mobile']) && imgObj['retina_mobile'].search(/http(|s):\/\//i) == 0) ? imgObj['retina_mobile'] : def );
|
1291 |
+
|
1292 |
+
var style_retina = 'style="background-image:url(\''+srcRetina+'\')"';
|
1293 |
+
var style_retina_mobile = 'style="background-image:url(\''+srcRetinaMobile+'\')"';
|
1294 |
+
|
1295 |
+
div +='<div class="pagelayer-elp-label-div pagelayer-retina-label" type="image" style="display:none;">'+
|
1296 |
+
'<label class="pagelayer-elp-label">Select Retina Image</label>'+
|
1297 |
+
'</div>'+
|
1298 |
+
'<div class="pagelayer-elp-retina-image-div" style="display:none;">'+
|
1299 |
+
'<div class="pagelayer-elp-drop-zone">'+
|
1300 |
+
'<div>'+
|
1301 |
+
'<i class="fas fa-upload"></i>'+
|
1302 |
+
'<h4>'+pagelayer_l('drop_file')+'</h4>'+
|
1303 |
+
'<div class="pagelayer-elp-img-up-progress">'+
|
1304 |
+
'<div class="pagelayer-elp-img-up-bar"></div>'+
|
1305 |
'</div>'+
|
1306 |
'</div>'+
|
1307 |
+
'</div>'+
|
1308 |
+
'<div class="pagelayer-elp-image pagelayer-retina" '+style_retina+'></div>'+
|
1309 |
+
'<div class="pagelayer-elp-retina-delete"><i class="pli pli-trashcan" ></i></div>'+
|
1310 |
+
'</div>'+
|
1311 |
+
'<div class="pagelayer-form-item">'+
|
1312 |
+
'<div class="pagelayer-elp-label-div pagelayer-retina-label" type="image" style="display:none;">'+
|
1313 |
+
'<label class="pagelayer-elp-label">Select Retina Image For Mobile</label>'+
|
1314 |
+
'</div>'+
|
1315 |
+
'<div class="pagelayer-elp-checkbox-div pagelayer-retina-label" style="display:none;">'+
|
1316 |
+
'<input type="checkbox" name="overlay" class="pagelayer-elp-checkbox pagelayer-retina-checkbox">'+
|
1317 |
+
'</div>'+
|
1318 |
+
'</div>'+
|
1319 |
+
|
1320 |
+
'<div class="pagelayer-elp-retina-mobile-image-div" style="display:none;">'+
|
1321 |
+
'<div class="pagelayer-elp-drop-zone">'+
|
1322 |
+
'<div>'+
|
1323 |
+
'<i class="fas fa-upload"></i>'+
|
1324 |
+
'<h4>'+pagelayer_l('drop_file')+'</h4>'+
|
1325 |
+
'<div class="pagelayer-elp-img-up-progress">'+
|
1326 |
+
'<div class="pagelayer-elp-img-up-bar"></div>'+
|
1327 |
+
'</div>'+
|
1328 |
+
'</div>'+
|
1329 |
+
'</div>'+
|
1330 |
+
'<div class="pagelayer-elp-image pagelayer-retina-mobile" '+style_retina_mobile+'></div>'+
|
1331 |
+
'<div class="pagelayer-elp-retina-mobile-delete"><i class="pli pli-trashcan" ></i></div>'+
|
1332 |
+
'</div>';
|
1333 |
+
}
|
1334 |
|
1335 |
row.append(div);
|
1336 |
|
1337 |
+
if(def == src && jQuery.isNumeric(imgObj['img'])){
|
1338 |
+
wp.media.attachment(imgObj['img']).fetch().then(function (data){
|
1339 |
+
var fetch_url = wp.media.attachment(imgObj['img']).get('url')
|
1340 |
+
row.find('.pagelayer-elp-image-div .pagelayer-elp-image').css('background-image', 'url(\''+fetch_url+'\')');
|
1341 |
_pagelayer_set_tmp_atts(row, 'url', fetch_url);
|
1342 |
}).fail(function(){
|
1343 |
+
row.find('.pagelayer-elp-image-div .pagelayer-elp-image').css('background-image', 'url(\''+src+'\')')
|
1344 |
});
|
1345 |
}
|
1346 |
|
1347 |
+
if(isRetina){
|
1348 |
+
if(def == srcRetina && 'retina' in imgObj && jQuery.isNumeric(imgObj['retina'])){
|
1349 |
+
wp.media.attachment(imgObj['retina']).fetch().then(function (data){
|
1350 |
+
var fetch_url = wp.media.attachment(imgObj['retina']).get('url')
|
1351 |
+
row.find('.pagelayer-retina').css('background-image', 'url(\''+fetch_url+'\')');
|
1352 |
+
_pagelayer_set_tmp_atts(row, 'retina-url', fetch_url);
|
1353 |
+
}).fail(function(){
|
1354 |
+
row.find('.pagelayer-retina').css('background-image', 'url(\''+srcRetina+'\')')
|
1355 |
+
});
|
1356 |
+
}
|
1357 |
+
|
1358 |
+
if(def == srcRetinaMobile && 'retina_mobile' in imgObj && jQuery.isNumeric(imgObj['retina_mobile'])){
|
1359 |
+
wp.media.attachment(imgObj['retina_mobile']).fetch().then(function (data){
|
1360 |
+
var fetch_url = wp.media.attachment(imgObj['retina_mobile']).get('url')
|
1361 |
+
row.find('.pagelayer-retina-mobile').css('background-image', 'url(\''+fetch_url+'\')');
|
1362 |
+
_pagelayer_set_tmp_atts(row, 'retina-mobile-url', fetch_url);
|
1363 |
+
}).fail(function(){
|
1364 |
+
row.find('.pagelayer-retina-mobile').css('background-image', 'url(\''+srcRetinaMobile+'\')')
|
1365 |
+
});
|
1366 |
+
}
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
var getImgVal = function(val){
|
1370 |
+
|
1371 |
+
if(typeof val === 'object' && pagelayer_length(val) == 1 && 'img' in val){
|
1372 |
+
return val['img'];
|
1373 |
+
}
|
1374 |
+
|
1375 |
+
return val;
|
1376 |
+
}
|
1377 |
+
|
1378 |
// Set an Image
|
1379 |
row.find('.pagelayer-elp-image').on('click', function(){
|
1380 |
|
1381 |
var button = jQuery(this);
|
1382 |
+
var inRetina = button.hasClass('pagelayer-retina');
|
1383 |
+
var inRetinaM = button.hasClass('pagelayer-retina-mobile');
|
1384 |
|
1385 |
// Load the frame
|
1386 |
var frame = pagelayer_select_frame('image');
|
1401 |
}else{
|
1402 |
|
1403 |
var attachment = frame.state().get('selection').first().toJSON();
|
|
|
1404 |
|
1405 |
// Set the new ID and URL
|
1406 |
id = attachment.id;
|
1407 |
+
url = attachment.url;
|
|
|
|
|
1408 |
var old = _pagelayer_img_tmp_atts(row);
|
|
|
1409 |
|
1410 |
+
//console.log(attachment);
|
1411 |
+
if(inRetina){
|
1412 |
+
// To remove past temp attr so that they are not involve in future temp values
|
1413 |
+
delete old[prop.c['name']+'-retina-url'];
|
1414 |
+
|
1415 |
+
// Keep a list of all sizes
|
1416 |
+
for(var x in attachment.sizes){
|
1417 |
+
_pagelayer_set_tmp_atts(row, 'retina-'+x+'-url', attachment.sizes[x].url);
|
1418 |
+
delete old[prop.c['name']+'-retina-'+x+'-url'];
|
1419 |
+
}
|
1420 |
+
|
1421 |
+
for(var x in old){
|
1422 |
+
|
1423 |
+
// Skip for retina and with url atts
|
1424 |
+
if(! x.endsWith('-url') || !x.startsWith(prop.c['name']+'-retina') || x.startsWith(prop.c['name']+'-retina-mobile')){
|
1425 |
+
continue;
|
1426 |
+
}
|
1427 |
+
|
1428 |
+
_pagelayer_set_tmp_atts(row, x, '');
|
1429 |
+
}
|
1430 |
+
|
1431 |
+
}else if(inRetinaM){
|
1432 |
+
|
1433 |
+
// To remove past temp attr so that they are not involve in future temp values
|
1434 |
+
delete old[prop.c['name']+'-retina-mobile-url'];
|
1435 |
+
|
1436 |
+
// Keep a list of all sizes
|
1437 |
+
for(var x in attachment.sizes){
|
1438 |
+
_pagelayer_set_tmp_atts(row, 'retina-mobile-'+x+'-url', attachment.sizes[x].url);
|
1439 |
+
delete old[prop.c['name']+'-retina-mobile-'+x+'-url'];
|
1440 |
+
}
|
1441 |
+
|
1442 |
+
for(var x in old){
|
1443 |
+
|
1444 |
+
// Skip for retina and with url atts
|
1445 |
+
if(! x.endsWith('-url') || ! x.startsWith(prop.c['name']+'-retina-mobile')){
|
1446 |
+
continue;
|
1447 |
+
}
|
1448 |
+
|
1449 |
+
_pagelayer_set_tmp_atts(row, x, '');
|
1450 |
+
}
|
1451 |
+
|
1452 |
+
}else{
|
1453 |
|
1454 |
+
// To remove past temp attr so that they are not involve in future temp values
|
1455 |
+
delete old[prop.c['name']+'-url'];
|
1456 |
+
|
1457 |
+
// Keep a list of all sizes
|
1458 |
+
for(var x in attachment.sizes){
|
1459 |
+
_pagelayer_set_tmp_atts(row, x+'-url', attachment.sizes[x].url);
|
1460 |
+
delete old[prop.c['name']+'-'+x+'-url'];
|
1461 |
+
}
|
1462 |
+
|
1463 |
+
for(var x in old){
|
1464 |
+
|
1465 |
+
// Skip for retina and with url atts
|
1466 |
+
if(! x.endsWith('-url') || x.startsWith(prop.c['name']+'-retina')){
|
1467 |
+
continue;
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
_pagelayer_set_tmp_atts(row, x, '');
|
1471 |
+
}
|
1472 |
+
}
|
1473 |
}
|
1474 |
|
1475 |
// Update thumbnail
|
1477 |
|
1478 |
// Save and render
|
1479 |
_pagelayer_set_tmp_atts(row, 'no-image-set', '');
|
1480 |
+
|
1481 |
+
if(inRetina){
|
1482 |
+
_pagelayer_set_tmp_atts(row, 'retina-url', url);
|
1483 |
+
imgObj['retina'] = id;
|
1484 |
+
}else if(inRetinaM){
|
1485 |
+
_pagelayer_set_tmp_atts(row, 'retina-mobile-url', url);
|
1486 |
+
imgObj['retina_mobile'] = id;
|
1487 |
+
}else{
|
1488 |
+
_pagelayer_set_tmp_atts(row, 'url', url);
|
1489 |
+
imgObj['img'] = id;
|
1490 |
+
}
|
1491 |
+
|
1492 |
+
_pagelayer_set_atts(row, getImgVal(imgObj));
|
1493 |
|
1494 |
},
|
1495 |
// On open select the appropriate images in the media manager
|
1496 |
'open': function() {
|
1497 |
var selection = frame.state().get('selection');
|
1498 |
var wp_id = pagelayer_get_att(prop.el.$, prop.c['name']);
|
1499 |
+
|
1500 |
+
if(typeof wp_id === 'object'){
|
1501 |
+
if(inRetina){
|
1502 |
+
wp_id = ('retina' in wp_id && !pagelayer_empty(wp_id['retina']) ? wp_id['retina'] : 0 );
|
1503 |
+
}else if(inRetinaM){
|
1504 |
+
wp_id = ('retina_mobile' in wp_id && !pagelayer_empty(wp_id['retina_mobile']) ? wp_id['retina_mobile'] : 0 );
|
1505 |
+
}else{
|
1506 |
+
wp_id = (!pagelayer_empty(wp_id['img']) ? wp_id['img'] : 0 );
|
1507 |
+
}
|
1508 |
+
}
|
1509 |
+
|
1510 |
selection.reset( wp_id ? [ wp.media.attachment( wp_id ) ] : [] );
|
1511 |
}
|
1512 |
});
|
1524 |
// Inserting values in image drag and drop function
|
1525 |
pagelayer_img_dragAndDrop(dropzoneParent, dropZone, '', row);
|
1526 |
|
1527 |
+
row.find('.pagelayer-elp-image-retina').click(function(){
|
1528 |
+
row.find('.pagelayer-retina-label').toggle();
|
1529 |
+
row.find('.pagelayer-elp-retina-image-div').toggle();
|
1530 |
+
var checkval = row.find('.pagelayer-retina-checkbox').is(":checked");
|
1531 |
+
|
1532 |
+
if(checkval == true){
|
1533 |
+
row.find('.pagelayer-retina-checkbox').trigger("click");
|
1534 |
+
}
|
1535 |
+
});
|
1536 |
+
|
1537 |
+
row.find('.pagelayer-retina-checkbox').click(function(){
|
1538 |
+
row.find('.pagelayer-elp-retina-mobile-image-div').toggle();
|
1539 |
+
});
|
1540 |
+
|
1541 |
// Delete this
|
1542 |
row.find('.pagelayer-elp-image-delete').on('click', function(){
|
1543 |
|
1544 |
// Update thumbnail
|
1545 |
+
jQuery(this).parent().find('.pagelayer-elp-image').css('background-image', 'url(\''+def+'\')');
|
1546 |
|
1547 |
// Set to blank and render
|
1548 |
_pagelayer_set_atts(row, '', true);
|
1549 |
+
|
1550 |
+
imgObj['img'] = def;
|
1551 |
|
1552 |
_pagelayer_set_tmp_atts(row, 'no-image-set', 1);
|
1553 |
_pagelayer_set_tmp_atts(row, 'url', def);
|
1554 |
+
_pagelayer_set_atts(row, getImgVal(imgObj));
|
1555 |
});
|
1556 |
|
1557 |
+
row.find('.pagelayer-elp-retina-delete').on('click', function(){
|
1558 |
+
// Update thumbnail
|
1559 |
+
jQuery(this).parent().find('.pagelayer-elp-image').css('background-image', 'url(\''+def+'\')');
|
1560 |
+
delete imgObj['retina'];
|
1561 |
+
|
1562 |
+
_pagelayer_set_tmp_atts(row, 'retina-url', def);
|
1563 |
+
_pagelayer_set_atts(row, getImgVal(imgObj));
|
1564 |
+
|
1565 |
+
});
|
1566 |
+
|
1567 |
+
row.find('.pagelayer-elp-retina-mobile-delete').on('click', function(){
|
1568 |
+
|
1569 |
+
// Update thumbnail
|
1570 |
+
jQuery(this).parent().find('.pagelayer-elp-image').css('background-image', 'url(\''+def+'\')');
|
1571 |
+
delete imgObj['retina_mobile'];
|
1572 |
+
|
1573 |
+
// Set to blank and render
|
1574 |
+
_pagelayer_set_tmp_atts(row, 'retina-mobile-url', def);
|
1575 |
+
_pagelayer_set_atts(row, getImgVal(imgObj));
|
1576 |
+
|
1577 |
+
});
|
1578 |
}
|
1579 |
|
1580 |
// Main image drag and drop function
|
1706 |
|
1707 |
// Any IDs ?
|
1708 |
if(!pagelayer_empty(prop.c['val'])){
|
1709 |
+
ids = prop.c['val']
|
1710 |
+
if(pagelayer_is_string(ids)){
|
1711 |
+
ids = prop.c['val'].split(',');
|
1712 |
+
}
|
1713 |
//console.log(ids);
|
1714 |
}
|
1715 |
|
1716 |
// Do we have a URL set ?
|
1717 |
+
if(!pagelayer_empty(ids)){
|
1718 |
if(tmp in prop.el.tmp){
|
1719 |
var images = JSON.parse(prop.el.tmp[tmp]);
|
1720 |
//console.log(images);
|
1783 |
'open': function(){
|
1784 |
|
1785 |
// Do we have anything
|
1786 |
+
if(!pagelayer_empty(ids)){
|
1787 |
|
1788 |
var selection = '';
|
1789 |
|
1880 |
});
|
1881 |
|
1882 |
row.find('.pagelayer-elp-button').on('click', function(){
|
1883 |
+
|
1884 |
+
if(!pagelayer_empty(ids)){
|
1885 |
if(isNaN(ids[0])){
|
1886 |
pagelayer_init_frame('embed');
|
1887 |
}else{
|
2146 |
// The Editor proprety
|
2147 |
function pagelayer_elp_editor(row, prop){
|
2148 |
|
2149 |
+
var rows = prop.rows ? prop.rows : '8';
|
2150 |
+
|
2151 |
var div = '<div class="pagelayer-elp-editor-div">'+
|
2152 |
+
'<textarea rows="'+rows+'" class="pagelayer-elp-editor" ></textarea>'+
|
2153 |
'</div>';
|
2154 |
|
2155 |
row.append(div);
|
2157 |
var editor = row.find('.pagelayer-elp-editor');
|
2158 |
editor.val(prop.c['val']);
|
2159 |
|
2160 |
+
// Handle on change
|
2161 |
+
editor.on('input', function(){
|
2162 |
+
_pagelayer_set_atts(row, pagelayer_trim(jQuery(this).val()));// Save and Render
|
2163 |
+
});
|
2164 |
+
|
2165 |
+
return;
|
2166 |
// No SVG Icons for now
|
2167 |
jQuery.trumbowyg.svgPath = false;
|
2168 |
|
2390 |
return true;
|
2391 |
}
|
2392 |
|
2393 |
+
var tag = pagelayer_tag(pEle);
|
2394 |
+
var all_props = pagelayer_shortcodes[tag];
|
2395 |
+
var edit_opts;
|
2396 |
+
var fullEdit = false;
|
2397 |
+
|
2398 |
+
for(var i in pagelayer_tabs){
|
2399 |
+
var tab = pagelayer_tabs[i];
|
2400 |
+
for(var section in all_props[tab]){ //console.log(tab+' '+section);
|
2401 |
+
|
2402 |
+
var props = section in pagelayer_shortcodes[tag] ? pagelayer_shortcodes[tag][section] : pagelayer_styles[section];//console.log(props);
|
2403 |
+
|
2404 |
+
// Any editor options?
|
2405 |
+
if(prop in props){
|
2406 |
+
|
2407 |
+
if('e' in props[prop]){
|
2408 |
+
edit_opts = props[prop].e;
|
2409 |
+
}
|
2410 |
+
|
2411 |
+
if(props[prop]['type'] == 'editor'){
|
2412 |
+
fullEdit = true;
|
2413 |
+
}
|
2414 |
+
}
|
2415 |
+
}
|
2416 |
+
}
|
2417 |
+
|
2418 |
+
var pen_tools = {
|
2419 |
+
'inline': [ 'viewHTML',
|
2420 |
+
{'formating' : ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p']},
|
2421 |
+
'bold', 'italic', 'underline', 'strike',
|
2422 |
+
{ 'color': [] }, { 'background': [] },
|
2423 |
+
'removeformat'
|
2424 |
+
],
|
2425 |
+
'h': ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
2426 |
+
'headers': [{'formating' : ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']}],
|
2427 |
+
'c': [{ 'color': [] }, { 'background': [] }],
|
2428 |
+
'f': ['bold', 'italic', 'underline', 'strike'],
|
2429 |
+
'a': [{ 'align': ['left', 'center', 'right', 'justify'] }],
|
2430 |
+
'r': ['removeformat'],
|
2431 |
+
'v': ['viewHTML'],
|
2432 |
+
};
|
2433 |
+
|
2434 |
+
// Create Toolbar Groups
|
2435 |
+
if(!('pen_tools' in pagelayer_editor)){
|
2436 |
+
pagelayer_editor['pen_tools'] = {};
|
2437 |
+
}
|
2438 |
+
|
2439 |
+
pagelayer_editor['pen_tools'] = Object.assign(pagelayer_editor['pen_tools'], pen_tools);
|
2440 |
+
|
2441 |
+
var toolbar_options = [];
|
2442 |
+
|
2443 |
+
if( pagelayer_empty(edit_opts) ){
|
2444 |
+
|
2445 |
+
if(fullEdit){
|
2446 |
+
toolbar_options = [
|
2447 |
+
[ 'viewHTML' ],
|
2448 |
+
[ 'bold', 'italic', 'underline', 'strike' ],
|
2449 |
+
[ 'sub', 'super' ],
|
2450 |
+
//[ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'blockquote'],
|
2451 |
+
[ {'formating' : ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'blockquote']}],
|
2452 |
+
[ {'align': ['left', 'center', 'right', 'justify']} ],
|
2453 |
+
[ 'image', 'link'],
|
2454 |
+
[ 'unorderedlist', 'orderedlist'],
|
2455 |
+
[ {'size': []}, {'lineheight': []}, {'font': []}],
|
2456 |
+
[ {'color': [] }, {'background': []}],
|
2457 |
+
[ 'removeformat' ]
|
2458 |
+
];
|
2459 |
+
}else{
|
2460 |
+
toolbar_options = pagelayer_editor.pen_tools['inline'];
|
2461 |
+
}
|
2462 |
+
}else{
|
2463 |
+
var options = [];
|
2464 |
+
|
2465 |
+
if(! Array.isArray(edit_opts) ){
|
2466 |
+
edit_opts = [edit_opts];
|
2467 |
+
}
|
2468 |
+
|
2469 |
+
for( var tt in edit_opts){
|
2470 |
+
|
2471 |
+
var tool = edit_opts[tt];
|
2472 |
+
|
2473 |
+
if(pagelayer_is_string(tool)){
|
2474 |
+
if(tool in pagelayer_editor['pen_tools']){
|
2475 |
+
tool = pagelayer_editor['pen_tools'][tool]
|
2476 |
+
}else{
|
2477 |
+
tool = [tool];
|
2478 |
+
}
|
2479 |
+
}
|
2480 |
+
|
2481 |
+
options.push(tool);
|
2482 |
+
}
|
2483 |
+
|
2484 |
+
toolbar_options = options;
|
2485 |
+
}
|
2486 |
|
2487 |
var options = {
|
2488 |
class: 'pagelayer-pen',
|
2489 |
+
editor: jEle,
|
2490 |
+
toolbar: toolbar_options
|
|
|
2491 |
}
|
2492 |
|
2493 |
// Setup the editor
|
2494 |
pagelayer_editor[eId] = {};
|
2495 |
+
pagelayer_editor[eId].pen = new PagelayerPen(jEle, options);
|
2496 |
pagelayer_editor[eId].$ = jEle;
|
2497 |
|
2498 |
// Are we the clicked object, then set the focus
|
2505 |
|
2506 |
// Reverse setup the event
|
2507 |
jEle.on('blur', function(){
|
2508 |
+
|
2509 |
//pagelayer_editor[eId].pen.destroy();
|
2510 |
+
if(jEle.hasClass('pagelayer-pen-focused')){
|
2511 |
+
return;
|
2512 |
+
}
|
2513 |
|
2514 |
var cEle = pEle;
|
2515 |
|
3094 |
});
|
3095 |
|
3096 |
// Find the existing items
|
3097 |
+
prop.el.$.find('[pagelayer-parent="'+prop.el['id']+'"]').each(function(){
|
3098 |
var jEle = jQuery(this);
|
3099 |
var id = pagelayer_assign_id(jEle);
|
3100 |
show_item(id);
|
3158 |
function pagelayer_elp_padding(row, prop){
|
3159 |
var val = ['', '', '', ''];
|
3160 |
|
3161 |
+
if(!pagelayer_empty(prop.c['val'])){
|
3162 |
+
val = prop.c['val'];
|
3163 |
+
if(pagelayer_is_string(val)){
|
3164 |
+
val = val.split(',');
|
3165 |
+
}
|
3166 |
}
|
3167 |
|
3168 |
var div = '<div class="pagelayer-elp-padding-div">'+
|
3242 |
|
3243 |
// Do we have a val ?
|
3244 |
if(!pagelayer_empty(prop.c['val'])){
|
3245 |
+
val = prop.c['val'];
|
3246 |
+
if(pagelayer_is_string(val)){
|
3247 |
+
val = val.split(',');
|
3248 |
+
}
|
3249 |
}
|
3250 |
|
3251 |
//var val = {color: '', blur: '', horizontal: '', vertical: ''};
|
3341 |
|
3342 |
// Do we have a val ?
|
3343 |
if(!pagelayer_empty(prop.c['val'])){
|
3344 |
+
val = prop.c['val'];
|
3345 |
+
if(pagelayer_is_string(val)){
|
3346 |
+
val = val.split(',');
|
3347 |
+
}
|
3348 |
}
|
3349 |
|
3350 |
var val_pos = ['horizontal','vertical','blur','color','spread','inset'];
|
3453 |
|
3454 |
// Do we have a val ?
|
3455 |
if(!pagelayer_empty(prop.c['val'])){
|
3456 |
+
val = prop.c['val'];
|
3457 |
+
if(pagelayer_is_string(val)){
|
3458 |
+
val = val.split(',');
|
3459 |
+
}
|
3460 |
}
|
3461 |
|
3462 |
var filters = [['blur','10','0.1'],['brightness','200','1'],['contrast','200','1'],['grayscale','200','1'],['hue','360','1'],['opacity','100','1'],['saturate','200','1']];
|
3499 |
|
3500 |
// Do we have a val ?
|
3501 |
if(!pagelayer_empty(prop.c['val'])){
|
3502 |
+
val = prop.c['val'];
|
3503 |
+
if(pagelayer_is_string(val)){
|
3504 |
+
val = val.split(',');
|
3505 |
+
}
|
3506 |
}
|
3507 |
|
3508 |
//var val = {color: '', blur: '', horizontal: '', vertical: ''};
|
3692 |
|
3693 |
// Do we have a val ?
|
3694 |
if(!pagelayer_empty(prop.c['val'])){
|
3695 |
+
val = prop.c['val'];
|
3696 |
+
if(pagelayer_is_string(val)){
|
3697 |
+
val = val.split(',');
|
3698 |
+
}
|
3699 |
}
|
3700 |
|
3701 |
var select = { 'style' : ['', 'Normal', 'Italic', 'Oblique'],
|
3889 |
|
3890 |
var val = ['', ''];
|
3891 |
|
3892 |
+
if(!pagelayer_empty(prop.c['val'])){
|
3893 |
+
|
3894 |
+
val = prop.c['val'];
|
3895 |
+
if(pagelayer_is_string(val)){
|
3896 |
+
val = val.split(',');
|
3897 |
+
//console.log(val);
|
3898 |
+
}
|
3899 |
+
|
3900 |
}
|
3901 |
|
3902 |
var div = '<div class="pagelayer-elp-dimension-div">'+
|
3997 |
$div.find('input[type=checkbox]').attr('checked', false);
|
3998 |
|
3999 |
if(!pagelayer_empty(prop.c['val'])){
|
4000 |
+
|
4001 |
+
var check_val = prop.c['val'];
|
4002 |
+
if(pagelayer_is_string(check_val)){
|
4003 |
+
check_val = check_val.split(',');
|
4004 |
+
}
|
4005 |
+
|
4006 |
+
for(var no in check_val){
|
4007 |
+
$div.find('input[type=checkbox][value='+check_val[no]+']').attr('checked', true);
|
4008 |
}
|
4009 |
}
|
4010 |
|
4127 |
return;
|
4128 |
}
|
4129 |
|
|
|
4130 |
var div = '<div class="pagelayer-elp-postTags" >'+
|
4131 |
'<div class="pagelayer-post-tags" >'+
|
4132 |
'<input type="text" autocomplete="off" class="pagelayer-elp-postTags-inp" autofocus="autofocus"/>'+
|
4286 |
|
4287 |
// Create array for needed term_id with corresponding to the name.
|
4288 |
if(!pagelayer_empty(prop.c['val'])){
|
4289 |
+
|
4290 |
+
var tags_val = prop.c['val'];
|
4291 |
+
if(pagelayer_is_string(tags_val)){
|
4292 |
+
tags_val = tags_val.split(',');
|
4293 |
+
}
|
4294 |
+
|
4295 |
+
for(var name in tags_val){
|
4296 |
+
tags_array[i] = pagelayer_post_tags.allTags.find(function(val){return val['name'] == tags_val[name]});
|
4297 |
i++;
|
4298 |
}
|
4299 |
}
|
4645 |
// value is an object or not
|
4646 |
if(typeof value == 'object'){
|
4647 |
// Checking value for NaN, empty and default.
|
4648 |
+
|
4649 |
+
for(var i = 0; i < pagelayer_length(value); i++){
|
4650 |
+
if(value[i]!= prop.default && value[i] == value[i] && value[i] != ''){
|
4651 |
row.find('.pagelayer-elp-default').attr('data_show',true);
|
4652 |
break;
|
4653 |
}
|
@@ -36,7 +36,13 @@ function pagelayer_render_pl_row(el){
|
|
36 |
}
|
37 |
}
|
38 |
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
// Render for inner row
|
@@ -76,67 +82,52 @@ function pagelayer_render_pl_col(el){
|
|
76 |
par.css('width', '');
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
pagelayer_bg_video(el);
|
80 |
}
|
81 |
|
82 |
function pagelayer_bg_video(el){
|
83 |
-
|
84 |
-
var youtubeRegExp = /youtube\.com|youtu\.be/;
|
85 |
-
var vimeoRegExp = /vimeo\.com/;
|
86 |
|
87 |
el.tmp['bg_video_src-url'] = el.tmp['bg_video_src-url'] || el.atts['bg_video_src'];
|
88 |
|
89 |
var src = el.tmp['bg_video_src-url'];
|
90 |
|
91 |
-
var
|
92 |
// Adding mute and loop option in row or col
|
93 |
if(el.atts['mute'] == "true"){
|
94 |
-
|
95 |
el.atts['mute'] = " muted ";
|
96 |
}else{
|
97 |
-
|
98 |
el.atts['mute'] = "";
|
99 |
}
|
100 |
|
101 |
if(el.atts['stop_loop'] != "true"){
|
102 |
-
|
103 |
el.atts['stop_loop'] = " loop ";
|
104 |
}else{
|
105 |
-
|
106 |
el.atts['stop_loop'] ="";
|
107 |
}
|
108 |
|
109 |
-
if (
|
110 |
-
|
111 |
-
var youtubeRegExp1 = /youtube\.com/;
|
112 |
-
var youtubewatch = /watch/;
|
113 |
-
var youtubeembed = /embed/;
|
114 |
-
var youtube = /youtu\.be/;
|
115 |
-
var videoId;
|
116 |
|
117 |
-
if (youtubeRegExp1.exec(src)) {
|
118 |
-
|
119 |
-
if (youtubewatch.exec(src)) {
|
120 |
-
videoId = src.split('?v=');
|
121 |
-
|
122 |
-
} else if (youtubewatch.exec(src)) {
|
123 |
-
videoId = src.split('embed/');
|
124 |
-
}
|
125 |
-
|
126 |
-
} else if (youtube.exec(src)) {
|
127 |
-
videoId = src.split('.be/');
|
128 |
-
}
|
129 |
//console.log(frame_height);
|
130 |
-
el.atts['vid_src'] = '<iframe src="'+
|
131 |
|
132 |
-
} else if (
|
133 |
|
134 |
-
el.atts['vid_src'] = '<iframe src="'+
|
135 |
|
136 |
}else{
|
137 |
|
138 |
el.atts['vid_src'] = '<video autoplay playsinline '+el.atts['mute']+el.atts['stop_loop']+'>'+
|
139 |
-
'<source src="'+
|
140 |
'</video>';
|
141 |
|
142 |
}
|
@@ -249,6 +240,14 @@ function pagelayer_render_pl_image(el){
|
|
249 |
// Decide the image URL
|
250 |
el.atts['func_id'] = el.tmp['id-'+el.atts['id-size']+'-url'] || el.tmp['id-url'];
|
251 |
el.atts['func_id'] = el.atts['func_id'] || el.atts['id'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
// What is the link ?
|
254 |
if('link_type' in el.atts){
|
@@ -305,30 +304,21 @@ function pagelayer_preDAndD_image(jEle){
|
|
305 |
}
|
306 |
|
307 |
// Render for video
|
308 |
-
function pagelayer_render_pl_video(el){
|
309 |
el.atts['video_overlay_image-url'] = el.tmp['video_overlay_image-'+el.atts['custom_size']+'-url'] || el.tmp['video_overlay_image-url'];
|
310 |
el.atts['video_overlay_image-url'] = el.atts['video_overlay_image-url'] || el.atts['video_overlay_image'];
|
311 |
el.tmp['src-url'] = el.tmp['src-url'] || el.atts['src'];
|
312 |
el.tmp['ele_id'] = el['id'];
|
313 |
-
|
314 |
|
315 |
-
|
316 |
-
el.atts['vid_src'] +="?&autoplay=1";
|
317 |
-
}else{
|
318 |
-
el.atts['vid_src'] +="?&autoplay=0";
|
319 |
-
}
|
320 |
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
if(el.atts['loop'] == "true"){
|
328 |
-
el.atts['vid_src'] +="&loop=1";
|
329 |
-
}else{
|
330 |
-
el.atts['vid_src'] +="&loop=0";
|
331 |
-
}
|
332 |
}
|
333 |
|
334 |
// Incase if there is a lightbox
|
@@ -365,6 +355,14 @@ function pagelayer_render_pl_service(el){
|
|
365 |
// Decide the image URL
|
366 |
el.atts['func_image'] = el.tmp['service_image-'+el.atts['service_image_size']+'-url'] || el.tmp['service_image-url'];
|
367 |
el.atts['func_image'] = el.atts['func_image'] || el.atts['service_image'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
|
369 |
}
|
370 |
|
@@ -596,7 +594,7 @@ function pagelayer_render_html_pl_tabs(el){
|
|
596 |
el.CSS.attr.push({'sel': '{{element}}', 'val': 'pagelayer-tabs-rotate="'+el.atts["rotate"]+'"'});
|
597 |
};
|
598 |
|
599 |
-
// Render the
|
600 |
function pagelayer_render_end_pl_tabs(el){
|
601 |
pagelayer_pl_tabs(el.$);
|
602 |
}
|
@@ -679,6 +677,63 @@ function pagelayer_owl_destroy(jEle, slides_class){
|
|
679 |
}
|
680 |
}
|
681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
////////////
|
683 |
// Freemium
|
684 |
////////////
|
@@ -750,6 +805,24 @@ function pagelayer_render_html_pl_featured_img(el){
|
|
750 |
});
|
751 |
}
|
752 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
753 |
/////////////////
|
754 |
// Freemium
|
755 |
/////////////////
|
@@ -805,7 +878,8 @@ function pagelayer_render_end_pl_archive_posts(el){
|
|
805 |
var data_handle = function(data){
|
806 |
//console.log(data);
|
807 |
var d = jQuery(data);
|
808 |
-
el.$.
|
|
|
809 |
pagelayer_ajax_data[el['id']] = data;
|
810 |
}
|
811 |
|
@@ -891,11 +965,15 @@ function pagelayer_render_pl_wp_title(el){
|
|
891 |
// But is there a default logo
|
892 |
if(!pagelayer_empty(pagelayer_site_logo)){
|
893 |
el.atts['func_image'] = pagelayer_site_logo[el.atts['logo_img_size']+'-url'] || pagelayer_site_logo['url'];
|
|
|
|
|
|
|
894 |
}
|
895 |
|
896 |
// Custom logo
|
897 |
}else{
|
898 |
el.atts['func_image'] = el.tmp['logo_img-'+el.atts['logo_img_size']+'-url'] || el.tmp['logo_img-url'];
|
|
|
899 |
}
|
900 |
}
|
901 |
|
36 |
}
|
37 |
}
|
38 |
|
39 |
+
// Row background parallax image.
|
40 |
+
if(!pagelayer_empty(el.atts['parallax_img'])){
|
41 |
+
el.atts['parallax_img_src'] = el.tmp['parallax_img-'+el.atts['parallax_id_size']+'-url'] || el.tmp['parallax_img-url'];
|
42 |
+
el.atts['parallax_img_src'] = el.atts['parallax_img_src'] || el.atts['parallax_img'];
|
43 |
+
}
|
44 |
+
|
45 |
+
pagelayer_bg_video(el);
|
46 |
}
|
47 |
|
48 |
// Render for inner row
|
82 |
par.css('width', '');
|
83 |
}
|
84 |
|
85 |
+
// Col background parallax image.
|
86 |
+
if(!pagelayer_empty(el.atts['parallax_img'])){
|
87 |
+
el.atts['parallax_img_src'] = el.tmp['parallax_img-'+el.atts['parallax_id_size']+'-url'] || el.tmp['parallax_img-url'];
|
88 |
+
el.atts['parallax_img_src'] = el.atts['parallax_img_src'] || el.atts['parallax_img'];
|
89 |
+
}
|
90 |
+
|
91 |
pagelayer_bg_video(el);
|
92 |
}
|
93 |
|
94 |
function pagelayer_bg_video(el){
|
|
|
|
|
|
|
95 |
|
96 |
el.tmp['bg_video_src-url'] = el.tmp['bg_video_src-url'] || el.atts['bg_video_src'];
|
97 |
|
98 |
var src = el.tmp['bg_video_src-url'];
|
99 |
|
100 |
+
var iframe_atts = pagelayer_video_url(el.tmp['bg_video_src-url'], true);
|
101 |
// Adding mute and loop option in row or col
|
102 |
if(el.atts['mute'] == "true"){
|
103 |
+
iframe_atts['src'] +="?&mute=1";
|
104 |
el.atts['mute'] = " muted ";
|
105 |
}else{
|
106 |
+
iframe_atts['src'] +="?&mute=0";
|
107 |
el.atts['mute'] = "";
|
108 |
}
|
109 |
|
110 |
if(el.atts['stop_loop'] != "true"){
|
111 |
+
iframe_atts['src'] +="&loop=1";
|
112 |
el.atts['stop_loop'] = " loop ";
|
113 |
}else{
|
114 |
+
iframe_atts['src'] +="&loop=0";
|
115 |
el.atts['stop_loop'] ="";
|
116 |
}
|
117 |
|
118 |
+
if (iframe_atts['type'] == 'youtube') {
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
//console.log(frame_height);
|
121 |
+
el.atts['vid_src'] = '<iframe src="'+iframe_atts['src']+'&autoplay=1&controls=0&showinfo=0&rel=0&autohide=1&&playlist='+iframe_atts['id']+'" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
122 |
|
123 |
+
} else if (iframe_atts['type'] == 'vimeo') {
|
124 |
|
125 |
+
el.atts['vid_src'] = '<iframe src="'+iframe_atts['src']+'&background=1&autoplay=1&byline=0&title=0" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
126 |
|
127 |
}else{
|
128 |
|
129 |
el.atts['vid_src'] = '<video autoplay playsinline '+el.atts['mute']+el.atts['stop_loop']+'>'+
|
130 |
+
'<source src="'+iframe_atts['src']+'" type="video/mp4">'+
|
131 |
'</video>';
|
132 |
|
133 |
}
|
240 |
// Decide the image URL
|
241 |
el.atts['func_id'] = el.tmp['id-'+el.atts['id-size']+'-url'] || el.tmp['id-url'];
|
242 |
el.atts['func_id'] = el.atts['func_id'] || el.atts['id'];
|
243 |
+
el.atts['pagelayer-srcset'] = el.atts['func_id']+', '+el.atts['func_id']+' 1x, ';
|
244 |
+
|
245 |
+
var image_atts = {
|
246 |
+
name : 'id',
|
247 |
+
size : 'id-size'
|
248 |
+
};
|
249 |
+
|
250 |
+
pagelayer_get_img_src(el, image_atts);
|
251 |
|
252 |
// What is the link ?
|
253 |
if('link_type' in el.atts){
|
304 |
}
|
305 |
|
306 |
// Render for video
|
307 |
+
function pagelayer_render_pl_video(el){
|
308 |
el.atts['video_overlay_image-url'] = el.tmp['video_overlay_image-'+el.atts['custom_size']+'-url'] || el.tmp['video_overlay_image-url'];
|
309 |
el.atts['video_overlay_image-url'] = el.atts['video_overlay_image-url'] || el.atts['video_overlay_image'];
|
310 |
el.tmp['src-url'] = el.tmp['src-url'] || el.atts['src'];
|
311 |
el.tmp['ele_id'] = el['id'];
|
312 |
+
var vid_atts = pagelayer_video_url(el.tmp['src-url'], true);
|
313 |
|
314 |
+
vid_atts['src'] += el.atts['autoplay'] == 'true' ? '?&autoplay=1' : '?&autoplay=0' ;
|
|
|
|
|
|
|
|
|
315 |
|
316 |
+
var mute = el.atts['mute'] == 'true' ? 1 : 0;
|
317 |
+
vid_atts['src'] +='&'+(vid_atts['type'] == 'vimeo' ? 'muted' : 'mute')+'='+mute;
|
318 |
+
|
319 |
+
vid_atts['src'] += el.atts['loop'] == 'true' ? '&loop=1' : '&loop=0' ;
|
320 |
+
|
321 |
+
el.atts['vid_src'] = vid_atts['src']+(vid_atts['type'] == 'youtube' ? '&playlist='+vid_atts['id'] : '');
|
|
|
|
|
|
|
|
|
|
|
322 |
}
|
323 |
|
324 |
// Incase if there is a lightbox
|
355 |
// Decide the image URL
|
356 |
el.atts['func_image'] = el.tmp['service_image-'+el.atts['service_image_size']+'-url'] || el.tmp['service_image-url'];
|
357 |
el.atts['func_image'] = el.atts['func_image'] || el.atts['service_image'];
|
358 |
+
el.atts['pagelayer-srcset'] = el.atts['func_image']+', '+el.atts['func_image']+' 1x, ';
|
359 |
+
|
360 |
+
var image_atts = {
|
361 |
+
name : 'service_image',
|
362 |
+
size : 'service_image_size'
|
363 |
+
};
|
364 |
+
|
365 |
+
pagelayer_get_img_src(el, image_atts);
|
366 |
|
367 |
}
|
368 |
|
594 |
el.CSS.attr.push({'sel': '{{element}}', 'val': 'pagelayer-tabs-rotate="'+el.atts["rotate"]+'"'});
|
595 |
};
|
596 |
|
597 |
+
// Render the tab item
|
598 |
function pagelayer_render_end_pl_tabs(el){
|
599 |
pagelayer_pl_tabs(el.$);
|
600 |
}
|
677 |
}
|
678 |
}
|
679 |
|
680 |
+
|
681 |
+
// Render the google maps v3
|
682 |
+
function pagelayer_render_pl_google_maps(el){
|
683 |
+
|
684 |
+
el.atts['show_v2'] = true;
|
685 |
+
|
686 |
+
if(pagelayer_empty(el.atts['api_version'])){
|
687 |
+
el.atts['src_code'] = '';
|
688 |
+
return;
|
689 |
+
}
|
690 |
+
|
691 |
+
el.atts['show_v2'] = false;
|
692 |
+
|
693 |
+
var gmaps_key = (pagelayer_empty(pagelayer_gmaps_key) ? '' : pagelayer_gmaps_key);
|
694 |
+
|
695 |
+
var api_key = (pagelayer_empty(el.atts['api_key']) ? gmaps_key : el.atts['api_key']);
|
696 |
+
|
697 |
+
if(el.atts['map_modes'] == 'view'){
|
698 |
+
el.atts['center'] = pagelayer_empty(el.atts['center']) ? '-33.8569,151.2152' : el.atts['center'];
|
699 |
+
}
|
700 |
+
|
701 |
+
var src_code = (pagelayer_empty(el.atts['center']) ? '' : '¢er='+el.atts['center'])+(el.atts['map_modes'] == 'streetview' ? '' : '&maptype='+el.atts['map_type']+'&zoom='+el.atts['zoom']);
|
702 |
+
|
703 |
+
switch(el.atts['map_modes']){
|
704 |
+
case 'place':
|
705 |
+
src_code += encodeURI('&q='+(pagelayer_empty(el.atts['address']) ? 'New York, New York, USA' : el.atts['address'] ));
|
706 |
+
break;
|
707 |
+
|
708 |
+
case 'directions':
|
709 |
+
src_code += encodeURI('&origin='+(pagelayer_empty(el.atts['direction_origin']) ? 'Oslow Norway' : el.atts['direction_origin'] ));
|
710 |
+
src_code += encodeURI('&destination='+(pagelayer_empty(el.atts['direction_destination']) ? 'Telemark Norway' : el.atts['direction_destination'] ));
|
711 |
+
src_code += (pagelayer_empty(el.atts['direction_waypoints']) ? '' : '&waypoints='+(el.atts['direction_waypoints'].trim()).split(' ').join('|') );
|
712 |
+
src_code += (pagelayer_empty(el.atts['direction_modes']) ? '' : '&mode='+el.atts['direction_modes'] );
|
713 |
+
src_code += (pagelayer_empty(el.atts['direction_avoid']) ? '' : '&avoid='+el.atts['direction_avoid'].split(',').join('|') );
|
714 |
+
src_code += (pagelayer_empty(el.atts['direction_units']) ? '' : '&units='+el.atts['direction_units'] );
|
715 |
+
break;
|
716 |
+
|
717 |
+
case 'streetview':
|
718 |
+
src_code += '&pano='+(pagelayer_empty(el.atts['streetview_pano']) ? 'eTnPNGoy4bxR9LpjjfFuOw' : el.atts['streetview_pano'] );
|
719 |
+
src_code += '&location='+(pagelayer_empty(el.atts['streetview_location']) ? '46.414382,10.013988' : el.atts['streetview_location'] );
|
720 |
+
src_code += (pagelayer_empty(el.atts['streetview_heading']) ? '' : '&heading='+el.atts['streetview_heading'] );
|
721 |
+
src_code += (pagelayer_empty(el.atts['streetview_pitch']) ? '' : '&pitch='+el.atts['streetview_pitch'] );
|
722 |
+
src_code += (pagelayer_empty(el.atts['streetview_fov']) ? '' : '&fov='+el.atts['streetview_fov'] );
|
723 |
+
break;
|
724 |
+
|
725 |
+
case 'search':
|
726 |
+
src_code += encodeURI('&q='+(pagelayer_empty(el.atts['search_term']) ? 'Record stores in Seattle' : el.atts['search_term'] ));
|
727 |
+
break;
|
728 |
+
|
729 |
+
}
|
730 |
+
|
731 |
+
var src_code_url = 'https://www.google.com/maps/embed/v1/'+el.atts['map_modes']+'?key='+api_key+src_code;
|
732 |
+
|
733 |
+
el.atts['src_code'] = '<iframe width="600" height="450" style="border:0" loading="lazy" allowfullscreen src="'+src_code_url+'"></iframe>';
|
734 |
+
|
735 |
+
}
|
736 |
+
|
737 |
////////////
|
738 |
// Freemium
|
739 |
////////////
|
805 |
});
|
806 |
}
|
807 |
|
808 |
+
// Retina image setting attribute.
|
809 |
+
function pagelayer_get_img_src(el, image_atts){
|
810 |
+
|
811 |
+
// Check if retina images is set
|
812 |
+
if(!pagelayer_empty(el.tmp[image_atts.name+'-retina-url']) && el.tmp[image_atts.name+'-retina-url'].includes('default-image') == false){
|
813 |
+
var retina_image = el.tmp[image_atts.name+'-retina-'+el.atts[image_atts.size]+'-url'];
|
814 |
+
retina_image = pagelayer_empty(retina_image) ? el.tmp[image_atts.name+'-retina-url'] : retina_image;
|
815 |
+
el.atts['pagelayer-srcset'] += retina_image +' 2x, ';
|
816 |
+
}
|
817 |
+
|
818 |
+
// Check if retina mobile images is set
|
819 |
+
if(!pagelayer_empty(el.tmp[image_atts.name+'-retina-mobile-url']) && el.tmp[image_atts.name+'-retina-mobile-url'].includes('default-image') == false){
|
820 |
+
var retina_image_mobile = el.tmp[image_atts.name+'-retina-mobile-'+el.atts[image_atts.size]+'-url'];
|
821 |
+
retina_image_mobile = pagelayer_empty(retina_image_mobile) ? el.tmp[image_atts.name+'-retina-mobile-url'] : retina_image_mobile;
|
822 |
+
el.atts['pagelayer-srcset'] += retina_image_mobile +' 3x';
|
823 |
+
}
|
824 |
+
}
|
825 |
+
|
826 |
/////////////////
|
827 |
// Freemium
|
828 |
/////////////////
|
878 |
var data_handle = function(data){
|
879 |
//console.log(data);
|
880 |
var d = jQuery(data);
|
881 |
+
el.$.children(':not(style)').remove();
|
882 |
+
var child = el.$.append(d.children(':not(style)'));
|
883 |
pagelayer_ajax_data[el['id']] = data;
|
884 |
}
|
885 |
|
965 |
// But is there a default logo
|
966 |
if(!pagelayer_empty(pagelayer_site_logo)){
|
967 |
el.atts['func_image'] = pagelayer_site_logo[el.atts['logo_img_size']+'-url'] || pagelayer_site_logo['url'];
|
968 |
+
|
969 |
+
el.atts['logo_img-title'] = pagelayer_empty(pagelayer_site_logo.title) ? '' : pagelayer_site_logo.title;
|
970 |
+
el.atts['logo_img-alt'] = pagelayer_empty(pagelayer_site_logo.alt) ? '' : pagelayer_site_logo.alt;
|
971 |
}
|
972 |
|
973 |
// Custom logo
|
974 |
}else{
|
975 |
el.atts['func_image'] = el.tmp['logo_img-'+el.atts['logo_img_size']+'-url'] || el.tmp['logo_img-url'];
|
976 |
+
el.atts['func_image'] = pagelayer_empty(el.atts['func_image']) ? el.atts['logo_img'] : el.atts['func_image'];
|
977 |
}
|
978 |
}
|
979 |
|
@@ -1873,5 +1873,53 @@
|
|
1873 |
"empty_post_content" : "The content of the post is empty. Are you sure you want to save the post with blank content.",
|
1874 |
"post_tag_desc" : "Separate with commas or the Enter key.",
|
1875 |
"post_pass_with_sticky_err" : "Publishing failed! A post can not be Sticky and have a Password.",
|
1876 |
-
"menu_toggle_icon_desc" : "If no icon is selected a bar icon will be shown"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1877 |
}
|
1873 |
"empty_post_content" : "The content of the post is empty. Are you sure you want to save the post with blank content.",
|
1874 |
"post_tag_desc" : "Separate with commas or the Enter key.",
|
1875 |
"post_pass_with_sticky_err" : "Publishing failed! A post can not be Sticky and have a Password.",
|
1876 |
+
"menu_toggle_icon_desc" : "If no icon is selected a bar icon will be shown",
|
1877 |
+
"download_file_name" : "Download File Name",
|
1878 |
+
"custom_attributes" : "Custom Attributes",
|
1879 |
+
"attributes" : "Attributes",
|
1880 |
+
"attribute_desc" : "Setting custom attribute for wrapper element. You can add attributes and their values in this way '<strong>attribute = value</strong>' and separate key-value pairs using <strong>semicolon ;</strong>. <br> <strong>Note :</strong> Allowed special characters are - _.",
|
1881 |
+
"google_maps" : "Google Maps",
|
1882 |
+
"api_version" : "API version",
|
1883 |
+
"api_version_desc" : "Choose the Google Maps API version. We are suggesting to use V3 as Google is deprecating V2 and V2 can stop anytime",
|
1884 |
+
"version2" : "Version 2",
|
1885 |
+
"version3" : "Version 3",
|
1886 |
+
"api_key" : "API key",
|
1887 |
+
"google_api_key_desc" : "Blank this field to use the API key from Pagelayer Settings.",
|
1888 |
+
"map_modes" : "Map modes",
|
1889 |
+
"place" : "Place",
|
1890 |
+
"view" : "View",
|
1891 |
+
"directions" : "Directions",
|
1892 |
+
"streetview" : "StreetView",
|
1893 |
+
"origin" : "Origin",
|
1894 |
+
"destination" : "Destination",
|
1895 |
+
"waypoints" : "Waypoints",
|
1896 |
+
"waypoints_desc" : "Place name, address, or place ID. Multiple waypoints can be specified by using the pipe character (|) to separate places (e.g. Kongsberg|Drammen). You can specify up to 20 waypoints.",
|
1897 |
+
"modes" : "Modes",
|
1898 |
+
"driving" : "Driving",
|
1899 |
+
"walking" : "Walking",
|
1900 |
+
"bicycling" : "Bicycling",
|
1901 |
+
"flying" : "Flying",
|
1902 |
+
"avoid" : "Avoid",
|
1903 |
+
"tolls" : "Tolls",
|
1904 |
+
"ferries" : "Ferries",
|
1905 |
+
"highways" : "Highways",
|
1906 |
+
"units" : "Units",
|
1907 |
+
"metric" : "Metric",
|
1908 |
+
"imperial" : "Imperial",
|
1909 |
+
"pano" : "Pano",
|
1910 |
+
"pano_desc" : "Pano is a specific panorama ID. For e.g. - eTnPNGoy4bxR9LpjjfFuOw",
|
1911 |
+
"location" : "Location",
|
1912 |
+
"heading" : "Heading",
|
1913 |
+
"heading_desc" : "Indicates the compass heading of the camera in degrees clockwise from North",
|
1914 |
+
"pitch" : "Pitch",
|
1915 |
+
"pitch_desc" : "Specifies the angle, up or down, of the camera",
|
1916 |
+
"fov" : "FOV (Field Of View)",
|
1917 |
+
"fov_desc" : "Determines the horizontal field of view of the image",
|
1918 |
+
"google_search_term" : "Search Term",
|
1919 |
+
"google_search_desc" : "Defines the search term.",
|
1920 |
+
"center_desc" : "Accepts comma-separated latitude and longitude value; for example -33.8569,151.2152",
|
1921 |
+
"map_type" : "Map type",
|
1922 |
+
"roadmap" : "Roadmap",
|
1923 |
+
"satellite" : "Satellite",
|
1924 |
+
"thumb_img_type" : "Thumbnail Image Type"
|
1925 |
}
|
@@ -268,18 +268,18 @@ function pagelayer_save_content(){
|
|
268 |
}
|
269 |
|
270 |
if($_post->post_type == 'post'){
|
271 |
-
$post['post_category'] =
|
272 |
|
273 |
-
$post['tags_input'] =
|
274 |
}else{
|
275 |
$cat_name = pagelayer_post_type_category($_post->post_type);
|
276 |
if($cat_name){
|
277 |
-
$post['tax_input'][$cat_name] =
|
278 |
}
|
279 |
|
280 |
$tag_name = pagelayer_post_type_tag($_post->post_type);
|
281 |
if($tag_name){
|
282 |
-
$post['tax_input'][$tag_name] =
|
283 |
}
|
284 |
}
|
285 |
|
@@ -1030,6 +1030,7 @@ function pagelayer_archive_posts_data(){
|
|
1030 |
pagelayer_load_shortcodes();
|
1031 |
|
1032 |
foreach($_POST['atts'] as $k => $v){
|
|
|
1033 |
$r[] = esc_html($k).'="'.pagelayer_escapeHTML($v).'"';
|
1034 |
}
|
1035 |
|
268 |
}
|
269 |
|
270 |
if($_post->post_type == 'post'){
|
271 |
+
$post['post_category'] = pagelayer_sanitize_text_field($_REQUEST['post_category']);
|
272 |
|
273 |
+
$post['tags_input'] = pagelayer_sanitize_text_field($_REQUEST['post_tags']);
|
274 |
}else{
|
275 |
$cat_name = pagelayer_post_type_category($_post->post_type);
|
276 |
if($cat_name){
|
277 |
+
$post['tax_input'][$cat_name] = pagelayer_sanitize_text_field($_REQUEST['post_category']);
|
278 |
}
|
279 |
|
280 |
$tag_name = pagelayer_post_type_tag($_post->post_type);
|
281 |
if($tag_name){
|
282 |
+
$post['tax_input'][$tag_name] = pagelayer_sanitize_text_field($_REQUEST['post_tags']);
|
283 |
}
|
284 |
}
|
285 |
|
1030 |
pagelayer_load_shortcodes();
|
1031 |
|
1032 |
foreach($_POST['atts'] as $k => $v){
|
1033 |
+
$v = pagelayer_maybe_implode($v);
|
1034 |
$r[] = esc_html($k).'="'.pagelayer_escapeHTML($v).'"';
|
1035 |
}
|
1036 |
|
@@ -83,6 +83,7 @@ class PageLayer{
|
|
83 |
var $css_settings = array();
|
84 |
|
85 |
var $data_attr = array();
|
|
|
86 |
|
87 |
function __construct() {
|
88 |
|
83 |
var $css_settings = array();
|
84 |
|
85 |
var $data_attr = array();
|
86 |
+
var $sc_audio_enqueued = 0;
|
87 |
|
88 |
function __construct() {
|
89 |
|
@@ -722,7 +722,7 @@ function pagelayer_add_shortcode($tag, $params = array()){
|
|
722 |
'animation_styles' => __pl('animation_styles'),
|
723 |
'motion_effects' => __pl('Motion Effects'),
|
724 |
'responsive_styles' => __pl('responsive_styles'),
|
725 |
-
'attributes' => __pl('
|
726 |
'custom_styles' => __pl('custom_styles'),
|
727 |
];
|
728 |
|
@@ -859,6 +859,26 @@ function pagelayer_image($id = 0){
|
|
859 |
|
860 |
$ret = [];
|
861 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
// External image ?
|
863 |
if(pagelayer_is_external_img($id)){
|
864 |
|
@@ -892,10 +912,10 @@ function pagelayer_image($id = 0){
|
|
892 |
$alt = get_post_meta($id, '_wp_attachment_image_alt', true);
|
893 |
$alt = empty($alt) ? $image->post_excerpt : $alt;
|
894 |
$alt = empty($alt) ? $image->post_title : $alt;
|
895 |
-
$alt = empty($alt) ? '' : trim(strip_tags($alt));
|
896 |
$link = get_attachment_link($id);
|
897 |
$caption = wp_get_attachment_caption($id);
|
898 |
-
$caption = !empty($caption) ? $caption : '';
|
899 |
|
900 |
}
|
901 |
|
@@ -982,7 +1002,7 @@ function pagelayer_attachment($id){
|
|
982 |
|
983 |
// Convert the regular URL of a Video to a Embed URL
|
984 |
// Todo : Check
|
985 |
-
function pagelayer_video_url($source){
|
986 |
|
987 |
if (!empty($source)) {
|
988 |
|
@@ -990,6 +1010,7 @@ function pagelayer_video_url($source){
|
|
990 |
$source = str_replace('&', '&', $source);
|
991 |
$url = parse_url($source);
|
992 |
$videoSite ='';
|
|
|
993 |
|
994 |
$youtubeRegExp = '/youtube\.com|youtu\.be/is';
|
995 |
$vimeoRegExp = '/vimeo\.com/is';
|
@@ -1027,8 +1048,10 @@ function pagelayer_video_url($source){
|
|
1027 |
}
|
1028 |
|
1029 |
}
|
1030 |
-
|
1031 |
-
|
|
|
|
|
1032 |
|
1033 |
break;
|
1034 |
case 'vimeo':
|
@@ -1048,15 +1071,25 @@ function pagelayer_video_url($source){
|
|
1048 |
}
|
1049 |
|
1050 |
}
|
1051 |
-
|
1052 |
-
|
|
|
|
|
1053 |
|
1054 |
break;
|
1055 |
default:
|
1056 |
-
|
1057 |
-
|
|
|
|
|
1058 |
|
1059 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1060 |
|
1061 |
}
|
1062 |
}
|
@@ -1612,7 +1645,7 @@ function pagelayer_posts($params, $args = []){
|
|
1612 |
$data .= '<a href="'. get_the_permalink() .'">';
|
1613 |
|
1614 |
if(!empty($params['show_thumb'])){
|
1615 |
-
$data .= '<div class="pagelayer-wposts-thumb" style="background:url('.(has_post_thumbnail($postsquery->ID) ? get_the_post_thumbnail_url($postsquery->ID, $params['thumb_size']) : PAGELAYER_URL.'/images/no_screenshot.png').')"></div>';
|
1616 |
}
|
1617 |
/* if($params['show_thumb'] && has_post_thumbnail( $postsquery->ID )){
|
1618 |
$data .= get_the_post_thumbnail_url($postsquery->ID,$params['thumb_size']);
|
@@ -1703,6 +1736,8 @@ function pagelayer_posts($params, $args = []){
|
|
1703 |
$data .= '</div></div></div>';
|
1704 |
endwhile;
|
1705 |
|
|
|
|
|
1706 |
return $data;
|
1707 |
}
|
1708 |
|
@@ -2249,7 +2284,7 @@ function pagelayer_export_media($parsed){
|
|
2249 |
continue;
|
2250 |
}
|
2251 |
|
2252 |
-
$ids =
|
2253 |
$ret = [];
|
2254 |
|
2255 |
foreach($ids as $id){
|
@@ -3037,3 +3072,38 @@ function pagelayer_list_parents( $parent = 0, $level = 0, $post = null, $values=
|
|
3037 |
|
3038 |
return $values;
|
3039 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
'animation_styles' => __pl('animation_styles'),
|
723 |
'motion_effects' => __pl('Motion Effects'),
|
724 |
'responsive_styles' => __pl('responsive_styles'),
|
725 |
+
'attributes' => __pl('attributes'),
|
726 |
'custom_styles' => __pl('custom_styles'),
|
727 |
];
|
728 |
|
859 |
|
860 |
$ret = [];
|
861 |
|
862 |
+
if(!empty($id) && is_array($id)){
|
863 |
+
|
864 |
+
foreach($id as $key => $image){
|
865 |
+
$attachment = pagelayer_image(@$image);
|
866 |
+
if(!empty($attachment)){
|
867 |
+
foreach($attachment as $k => $v){
|
868 |
+
if($key == 'retina'){
|
869 |
+
$ret['retina-'.$k] = $v;
|
870 |
+
}else if($key == 'retina_mobile'){
|
871 |
+
$ret['retina-mobile-'.$k] = $v;
|
872 |
+
}else{
|
873 |
+
$ret[$k] = $v;
|
874 |
+
}
|
875 |
+
}
|
876 |
+
}
|
877 |
+
}
|
878 |
+
|
879 |
+
return $ret;
|
880 |
+
}
|
881 |
+
|
882 |
// External image ?
|
883 |
if(pagelayer_is_external_img($id)){
|
884 |
|
912 |
$alt = get_post_meta($id, '_wp_attachment_image_alt', true);
|
913 |
$alt = empty($alt) ? $image->post_excerpt : $alt;
|
914 |
$alt = empty($alt) ? $image->post_title : $alt;
|
915 |
+
$alt = empty($alt) ? '' : esc_attr(trim(strip_tags($alt)));
|
916 |
$link = get_attachment_link($id);
|
917 |
$caption = wp_get_attachment_caption($id);
|
918 |
+
$caption = !empty($caption) ? esc_attr($caption) : '';
|
919 |
|
920 |
}
|
921 |
|
1002 |
|
1003 |
// Convert the regular URL of a Video to a Embed URL
|
1004 |
// Todo : Check
|
1005 |
+
function pagelayer_video_url($source, $no_url = false){
|
1006 |
|
1007 |
if (!empty($source)) {
|
1008 |
|
1010 |
$source = str_replace('&', '&', $source);
|
1011 |
$url = parse_url($source);
|
1012 |
$videoSite ='';
|
1013 |
+
$vid_atts = [];
|
1014 |
|
1015 |
$youtubeRegExp = '/youtube\.com|youtu\.be/is';
|
1016 |
$vimeoRegExp = '/vimeo\.com/is';
|
1048 |
}
|
1049 |
|
1050 |
}
|
1051 |
+
|
1052 |
+
$vid_atts['type'] = 'youtube';
|
1053 |
+
$vid_atts['src'] = '//youtube.com/embed/'.$videoId;
|
1054 |
+
$vid_atts['id'] = $videoId;
|
1055 |
|
1056 |
break;
|
1057 |
case 'vimeo':
|
1071 |
}
|
1072 |
|
1073 |
}
|
1074 |
+
|
1075 |
+
$vid_atts['type'] = 'vimeo';
|
1076 |
+
$vid_atts['src'] = '//player.vimeo.com/video/'.$videoId;
|
1077 |
+
$vid_atts['id'] = $videoId;
|
1078 |
|
1079 |
break;
|
1080 |
default:
|
1081 |
+
|
1082 |
+
$vid_atts['type'] = 'local';
|
1083 |
+
$vid_atts['src'] = $source;
|
1084 |
+
$vid_atts['id'] = '';
|
1085 |
|
1086 |
}
|
1087 |
+
|
1088 |
+
if(!$no_url){
|
1089 |
+
return $vid_atts['src'];
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
return $vid_atts;
|
1093 |
|
1094 |
}
|
1095 |
}
|
1645 |
$data .= '<a href="'. get_the_permalink() .'">';
|
1646 |
|
1647 |
if(!empty($params['show_thumb'])){
|
1648 |
+
$data .= '<div class="pagelayer-wposts-thumb" style="background:url('.(has_post_thumbnail($postsquery->ID) ? get_the_post_thumbnail_url($postsquery->ID, $params['thumb_size']) : ( empty($params['thumb_img_type']) || empty($params['def_thumb_img']) ? PAGELAYER_URL.'/images/no_screenshot.png' : $params['def_thumb_img']) ).')"></div>';
|
1649 |
}
|
1650 |
/* if($params['show_thumb'] && has_post_thumbnail( $postsquery->ID )){
|
1651 |
$data .= get_the_post_thumbnail_url($postsquery->ID,$params['thumb_size']);
|
1736 |
$data .= '</div></div></div>';
|
1737 |
endwhile;
|
1738 |
|
1739 |
+
wp_reset_postdata();
|
1740 |
+
|
1741 |
return $data;
|
1742 |
}
|
1743 |
|
2284 |
continue;
|
2285 |
}
|
2286 |
|
2287 |
+
$ids = pagelayer_maybe_explode(',', $v['attrs'][$kk]);
|
2288 |
$ret = [];
|
2289 |
|
2290 |
foreach($ids as $id){
|
3072 |
|
3073 |
return $values;
|
3074 |
}
|
3075 |
+
|
3076 |
+
// Maybe explode
|
3077 |
+
function pagelayer_maybe_explode( $separator = ',', $string = '', $limit = PHP_INT_MAX ){
|
3078 |
+
|
3079 |
+
if(is_array($string)){
|
3080 |
+
return $string;
|
3081 |
+
}
|
3082 |
+
|
3083 |
+
return explode($separator, $string, $limit);
|
3084 |
+
}
|
3085 |
+
|
3086 |
+
// Maybe implode
|
3087 |
+
function pagelayer_maybe_implode($array, $separator = ','){
|
3088 |
+
|
3089 |
+
if(is_array($array)){
|
3090 |
+
return implode($separator, $array);
|
3091 |
+
}
|
3092 |
+
|
3093 |
+
return $array;
|
3094 |
+
|
3095 |
+
}
|
3096 |
+
|
3097 |
+
// Sanitize text field or array
|
3098 |
+
function pagelayer_sanitize_text_field($str) {
|
3099 |
+
|
3100 |
+
if ( !is_object( $str ) && !is_array( $str ) ) {
|
3101 |
+
return sanitize_text_field($str);
|
3102 |
+
}
|
3103 |
+
|
3104 |
+
if( is_array($str) ){
|
3105 |
+
return array_map( 'pagelayer_sanitize_text_field', $str);
|
3106 |
+
}
|
3107 |
+
|
3108 |
+
return $str;
|
3109 |
+
}
|
@@ -540,10 +540,10 @@ global $pagelayer, $pl_error, $sitepad;
|
|
540 |
|
541 |
$dest_dir = $pagelayer_theme_path.'/images';
|
542 |
$dest_file = $dest_dir.'/'.$k;
|
543 |
-
$image_file =
|
544 |
|
545 |
// Compare image md5
|
546 |
-
if($v['md5'] !=
|
547 |
continue;
|
548 |
}
|
549 |
|
540 |
|
541 |
$dest_dir = $pagelayer_theme_path.'/images';
|
542 |
$dest_file = $dest_dir.'/'.$k;
|
543 |
+
$image_file = $v['download_url'];
|
544 |
|
545 |
// Compare image md5
|
546 |
+
if($v['md5'] != md5_file($image_file)){
|
547 |
continue;
|
548 |
}
|
549 |
|
@@ -51,7 +51,7 @@ class PageLayer_LiveEditor{
|
|
51 |
$scmd5 = md5(json_encode($pagelayer->shortcodes).json_encode($pagelayer->groups).json_encode($pagelayer->styles));
|
52 |
|
53 |
// Enqueue our Editor's JS
|
54 |
-
wp_register_script('pagelayer-editor', admin_url( 'admin-ajax.php?action=pagelayer_givejs' ).'&give=pagelayer-editor.js,widgets.js,'.(defined('PAGELAYER_PREMIUM') ? 'premium.js,' : '').'properties.js,base-64.min.js,slimscroll.js,vanilla-picker.min.js,trumbowyg.js,trumbowyg.fontfamily.js,trumbowyg-pagelayer.js,
|
55 |
|
56 |
wp_enqueue_script('pagelayer-editor');
|
57 |
|
@@ -61,7 +61,7 @@ class PageLayer_LiveEditor{
|
|
61 |
}
|
62 |
|
63 |
// Enqueue the Editor's CSS
|
64 |
-
wp_register_style('pagelayer-editor', $css_url.'give=pagelayer-editor-frontend.css,pen.css'.(defined('PAGELAYER_PREMIUM') ? ',owl.theme.default.min.css,owl.carousel.min.css' : ''), array(), PAGELAYER_VERSION);
|
65 |
wp_enqueue_style('pagelayer-editor');
|
66 |
|
67 |
// Enqueue the DateTime picker CSS
|
@@ -159,6 +159,7 @@ pagelayer_post_tags = '.json_encode(pagelayer_post_tags($post)).';
|
|
159 |
pagelayer_shortcodes.pl_post_props.name = "'.ucfirst($post_type_name).' '. __pl('Settings').'";
|
160 |
pagelayer_shortcodes.pl_post_props.params.post_author.list = '.json_encode(pagelayer_post_authors_by_type($post->post_type)).';
|
161 |
pagelayer_shortcodes.pl_post_props.pageParent.post_parent.list = '.json_encode(pagelayer_parent_post_prop($post)).';
|
|
|
162 |
pagelayer_ajax_post_data = {};';
|
163 |
|
164 |
// Detect JS via givejs for better performance
|
51 |
$scmd5 = md5(json_encode($pagelayer->shortcodes).json_encode($pagelayer->groups).json_encode($pagelayer->styles));
|
52 |
|
53 |
// Enqueue our Editor's JS
|
54 |
+
wp_register_script('pagelayer-editor', admin_url( 'admin-ajax.php?action=pagelayer_givejs' ).'&give=pagelayer-editor.js,widgets.js,'.(defined('PAGELAYER_PREMIUM') ? 'premium.js,' : '').'properties.js,base-64.min.js,slimscroll.js,vanilla-picker.min.js,trumbowyg.js,trumbowyg.fontfamily.js,trumbowyg-pagelayer.js,tlite.min.js,pagelayer-pen.js,&pagelayer_nonce=1&scmd5='.$scmd5, array('jquery'), PAGELAYER_VERSION);
|
55 |
|
56 |
wp_enqueue_script('pagelayer-editor');
|
57 |
|
61 |
}
|
62 |
|
63 |
// Enqueue the Editor's CSS
|
64 |
+
wp_register_style('pagelayer-editor', $css_url.'give=pagelayer-editor-frontend.css,pagelayer-pen.css,'.(defined('PAGELAYER_PREMIUM') ? ',owl.theme.default.min.css,owl.carousel.min.css' : ''), array(), PAGELAYER_VERSION);
|
65 |
wp_enqueue_style('pagelayer-editor');
|
66 |
|
67 |
// Enqueue the DateTime picker CSS
|
159 |
pagelayer_shortcodes.pl_post_props.name = "'.ucfirst($post_type_name).' '. __pl('Settings').'";
|
160 |
pagelayer_shortcodes.pl_post_props.params.post_author.list = '.json_encode(pagelayer_post_authors_by_type($post->post_type)).';
|
161 |
pagelayer_shortcodes.pl_post_props.pageParent.post_parent.list = '.json_encode(pagelayer_parent_post_prop($post)).';
|
162 |
+
pagelayer_gmaps_key = "'.get_option('pagelayer-gmaps-api-key').'";
|
163 |
pagelayer_ajax_post_data = {};';
|
164 |
|
165 |
// Detect JS via givejs for better performance
|
@@ -234,6 +234,16 @@ function pagelayer_settings_page(){
|
|
234 |
$done = 1;
|
235 |
|
236 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
if(defined('PAGELAYER_PREMIUM')){
|
239 |
|
@@ -483,8 +493,8 @@ function pagelayer_settings_page(){
|
|
483 |
?>
|
484 |
<a href="#icons" class="nav-tab "><?php _e('Enable Icons');?></a>
|
485 |
<a href="#social" class="nav-tab"><?php _e('Information');?></a>
|
486 |
-
<?php if(defined('PAGELAYER_PREMIUM')){ ?>
|
487 |
<a href="#integration" class="nav-tab"><?php _e('Integrations');?></a>
|
|
|
488 |
<a href="#contactform" class="nav-tab "><?php _e('Contact Form');?></a>
|
489 |
<a href="#captcha" class="nav-tab "><?php _e('Google Captcha');?></a>
|
490 |
<?php
|
@@ -635,20 +645,38 @@ function pagelayer_settings_page(){
|
|
635 |
<?php } ?>
|
636 |
</div>
|
637 |
</div>
|
638 |
-
<?php if(defined('PAGELAYER_PREMIUM')){ ?>
|
639 |
<div class="pagelayer-tab-panel" id="integration">
|
640 |
-
|
641 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
642 |
</div>
|
643 |
-
<table>
|
644 |
-
<tr>
|
645 |
-
<th><?php _e('App ID');?></th>
|
646 |
-
<td><input type="text" name="pagelayer-fbapp-id" class="pagelayer-app-id" <?php if(get_option('pagelayer-fbapp-id')){
|
647 |
-
echo 'value="'.get_option('pagelayer-fbapp-id').'"';
|
648 |
-
}?>/></td>
|
649 |
-
</tr>
|
650 |
-
</table>
|
651 |
</div>
|
|
|
652 |
<div class="pagelayer-tab-panel pagelayer-cf" id="contactform">
|
653 |
<table>
|
654 |
<tr>
|
234 |
$done = 1;
|
235 |
|
236 |
}
|
237 |
+
|
238 |
+
if(isset($_POST['pagelayer-gmaps-api-key'])){
|
239 |
+
|
240 |
+
$maps_id = $_REQUEST['pagelayer-gmaps-api-key'];
|
241 |
+
|
242 |
+
update_option( 'pagelayer-gmaps-api-key', $maps_id );
|
243 |
+
|
244 |
+
$done = 1;
|
245 |
+
|
246 |
+
}
|
247 |
|
248 |
if(defined('PAGELAYER_PREMIUM')){
|
249 |
|
493 |
?>
|
494 |
<a href="#icons" class="nav-tab "><?php _e('Enable Icons');?></a>
|
495 |
<a href="#social" class="nav-tab"><?php _e('Information');?></a>
|
|
|
496 |
<a href="#integration" class="nav-tab"><?php _e('Integrations');?></a>
|
497 |
+
<?php if(defined('PAGELAYER_PREMIUM')){ ?>
|
498 |
<a href="#contactform" class="nav-tab "><?php _e('Contact Form');?></a>
|
499 |
<a href="#captcha" class="nav-tab "><?php _e('Google Captcha');?></a>
|
500 |
<?php
|
645 |
<?php } ?>
|
646 |
</div>
|
647 |
</div>
|
|
|
648 |
<div class="pagelayer-tab-panel" id="integration">
|
649 |
+
<?php if(defined('PAGELAYER_PREMIUM')){ ?>
|
650 |
+
<div style="margin:50px auto">
|
651 |
+
<div class="pagelayer-title">
|
652 |
+
<h2><?php _e('Facebook SDK Details');?></h2>
|
653 |
+
</div>
|
654 |
+
<table>
|
655 |
+
<tr>
|
656 |
+
<th><?php _e('App ID');?></th>
|
657 |
+
<td><input type="text" name="pagelayer-fbapp-id" class="pagelayer-app-id" <?php if(get_option('pagelayer-fbapp-id')){
|
658 |
+
echo 'value="'.get_option('pagelayer-fbapp-id').'"';
|
659 |
+
}?>/></td>
|
660 |
+
</tr>
|
661 |
+
</table>
|
662 |
+
</div>
|
663 |
+
<hr>
|
664 |
+
<?php } ?>
|
665 |
+
<div style="margin:50px auto">
|
666 |
+
<div class="pagelayer-title">
|
667 |
+
<h2><?php _e('Google Maps API Key'); ?></h2>
|
668 |
+
</div>
|
669 |
+
<table>
|
670 |
+
<tr>
|
671 |
+
<th style="vertical-align:top"><?php _e('Project ID');?></th>
|
672 |
+
<td><input type="text" name="pagelayer-gmaps-api-key" class="pagelayer-gmaps-api-key" <?php if(get_option('pagelayer-gmaps-api-key')){
|
673 |
+
echo 'value="'.get_option('pagelayer-gmaps-api-key').'"';
|
674 |
+
}?>/><p><?php _e('Insert google maps API key. <a href="https://pagelayer.com/docs/pagelayer-widgets/google-maps/"><strong>CLICK HERE</strong></a> to get help in getting API key.') ?></p></td>
|
675 |
+
</tr>
|
676 |
+
</table>
|
677 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
</div>
|
679 |
+
<?php if(defined('PAGELAYER_PREMIUM')){ ?>
|
680 |
<div class="pagelayer-tab-panel pagelayer-cf" id="contactform">
|
681 |
<table>
|
682 |
<tr>
|
@@ -255,7 +255,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
255 |
// Load any attachment values - This should go on top in the newer version @TODO
|
256 |
if($param['type'] == 'multi_image'){
|
257 |
|
258 |
-
$img_ids =
|
259 |
$img_urls = [];
|
260 |
|
261 |
// Make the image URL
|
@@ -287,8 +287,13 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
287 |
}
|
288 |
|
289 |
// Backward compatibility of Box Shadow
|
290 |
-
if($param['type'] == 'box_shadow' && !empty($el['atts'][$prop])
|
291 |
-
$
|
|
|
|
|
|
|
|
|
|
|
292 |
}
|
293 |
|
294 |
// Backward compatibility of units. And also for the default set value if it is numeric
|
@@ -393,7 +398,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
393 |
|
394 |
$M_prop = $prop.$mv;
|
395 |
if($param['type'] == 'typography' && !empty($el['atts'][$M_prop])){
|
396 |
-
$val =
|
397 |
|
398 |
if(!empty($val[0])){
|
399 |
$font_weight = empty($val[3]) ? 400 : $val[3];
|
@@ -771,13 +776,13 @@ function pagelayer_parse_vars($str, &$el){
|
|
771 |
//pagelayer_print($el);
|
772 |
if(is_array($el['tmp'])){
|
773 |
foreach($el['tmp'] as $k => $v){
|
774 |
-
$str = str_replace('{{{'.$k.'}}}', $el['tmp'][$k], $str);
|
775 |
}
|
776 |
}
|
777 |
|
778 |
if(is_array($el['atts'])){
|
779 |
foreach($el['atts'] as $k => $v){
|
780 |
-
$str = str_replace('{{'.$k.'}}', $el['atts'][$k], $str);
|
781 |
}
|
782 |
}
|
783 |
|
@@ -790,6 +795,10 @@ function pagelayer_css_render($rule, $val, $sep = ','){
|
|
790 |
// Seperator
|
791 |
$sep = empty($sep) ? ',' : $sep;
|
792 |
|
|
|
|
|
|
|
|
|
793 |
// Replace the val
|
794 |
$rule = str_replace('{{val}}', pagelayer_hex8_to_rgba($val), $rule);
|
795 |
|
@@ -829,15 +838,13 @@ function pagelayer_sc_post_props(&$el){
|
|
829 |
$tag_name = pagelayer_post_type_tag($post->post_type);
|
830 |
if(!empty($tag_name)){
|
831 |
$postTags = wp_get_post_terms( $post->ID, $tag_name );
|
832 |
-
$
|
833 |
-
$el['oAtts']['post_tags'] = implode(',', $names);
|
834 |
}
|
835 |
|
836 |
$cat_name = pagelayer_post_type_category($post->post_type);
|
837 |
if(!empty($cat_name)){
|
838 |
$category = get_the_terms( $post->ID, $cat_name );
|
839 |
-
$
|
840 |
-
$el['oAtts']['post_category'] = implode(',', $ids);
|
841 |
}
|
842 |
|
843 |
// Load featured image details
|
@@ -872,7 +879,7 @@ function pagelayer_sc_row(&$el){
|
|
872 |
|
873 |
// Row background slider
|
874 |
if(!empty($el['atts']['bg_slider'])){
|
875 |
-
$ids =
|
876 |
$urls = [];
|
877 |
$el['atts']['slider'] = '';
|
878 |
|
@@ -891,6 +898,13 @@ function pagelayer_sc_row(&$el){
|
|
891 |
}
|
892 |
|
893 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
894 |
}
|
895 |
|
896 |
// Column Handler
|
@@ -905,7 +919,7 @@ function pagelayer_sc_col(&$el){
|
|
905 |
|
906 |
// Column background slider
|
907 |
if(!empty($el['atts']['bg_slider'])){
|
908 |
-
$ids =
|
909 |
$urls = [];
|
910 |
$el['atts']['slider'] = '';
|
911 |
|
@@ -925,6 +939,12 @@ function pagelayer_sc_col(&$el){
|
|
925 |
|
926 |
}
|
927 |
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
}
|
929 |
|
930 |
// Just for BG handling
|
@@ -935,69 +955,42 @@ function pagelayer_bg_video(&$el){
|
|
935 |
}
|
936 |
|
937 |
// Get the video URL for the iframe
|
938 |
-
$
|
939 |
|
940 |
$source = esc_url( $el['tmp']['bg_video_src-url'] );
|
941 |
$source = str_replace('&', '&', $source);
|
942 |
$url = parse_url($source);
|
943 |
-
|
944 |
-
$youtubeRegExp = '/youtube\.com|youtu\.be/is';
|
945 |
-
$vimeoRegExp = '/vimeo\.com/is';
|
946 |
|
947 |
if(!empty($el['atts']['mute'])){
|
948 |
-
$
|
949 |
$el['atts']['mute'] = " muted ";
|
950 |
}else{
|
951 |
-
$
|
952 |
$el['atts']['mute'] = "";
|
953 |
}
|
954 |
|
955 |
if(empty($el['atts']['stop_loop'])){
|
956 |
-
$
|
957 |
$el['atts']['stop_loop'] = " loop ";
|
958 |
}else{
|
959 |
-
$
|
960 |
$el['atts']['stop_loop'] = "";
|
961 |
}
|
962 |
|
963 |
if (!empty($source)) {
|
964 |
|
965 |
-
if (
|
966 |
-
if (preg_match('/youtube\.com/is', $source)) {
|
967 |
-
|
968 |
-
if (preg_match('/watch/is', $source)) {
|
969 |
-
parse_str($url['query'], $parameters);
|
970 |
-
|
971 |
-
if (isset($parameters['v']) && !empty($parameters['v'])) {
|
972 |
-
$videoId = $parameters['v'];
|
973 |
-
}
|
974 |
-
|
975 |
-
} else if (preg_match('/embed/is', $url['path'])) {
|
976 |
-
$path = explode('/', $url['path']);
|
977 |
-
if (isset($path[2]) && !empty($path[2])) {
|
978 |
-
$videoId = $path[2];
|
979 |
-
}
|
980 |
-
}
|
981 |
-
|
982 |
-
} else if (preg_match('/youtu\.be/is', $url['host'])) {
|
983 |
-
$path = explode('/', $url['path']);
|
984 |
-
|
985 |
-
if (isset($path[1]) && !empty($path[1])) {
|
986 |
-
$videoId = $path[1];
|
987 |
-
}
|
988 |
-
|
989 |
-
}
|
990 |
|
991 |
-
$el['atts']['vid_src'] = '<iframe src="'.$
|
992 |
|
993 |
-
} else if (
|
994 |
|
995 |
-
$el['atts']['vid_src'] = '<iframe src="'.$
|
996 |
|
997 |
}else{
|
998 |
|
999 |
$el['atts']['vid_src'] = '<video autoplay playsinline '.$el['atts']['mute'].$el['atts']['stop_loop'].'>'.
|
1000 |
-
'<source src="'.$
|
1001 |
'</video>';
|
1002 |
|
1003 |
}
|
@@ -1017,7 +1010,15 @@ function pagelayer_sc_image(&$el){
|
|
1017 |
// Decide the image URL
|
1018 |
$el['atts']['func_id'] = @$el['tmp']['id-'.$el['atts']['id-size'].'-url'];
|
1019 |
$el['atts']['func_id'] = empty($el['atts']['func_id']) ? @$el['tmp']['id-url'] : $el['atts']['func_id'];
|
|
|
1020 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1021 |
// What is the link ?
|
1022 |
if(!empty($el['atts']['link_type'])){
|
1023 |
|
@@ -1049,7 +1050,7 @@ function pagelayer_sc_image_slider(&$el){
|
|
1049 |
$el['atts']['ids'] = '';
|
1050 |
}
|
1051 |
|
1052 |
-
$ids =
|
1053 |
$urls = [];
|
1054 |
$all_urls = [];
|
1055 |
$final_urls = [];
|
@@ -1122,7 +1123,7 @@ function pagelayer_sc_grid_gallery(&$el){
|
|
1122 |
$el['atts']['ids'] = '';
|
1123 |
}
|
1124 |
|
1125 |
-
$ids =
|
1126 |
$urls = [];
|
1127 |
$all_urls = [];
|
1128 |
$final_urls = [];
|
@@ -1246,26 +1247,17 @@ function pagelayer_sc_video(&$el){
|
|
1246 |
$el['atts']['video_overlay_image-url'] = empty($el['atts']['video_overlay_image-url']) ? $el['atts']['video_overlay_image'] : $el['atts']['video_overlay_image-url'];
|
1247 |
|
1248 |
// Get the video URL for the iframe
|
1249 |
-
$
|
1250 |
|
1251 |
-
|
1252 |
-
$el['atts']['vid_src'] .="?&autoplay=1";
|
1253 |
-
}else{
|
1254 |
-
$el['atts']['vid_src'] .="?&autoplay=0";
|
1255 |
-
}
|
1256 |
-
|
1257 |
-
if(!empty($el['atts']['mute'])){
|
1258 |
-
$el['atts']['vid_src'] .="&mute=1";
|
1259 |
-
}else{
|
1260 |
-
$el['atts']['vid_src'] .="&mute=0";
|
1261 |
-
}
|
1262 |
-
|
1263 |
-
if(!empty($el['atts']['loop'])){
|
1264 |
-
$el['atts']['vid_src'] .="&loop=1";
|
1265 |
-
}else{
|
1266 |
-
$el['atts']['vid_src'] .="&loop=0";
|
1267 |
-
}
|
1268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1269 |
$el['tmp']['ele_id'] = $el['id'];
|
1270 |
|
1271 |
}
|
@@ -1299,12 +1291,79 @@ function pagelayer_sc_wp_widgets(&$el){
|
|
1299 |
// Service Handler
|
1300 |
function pagelayer_sc_service(&$el){
|
1301 |
|
1302 |
-
if(!empty($el['atts']['service_image'])){
|
|
|
|
|
1303 |
$el['atts']['func_image'] = @$el['tmp']['service_image-'.$el['atts']['service_image_size'].'-url'];
|
1304 |
$el['atts']['func_image'] = empty($el['atts']['func_image']) ? @$el['tmp']['service_image-url'] : $el['atts']['func_image'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1305 |
}
|
1306 |
}
|
1307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1308 |
/*pagelayer_print($atts);
|
1309 |
pagelayer_print($content);
|
1310 |
die();*/
|
@@ -1325,3 +1384,21 @@ function pagelayer_font_family(){
|
|
1325 |
function pagelayer_icon_class_list(){
|
1326 |
return array();
|
1327 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
// Load any attachment values - This should go on top in the newer version @TODO
|
256 |
if($param['type'] == 'multi_image'){
|
257 |
|
258 |
+
$img_ids = pagelayer_maybe_explode(',', $el['atts'][$prop]);
|
259 |
$img_urls = [];
|
260 |
|
261 |
// Make the image URL
|
287 |
}
|
288 |
|
289 |
// Backward compatibility of Box Shadow
|
290 |
+
if($param['type'] == 'box_shadow' && !empty($el['atts'][$prop])){
|
291 |
+
$shadow_atts = pagelayer_maybe_explode(',', $el['atts'][$prop]);
|
292 |
+
if(count($shadow_atts) == 4){
|
293 |
+
$shadow_atts[] = '0';
|
294 |
+
$shadow_atts[] = '';
|
295 |
+
$el['atts'][$prop] = $el['oAtts'][$prop] = $shadow_atts;
|
296 |
+
}
|
297 |
}
|
298 |
|
299 |
// Backward compatibility of units. And also for the default set value if it is numeric
|
398 |
|
399 |
$M_prop = $prop.$mv;
|
400 |
if($param['type'] == 'typography' && !empty($el['atts'][$M_prop])){
|
401 |
+
$val = pagelayer_maybe_explode(',', $el['atts'][$M_prop]);
|
402 |
|
403 |
if(!empty($val[0])){
|
404 |
$font_weight = empty($val[3]) ? 400 : $val[3];
|
776 |
//pagelayer_print($el);
|
777 |
if(is_array($el['tmp'])){
|
778 |
foreach($el['tmp'] as $k => $v){
|
779 |
+
$str = str_replace('{{{'.$k.'}}}', pagelayer_maybe_implode($el['tmp'][$k]), $str);
|
780 |
}
|
781 |
}
|
782 |
|
783 |
if(is_array($el['atts'])){
|
784 |
foreach($el['atts'] as $k => $v){
|
785 |
+
$str = str_replace('{{'.$k.'}}', pagelayer_maybe_implode($el['atts'][$k]), $str);
|
786 |
}
|
787 |
}
|
788 |
|
795 |
// Seperator
|
796 |
$sep = empty($sep) ? ',' : $sep;
|
797 |
|
798 |
+
if(is_array($val)){
|
799 |
+
$val = implode($sep, $val);
|
800 |
+
}
|
801 |
+
|
802 |
// Replace the val
|
803 |
$rule = str_replace('{{val}}', pagelayer_hex8_to_rgba($val), $rule);
|
804 |
|
838 |
$tag_name = pagelayer_post_type_tag($post->post_type);
|
839 |
if(!empty($tag_name)){
|
840 |
$postTags = wp_get_post_terms( $post->ID, $tag_name );
|
841 |
+
$el['oAtts']['post_tags'] = array_column((array)$postTags, 'name');
|
|
|
842 |
}
|
843 |
|
844 |
$cat_name = pagelayer_post_type_category($post->post_type);
|
845 |
if(!empty($cat_name)){
|
846 |
$category = get_the_terms( $post->ID, $cat_name );
|
847 |
+
$el['oAtts']['post_category'] = array_column((array)$category, 'term_id');
|
|
|
848 |
}
|
849 |
|
850 |
// Load featured image details
|
879 |
|
880 |
// Row background slider
|
881 |
if(!empty($el['atts']['bg_slider'])){
|
882 |
+
$ids = pagelayer_maybe_explode(',', $el['atts']['bg_slider']);
|
883 |
$urls = [];
|
884 |
$el['atts']['slider'] = '';
|
885 |
|
898 |
}
|
899 |
|
900 |
}
|
901 |
+
|
902 |
+
// Row background parallax image.
|
903 |
+
if(!empty($el['atts']['parallax_img'])){
|
904 |
+
$img_size = @$el['tmp']['parallax_img-'.$el['atts']['parallax_id_size'].'-url'];
|
905 |
+
$el['atts']['parallax_img_src'] = empty($img_size) ? @$el['tmp']['parallax_img-url'] : $img_size;
|
906 |
+
}
|
907 |
+
|
908 |
}
|
909 |
|
910 |
// Column Handler
|
919 |
|
920 |
// Column background slider
|
921 |
if(!empty($el['atts']['bg_slider'])){
|
922 |
+
$ids = pagelayer_maybe_explode(',', $el['atts']['bg_slider']);
|
923 |
$urls = [];
|
924 |
$el['atts']['slider'] = '';
|
925 |
|
939 |
|
940 |
}
|
941 |
|
942 |
+
// Col background parallax image.
|
943 |
+
if(!empty($el['atts']['parallax_img'])){
|
944 |
+
$img_size = @$el['tmp']['parallax_img-'.$el['atts']['parallax_id_size'].'-url'];
|
945 |
+
$el['atts']['parallax_img_src'] = empty($img_size) ? @$el['tmp']['parallax_img-url'] : $img_size;
|
946 |
+
}
|
947 |
+
|
948 |
}
|
949 |
|
950 |
// Just for BG handling
|
955 |
}
|
956 |
|
957 |
// Get the video URL for the iframe
|
958 |
+
$iframe_atts = pagelayer_video_url($el['tmp']['bg_video_src-url'], true);
|
959 |
|
960 |
$source = esc_url( $el['tmp']['bg_video_src-url'] );
|
961 |
$source = str_replace('&', '&', $source);
|
962 |
$url = parse_url($source);
|
|
|
|
|
|
|
963 |
|
964 |
if(!empty($el['atts']['mute'])){
|
965 |
+
$iframe_atts['src'] .= "?&mute=1";
|
966 |
$el['atts']['mute'] = " muted ";
|
967 |
}else{
|
968 |
+
$iframe_atts['src'] .= "?&mute=0";
|
969 |
$el['atts']['mute'] = "";
|
970 |
}
|
971 |
|
972 |
if(empty($el['atts']['stop_loop'])){
|
973 |
+
$iframe_atts['src'] .= "&loop=1";
|
974 |
$el['atts']['stop_loop'] = " loop ";
|
975 |
}else{
|
976 |
+
$iframe_atts['src'] .= "&loop=0";
|
977 |
$el['atts']['stop_loop'] = "";
|
978 |
}
|
979 |
|
980 |
if (!empty($source)) {
|
981 |
|
982 |
+
if ($iframe_atts['src'] == 'youtube') {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
983 |
|
984 |
+
$el['atts']['vid_src'] = '<iframe src="'.$iframe_atts['src'].'&autoplay=1&controls=0&showinfo=0&rel=0&autohide=1&playlist='.$iframe_atts['id'].'" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
985 |
|
986 |
+
} else if ($iframe_atts['src'] == 'vimeo') {
|
987 |
|
988 |
+
$el['atts']['vid_src'] = '<iframe src="'.$iframe_atts['src'].'&background=1&autoplay=1&byline=0&title=0" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
989 |
|
990 |
}else{
|
991 |
|
992 |
$el['atts']['vid_src'] = '<video autoplay playsinline '.$el['atts']['mute'].$el['atts']['stop_loop'].'>'.
|
993 |
+
'<source src="'.$iframe_atts['src'].'" type="video/mp4">'.
|
994 |
'</video>';
|
995 |
|
996 |
}
|
1010 |
// Decide the image URL
|
1011 |
$el['atts']['func_id'] = @$el['tmp']['id-'.$el['atts']['id-size'].'-url'];
|
1012 |
$el['atts']['func_id'] = empty($el['atts']['func_id']) ? @$el['tmp']['id-url'] : $el['atts']['func_id'];
|
1013 |
+
$el['atts']['pagelayer-srcset'] = $el['atts']['func_id'].', '.$el['atts']['func_id'].' 1x, ';
|
1014 |
|
1015 |
+
$image_atts = array(
|
1016 |
+
'name' => 'id',
|
1017 |
+
'size' => 'id-size'
|
1018 |
+
);
|
1019 |
+
|
1020 |
+
pagelayer_get_img_srcset($el, $image_atts);
|
1021 |
+
|
1022 |
// What is the link ?
|
1023 |
if(!empty($el['atts']['link_type'])){
|
1024 |
|
1050 |
$el['atts']['ids'] = '';
|
1051 |
}
|
1052 |
|
1053 |
+
$ids = pagelayer_maybe_explode(',', $el['atts']['ids']);
|
1054 |
$urls = [];
|
1055 |
$all_urls = [];
|
1056 |
$final_urls = [];
|
1123 |
$el['atts']['ids'] = '';
|
1124 |
}
|
1125 |
|
1126 |
+
$ids = pagelayer_maybe_explode(',', $el['atts']['ids']);
|
1127 |
$urls = [];
|
1128 |
$all_urls = [];
|
1129 |
$final_urls = [];
|
1247 |
$el['atts']['video_overlay_image-url'] = empty($el['atts']['video_overlay_image-url']) ? $el['atts']['video_overlay_image'] : $el['atts']['video_overlay_image-url'];
|
1248 |
|
1249 |
// Get the video URL for the iframe
|
1250 |
+
$vid_atts = pagelayer_video_url($el['tmp']['src-url'], true);
|
1251 |
|
1252 |
+
$vid_atts['src'] .= !empty($el['atts']['autoplay']) ? '?&autoplay=1' : '?&autoplay=0' ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1253 |
|
1254 |
+
$mute = !empty($el['atts']['mute']) ? 1 : 0;
|
1255 |
+
$vid_atts['src'] .='&'.($vid_atts['type'] == 'vimeo' ? 'muted' : 'mute').'='.$mute;
|
1256 |
+
|
1257 |
+
$vid_atts['src'] .= !empty($el['atts']['loop']) == 'true' ? '&loop=1' : '&loop=0' ;
|
1258 |
+
|
1259 |
+
$el['atts']['vid_src'] = $vid_atts['src'].($vid_atts['type'] == 'youtube' ? '&playlist='.$vid_atts['id'] : '');
|
1260 |
+
|
1261 |
$el['tmp']['ele_id'] = $el['id'];
|
1262 |
|
1263 |
}
|
1291 |
// Service Handler
|
1292 |
function pagelayer_sc_service(&$el){
|
1293 |
|
1294 |
+
if(!empty($el['atts']['service_image'])){
|
1295 |
+
|
1296 |
+
// Decide the image URL
|
1297 |
$el['atts']['func_image'] = @$el['tmp']['service_image-'.$el['atts']['service_image_size'].'-url'];
|
1298 |
$el['atts']['func_image'] = empty($el['atts']['func_image']) ? @$el['tmp']['service_image-url'] : $el['atts']['func_image'];
|
1299 |
+
$el['atts']['pagelayer-srcset'] = $el['atts']['func_image'].', '.$el['atts']['func_image'].' 1x, ';
|
1300 |
+
|
1301 |
+
$image_atts = array(
|
1302 |
+
'name' => 'service_image',
|
1303 |
+
'size' => 'service_image_size'
|
1304 |
+
);
|
1305 |
+
|
1306 |
+
pagelayer_get_img_srcset($el, $image_atts);
|
1307 |
+
|
1308 |
}
|
1309 |
}
|
1310 |
|
1311 |
+
function pagelayer_sc_google_maps(&$el){
|
1312 |
+
|
1313 |
+
$el['atts']['show_v2'] = true;
|
1314 |
+
|
1315 |
+
if(empty($el['atts']['api_version'])){
|
1316 |
+
$el['atts']['src_code'] = '';
|
1317 |
+
return;
|
1318 |
+
}
|
1319 |
+
|
1320 |
+
$el['atts']['show_v2'] = false;
|
1321 |
+
$api_key = @$el['atts']['api_key'];
|
1322 |
+
|
1323 |
+
if( empty($api_key) && !empty(get_option('pagelayer-gmaps-api-key')) ){
|
1324 |
+
$api_key = get_option('pagelayer-gmaps-api-key');
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
if($el['atts']['map_modes'] == 'view'){
|
1328 |
+
$el['atts']['center'] = empty($el['atts']['center']) ? '-33.8569,151.2152' : $el['atts']['center'];
|
1329 |
+
}
|
1330 |
+
|
1331 |
+
$src_code = (empty($el['atts']['center']) ? '' : '¢er='.$el['atts']['center']).($el['atts']['map_modes'] == 'streetview' ? '' : '&maptype='.$el['atts']['map_type'].'&zoom='.$el['atts']['zoom']);
|
1332 |
+
|
1333 |
+
switch($el['atts']['map_modes']){
|
1334 |
+
case 'place':
|
1335 |
+
$src_code .= '&q='.(empty($el['atts']['address']) ? 'New York, New York, USA' : urlencode($el['atts']['address']) );
|
1336 |
+
break;
|
1337 |
+
|
1338 |
+
case 'directions':
|
1339 |
+
$src_code .= '&origin='.(empty($el['atts']['direction_origin']) ? 'Oslow Norway' : urlencode($el['atts']['direction_origin']) );
|
1340 |
+
$src_code .= '&destination='.(empty($el['atts']['direction_destination']) ? 'Telemark Norway' : urlencode($el['atts']['direction_destination']) );
|
1341 |
+
$src_code .= (empty($el['atts']['direction_waypoints']) ? '' : '&waypoints='.join('|', explode(' ', trim($el['atts']['direction_waypoints']))) );
|
1342 |
+
$src_code .= (empty($el['atts']['direction_modes']) ? '' : '&mode='.$el['atts']['direction_modes'] );
|
1343 |
+
$src_code .= (empty($el['atts']['direction_avoid']) ? '' : '&avoid='.join('|', explode(',', $el['atts']['direction_avoid'])) );
|
1344 |
+
$src_code .= (empty($el['atts']['direction_units']) ? '' : '&units='.$el['atts']['direction_units'] );
|
1345 |
+
break;
|
1346 |
+
|
1347 |
+
case 'streetview':
|
1348 |
+
$src_code .= '&pano='.(empty($el['atts']['streetview_pano']) ? 'eTnPNGoy4bxR9LpjjfFuOw' : $el['atts']['streetview_pano'] );
|
1349 |
+
$src_code .= '&location='.(empty($el['atts']['streetview_location']) ? '46.414382,10.013988' : $el['atts']['streetview_location'] );
|
1350 |
+
$src_code .= (empty($el['atts']['streetview_heading']) ? '' : '&heading='.$el['atts']['streetview_heading'] );
|
1351 |
+
$src_code .= (empty($el['atts']['streetview_pitch']) ? '' : '&pitch='.$el['atts']['streetview_pitch'] );
|
1352 |
+
$src_code .= (empty($el['atts']['streetview_fov']) ? '' : '&fov='.$el['atts']['streetview_fov'] );
|
1353 |
+
break;
|
1354 |
+
|
1355 |
+
case 'search':
|
1356 |
+
$src_code .= '&q='.(empty($el['atts']['search_term']) ? 'Record stores in Seattle' : urlencode($el['atts']['search_term']) );
|
1357 |
+
break;
|
1358 |
+
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
$src_iframe = 'https://www.google.com/maps/embed/v1/'.$el['atts']['map_modes'].'?key='.$api_key.$src_code;
|
1362 |
+
|
1363 |
+
$el['atts']['src_code'] = '<iframe width="600" height="450" style="border:0" loading="lazy" allowfullscreen src="'.$src_iframe.'"></iframe>';
|
1364 |
+
|
1365 |
+
}
|
1366 |
+
|
1367 |
/*pagelayer_print($atts);
|
1368 |
pagelayer_print($content);
|
1369 |
die();*/
|
1384 |
function pagelayer_icon_class_list(){
|
1385 |
return array();
|
1386 |
}
|
1387 |
+
|
1388 |
+
// Retina image setting attribute.
|
1389 |
+
function pagelayer_get_img_srcset(&$el, $image_atts){
|
1390 |
+
|
1391 |
+
// Check if retina images is set
|
1392 |
+
if(isset($el['tmp'][$image_atts['name'].'-retina-url']) && strpos($el['tmp'][$image_atts['name'].'-retina-url'],'default-image') == false){
|
1393 |
+
$retina_image = @$el['tmp'][$image_atts['name'].'-retina-'.$el['atts'][$image_atts['size']].'-url'];
|
1394 |
+
$retina_image = empty($retina_image) ? @$el['tmp'][$image_atts['name'].'-retina-url'] : $retina_image;
|
1395 |
+
$el['atts']['pagelayer-srcset'] .= $retina_image.' 2x, ';
|
1396 |
+
}
|
1397 |
+
|
1398 |
+
// Check if retina mobile images is set
|
1399 |
+
if(isset($el['tmp'][$image_atts['name'].'-retina-mobile-url']) && strpos($el['tmp'][$image_atts['name'].'-retina-mobile-url'],'default-image') == false){
|
1400 |
+
$retina_image_mobile = @$el['tmp'][$image_atts['name'].'-retina-mobile-'.$el['atts'][$image_atts['size']].'-url'];
|
1401 |
+
$retina_image_mobile = empty($retina_image_mobile) ? @$el['tmp'][$image_atts['name'].'-retina-mobile-url'] : $retina_image_mobile;
|
1402 |
+
$el['atts']['pagelayer-srcset'] .= $retina_image_mobile.' 3x';
|
1403 |
+
}
|
1404 |
+
}
|
@@ -75,7 +75,7 @@ if(!defined('PAGELAYER_VERSION')) {
|
|
75 |
|
76 |
*/
|
77 |
|
78 |
-
// Example
|
79 |
/*
|
80 |
|
81 |
// Set the value to the parent element
|
@@ -311,7 +311,7 @@ $pagelayer->slider_pager_styles = [
|
|
311 |
'max' => 200,
|
312 |
'screen' => 1,
|
313 |
'css' => [
|
314 |
-
'{{element}} .pagelayer-owl-dots' => 'margin-top: {{val}}px;'
|
315 |
]
|
316 |
)
|
317 |
];
|
@@ -1493,7 +1493,7 @@ $pagelayer->styles['motion_effects'] = [
|
|
1493 |
'label' => __pl('Enable'),
|
1494 |
'group' => 'scrolling_rotate',
|
1495 |
'addAttr' => 'ele_rotate="{{ele_rotate}}"',
|
1496 |
-
'req' => ['!ele_scrolling_effects' => ''
|
1497 |
'show' => ['ele_motion_effects' => '']
|
1498 |
),
|
1499 |
'ele_rot_direction' => array(
|
@@ -1817,10 +1817,10 @@ $pagelayer->styles['responsive_styles'] = [
|
|
1817 |
$pagelayer->styles['attributes'] = [
|
1818 |
'ele_attributes' => [
|
1819 |
'type' => 'textarea',
|
1820 |
-
'label' => __pl('
|
1821 |
'rows' => 5,
|
1822 |
'pro' => 1,
|
1823 |
-
'desc' => '
|
1824 |
],
|
1825 |
];
|
1826 |
|
@@ -1864,7 +1864,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_row', array(
|
|
1864 |
{{slider}}
|
1865 |
</div>
|
1866 |
<div if="{{parallax_img}}" class="pagelayer-parallax-window">
|
1867 |
-
<img class="pagelayer-img" src="{{
|
1868 |
</div>
|
1869 |
<div if="{{row_shape_position}}" class="pagelayer-row-shape">
|
1870 |
<div class="pagelayer-row-svg">
|
@@ -1999,6 +1999,50 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_row', array(
|
|
1999 |
'label' => __pl('Image'),
|
2000 |
'req' => ['row_bg_type' => 'parallax']
|
2001 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002 |
'bg_slider' => array(
|
2003 |
'type' => 'multi_image',
|
2004 |
'label' => __pl('image_slider_ids_label'),
|
@@ -2404,7 +2448,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_col', array(
|
|
2404 |
{{slider}}
|
2405 |
</div>
|
2406 |
<div if="{{parallax_img}}" class="pagelayer-parallax-window">
|
2407 |
-
<img class="pagelayer-img" src="{{
|
2408 |
</div>
|
2409 |
<div if="{{overlay_type}}" class="pagelayer-background-overlay"></div>
|
2410 |
<div class="pagelayer-col-holder"></div>',
|
@@ -2493,6 +2537,50 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_col', array(
|
|
2493 |
'label' => __pl('Image'),
|
2494 |
'req' => ['col_bg_type' => 'parallax']
|
2495 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2496 |
'bg_slider' => array(
|
2497 |
'type' => 'multi_image',
|
2498 |
'label' => __pl('image_slider_ids_label'),
|
@@ -2782,6 +2870,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_heading', array(
|
|
2782 |
'label' => __pl('Edit Title'),
|
2783 |
'default' => '<h2>Your Heading</h2>',
|
2784 |
'desc' => __pl('Edit the heading here'),
|
|
|
2785 |
'edit' => '.pagelayer-heading-holder', // Edit the text and also mirror the same
|
2786 |
),
|
2787 |
'link' => array(
|
@@ -2878,7 +2967,8 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_text', array(
|
|
2878 |
'type' => 'editor',
|
2879 |
'label' => __pl('Edit Rich Text'),
|
2880 |
'default' => '<p>Lorem ipsum dolor sit amet</p>',
|
2881 |
-
'
|
|
|
2882 |
'edit' => '.pagelayer-text-holder', // Edit the text and also mirror the same
|
2883 |
)
|
2884 |
)
|
@@ -2968,7 +3058,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_quote', array(
|
|
2968 |
'max' => 1000,
|
2969 |
'default' => 70,
|
2970 |
'screen' => 1,
|
2971 |
-
'css' => ['{{element}}
|
2972 |
'req' => array(
|
2973 |
'quote_style' => ['quotation','double']
|
2974 |
)
|
@@ -2977,7 +3067,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_quote', array(
|
|
2977 |
'type' => 'color',
|
2978 |
'label' => __pl('quotation_color_label'),
|
2979 |
'default' => '#dadada',
|
2980 |
-
'css' => ['{{element}}
|
2981 |
'req' => array(
|
2982 |
'quote_style' => ['quotation','double']
|
2983 |
)
|
@@ -3315,7 +3405,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_list', array(
|
|
3315 |
'type' => 'color',
|
3316 |
'label' => __pl('list_icon_color_label'),
|
3317 |
'default' => '#0986c0',
|
3318 |
-
'css' => ['{{element}}
|
3319 |
'show' => ['list_icon_state' => 'normal'],
|
3320 |
),
|
3321 |
'icon_size' => array(
|
@@ -3325,7 +3415,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_list', array(
|
|
3325 |
'step' => 1,
|
3326 |
'max' => 150,
|
3327 |
'screen' => 1,
|
3328 |
-
'css' => ['{{element}}
|
3329 |
'show' => ['list_icon_state' => 'normal'],
|
3330 |
),
|
3331 |
'icon_hover_delay' => array(
|
@@ -3334,13 +3424,13 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_list', array(
|
|
3334 |
'min' => 0,
|
3335 |
'step' => 100,
|
3336 |
'max' => 5000,
|
3337 |
-
'css' => ['{{element}}
|
3338 |
'show' =>['list_icon_state' => 'hover']
|
3339 |
),
|
3340 |
'icon_color_hover' => array(
|
3341 |
'type' => 'color',
|
3342 |
'label' => __pl('list_icon_color_label'),
|
3343 |
-
'css' => ['{{element}} .pagelayer-list-ul > div:hover
|
3344 |
'show' => ['list_icon_state' => 'hover'],
|
3345 |
),
|
3346 |
'icon_size_hover' => array(
|
@@ -3350,7 +3440,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_list', array(
|
|
3350 |
'step' => 1,
|
3351 |
'max' => 150,
|
3352 |
'screen' => 1,
|
3353 |
-
'css' => ['{{element}} .pagelayer-list-ul > div:hover
|
3354 |
'show' => ['list_icon_state' => 'hover'],
|
3355 |
),
|
3356 |
],
|
@@ -3386,7 +3476,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_list', array(
|
|
3386 |
'max' => 100,
|
3387 |
'default' => 3,
|
3388 |
'screen' => 1,
|
3389 |
-
'css' => ['{{element}} .pagelayer-list-ul > div' => 'border-bottom-width: {{val
|
3390 |
'req' => [
|
3391 |
'!icon_border_type' => ''
|
3392 |
]
|
@@ -3817,9 +3907,9 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_badge', array(
|
|
3817 |
</a>
|
3818 |
</div>
|
3819 |
<a if-ext="{{badge_url}}" class="pagelayer-ele-link" href="{{{badge_url}}}">
|
3820 |
-
<button class="pagelayer-badge-
|
3821 |
<span if="{{text}}" class="pagelayer-badge-text">{{text}}</span>
|
3822 |
-
<span if="{{badge_text}}" class="pagelayer-badge-details pagelayer-badge-{{badge_notification_type}} pagelayer-badge-{{badge_style_type}}">{{badge_text}}</span>
|
3823 |
</button>
|
3824 |
</a>',
|
3825 |
'params' => array(
|
@@ -4081,7 +4171,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_tooltip', array(
|
|
4081 |
<span if="{{tooltip_icon}}" class="pagelayer-tooltip-icon"><i class="{{tooltip_icon}}"></i></span>
|
4082 |
<span if="{{text}}" class="pagelayer-tooltip-title">{{text}}</span>
|
4083 |
<div if="{{tooltip_text}}" class="pagelayer-tooltip-text pagelayer-tooltip-{{tooltip_position}}">
|
4084 |
-
|
4085 |
</div>
|
4086 |
</div>',
|
4087 |
'params' => array(
|
@@ -4095,7 +4185,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_tooltip', array(
|
|
4095 |
'type' => 'editor',
|
4096 |
'label' => __pl('tooltip_text'),
|
4097 |
'default' => 'Hey there, I have an amazing tooltip !',
|
4098 |
-
'edit' => '.pagelayer-tooltip',
|
4099 |
),
|
4100 |
),
|
4101 |
'text_style' => [
|
@@ -4259,7 +4349,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_image', array(
|
|
4259 |
'innerHTML' => 'text',
|
4260 |
'html' => '<div class="pagelayer-image-holder pagelayer-anim-par">
|
4261 |
<a if-ext="{{link_type}}" class="pagelayer-ele-link" href="{{func_link}}" pagelayer-image-link-type="{{link_type}}">
|
4262 |
-
<img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_id}}" title="{{{id-title}}}" alt="{{{id-alt}}}" />
|
4263 |
<div if="{{overlay}}" class="pagelayer-image-overlay {{content_position}}">
|
4264 |
<div class="pagelayer-image-overlay-content">
|
4265 |
<i if="{{icon}}" class="pagelayer-image-overlay-icon {{icon}}"></i>
|
@@ -4275,6 +4365,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_image', array(
|
|
4275 |
'desc' => __pl('image_src_desc'),
|
4276 |
'type' => 'image',
|
4277 |
'default' => PAGELAYER_URL.'/images/default-image.png',
|
|
|
4278 |
),
|
4279 |
'id-size' => array(
|
4280 |
'label' => __pl('obj_image_size_label'),
|
@@ -4658,6 +4749,13 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_image_slider', array(
|
|
4658 |
'link_type' => ['custom_url', 'media_file']
|
4659 |
)
|
4660 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4661 |
),
|
4662 |
'slider_options' => [
|
4663 |
'slide_items' => array(
|
@@ -5820,7 +5918,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_service', array(
|
|
5820 |
'innerHTML' => 'service_text',
|
5821 |
'html' => '<div class="pagelayer-service-container pagelayer-service-align-{{service_alignment}} pagelayer-service-vertical-{{service_vertical_alignment}}">
|
5822 |
<div if="{{service_image}}" class="pagelayer-service-image">
|
5823 |
-
<img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_image}}" title="{{{service_image-title}}}" alt="{{{service_image-alt}}}" />
|
5824 |
</div>
|
5825 |
<div class="pagelayer-service-details">
|
5826 |
<a if-ext={{heading_url}} href="{{{heading_url}}}" class="pagelayer-ele-link">
|
@@ -5836,6 +5934,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_service', array(
|
|
5836 |
'type' => 'image',
|
5837 |
'label' => __pl('service_box_image_icon_label'),
|
5838 |
'default' => PAGELAYER_URL.'/images/default-image.png',
|
|
|
5839 |
),
|
5840 |
'service_image_size' => array(
|
5841 |
'type' => 'radio',
|
@@ -7954,18 +8053,202 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_shortcodes', array(
|
|
7954 |
|
7955 |
// Google Maps
|
7956 |
pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_google_maps', array(
|
7957 |
-
'name' => __pl('
|
7958 |
'group' => 'other',
|
7959 |
'innerHTML' => 'address',
|
7960 |
'html' => '<div class="pagelayer-google-maps-holder">
|
7961 |
-
<iframe marginheight="0" scrolling="no" marginwidth="0" frameborder="0" src="https://maps.google.com/maps?q={{address}}&t=m&z={{zoom}}&output=embed&iwloc=near" aria-label="{{address}}"></iframe>
|
|
|
7962 |
</div>',
|
7963 |
'params' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7964 |
'address' => array(
|
7965 |
'type' => 'text',
|
7966 |
'label' => __pl('google_map_address_label'),
|
7967 |
'default' => 'New York, New York, USA',
|
7968 |
-
'desc' => __pl('google_map_address_desc')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7969 |
),
|
7970 |
'noscroll' => array(
|
7971 |
'type' => 'checkbox',
|
@@ -7977,7 +8260,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_google_maps', array(
|
|
7977 |
'label' => __pl('google_map_zoom_label'),
|
7978 |
'default' => 10,
|
7979 |
'min' => 0,
|
7980 |
-
'max' =>
|
7981 |
),
|
7982 |
'height' => array(
|
7983 |
'type' => 'slider',
|
@@ -8138,7 +8421,6 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_testimonial', array(
|
|
8138 |
'cite_url' => array(
|
8139 |
'type' => 'link',
|
8140 |
'label' => __pl('testimonial_url_label'),
|
8141 |
-
'default' => '',
|
8142 |
'desc' => __pl('testimonial_url_desc'),
|
8143 |
),
|
8144 |
'cite_spacing' => array(
|
75 |
|
76 |
*/
|
77 |
|
78 |
+
// Example o0f 'addAttr' or 'addClass'
|
79 |
/*
|
80 |
|
81 |
// Set the value to the parent element
|
311 |
'max' => 200,
|
312 |
'screen' => 1,
|
313 |
'css' => [
|
314 |
+
'{{element}} .pagelayer-owl-dots' => 'margin-top: {{val}}px !important;'
|
315 |
]
|
316 |
)
|
317 |
];
|
1493 |
'label' => __pl('Enable'),
|
1494 |
'group' => 'scrolling_rotate',
|
1495 |
'addAttr' => 'ele_rotate="{{ele_rotate}}"',
|
1496 |
+
'req' => ['!ele_scrolling_effects' => ''],
|
1497 |
'show' => ['ele_motion_effects' => '']
|
1498 |
),
|
1499 |
'ele_rot_direction' => array(
|
1817 |
$pagelayer->styles['attributes'] = [
|
1818 |
'ele_attributes' => [
|
1819 |
'type' => 'textarea',
|
1820 |
+
'label' => __pl('custom_attributes'),
|
1821 |
'rows' => 5,
|
1822 |
'pro' => 1,
|
1823 |
+
'desc' => __pl('attribute_desc')
|
1824 |
],
|
1825 |
];
|
1826 |
|
1864 |
{{slider}}
|
1865 |
</div>
|
1866 |
<div if="{{parallax_img}}" class="pagelayer-parallax-window">
|
1867 |
+
<img class="pagelayer-img" src="{{parallax_img_src}}" title="{{{parallax_img-title}}}" alt="{{{parallax_img-alt}}}">
|
1868 |
</div>
|
1869 |
<div if="{{row_shape_position}}" class="pagelayer-row-shape">
|
1870 |
<div class="pagelayer-row-svg">
|
1999 |
'label' => __pl('Image'),
|
2000 |
'req' => ['row_bg_type' => 'parallax']
|
2001 |
),
|
2002 |
+
'parallax_align' => array(
|
2003 |
+
'type' => 'radio',
|
2004 |
+
'label' => __pl('obj_align_label'),
|
2005 |
+
'screen' => 1,
|
2006 |
+
'default' => 'center',
|
2007 |
+
'css' => ['{{element}} .pagelayer-parallax-window' => 'text-align: {{val}}'],
|
2008 |
+
'list' => array(
|
2009 |
+
'left' => __pl('left'),
|
2010 |
+
'center' => __pl('center'),
|
2011 |
+
'right' => __pl('right')
|
2012 |
+
),
|
2013 |
+
'req' => ['row_bg_type' => 'parallax']
|
2014 |
+
),
|
2015 |
+
'parallax_id_size' => array(
|
2016 |
+
'label' => __pl('obj_image_size_label'),
|
2017 |
+
'type' => 'select',
|
2018 |
+
'default' => 'full',
|
2019 |
+
'list' => array(
|
2020 |
+
'full' => __pl('full'),
|
2021 |
+
'large' => __pl('large'),
|
2022 |
+
'medium' => __pl('medium'),
|
2023 |
+
'thumbnail' => __pl('thumbnail'),
|
2024 |
+
'custom' => __pl('custom')
|
2025 |
+
),
|
2026 |
+
'req' => ['row_bg_type' => 'parallax']
|
2027 |
+
),
|
2028 |
+
'parallax_custom_size' => array(
|
2029 |
+
'type' => 'dimension',
|
2030 |
+
'label' => __pl('image_custom_size_label'),
|
2031 |
+
'css' => ['{{element}} .pagelayer-parallax-window img' => 'width: {{val[0]}}px; height: {{val[1]}}px;'],
|
2032 |
+
'req' => [
|
2033 |
+
'parallax_id_size' => 'custom',
|
2034 |
+
'row_bg_type' => 'parallax'
|
2035 |
+
],
|
2036 |
+
),
|
2037 |
+
'parallax_max_width' => array(
|
2038 |
+
'label' => __pl('max-width-percent'),
|
2039 |
+
'type' => 'slider',
|
2040 |
+
'min' => 0,
|
2041 |
+
'max' => 100,
|
2042 |
+
'screen' => 1,
|
2043 |
+
'css' => ['{{element}} .pagelayer-parallax-window img' => 'max-width: {{val}}%'],
|
2044 |
+
'req' => ['row_bg_type' => 'parallax']
|
2045 |
+
),
|
2046 |
'bg_slider' => array(
|
2047 |
'type' => 'multi_image',
|
2048 |
'label' => __pl('image_slider_ids_label'),
|
2448 |
{{slider}}
|
2449 |
</div>
|
2450 |
<div if="{{parallax_img}}" class="pagelayer-parallax-window">
|
2451 |
+
<img class="pagelayer-img" src="{{parallax_img_src}}" title="{{{parallax_img-title}}}" alt="{{{parallax_img-alt}}}">
|
2452 |
</div>
|
2453 |
<div if="{{overlay_type}}" class="pagelayer-background-overlay"></div>
|
2454 |
<div class="pagelayer-col-holder"></div>',
|
2537 |
'label' => __pl('Image'),
|
2538 |
'req' => ['col_bg_type' => 'parallax']
|
2539 |
),
|
2540 |
+
'parallax_align' => array(
|
2541 |
+
'type' => 'radio',
|
2542 |
+
'label' => __pl('obj_align_label'),
|
2543 |
+
'screen' => 1,
|
2544 |
+
'default' => 'center',
|
2545 |
+
'css' => ['{{element}} .pagelayer-parallax-window' => 'text-align: {{val}}'],
|
2546 |
+
'list' => array(
|
2547 |
+
'left' => __pl('left'),
|
2548 |
+
'center' => __pl('center'),
|
2549 |
+
'right' => __pl('right')
|
2550 |
+
),
|
2551 |
+
'req' => ['col_bg_type' => 'parallax']
|
2552 |
+
),
|
2553 |
+
'parallax_id_size' => array(
|
2554 |
+
'label' => __pl('obj_image_size_label'),
|
2555 |
+
'type' => 'select',
|
2556 |
+
'default' => 'full',
|
2557 |
+
'list' => array(
|
2558 |
+
'full' => __pl('full'),
|
2559 |
+
'large' => __pl('large'),
|
2560 |
+
'medium' => __pl('medium'),
|
2561 |
+
'thumbnail' => __pl('thumbnail'),
|
2562 |
+
'custom' => __pl('custom')
|
2563 |
+
),
|
2564 |
+
'req' => ['col_bg_type' => 'parallax']
|
2565 |
+
),
|
2566 |
+
'parallax_custom_size' => array(
|
2567 |
+
'type' => 'dimension',
|
2568 |
+
'label' => __pl('image_custom_size_label'),
|
2569 |
+
'css' => ['{{element}} .pagelayer-parallax-window img' => 'width: {{val[0]}}px; height: {{val[1]}}px;'],
|
2570 |
+
'req' => array(
|
2571 |
+
'parallax_id_size' => 'custom',
|
2572 |
+
'col_bg_type' => 'parallax'
|
2573 |
+
),
|
2574 |
+
),
|
2575 |
+
'parallax_max_width' => array(
|
2576 |
+
'label' => __pl('max-width-percent'),
|
2577 |
+
'type' => 'slider',
|
2578 |
+
'min' => 0,
|
2579 |
+
'max' => 100,
|
2580 |
+
'screen' => 1,
|
2581 |
+
'css' => ['{{element}} .pagelayer-parallax-window img' => 'max-width: {{val}}%'],
|
2582 |
+
'req' => ['col_bg_type' => 'parallax']
|
2583 |
+
),
|
2584 |
'bg_slider' => array(
|
2585 |
'type' => 'multi_image',
|
2586 |
'label' => __pl('image_slider_ids_label'),
|
2870 |
'label' => __pl('Edit Title'),
|
2871 |
'default' => '<h2>Your Heading</h2>',
|
2872 |
'desc' => __pl('Edit the heading here'),
|
2873 |
+
'e' => [ 'v', 'h', 'f', 'c'],
|
2874 |
'edit' => '.pagelayer-heading-holder', // Edit the text and also mirror the same
|
2875 |
),
|
2876 |
'link' => array(
|
2967 |
'type' => 'editor',
|
2968 |
'label' => __pl('Edit Rich Text'),
|
2969 |
'default' => '<p>Lorem ipsum dolor sit amet</p>',
|
2970 |
+
'rows' => '15',
|
2971 |
+
'desc' => __pl('Edit the content by clicking on the content you want to edit on the website'),
|
2972 |
'edit' => '.pagelayer-text-holder', // Edit the text and also mirror the same
|
2973 |
)
|
2974 |
)
|
3058 |
'max' => 1000,
|
3059 |
'default' => 70,
|
3060 |
'screen' => 1,
|
3061 |
+
'css' => ['{{element}} .fa' => 'font-size: {{val}}px;'],
|
3062 |
'req' => array(
|
3063 |
'quote_style' => ['quotation','double']
|
3064 |
)
|
3067 |
'type' => 'color',
|
3068 |
'label' => __pl('quotation_color_label'),
|
3069 |
'default' => '#dadada',
|
3070 |
+
'css' => ['{{element}} .fa' => 'color:{{val}}'],
|
3071 |
'req' => array(
|
3072 |
'quote_style' => ['quotation','double']
|
3073 |
)
|
3405 |
'type' => 'color',
|
3406 |
'label' => __pl('list_icon_color_label'),
|
3407 |
'default' => '#0986c0',
|
3408 |
+
'css' => ['{{element}} .pagelayer-list-icon' => 'color:{{val}}'],
|
3409 |
'show' => ['list_icon_state' => 'normal'],
|
3410 |
),
|
3411 |
'icon_size' => array(
|
3415 |
'step' => 1,
|
3416 |
'max' => 150,
|
3417 |
'screen' => 1,
|
3418 |
+
'css' => ['{{element}} .pagelayer-list-icon' => 'font-size: {{val}}px'],
|
3419 |
'show' => ['list_icon_state' => 'normal'],
|
3420 |
),
|
3421 |
'icon_hover_delay' => array(
|
3424 |
'min' => 0,
|
3425 |
'step' => 100,
|
3426 |
'max' => 5000,
|
3427 |
+
'css' => ['{{element}} .pagelayer-list-icon' => 'transition: all {{val}}ms;'],
|
3428 |
'show' =>['list_icon_state' => 'hover']
|
3429 |
),
|
3430 |
'icon_color_hover' => array(
|
3431 |
'type' => 'color',
|
3432 |
'label' => __pl('list_icon_color_label'),
|
3433 |
+
'css' => ['{{element}} .pagelayer-list-ul > div:hover .pagelayer-list-icon' => 'color:{{val}}'],
|
3434 |
'show' => ['list_icon_state' => 'hover'],
|
3435 |
),
|
3436 |
'icon_size_hover' => array(
|
3440 |
'step' => 1,
|
3441 |
'max' => 150,
|
3442 |
'screen' => 1,
|
3443 |
+
'css' => ['{{element}} .pagelayer-list-ul > div:hover .pagelayer-list-icon' => 'font-size: {{val}}px'],
|
3444 |
'show' => ['list_icon_state' => 'hover'],
|
3445 |
),
|
3446 |
],
|
3476 |
'max' => 100,
|
3477 |
'default' => 3,
|
3478 |
'screen' => 1,
|
3479 |
+
'css' => ['{{element}} .pagelayer-list-ul > div' => 'border-bottom-width: {{val}}px;'],
|
3480 |
'req' => [
|
3481 |
'!icon_border_type' => ''
|
3482 |
]
|
3907 |
</a>
|
3908 |
</div>
|
3909 |
<a if-ext="{{badge_url}}" class="pagelayer-ele-link" href="{{{badge_url}}}">
|
3910 |
+
<button class="pagelayer-badge-btn pagelayer-btn-{{badge_btn_type}}">
|
3911 |
<span if="{{text}}" class="pagelayer-badge-text">{{text}}</span>
|
3912 |
+
<span if="{{badge_text}}" class="pagelayer-badge-title pagelayer-badge-details pagelayer-badge-{{badge_notification_type}} pagelayer-badge-{{badge_style_type}}">{{badge_text}}</span>
|
3913 |
</button>
|
3914 |
</a>',
|
3915 |
'params' => array(
|
4171 |
<span if="{{tooltip_icon}}" class="pagelayer-tooltip-icon"><i class="{{tooltip_icon}}"></i></span>
|
4172 |
<span if="{{text}}" class="pagelayer-tooltip-title">{{text}}</span>
|
4173 |
<div if="{{tooltip_text}}" class="pagelayer-tooltip-text pagelayer-tooltip-{{tooltip_position}}">
|
4174 |
+
{{tooltip_text}}
|
4175 |
</div>
|
4176 |
</div>',
|
4177 |
'params' => array(
|
4185 |
'type' => 'editor',
|
4186 |
'label' => __pl('tooltip_text'),
|
4187 |
'default' => 'Hey there, I have an amazing tooltip !',
|
4188 |
+
'edit' => '.pagelayer-tooltip-text',
|
4189 |
),
|
4190 |
),
|
4191 |
'text_style' => [
|
4349 |
'innerHTML' => 'text',
|
4350 |
'html' => '<div class="pagelayer-image-holder pagelayer-anim-par">
|
4351 |
<a if-ext="{{link_type}}" class="pagelayer-ele-link" href="{{func_link}}" pagelayer-image-link-type="{{link_type}}">
|
4352 |
+
<img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_id}}" title="{{{id-title}}}" alt="{{{id-alt}}}" srcset="{{pagelayer-srcset}}" />
|
4353 |
<div if="{{overlay}}" class="pagelayer-image-overlay {{content_position}}">
|
4354 |
<div class="pagelayer-image-overlay-content">
|
4355 |
<i if="{{icon}}" class="pagelayer-image-overlay-icon {{icon}}"></i>
|
4365 |
'desc' => __pl('image_src_desc'),
|
4366 |
'type' => 'image',
|
4367 |
'default' => PAGELAYER_URL.'/images/default-image.png',
|
4368 |
+
'retina' => 1,
|
4369 |
),
|
4370 |
'id-size' => array(
|
4371 |
'label' => __pl('obj_image_size_label'),
|
4749 |
'link_type' => ['custom_url', 'media_file']
|
4750 |
)
|
4751 |
),
|
4752 |
+
'slider_img_gap' => array(
|
4753 |
+
'type' => 'dimension',
|
4754 |
+
'label' => __pl('space_between'),
|
4755 |
+
'min' => 0,
|
4756 |
+
'screen' => 1,
|
4757 |
+
'css' => ['{{element}} .pagelayer-slider-item' => 'padding: {{val[0]}}px {{val[1]}}px;'],
|
4758 |
+
),
|
4759 |
),
|
4760 |
'slider_options' => [
|
4761 |
'slide_items' => array(
|
5918 |
'innerHTML' => 'service_text',
|
5919 |
'html' => '<div class="pagelayer-service-container pagelayer-service-align-{{service_alignment}} pagelayer-service-vertical-{{service_vertical_alignment}}">
|
5920 |
<div if="{{service_image}}" class="pagelayer-service-image">
|
5921 |
+
<img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_image}}" title="{{{service_image-title}}}" alt="{{{service_image-alt}}}" srcset="{{pagelayer-srcset}}" />
|
5922 |
</div>
|
5923 |
<div class="pagelayer-service-details">
|
5924 |
<a if-ext={{heading_url}} href="{{{heading_url}}}" class="pagelayer-ele-link">
|
5934 |
'type' => 'image',
|
5935 |
'label' => __pl('service_box_image_icon_label'),
|
5936 |
'default' => PAGELAYER_URL.'/images/default-image.png',
|
5937 |
+
'retina' => 1,
|
5938 |
),
|
5939 |
'service_image_size' => array(
|
5940 |
'type' => 'radio',
|
8053 |
|
8054 |
// Google Maps
|
8055 |
pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_google_maps', array(
|
8056 |
+
'name' => __pl('google_maps'),
|
8057 |
'group' => 'other',
|
8058 |
'innerHTML' => 'address',
|
8059 |
'html' => '<div class="pagelayer-google-maps-holder">
|
8060 |
+
<iframe if="{{show_v2}}" marginheight="0" scrolling="no" marginwidth="0" frameborder="0" src="https://maps.google.com/maps?q={{address}}&t=m&z={{zoom}}&output=embed&iwloc=near" aria-label="{{address}}"></iframe>
|
8061 |
+
{{src_code}}
|
8062 |
</div>',
|
8063 |
'params' => array(
|
8064 |
+
'api_version' => array(
|
8065 |
+
'type' => 'select',
|
8066 |
+
'label' => __pl('api_version'),
|
8067 |
+
'default' => 'v3',
|
8068 |
+
'list' =>array(
|
8069 |
+
'' => __pl('version2'),
|
8070 |
+
'v3' => __pl('version3')
|
8071 |
+
),
|
8072 |
+
'desc' => __pl('api_version_desc')
|
8073 |
+
),
|
8074 |
+
'api_key' => array(
|
8075 |
+
'type' => 'text',
|
8076 |
+
'label' => __pl('api_key'),
|
8077 |
+
'desc' => __pl('google_api_key_desc'),
|
8078 |
+
'req' => ['api_version' => 'v3']
|
8079 |
+
),
|
8080 |
+
'map_modes' => array(
|
8081 |
+
'type' => 'select',
|
8082 |
+
'label' => __pl('map_modes'),
|
8083 |
+
'default' => 'place',
|
8084 |
+
'list' =>array(
|
8085 |
+
'place' => __pl('place'),
|
8086 |
+
'view' => __pl('view'),
|
8087 |
+
'directions' => __pl('directions'),
|
8088 |
+
'streetview' => __pl('streetview'),
|
8089 |
+
'search' => __pl('search')
|
8090 |
+
),
|
8091 |
+
'req' => ['api_version' => 'v3']
|
8092 |
+
),
|
8093 |
'address' => array(
|
8094 |
'type' => 'text',
|
8095 |
'label' => __pl('google_map_address_label'),
|
8096 |
'default' => 'New York, New York, USA',
|
8097 |
+
'desc' => __pl('google_map_address_desc'),
|
8098 |
+
'req' => ['!map_modes' => 'search']
|
8099 |
+
),
|
8100 |
+
'direction_origin' => array(
|
8101 |
+
'type' => 'text',
|
8102 |
+
'label' => __pl('origin'),
|
8103 |
+
'default' => 'Oslow Norway',
|
8104 |
+
'req' => [
|
8105 |
+
'api_version' => 'v3',
|
8106 |
+
'map_modes' => 'directions'
|
8107 |
+
]
|
8108 |
+
),
|
8109 |
+
'direction_destination' => array(
|
8110 |
+
'type' => 'text',
|
8111 |
+
'label' => __pl('destination'),
|
8112 |
+
'default' => 'Telemark Norway',
|
8113 |
+
'req' => [
|
8114 |
+
'api_version' => 'v3',
|
8115 |
+
'map_modes' => 'directions'
|
8116 |
+
]
|
8117 |
+
),
|
8118 |
+
'direction_waypoints' => array(
|
8119 |
+
'type' => 'text',
|
8120 |
+
'label' => __pl('waypoints'),
|
8121 |
+
'desc' => __pl('waypoints_desc'),
|
8122 |
+
'req' => [
|
8123 |
+
'api_version' => 'v3',
|
8124 |
+
'map_modes' => 'directions'
|
8125 |
+
]
|
8126 |
+
),
|
8127 |
+
'direction_modes' => array(
|
8128 |
+
'type' => 'select',
|
8129 |
+
'label' => __pl('modes'),
|
8130 |
+
'default' => 'driving',
|
8131 |
+
'list' =>array(
|
8132 |
+
'driving' => __pl('driving'),
|
8133 |
+
'walking' => __pl('walking'),
|
8134 |
+
'bicycling' => __pl('bicycling'),
|
8135 |
+
'flying' => __pl('flying')
|
8136 |
+
),
|
8137 |
+
'req' => [
|
8138 |
+
'api_version' => 'v3',
|
8139 |
+
'map_modes' => 'directions'
|
8140 |
+
]
|
8141 |
+
),
|
8142 |
+
'direction_avoid' => array(
|
8143 |
+
'type' => 'multiselect',
|
8144 |
+
'label' => __pl('avoid'),
|
8145 |
+
'list' => array(
|
8146 |
+
'tolls' => __pl('tolls'),
|
8147 |
+
'ferries' => __pl('ferries'),
|
8148 |
+
'highways' => __pl('highways'),
|
8149 |
+
),
|
8150 |
+
'req' => [
|
8151 |
+
'api_version' => 'v3',
|
8152 |
+
'map_modes' => 'directions'
|
8153 |
+
]
|
8154 |
+
),
|
8155 |
+
'direction_units' => array(
|
8156 |
+
'type' => 'select',
|
8157 |
+
'label' => __pl('units'),
|
8158 |
+
'default' => 'metric',
|
8159 |
+
'list' =>array(
|
8160 |
+
'metric' => __pl('metric'),
|
8161 |
+
'imperial' => __pl('imperial'),
|
8162 |
+
),
|
8163 |
+
'req' => [
|
8164 |
+
'api_version' => 'v3',
|
8165 |
+
'map_modes' => 'directions'
|
8166 |
+
]
|
8167 |
+
),
|
8168 |
+
'streetview_pano' => array(
|
8169 |
+
'type' => 'text',
|
8170 |
+
'label' => __pl('pano'),
|
8171 |
+
'default' => 'eTnPNGoy4bxR9LpjjfFuOw',
|
8172 |
+
'desc' => __pl('pano_desc'),
|
8173 |
+
'req' => [
|
8174 |
+
'api_version' => 'v3',
|
8175 |
+
'map_modes' => 'streetview'
|
8176 |
+
]
|
8177 |
+
),
|
8178 |
+
'streetview_location' => array(
|
8179 |
+
'type' => 'text',
|
8180 |
+
'label' => __pl('location'),
|
8181 |
+
'default' => '46.414382,10.013988',
|
8182 |
+
'desc' => __pl('center_desc'),
|
8183 |
+
'req' => [
|
8184 |
+
'api_version' => 'v3',
|
8185 |
+
'map_modes' => 'streetview'
|
8186 |
+
]
|
8187 |
+
),
|
8188 |
+
'streetview_heading' => array(
|
8189 |
+
'type' => 'slider',
|
8190 |
+
'label' => __pl('heading'),
|
8191 |
+
'min' => -180,
|
8192 |
+
'max' => 360,
|
8193 |
+
'desc' => __pl('heading_desc'),
|
8194 |
+
'req' => [
|
8195 |
+
'api_version' => 'v3',
|
8196 |
+
'map_modes' => 'streetview'
|
8197 |
+
]
|
8198 |
+
),
|
8199 |
+
'streetview_pitch' => array(
|
8200 |
+
'type' => 'slider',
|
8201 |
+
'label' => __pl('pitch'),
|
8202 |
+
'min' => -90,
|
8203 |
+
'max' => 90,
|
8204 |
+
'desc' => __pl('pitch_desc'),
|
8205 |
+
'req' => [
|
8206 |
+
'api_version' => 'v3',
|
8207 |
+
'map_modes' => 'streetview'
|
8208 |
+
]
|
8209 |
+
),
|
8210 |
+
'streetview_fov' => array(
|
8211 |
+
'type' => 'slider',
|
8212 |
+
'label' => __pl('fov'),
|
8213 |
+
'min' => 10,
|
8214 |
+
'max' => 100,
|
8215 |
+
'desc' => __pl('fov_desc'),
|
8216 |
+
'req' => [
|
8217 |
+
'api_version' => 'v3',
|
8218 |
+
'map_modes' => 'streetview'
|
8219 |
+
]
|
8220 |
+
),
|
8221 |
+
'search_term' => array(
|
8222 |
+
'type' => 'text',
|
8223 |
+
'label' => __pl('google_search_term'),
|
8224 |
+
'default' => 'Record stores in Seattle',
|
8225 |
+
'desc' => __pl('google_search_desc'),
|
8226 |
+
'req' => [
|
8227 |
+
'api_version' => 'v3',
|
8228 |
+
'map_modes' => 'search'
|
8229 |
+
]
|
8230 |
+
),
|
8231 |
+
'center' => array(
|
8232 |
+
'type' => 'text',
|
8233 |
+
'label' => __pl('center'),
|
8234 |
+
'desc' => __pl('center_desc'),
|
8235 |
+
'req' => [
|
8236 |
+
'api_version' => 'v3',
|
8237 |
+
'!map_modes' => 'streetview'
|
8238 |
+
]
|
8239 |
+
),
|
8240 |
+
'map_type' => array(
|
8241 |
+
'type' => 'select',
|
8242 |
+
'label' => __pl('map_type'),
|
8243 |
+
'default' => 'roadmap',
|
8244 |
+
'list' =>array(
|
8245 |
+
'roadmap' => __pl('roadmap'),
|
8246 |
+
'satellite' => __pl('satellite')
|
8247 |
+
),
|
8248 |
+
'req' => [
|
8249 |
+
'api_version' => 'v3',
|
8250 |
+
'!map_modes' => 'streetview'
|
8251 |
+
]
|
8252 |
),
|
8253 |
'noscroll' => array(
|
8254 |
'type' => 'checkbox',
|
8260 |
'label' => __pl('google_map_zoom_label'),
|
8261 |
'default' => 10,
|
8262 |
'min' => 0,
|
8263 |
+
'max' => 21
|
8264 |
),
|
8265 |
'height' => array(
|
8266 |
'type' => 'slider',
|
8421 |
'cite_url' => array(
|
8422 |
'type' => 'link',
|
8423 |
'label' => __pl('testimonial_url_label'),
|
|
|
8424 |
'desc' => __pl('testimonial_url_desc'),
|
8425 |
),
|
8426 |
'cite_spacing' => array(
|
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: PageLayer
|
4 |
Plugin URI: http://wordpress.org/plugins/pagelayer/
|
5 |
Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
|
6 |
-
Version: 1.5.
|
7 |
Author: Pagelayer Team
|
8 |
Author URI: https://pagelayer.com/
|
9 |
License: LGPL v2.1
|
3 |
Plugin Name: PageLayer
|
4 |
Plugin URI: http://wordpress.org/plugins/pagelayer/
|
5 |
Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
|
6 |
+
Version: 1.5.2
|
7 |
Author: Pagelayer Team
|
8 |
Author URI: https://pagelayer.com/
|
9 |
License: LGPL v2.1
|
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: pagelayer
|
3 |
Tags: page builder, editor, drag-and-drop, landing page, replace image, pagelayer, form-builder, popup, widgets, softaculous, visual editor, wysiwyg, design, maintenance mode, coming soon, under construction, website builder, landing page builder, front-end builder, site-builder
|
4 |
Requires at least: 4.7
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.5
|
7 |
-
Stable tag: 1.5.
|
8 |
License: LGPL v2.1
|
9 |
License URI: http://www.gnu.org/licenses/lgpl-2.1.html
|
10 |
|
@@ -109,6 +109,32 @@ Do you have questions related to PageLayer ? Use the following links :
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
= 1.5.1 (May 18, 2021) =
|
113 |
* [Bug-Fix] Some images were not imported properly while importing the theme if the same slug was used. This is fixed.
|
114 |
* [Bug-Fix] Icon alignment on contact form submit button was not working properly. This is fixed.
|
2 |
Contributors: pagelayer
|
3 |
Tags: page builder, editor, drag-and-drop, landing page, replace image, pagelayer, form-builder, popup, widgets, softaculous, visual editor, wysiwyg, design, maintenance mode, coming soon, under construction, website builder, landing page builder, front-end builder, site-builder
|
4 |
Requires at least: 4.7
|
5 |
+
Tested up to: 5.8
|
6 |
Requires PHP: 5.5
|
7 |
+
Stable tag: 1.5.2
|
8 |
License: LGPL v2.1
|
9 |
License URI: http://www.gnu.org/licenses/lgpl-2.1.html
|
10 |
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
= 1.5.2 (July 23, 2021) =
|
113 |
+
* [Feature] We have improved the inline editor UI and UX. This is to give a better experience while editing the text. More improvements to the editing experience will follow soon.
|
114 |
+
* [Feature] Retina Image option enabled for Image and Image Box widgets.
|
115 |
+
* [Feature] Added option for custom thumbnail in posts and archive posts widgets.
|
116 |
+
* [Feature] The Map widget has been further improved for Google map v3. We recommend you use version 3 as Google is deprecating version 2, or Google may discontinue version 2 maps at any time.
|
117 |
+
* [Feature] Added Enter and Backspace key handler, now on press enter key inside title widget, we will break widget content from current cursor position and open new title widget with same content and by clicking backspace we will merge it again.
|
118 |
+
* [Improvement] Added col margin option in the posts and archive posts widget.
|
119 |
+
* [Improvement] Added space between option in image slider widget.
|
120 |
+
* [Improvement] Added the "download file name" option to the download button widget. Now user can set the custom name of the download file.
|
121 |
+
* [Improvement] Added alignment, size and max width options for the Row and Column parallax image.
|
122 |
+
* [Improvement] Image drop zone UI has beed further fixed.
|
123 |
+
* [Improvement] Added alt and title attributes for the site logo and post author image.
|
124 |
+
* [Bug-Fix] The image media modal headings styles have been further fixed.
|
125 |
+
* [Bug-Fix] In the image hotspot, quote and list widgets, the icon styles were applied for all the I (italics) tag. This is fixed.
|
126 |
+
* [Bug-Fix] When editing the tooltip text through the inline editor, the tooltip was hidden when hovered out. This is fixed.
|
127 |
+
* [Bug-Fix] In certain case while resizing the window, the primary menu was not working properly. This is fixed.
|
128 |
+
* [Bug-Fix] While adding Tab widget inside the Tab widget, the Tab widgets were not working properly. This is fixed.
|
129 |
+
* [Bug-Fix] Clicking on the close alert icon in the editor will hide the alert widget. Due to this we were not able to edit the alert widget again. This is fixed.
|
130 |
+
* [Bug-Fix] While editing the slider content through the inline editor, we were unable to select content. This is fixed.
|
131 |
+
* [Bug-Fix] On window resizing the scroll effects was not working properly. This is fixed.
|
132 |
+
* [Bug-Fix] While pasting the content, the widgets were pasted. This is fixed.
|
133 |
+
* [Bug-Fix] In certain cases, the video widget was not working properly. This is fixed.
|
134 |
+
* [Bug-Fix] In certain cases, the video mute option was not working properly. This is fixed.
|
135 |
+
* [Bug-Fix] Post widget copy-paste and duplicate was not working properly. This is fixed.
|
136 |
+
* [Bug-Fix] In certain cases, the audio widget was not working properly. This is fixed.
|
137 |
+
|
138 |
= 1.5.1 (May 18, 2021) =
|
139 |
* [Bug-Fix] Some images were not imported properly while importing the theme if the same slug was used. This is fixed.
|
140 |
* [Bug-Fix] Icon alignment on contact form submit button was not working properly. This is fixed.
|