Page Builder: PageLayer – Drag and Drop website builder - Version 1.4.0

Version Description

(Jan 01, 2021) = * [Improvement] While editing the page, the element attributes storing method has been further improved and will reduce your page size. * [Improvement] The element pagelayer-id size has been reduced from 16 chars to 8 chars and will reduce your page size. * [Added] Added element up and down option. Now you can move elements up and down without dragging the element. The Drag option is also available. * [Task] The Website Setting has been further improved. Now you can set the global styles to the elements for any screen modes. * [Bug-Fix] In some cases, memory was exhausted while saving the post. This is fixed. * [Bug-Fix] In some cases the archive template was not applied properly. This is fixed.

Download this release

Release Info

Developer pagelayer
Plugin Icon 128x128 Page Builder: PageLayer – Drag and Drop website builder
Version 1.4.0
Comparing to
See all releases

Code changes from version 1.3.8 to 1.4.0

css/combined.css CHANGED
@@ -2453,11 +2453,11 @@ display:inline-block;
2453
  display:none;
2454
  }
2455
 
2456
- .pagelayer-countdown[pagelayer-a-display_expired_text="true"] .pagelayer-countdown-expired{
2457
  display:block !important;
2458
  }
2459
 
2460
- .pagelayer-countdown[pagelayer-a-display_expired_text="true"] .pagelayer-countdown-counter{
2461
  display:none !important;
2462
  }
2463
  /* Countdown End*/
@@ -3765,11 +3765,11 @@ object-fit: cover;
3765
  -o-object-fit: cover;
3766
  }
3767
 
3768
- .pagelayer-flipbox[pagelayer-a-back_section= "true"] .pagelayer-flipbox-front{
3769
  display:none;
3770
  }
3771
 
3772
- .pagelayer-flipbox[pagelayer-a-back_section= "true"] .pagelayer-flipbox-back{
3773
  transform: rotateX(0) rotateY(0deg) !important;
3774
  -webkit-transform: rotateX(0) rotateY(0deg) !important;
3775
  opacity: 1 !important;
2453
  display:none;
2454
  }
2455
 
2456
+ .pagelayer-countdown[display_expired_text="true"] .pagelayer-countdown-expired{
2457
  display:block !important;
2458
  }
2459
 
2460
+ .pagelayer-countdown[display_expired_text="true"] .pagelayer-countdown-counter{
2461
  display:none !important;
2462
  }
2463
  /* Countdown End*/
3765
  -o-object-fit: cover;
3766
  }
3767
 
3768
+ .pagelayer-flipbox[back_section="true"] .pagelayer-flipbox-front{
3769
  display:none;
3770
  }
3771
 
3772
+ .pagelayer-flipbox[back_section="true"] .pagelayer-flipbox-back{
3773
  transform: rotateX(0) rotateY(0deg) !important;
3774
  -webkit-transform: rotateX(0) rotateY(0deg) !important;
3775
  opacity: 1 !important;
css/pagelayer-admin.css CHANGED
@@ -4,7 +4,12 @@ display:none;
4
  }
5
 
6
  .pagelayer-setting-form th, .pagelayer-setting-form td{
7
- padding:20px 20px 20px 0px ;
 
 
 
 
 
8
  text-align:left;
9
  }
10
 
@@ -43,6 +48,8 @@ display: block;
43
  padding: 4px;
44
  text-decoration: none;
45
  position: relative;
 
 
46
  }
47
 
48
  .pagelayer-show-vanilla .dashicons{
@@ -72,9 +79,12 @@ background-size: cover !important;
72
  display:none;
73
  }
74
 
 
 
 
 
75
  .pagelayer-heading-tab{
76
  background: #fff !important;
77
- width: 98px;
78
  }
79
 
80
  .pagelayer-heading-wrapper{
@@ -82,6 +92,16 @@ margin-right: 20px;
82
  border-bottom: unset;
83
  }
84
 
 
 
 
 
 
 
 
 
 
 
85
  .pagelayer-notice{
86
  padding: 10px;
87
  background-color: #fff;
4
  }
5
 
6
  .pagelayer-setting-form th, .pagelayer-setting-form td{
7
+ padding:10px 20px 10px 0px;
8
+ text-align:left;
9
+ }
10
+
11
+ .pagelayer-internal-table th, .pagelayer-internal-table td{
12
+ padding:3px;
13
  text-align:left;
14
  }
15
 
48
  padding: 4px;
49
  text-decoration: none;
50
  position: relative;
51
+ width: 40px;
52
+ box-sizing: content-box;
53
  }
54
 
55
  .pagelayer-show-vanilla .dashicons{
79
  display:none;
80
  }
81
 
82
+ .pagelayer-styles-screens > li{
83
+ display: inline-block;
84
+ }
85
+
86
  .pagelayer-heading-tab{
87
  background: #fff !important;
 
88
  }
89
 
90
  .pagelayer-heading-wrapper{
92
  border-bottom: unset;
93
  }
94
 
95
+ .pagelayer-heading-wrapper .nav-tab{
96
+ display:block;
97
+ width: 100%;
98
+ box-sizing: border-box;
99
+ }
100
+
101
+ .pagelayer-website-padding{
102
+ width:65px;
103
+ }
104
+
105
  .pagelayer-notice{
106
  padding: 10px;
107
  background-color: #fff;
css/pagelayer-editor-frontend.css CHANGED
@@ -131,6 +131,22 @@ background:#277CF9;
131
  background:#1c59b3;
132
  }
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  .pagelayer-col-option .pagelayer-eoi{
135
  background:#42ADE1;
136
  }
131
  background:#1c59b3;
132
  }
133
 
134
+ .pagelayer-wrap-row > .pagelayer-ele-overlay .pagelayer-move-up,
135
+ .pagelayer-col-holder > .pagelayer-wrap-inner-row:first-child > .pagelayer-ele-overlay .pagelayer-move-up,
136
+ .pagelayer-col-holder > .pagelayer-wrap-ele:first-child > .pagelayer-ele-overlay .pagelayer-move-up{
137
+ display:none !important;
138
+ }
139
+
140
+ .pagelayer-wrap-row ~ .pagelayer-wrap-row > .pagelayer-ele-overlay .pagelayer-move-up{
141
+ display:inline-block !important;
142
+ }
143
+
144
+ .pagelayer-wrap-row:nth-last-of-type(2) > .pagelayer-ele-overlay .pagelayer-move-down,
145
+ .pagelayer-col-holder > .pagelayer-wrap-inner-row:last-child > .pagelayer-ele-overlay .pagelayer-move-down,
146
+ .pagelayer-col-holder > .pagelayer-wrap-ele:last-child > .pagelayer-ele-overlay .pagelayer-move-down{
147
+ display:none !important;
148
+ }
149
+
150
  .pagelayer-col-option .pagelayer-eoi{
151
  background:#42ADE1;
152
  }
css/pagelayer-frontend.css CHANGED
@@ -2453,11 +2453,11 @@ display:inline-block;
2453
  display:none;
2454
  }
2455
 
2456
- .pagelayer-countdown[pagelayer-a-display_expired_text="true"] .pagelayer-countdown-expired{
2457
  display:block !important;
2458
  }
2459
 
2460
- .pagelayer-countdown[pagelayer-a-display_expired_text="true"] .pagelayer-countdown-counter{
2461
  display:none !important;
2462
  }
2463
  /* Countdown End*/
@@ -3765,11 +3765,11 @@ object-fit: cover;
3765
  -o-object-fit: cover;
3766
  }
3767
 
3768
- .pagelayer-flipbox[pagelayer-a-back_section= "true"] .pagelayer-flipbox-front{
3769
  display:none;
3770
  }
3771
 
3772
- .pagelayer-flipbox[pagelayer-a-back_section= "true"] .pagelayer-flipbox-back{
3773
  transform: rotateX(0) rotateY(0deg) !important;
3774
  -webkit-transform: rotateX(0) rotateY(0deg) !important;
3775
  opacity: 1 !important;
2453
  display:none;
2454
  }
2455
 
2456
+ .pagelayer-countdown[display_expired_text="true"] .pagelayer-countdown-expired{
2457
  display:block !important;
2458
  }
2459
 
2460
+ .pagelayer-countdown[display_expired_text="true"] .pagelayer-countdown-counter{
2461
  display:none !important;
2462
  }
2463
  /* Countdown End*/
3765
  -o-object-fit: cover;
3766
  }
3767
 
3768
+ .pagelayer-flipbox[back_section="true"] .pagelayer-flipbox-front{
3769
  display:none;
3770
  }
3771
 
3772
+ .pagelayer-flipbox[back_section="true"] .pagelayer-flipbox-back{
3773
  transform: rotateX(0) rotateY(0deg) !important;
3774
  -webkit-transform: rotateX(0) rotateY(0deg) !important;
3775
  opacity: 1 !important;
init.php CHANGED
@@ -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.3.8');
9
  define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
10
  define('PAGELAYER_SLUG', 'pagelayer');
11
  define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
@@ -18,6 +18,7 @@ define('PAGELAYER_API', 'https://api.pagelayer.com/');
18
  define('PAGELAYER_SC_PREFIX', 'pl');
19
  define('PAGELAYER_YOUTUBE_BG', 'https://www.youtube.com/watch?v=Csa6rvCWmLU');
20
  define('PAGELAYER_BLOCK_PREFIX', defined('SITEPAD') ? 'sp' : 'wp');
 
21
  define('PAGELAYER_DEV', file_exists(dirname(__FILE__).'/dev.php') ? 1 : 0);
22
 
23
  include_once(PAGELAYER_DIR.'/main/functions.php');
@@ -112,18 +113,52 @@ function pagelayer_load_plugin(){
112
  $pagelayer->settings['max_width'] = (int) (empty(get_option('pagelayer_content_width')) ? 1170 : get_option('pagelayer_content_width'));
113
  $pagelayer->settings['tablet_breakpoint'] = (int) (empty(get_option('pagelayer_tablet_breakpoint')) ? 768 : get_option('pagelayer_tablet_breakpoint'));
114
  $pagelayer->settings['mobile_breakpoint'] = (int) (empty(get_option('pagelayer_mobile_breakpoint')) ? 360 : get_option('pagelayer_mobile_breakpoint'));
 
115
  $pagelayer->settings['body_font'] = get_option('pagelayer_body_font');
116
- $pagelayer->settings['body'] = get_option('pagelayer_body_typography');
117
- $pagelayer->settings['h1'] = get_option('pagelayer_h1_typography');
118
- $pagelayer->settings['h2'] = get_option('pagelayer_h2_typography');
119
- $pagelayer->settings['h3'] = get_option('pagelayer_h3_typography');
120
- $pagelayer->settings['h4'] = get_option('pagelayer_h4_typography');
121
- $pagelayer->settings['h5'] = get_option('pagelayer_h5_typography');
122
- $pagelayer->settings['h6'] = get_option('pagelayer_h6_typography');
123
  $pagelayer->settings['color'] = get_option('pagelayer_color');
124
- $pagelayer->settings['sidebar'] = get_option('pagelayer_sidebar');
125
 
126
- // To make things backward compatible
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  if(!empty($pagelayer->settings['body_font'])){
128
  $pagelayer->settings['body']['font-family'] = $pagelayer->settings['body_font'];
129
  }
@@ -574,18 +609,16 @@ function pagelayer_enqueue_fonts(){
574
  }
575
 
576
  $url = [];
577
-
578
- // Global CSS settings
579
- $css_settings = ['body', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
580
 
581
- foreach($css_settings as $set){
582
 
583
  // Fetch body font if given
584
- if(!empty($pagelayer->settings[$set]['font-family'])){
585
 
586
- $val = $pagelayer->settings[$set]['font-family'];
587
- $font_weight = empty($pagelayer->settings[$set]['font-weight']) ? 400 : $pagelayer->settings[$set]['font-weight'];
588
- $font_style = empty($pagelayer->settings[$set]['font-style']) ? 'normal' : $pagelayer->settings[$set]['font-style'];$font_style = in_array($font_style, ['italic', 'oblique']) ? 'i' : '';
 
589
 
590
  $pagelayer->runtime_fonts[$val][$font_weight.$font_style] = $font_weight.$font_style;
591
 
@@ -657,58 +690,31 @@ function pagelayer_global_styles(){
657
  }'.PHP_EOL;
658
 
659
  }
660
-
661
- $styles .= '@media (max-width: '.$pagelayer->settings['tablet_breakpoint'].'px){
662
- [class^="pagelayer-offset-"],
663
- [class*=" pagelayer-offset-"] {
664
- margin-left: 0;
665
- }
666
-
667
- .pagelayer-row .pagelayer-col {
668
- margin-left: 0;
669
- width: 100%;
670
- }
671
- .pagelayer-row.pagelayer-gutters .pagelayer-col {
672
- margin-bottom: 16px;
673
- }
674
- .pagelayer-first-sm {
675
- order: -1;
676
- }
677
- .pagelayer-last-sm {
678
- order: 1;
679
- }
680
- }'.PHP_EOL;
681
-
682
- // Colors
683
- if(!empty($pagelayer->settings['color']['background'])){
684
- $pagelayer->settings['body']['background-color'] = $pagelayer->settings['color']['background'];
685
- }
686
-
687
- if(!empty($pagelayer->settings['color']['text'])){
688
- $pagelayer->settings['body']['color'] = $pagelayer->settings['color']['text'];
689
- }
690
 
691
- // Global CSS settings
692
- $css_settings = ['body', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
693
 
694
  // PX suffix
695
  $pxs = ['font-size', 'letter-spacing', 'word-spacing'];
 
696
 
697
- foreach($css_settings as $k => $v){
 
698
 
699
- $key = is_numeric($k) ? $v : $k;
700
  $r = [];
701
-
702
- if(empty($pagelayer->settings[$key])){
703
- continue;
704
- }
705
 
706
- foreach($pagelayer->settings[$key] as $kk => $vv){
707
 
708
  if(empty($vv)){
709
  continue;
710
  }
711
 
 
 
 
 
 
 
712
  $r[] = $kk.':'.$vv.(in_array($kk, $pxs) ? 'px' : '');
713
 
714
  }
@@ -717,23 +723,56 @@ $styles .= '@media (max-width: '.$pagelayer->settings['tablet_breakpoint'].'px){
717
  continue;
718
  }
719
 
720
- $styles .= 'body.pagelayer-body '.($v == 'body' ? '' : $v).'{'.implode(';', $r)."}\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  }
722
-
723
- // Link Color
724
- if(!empty($pagelayer->settings['color']['link'])){
725
- $styles .= 'body.pagelayer-body a{color: '.$pagelayer->settings['color']['link'].'}'.PHP_EOL;
 
 
726
  }
727
-
728
- // Link Hover Color
729
- if(!empty($pagelayer->settings['color']['link-hover'])){
730
- $styles .= 'body.pagelayer-body a:hover{color: '.$pagelayer->settings['color']['link-hover'].'}'.PHP_EOL;
731
  }
732
-
733
- // Link Hover Color
734
- if(!empty($pagelayer->settings['color']['heading'])){
735
- $styles .= 'body.pagelayer-body h1,h2,h3,h4,h5,h6{color: '.$pagelayer->settings['color']['heading'].'}'.PHP_EOL;
736
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
737
 
738
  $styles .= PHP_EOL.'</style>';
739
 
5
 
6
  define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
7
  define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
8
+ define('PAGELAYER_VERSION', '1.4.0');
9
  define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
10
  define('PAGELAYER_SLUG', 'pagelayer');
11
  define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
18
  define('PAGELAYER_SC_PREFIX', 'pl');
19
  define('PAGELAYER_YOUTUBE_BG', 'https://www.youtube.com/watch?v=Csa6rvCWmLU');
20
  define('PAGELAYER_BLOCK_PREFIX', defined('SITEPAD') ? 'sp' : 'wp');
21
+ define('PAGELAYER_CMS_DIR_PREFIX', defined('SITEPAD') ? 'site' : 'wp');
22
  define('PAGELAYER_DEV', file_exists(dirname(__FILE__).'/dev.php') ? 1 : 0);
23
 
24
  include_once(PAGELAYER_DIR.'/main/functions.php');
113
  $pagelayer->settings['max_width'] = (int) (empty(get_option('pagelayer_content_width')) ? 1170 : get_option('pagelayer_content_width'));
114
  $pagelayer->settings['tablet_breakpoint'] = (int) (empty(get_option('pagelayer_tablet_breakpoint')) ? 768 : get_option('pagelayer_tablet_breakpoint'));
115
  $pagelayer->settings['mobile_breakpoint'] = (int) (empty(get_option('pagelayer_mobile_breakpoint')) ? 360 : get_option('pagelayer_mobile_breakpoint'));
116
+ $pagelayer->settings['sidebar'] = get_option('pagelayer_sidebar');
117
  $pagelayer->settings['body_font'] = get_option('pagelayer_body_font');
 
 
 
 
 
 
 
118
  $pagelayer->settings['color'] = get_option('pagelayer_color');
 
119
 
120
+ // Load CSS settings
121
+ foreach($pagelayer->css_settings as $k => $params){
122
+ foreach($pagelayer->screens as $sk => $sv){
123
+ $suffix = (!empty($sv) ? '_'.$sv : '');
124
+ $setting = empty($params['key']) ? 'pagelayer_'.$k.'_css' : $params['key'];
125
+ $tmp = get_option($setting.$suffix);
126
+ if(!empty($tmp)){
127
+ $pagelayer->css[$k.$suffix] = $tmp;
128
+ }
129
+ }
130
+ }
131
+
132
+ // Backward compat for colors
133
+ if(!empty($pagelayer->settings['color']['background']) && empty($pagelayer->css['body']['background-color'])){
134
+ $pagelayer->css['body']['background-color'] = $pagelayer->settings['color']['background'];
135
+ }
136
+
137
+ if(!empty($pagelayer->settings['color']['text']) && empty($pagelayer->css['body']['color'])){
138
+ $pagelayer->css['body']['color'] = $pagelayer->settings['color']['text'];
139
+ }
140
+
141
+ // Link Color
142
+ if(!empty($pagelayer->settings['color']['link']) && empty($pagelayer->css['a']['color'])){
143
+ $pagelayer->css['a']['color'] = $pagelayer->settings['color']['link'];
144
+ }
145
+
146
+ // Link Hover Color
147
+ if(!empty($pagelayer->settings['color']['link-hover']) && empty($pagelayer->css['a-hover']['color'])){
148
+ $pagelayer->css['a-hover']['color'] = $pagelayer->settings['color']['link-hover'];
149
+ }
150
+
151
+ // Headings Color
152
+ if(!empty($pagelayer->settings['color']['heading'])){
153
+ $htmp = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
154
+ foreach($htmp as $k => $v){
155
+ if(empty($pagelayer->css[$v]['color'])){
156
+ $pagelayer->css[$v]['color'] = $pagelayer->settings['color']['heading'];
157
+ }
158
+ }
159
+ }
160
+
161
+ // Backward compat for body font
162
  if(!empty($pagelayer->settings['body_font'])){
163
  $pagelayer->settings['body']['font-family'] = $pagelayer->settings['body_font'];
164
  }
609
  }
610
 
611
  $url = [];
 
 
 
612
 
613
+ foreach($pagelayer->css as $k => $set){
614
 
615
  // Fetch body font if given
616
+ if(!empty($set['font-family'])){
617
 
618
+ $val = $set['font-family'];
619
+ $font_weight = empty($set['font-weight']) ? 400 : $set['font-weight'];
620
+ $font_style = empty($set['font-style']) ? 'normal' : $set['font-style'];
621
+ $font_style = in_array($font_style, ['italic', 'oblique']) ? 'i' : '';
622
 
623
  $pagelayer->runtime_fonts[$val][$font_weight.$font_style] = $font_weight.$font_style;
624
 
690
  }'.PHP_EOL;
691
 
692
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
693
 
694
+ $screen_style['tablet'] = '';
695
+ $screen_style['mobile'] = '';
696
 
697
  // PX suffix
698
  $pxs = ['font-size', 'letter-spacing', 'word-spacing'];
699
+ $arrays = ['padding', 'margin'];
700
 
701
+ // Loop CSS settings
702
+ foreach($pagelayer->css as $k => $v){
703
 
 
704
  $r = [];
 
 
 
 
705
 
706
+ foreach($pagelayer->css[$k] as $kk => $vv){
707
 
708
  if(empty($vv)){
709
  continue;
710
  }
711
 
712
+ if(in_array($kk, $arrays)){
713
+ $skel = [0, 0, 0, 0];
714
+ $vv = array_replace($skel, $vv);
715
+ $vv = implode('px ', $vv).'px';
716
+ }
717
+
718
  $r[] = $kk.':'.$vv.(in_array($kk, $pxs) ? 'px' : '');
719
 
720
  }
723
  continue;
724
  }
725
 
726
+ $matches = [];
727
+ preg_match('/_(mobile|tablet)$/is', $k, $matches);
728
+ $key = str_replace(['_mobile', '_tablet'], '', $k);
729
+ $screen = $matches[1];
730
+
731
+ //echo $key.' - '.$k;pagelayer_print($matches);
732
+
733
+ $params = $pagelayer->css_settings[$key];
734
+
735
+ $sel = empty($params['sel']) ? ($key == 'body' ? '' : $key) : $params['sel'];
736
+
737
+ $style = 'body.pagelayer-body '.$sel.'{'.implode(';', $r)."}\n";
738
+
739
+ // Mobile or tablet ?
740
+ if(!empty($screen)){
741
+ $screen_style[$screen] .= $style;
742
+ }else{
743
+ $styles .= $style;
744
+ }
745
  }
746
+
747
+ // Tablet Styles
748
+ $styles .= '@media (max-width: '.$pagelayer->settings['tablet_breakpoint'].'px){
749
+ [class^="pagelayer-offset-"],
750
+ [class*=" pagelayer-offset-"] {
751
+ margin-left: 0;
752
  }
753
+
754
+ .pagelayer-row .pagelayer-col {
755
+ margin-left: 0;
756
+ width: 100%;
757
  }
758
+ .pagelayer-row.pagelayer-gutters .pagelayer-col {
759
+ margin-bottom: 16px;
 
 
760
  }
761
+ .pagelayer-first-sm {
762
+ order: -1;
763
+ }
764
+ .pagelayer-last-sm {
765
+ order: 1;
766
+ }
767
+
768
+ '.$screen_style['tablet'].'
769
+ }'.PHP_EOL;
770
+
771
+ // Any mobile style ?
772
+ if(!empty($screen_style['mobile'])){
773
+ $styles .= '@media (max-width: '.$pagelayer->settings['mobile_breakpoint'].'px){
774
+ '.$screen_style['mobile'].'}'.PHP_EOL;
775
+ }
776
 
777
  $styles .= PHP_EOL.'</style>';
778
 
js/pagelayer-editor.js CHANGED
@@ -20,6 +20,7 @@ pagelayer = {
20
  pro_txt : '',
21
  loaded : 0,
22
  post_status : '',
 
23
  }
24
 
25
  var pagelayer_history_obj = {}, pagelayer_revision_obj = {};
@@ -61,7 +62,13 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {
61
  };
62
 
63
  // Lets start
64
- jQuery(document).ready(function(){
 
 
 
 
 
 
65
 
66
  // Prevent the click Insite editor
67
  pagelayer_prevent_click();
@@ -141,7 +148,7 @@ jQuery(document).ready(function(){
141
  // Hide the loader
142
  pagelayer_loader_hide();
143
 
144
- });
145
 
146
  // Prevent the click Insite editor
147
  function pagelayer_prevent_click(){
@@ -1135,7 +1142,6 @@ function pagelayer_element_added(jEle){
1135
  if(!pagelayer_empty(gId)){
1136
 
1137
  html = pagelayer_element_unsetup(pagelayer_global_widgets[gId].$);
1138
- html.attr('pagelayer-a-global_id', gId);
1139
 
1140
  // Generate the HTML
1141
  }else{
@@ -1151,6 +1157,11 @@ function pagelayer_element_added(jEle){
1151
  // Setup the properties of the elements
1152
  pagelayer_element_setup("[pagelayer-id="+par_id+"], [pagelayer-id="+par_id+"] .pagelayer-ele", true);
1153
 
 
 
 
 
 
1154
  // Any children to add ?
1155
  if(!('widget' in pagelayer_shortcodes[sc])){
1156
 
@@ -1183,7 +1194,7 @@ function pagelayer_element_added(jEle){
1183
  'title' : pagelayer_shortcodes[sc]['name'],
1184
  'action' : 'Added',
1185
  'pl_id' : id,
1186
- 'html' : jQuery("[pagelayer-id="+id+"]"),
1187
  'cEle' : cEle
1188
  });
1189
 
@@ -1268,7 +1279,7 @@ function pagelayer_assign_id(jEle){
1268
  // Do you have the pagelayer id
1269
  var id = jEle.attr("pagelayer-id");
1270
  if(!id || id.length < 1){
1271
- id = pagelayer_randstr(16);
1272
  jEle.attr("pagelayer-id", id);
1273
  }
1274
 
@@ -1331,7 +1342,7 @@ function pagelayer_element_setup(selector, render){
1331
 
1332
  // Loop through
1333
  jQuery(pagelayer_editable+' '+selector).each(function(){
1334
-
1335
  var jEle = jQuery(this);
1336
 
1337
  // Assign an ID if not there
@@ -1339,6 +1350,11 @@ function pagelayer_element_setup(selector, render){
1339
  var pId = pagelayer_get_parent(jEle) || '';// Options to show on hover
1340
  var selector = '[pagelayer-id='+id+']';
1341
 
 
 
 
 
 
1342
  if(render){
1343
  pagelayer_sc_render(jEle);
1344
  }
@@ -1417,9 +1433,11 @@ function pagelayer_element_setup(selector, render){
1417
  }
1418
 
1419
  html = '<div class="pagelayer-row-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
 
1420
  '<i class="far fa-clone pagelayer-eoi" onclick="pagelayer_copy_element(\''+selector+'\')" ></i>'+
1421
  '<i class="fas fa-trash pagelayer-eoi" onclick="pagelayer_delete_element(\''+selector+'\')" ></i>'+
1422
  '<i class="fas fa-pencil-alt pagelayer-eoi" onclick="pagelayer_edit_element(\''+selector+'\', event)" ></i>'+
 
1423
  '</div>';
1424
 
1425
  }else if(tag == 'pl_col'){
@@ -1439,9 +1457,11 @@ function pagelayer_element_setup(selector, render){
1439
  }else{
1440
 
1441
  html = '<div class="pagelayer-ele-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
 
1442
  '<i class="far fa-clone pagelayer-eoi" onclick="pagelayer_copy_element(\''+selector+'\')" ></i>'+
1443
  '<i class="fas fa-trash pagelayer-eoi" onclick="pagelayer_delete_element(\''+selector+'\')" ></i>'+
1444
  '<i class="fas fa-pencil-alt pagelayer-eoi" onclick="pagelayer_edit_element(\''+selector+'\', event)" ></i>'+
 
1445
  '</div>';
1446
 
1447
  }
@@ -1617,7 +1637,7 @@ function pagelayer_right_click(){
1617
  $contextMenu.find('.pagelayer-right-paste').parent().hide();
1618
  }
1619
 
1620
- var gId = jEle.attr("pagelayer-a-global_id");
1621
 
1622
  // Are we to hide the global widget ?
1623
  if(!pagelayer_empty(gId) || tag == 'pl_row' || tag == 'pl_inner_row'|| tag == 'pl_col'){
@@ -1626,7 +1646,7 @@ function pagelayer_right_click(){
1626
  $contextMenu.find('.pagelayer-right-save-global-widget').parent().show();
1627
  }
1628
 
1629
- var sId = jEle.attr("pagelayer-a-global-section-id");
1630
 
1631
  // Are we to hide the save as global section ?
1632
  if( tag == 'pl_row' && pagelayer_empty(sId)){
@@ -1958,7 +1978,7 @@ function pagelayer_delete_element(selector){
1958
  'title' : pagelayer_shortcodes[sc]['name'],
1959
  'action' : 'Deleted',
1960
  'pl_id' : id,
1961
- 'html' : jEle,
1962
  'cEle' : cEle
1963
  });
1964
  }
@@ -2083,7 +2103,7 @@ function pagelayer_copy_element(selector, insertAfter){
2083
  'title' : pagelayer_shortcodes[tag]['name'],
2084
  'action' : 'Copied',
2085
  'pl_id' : id,
2086
- 'html' : jEle,
2087
  'cEle' : cEle
2088
  });
2089
  }
@@ -2099,6 +2119,83 @@ function pagelayer_copy_element(selector, insertAfter){
2099
  return id;
2100
  };
2101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2102
  // Save sections as template
2103
  function pagelayer_ajax_save_template(data, ajax_call_back = ''){
2104
 
@@ -2128,6 +2225,23 @@ function pagelayer_ajax_save_template(data, ajax_call_back = ''){
2128
 
2129
  }
2130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2131
  // Save widgets as a global widget
2132
  function pagelayer_save_sections(sel, section = 'section'){
2133
 
@@ -2182,7 +2296,7 @@ function pagelayer_save_sections(sel, section = 'section'){
2182
 
2183
  for(var post_id in obj['success']){
2184
 
2185
- jEle.attr("pagelayer-a-global_id", post_id );
2186
 
2187
  // Add global
2188
  jData = {};
@@ -2253,7 +2367,7 @@ function pagelayer_generate_sc_global_widget(){
2253
 
2254
  var pagelayer_set_global_timmer = {};
2255
 
2256
- // If you edit one Global widget it shoud be copied to other instances of the same global widget
2257
  function pagelayer_setup_global_widgets(id, jEle){
2258
 
2259
  if(pagelayer_empty(id) || pagelayer_empty(pagelayer_global_widgets[id])){
@@ -2265,7 +2379,7 @@ function pagelayer_setup_global_widgets(id, jEle){
2265
  clearTimeout(pagelayer_set_global_timmer);
2266
  pagelayer_set_global_timmer = setTimeout(function(){
2267
  // Set attrs for all the global widgets
2268
- jQuery(pagelayer_editable+' [pagelayer-a-global_id='+ id +']').each(function(){
2269
 
2270
  var cEle = jQuery(this);
2271
  var cEleID = pagelayer_id(cEle);
@@ -2460,14 +2574,77 @@ function pagelayer_tag(jEle){
2460
  return jEle.attr('pagelayer-tag');
2461
  }
2462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2463
  // Gets a single attribute value
2464
  function pagelayer_get_att(jEle, att){
2465
- return jEle.attr('pagelayer-a-'+att);
 
 
 
 
2466
  };
2467
 
2468
  // Gets a single attribute value
2469
  function pagelayer_get_tmp_att(jEle, att){
2470
- return jEle.attr('pagelayer-tmp-'+att);
 
 
 
 
2471
  };
2472
 
2473
  // This function will just set atts and not do anything else
@@ -2561,6 +2738,8 @@ function pagelayer_set_atts(jEle, atts, val){
2561
 
2562
  }
2563
 
 
 
2564
  for(var x in atts){
2565
 
2566
  // Are we to trigger change
@@ -2594,17 +2773,17 @@ function pagelayer_set_atts(jEle, atts, val){
2594
  'newVal' : atts[x]
2595
  });
2596
  }
2597
-
2598
  // Remove the attribute if its BLANK and there is no default for it
2599
  // If there is a default, we set it to blank to keep record of the current val
2600
  if(atts[x].length < 1){
2601
 
2602
- // Dont remove the value as there is a default
2603
  if(!(x in defaults)){
2604
- jEle.removeAttr('pagelayer-a-'+x);
2605
- // Otherwise blank it
2606
  }else{
2607
- jEle.attr('pagelayer-a-'+x, atts[x]);
2608
  }
2609
 
2610
  // Remove the tmp atts anyway
@@ -2612,7 +2791,7 @@ function pagelayer_set_atts(jEle, atts, val){
2612
 
2613
  // Set the value
2614
  }else{
2615
- jEle.attr('pagelayer-a-'+x, pagelayer_trim(atts[x]));
2616
  }
2617
 
2618
  // Are you the active element
@@ -2624,6 +2803,8 @@ function pagelayer_set_atts(jEle, atts, val){
2624
 
2625
  }
2626
 
 
 
2627
  // Trigger the change of the parameter and show the required properties
2628
  if(trigger_onchange){
2629
  pagelayer_elpd_show_rows();
@@ -2646,8 +2827,12 @@ function pagelayer_set_tmp_atts(jEle, atts, val){
2646
  return false;
2647
  }
2648
 
 
 
2649
  for(var x in atts){
2650
 
 
 
2651
  // Record history
2652
  if(pagelayer.history_action){
2653
 
@@ -2664,44 +2849,33 @@ function pagelayer_set_tmp_atts(jEle, atts, val){
2664
  });
2665
 
2666
  }
2667
-
2668
- jEle.attr('pagelayer-tmp-'+x, atts[x]);
 
2669
  }
2670
 
 
 
2671
  };
2672
 
2673
  // This function removes the temporary attributes of an ele
2674
- function pagelayer_clear_tmp_atts(jEle, attr){
2675
-
2676
- var to_del = new Array();
2677
- var regexp = new RegExp('pagelayer\-tmp\-'+attr, 'gi');
2678
 
2679
- jQuery.each(jEle[0].attributes, function(index, att){
2680
- if(!att) return;
2681
- if(att.name.match(regexp)){
2682
- to_del.push(att.name);
2683
- }
2684
- });
2685
 
2686
  //console.log(to_del);
2687
- for(var n in to_del){
2688
- jEle.removeAttr(to_del[n]);
 
 
2689
  }
2690
  }
2691
 
2692
  // Set the att and classes of an HTML which is not yet created
2693
- function pagelayer_sc_atts(classes, atts){
2694
-
2695
- if(typeof atts != 'object'){
2696
- atts = new Object();
2697
- }
2698
-
2699
- var r = new Array();
2700
-
2701
- for(var x in atts){
2702
- r.push('pagelayer-a-'+x+'="'+atts[x]+'"');
2703
- }
2704
-
2705
  return 'class="'+classes+' pagelayer-ele" '+r.join(' ');
2706
  }
2707
 
@@ -2749,6 +2923,8 @@ function pagelayer_css_render(css, val, seperator){
2749
  // Handle hexa to rgba and also remove alpha which is ff
2750
  function pagelayer_hex8_to_rgba(val){
2751
 
 
 
2752
  // If opacity is ff then discard ff
2753
  if(val.match(/^#([a-f0-9]{6})ff$/)){
2754
  return val.substr(0,7);
@@ -3210,7 +3386,7 @@ function pagelayer_sc_render(jEle){
3210
  pagelayer_trigger_action('pagelayer_sc_render_end', [el]);
3211
 
3212
  var gEle = pagelayer_ele_by_id(eleId);
3213
- var gId = gEle.attr('pagelayer-a-global_id');
3214
 
3215
  // If global id exist then update the global array and restup the all global element
3216
  if(!pagelayer_empty(gId) && !pagelayer_empty(pagelayer.global_render)){
@@ -3219,10 +3395,12 @@ function pagelayer_sc_render(jEle){
3219
  pagelayer_global_widgets[gId]['is_dirty'] = true;
3220
  pagelayer_setup_global_widgets(gId, pagelayer_ele_by_id(eleId), true);
3221
  }else{
3222
- gEle.removeAttr('pagelayer-a-global_id');
3223
  }
3224
  };
3225
 
 
 
3226
  };
3227
 
3228
  // Is the given tag a group
@@ -3406,17 +3584,11 @@ function pagelayer_generate_sc(selector, selfEle){
3406
  inner = pagelayer_shortcodes[tag]['innerHTML'];
3407
  }
3408
 
 
 
 
3409
  // Create the tag
3410
- var data = {};
3411
-
3412
- // Get the attributes to store
3413
- jQuery.each(jEle[0].attributes, function(i, attrib){
3414
- var res = attrib.name.match(/^pagelayer-a-(.+)/i);
3415
- if(res && res[1] != inner){
3416
- //console.log(attrib.name+' '+res[1]);
3417
- data[res[1]] = attrib.value;
3418
- }
3419
- });
3420
 
3421
  data['pagelayer-id'] = id;
3422
  data = pagelayer_serializeAttributes(data);
@@ -3997,33 +4169,9 @@ function pagelayer_history_setup(force){
3997
  alert(obj['error']);
3998
  }else{
3999
 
4000
- // Get the current post_name and post_status
4001
- var props = jQuery(pagelayer_editable).find('.pagelayer-post_props');
4002
- var post_name = '', post_status = '';
4003
-
4004
- if(props.length > 0){
4005
- post_name = pagelayer_get_att(props, 'post_name');
4006
- post_status = pagelayer_get_att(props, 'post_status');
4007
- }
4008
-
4009
  jQuery(pagelayer_editable).html(obj['content']);
4010
 
4011
- // Add previous post_name and post_status
4012
- var props_new = jQuery(pagelayer_editable).find('.pagelayer-post_props');
4013
- if(props_new.length > 0){
4014
-
4015
- if(pagelayer_empty(post_name)){
4016
- post_name = pagelayer_shortcodes.pl_post_props.params.post_name.default;
4017
- }
4018
-
4019
- if(pagelayer_empty(post_status)){
4020
- post_status = pagelayer_shortcodes.pl_post_props.params.post_status.default;
4021
- }
4022
-
4023
- props_new.attr('pagelayer-a-post_name', post_name);
4024
- props_new.attr('pagelayer-a-post_status', post_status);
4025
- }
4026
-
4027
  // Need to pass true to render table
4028
  pagelayer_element_setup('.pagelayer-ele', true);
4029
  pagelayer_add_widget();
@@ -4626,29 +4774,6 @@ function pagelayer_randstr(n, special){
4626
  return text;
4627
  };
4628
 
4629
- function pagelayer_update_site_title(val){
4630
- if(!pagelayer_empty(val)){
4631
- var site_name = jQuery('.pagelayer-wp-title').attr('pagelayer-a-site_name');
4632
- if(!pagelayer_empty(site_name)){
4633
- var site_title = jQuery.ajax({
4634
- url: pagelayer_ajax_url+'&action=pagelayer_fetch_site_title',
4635
- type: 'post',
4636
- async: false
4637
- }).responseText;
4638
-
4639
- if(site_title != site_name){
4640
- var site_title = jQuery.ajax({
4641
- url: pagelayer_ajax_url+'&action=pagelayer_update_site_title',
4642
- type: 'post',
4643
- data: {'site_title': site_name},
4644
- async: false
4645
- }).responseText;
4646
- }
4647
- }
4648
- }
4649
- }
4650
-
4651
-
4652
  // Convert the regular URL of a Video to a Embed URL
4653
  function pagelayer_video_url(src){
4654
 
@@ -4759,9 +4884,12 @@ function pagelayer_add_widget(){
4759
  // Create element
4760
  var ele = jQuery('<div pagelayer-tag="'+tag+'" '+attr+'></div>');
4761
  cEle.find('.pagelayer-col-holder').append(ele);
 
4762
  var id = pagelayer_onadd(ele);
 
 
4763
  var eEle = pagelayer_ele_by_id(col_id);
4764
-
4765
  // Ensure the column is not empty
4766
  pagelayer_empty_col(cEle.find('.pagelayer-col-holder'));
4767
 
20
  pro_txt : '',
21
  loaded : 0,
22
  post_status : '',
23
+ el: {},// All elements data
24
  }
25
 
26
  var pagelayer_history_obj = {}, pagelayer_revision_obj = {};
62
  };
63
 
64
  // Lets start
65
+ jQuery(document).ready(pagelayer_start);
66
+
67
+ // Function to load the codes
68
+ function pagelayer_start(){
69
+
70
+ pagelayer.loading = 1;
71
+ console.log('['+pagelayer_brand+'] Starting Pagelayer');
72
 
73
  // Prevent the click Insite editor
74
  pagelayer_prevent_click();
148
  // Hide the loader
149
  pagelayer_loader_hide();
150
 
151
+ }
152
 
153
  // Prevent the click Insite editor
154
  function pagelayer_prevent_click(){
1142
  if(!pagelayer_empty(gId)){
1143
 
1144
  html = pagelayer_element_unsetup(pagelayer_global_widgets[gId].$);
 
1145
 
1146
  // Generate the HTML
1147
  }else{
1157
  // Setup the properties of the elements
1158
  pagelayer_element_setup("[pagelayer-id="+par_id+"], [pagelayer-id="+par_id+"] .pagelayer-ele", true);
1159
 
1160
+ // Is this a global widget ? Then set this as global element
1161
+ if(!pagelayer_empty(gId)){
1162
+ html = pagelayer_set_ele_global(jQuery('[pagelayer-id="'+par_id+'"]'), gId);
1163
+ }
1164
+
1165
  // Any children to add ?
1166
  if(!('widget' in pagelayer_shortcodes[sc])){
1167
 
1194
  'title' : pagelayer_shortcodes[sc]['name'],
1195
  'action' : 'Added',
1196
  'pl_id' : id,
1197
+ 'html' : jQuery("[pagelayer-id="+id+"]")[0].outerHTML,
1198
  'cEle' : cEle
1199
  });
1200
 
1279
  // Do you have the pagelayer id
1280
  var id = jEle.attr("pagelayer-id");
1281
  if(!id || id.length < 1){
1282
+ id = pagelayer_randstr(8);
1283
  jEle.attr("pagelayer-id", id);
1284
  }
1285
 
1342
 
1343
  // Loop through
1344
  jQuery(pagelayer_editable+' '+selector).each(function(){
1345
+
1346
  var jEle = jQuery(this);
1347
 
1348
  // Assign an ID if not there
1350
  var pId = pagelayer_get_parent(jEle) || '';// Options to show on hover
1351
  var selector = '[pagelayer-id='+id+']';
1352
 
1353
+ // Get data part
1354
+ pagelayer.el[id] = pagelayer_el_get_data(jEle);
1355
+ //console.log(jEle[0].outerHTML);
1356
+ //console.log(pagelayer.el[id]);
1357
+
1358
  if(render){
1359
  pagelayer_sc_render(jEle);
1360
  }
1433
  }
1434
 
1435
  html = '<div class="pagelayer-row-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
1436
+ '<i class="fas fa-caret-up pagelayer-eoi pagelayer-move-up" onclick="pagelayer_move_element_up(\''+selector+'\')" ></i>'+
1437
  '<i class="far fa-clone pagelayer-eoi" onclick="pagelayer_copy_element(\''+selector+'\')" ></i>'+
1438
  '<i class="fas fa-trash pagelayer-eoi" onclick="pagelayer_delete_element(\''+selector+'\')" ></i>'+
1439
  '<i class="fas fa-pencil-alt pagelayer-eoi" onclick="pagelayer_edit_element(\''+selector+'\', event)" ></i>'+
1440
+ '<i class="fas fa-caret-down pagelayer-eoi pagelayer-move-down" onclick="pagelayer_move_element_down(\''+selector+'\')" ></i>'+
1441
  '</div>';
1442
 
1443
  }else if(tag == 'pl_col'){
1457
  }else{
1458
 
1459
  html = '<div class="pagelayer-ele-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
1460
+ '<i class="fas fa-caret-up pagelayer-eoi pagelayer-move-up" onclick="pagelayer_move_element_up(\''+selector+'\')" ></i>'+
1461
  '<i class="far fa-clone pagelayer-eoi" onclick="pagelayer_copy_element(\''+selector+'\')" ></i>'+
1462
  '<i class="fas fa-trash pagelayer-eoi" onclick="pagelayer_delete_element(\''+selector+'\')" ></i>'+
1463
  '<i class="fas fa-pencil-alt pagelayer-eoi" onclick="pagelayer_edit_element(\''+selector+'\', event)" ></i>'+
1464
+ '<i class="fas fa-caret-down pagelayer-eoi pagelayer-move-down" onclick="pagelayer_move_element_down(\''+selector+'\')" ></i>'+
1465
  '</div>';
1466
 
1467
  }
1637
  $contextMenu.find('.pagelayer-right-paste').parent().hide();
1638
  }
1639
 
1640
+ var gId = pagelayer_get_global_id(jEle);
1641
 
1642
  // Are we to hide the global widget ?
1643
  if(!pagelayer_empty(gId) || tag == 'pl_row' || tag == 'pl_inner_row'|| tag == 'pl_col'){
1646
  $contextMenu.find('.pagelayer-right-save-global-widget').parent().show();
1647
  }
1648
 
1649
+ var sId = pagelayer_get_att(jEle, 'global-section-id');
1650
 
1651
  // Are we to hide the save as global section ?
1652
  if( tag == 'pl_row' && pagelayer_empty(sId)){
1978
  'title' : pagelayer_shortcodes[sc]['name'],
1979
  'action' : 'Deleted',
1980
  'pl_id' : id,
1981
+ 'html' : jEle[0].outerHTML,
1982
  'cEle' : cEle
1983
  });
1984
  }
2103
  'title' : pagelayer_shortcodes[tag]['name'],
2104
  'action' : 'Copied',
2105
  'pl_id' : id,
2106
+ 'html' : jEle[0].outerHTML,
2107
  'cEle' : cEle
2108
  });
2109
  }
2119
  return id;
2120
  };
2121
 
2122
+ // Traversing up one step an element
2123
+ function pagelayer_move_element_up(selector){
2124
+
2125
+ var src = jQuery(selector);
2126
+ var srcParent = src.parent();
2127
+
2128
+ var srcParentPrev = srcParent.prev('.pagelayer-wrap-row, .pagelayer-wrap-inner-row, .pagelayer-wrap-ele');
2129
+
2130
+ if(srcParentPrev.length<=0){
2131
+ return;
2132
+ }
2133
+
2134
+ var srcTopValue = srcParent.offset().top;
2135
+
2136
+ if(srcParentPrev.hasClass('pagelayer-wrap-ele')){
2137
+
2138
+ var animUpCalc = srcTopValue-srcParentPrev.offset().top;
2139
+
2140
+ srcParent.animate({top:-animUpCalc}, 200, function(){
2141
+ srcParent.css('top', '');
2142
+ srcParentPrev.css('top', '');
2143
+ srcParentPrev.before(srcParent.detach());
2144
+ });
2145
+
2146
+ srcParentPrev.animate({top:(srcParent.height()+srcParentPrev.height())-animUpCalc}, 200, function(){
2147
+ srcParentPrev.css('top', '');
2148
+ });
2149
+
2150
+ // Traverse window scroll with the element
2151
+ jQuery('html, body').animate({scrollTop:('-='+(srcTopValue-(srcParentPrev.offset().top)))},200);
2152
+ }else{
2153
+ srcParentPrev.before(srcParent.detach());
2154
+
2155
+ // Traverse window scroll with the element
2156
+ jQuery('html, body').animate({scrollTop:('-='+(srcTopValue-(src.parent().offset().top)))},200);
2157
+ }
2158
+
2159
+ }
2160
+
2161
+ // Traversing down one step an element
2162
+ function pagelayer_move_element_down(selector){
2163
+
2164
+ var src = jQuery(selector);
2165
+ var srcParent = src.parent();
2166
+
2167
+ var srcParentNext = srcParent.next('.pagelayer-wrap-row, .pagelayer-wrap-inner-row, .pagelayer-wrap-ele');
2168
+
2169
+ if(srcParentNext.length<=0){
2170
+ return;
2171
+ }
2172
+
2173
+ var srcTopValue = srcParent.offset().top;
2174
+
2175
+ if(srcParentNext.hasClass('pagelayer-wrap-ele')){
2176
+
2177
+ var animDownCalc = srcParentNext.offset().top-srcTopValue;
2178
+
2179
+ srcParent.animate({top:(animDownCalc-(srcParent.height()-srcParentNext.height()))}, 200, function(){
2180
+ srcParent.css('top', '');
2181
+ srcParentNext.css('top', '');
2182
+ srcParentNext.after(srcParent.detach());
2183
+ });
2184
+
2185
+ srcParentNext.animate({top:-animDownCalc}, 200, function(){
2186
+ srcParentNext.css('top', '');
2187
+ });
2188
+
2189
+ // Traverse window scroll with the element
2190
+ jQuery('html, body').animate({scrollTop:('+='+(animDownCalc-(srcParent.height()-srcParentNext.height())))},200);
2191
+ }else{
2192
+ srcParentNext.after(srcParent.detach());
2193
+
2194
+ // Traverse window scroll with the element
2195
+ jQuery('html, body').animate({scrollTop:('+='+((src.parent().offset().top)-srcTopValue))},200);
2196
+ }
2197
+ }
2198
+
2199
  // Save sections as template
2200
  function pagelayer_ajax_save_template(data, ajax_call_back = ''){
2201
 
2225
 
2226
  }
2227
 
2228
+ // Get global id of the element
2229
+ function pagelayer_get_global_id(jEle){
2230
+ return pagelayer_get_att(jEle, 'global_id');
2231
+ }
2232
+
2233
+ // Set element as a global widget
2234
+ function pagelayer_set_ele_global(jEle, post_id){
2235
+
2236
+ // Add attribute for global ID
2237
+ jEle.attr('pagelayer-global-id', post_id);
2238
+ pagelayer.history_action = false;
2239
+ pagelayer_set_atts(jEle, 'global_id', post_id);
2240
+ pagelayer.history_action = true;
2241
+
2242
+ return jEle;
2243
+ }
2244
+
2245
  // Save widgets as a global widget
2246
  function pagelayer_save_sections(sel, section = 'section'){
2247
 
2296
 
2297
  for(var post_id in obj['success']){
2298
 
2299
+ pagelayer_set_ele_global(jEle, post_id);
2300
 
2301
  // Add global
2302
  jData = {};
2367
 
2368
  var pagelayer_set_global_timmer = {};
2369
 
2370
+ // If you edit one Global widget it should be copied to other instances of the same global widget
2371
  function pagelayer_setup_global_widgets(id, jEle){
2372
 
2373
  if(pagelayer_empty(id) || pagelayer_empty(pagelayer_global_widgets[id])){
2379
  clearTimeout(pagelayer_set_global_timmer);
2380
  pagelayer_set_global_timmer = setTimeout(function(){
2381
  // Set attrs for all the global widgets
2382
+ jQuery(pagelayer_editable+' [pagelayer-global-id='+ id +']').each(function(){
2383
 
2384
  var cEle = jQuery(this);
2385
  var cEleID = pagelayer_id(cEle);
2574
  return jEle.attr('pagelayer-tag');
2575
  }
2576
 
2577
+ function pagelayer_el_data_ref(jEle){
2578
+ var id = pagelayer_id(jEle);
2579
+
2580
+ if(!(id in pagelayer.el)){
2581
+ pagelayer.el[id] = {};
2582
+ }
2583
+
2584
+ if(typeof pagelayer.el[id] !== 'object'){
2585
+ pagelayer.el[id] = {};
2586
+ }
2587
+
2588
+ if(!('attr' in pagelayer.el[id])){
2589
+ pagelayer.el[id]['attr'] = {};
2590
+ }
2591
+
2592
+ if(!('tmp' in pagelayer.el[id])){
2593
+ pagelayer.el[id]['tmp'] = {};
2594
+ }
2595
+
2596
+ return pagelayer.el[id];
2597
+ };
2598
+
2599
+ // Gets the data node which can be position 0 or 1
2600
+ function pagelayer_el_get_data_node(jEle){
2601
+ var node = jEle[0].childNodes[0];
2602
+ if(node && node.nodeType === 8){
2603
+ return node;
2604
+ }
2605
+ node = jEle[0].childNodes[1];
2606
+ if(node && node.nodeType === 8){
2607
+ return node;
2608
+ }
2609
+ return false;
2610
+ }
2611
+
2612
+ // Get the data
2613
+ function pagelayer_el_get_data(jEle){
2614
+ var node = pagelayer_el_get_data_node(jEle);
2615
+ if(node){
2616
+ return JSON.parse(node.nodeValue);
2617
+ }
2618
+ return false;
2619
+ };
2620
+
2621
+ // Add the data back again
2622
+ function pagelayer_el_dump_data(jEle){
2623
+ var node = pagelayer_el_get_data_node(jEle);
2624
+ var d = JSON.stringify(pagelayer.el[pagelayer_id(jEle)]);
2625
+ if(node){
2626
+ node.nodeValue = d;
2627
+ }else{
2628
+ jEle.prepend('<!-- '+d+' -->');
2629
+ }
2630
+ };
2631
+
2632
  // Gets a single attribute value
2633
  function pagelayer_get_att(jEle, att){
2634
+ var ref_data = pagelayer_el_data_ref(jEle);
2635
+ if(att in ref_data['attr']){
2636
+ return ref_data['attr'][att];
2637
+ }
2638
+ return;
2639
  };
2640
 
2641
  // Gets a single attribute value
2642
  function pagelayer_get_tmp_att(jEle, att){
2643
+ var ref_data = pagelayer_el_data_ref(jEle);
2644
+ if(att in ref_data['tmp']){
2645
+ return ref_data['tmp'][att];
2646
+ }
2647
+ return;
2648
  };
2649
 
2650
  // This function will just set atts and not do anything else
2738
 
2739
  }
2740
 
2741
+ var ref_data = pagelayer_el_data_ref(jEle);
2742
+
2743
  for(var x in atts){
2744
 
2745
  // Are we to trigger change
2773
  'newVal' : atts[x]
2774
  });
2775
  }
2776
+
2777
  // Remove the attribute if its BLANK and there is no default for it
2778
  // If there is a default, we set it to blank to keep record of the current val
2779
  if(atts[x].length < 1){
2780
 
2781
+ // Remove values which are not defaults
2782
  if(!(x in defaults)){
2783
+ delete ref_data['attr'][x];
2784
+ // Otherwise keep value set for avoiding resetting
2785
  }else{
2786
+ ref_data['attr'][x] = String(atts[x]);
2787
  }
2788
 
2789
  // Remove the tmp atts anyway
2791
 
2792
  // Set the value
2793
  }else{
2794
+ ref_data['attr'][x] = pagelayer_trim(String(atts[x]));
2795
  }
2796
 
2797
  // Are you the active element
2803
 
2804
  }
2805
 
2806
+ pagelayer_el_dump_data(jEle);
2807
+
2808
  // Trigger the change of the parameter and show the required properties
2809
  if(trigger_onchange){
2810
  pagelayer_elpd_show_rows();
2827
  return false;
2828
  }
2829
 
2830
+ var ref_data = pagelayer_el_data_ref(jEle);
2831
+
2832
  for(var x in atts){
2833
 
2834
+ atts[x] = String(atts[x]);
2835
+
2836
  // Record history
2837
  if(pagelayer.history_action){
2838
 
2849
  });
2850
 
2851
  }
2852
+
2853
+ ref_data['tmp'][x] = atts[x];
2854
+
2855
  }
2856
 
2857
+ pagelayer_el_dump_data(jEle);
2858
+
2859
  };
2860
 
2861
  // This function removes the temporary attributes of an ele
2862
+ function pagelayer_clear_tmp_atts(jEle, attr){
 
 
 
2863
 
2864
+ var to_del = new Array();
2865
+ var regexp = new RegExp('^'+attr+'\-', 'gi');
2866
+ var ref_data = pagelayer_el_data_ref(jEle);
 
 
 
2867
 
2868
  //console.log(to_del);
2869
+ for(var n in ref_data['tmp']){
2870
+ if(n.match(regexp)){
2871
+ delete ref_data['tmp'][n];
2872
+ }
2873
  }
2874
  }
2875
 
2876
  // Set the att and classes of an HTML which is not yet created
2877
+ function pagelayer_sc_atts(classes){
2878
+ var r = new Array();
 
 
 
 
 
 
 
 
 
 
2879
  return 'class="'+classes+' pagelayer-ele" '+r.join(' ');
2880
  }
2881
 
2923
  // Handle hexa to rgba and also remove alpha which is ff
2924
  function pagelayer_hex8_to_rgba(val){
2925
 
2926
+ val = String(val);
2927
+
2928
  // If opacity is ff then discard ff
2929
  if(val.match(/^#([a-f0-9]{6})ff$/)){
2930
  return val.substr(0,7);
3386
  pagelayer_trigger_action('pagelayer_sc_render_end', [el]);
3387
 
3388
  var gEle = pagelayer_ele_by_id(eleId);
3389
+ var gId = pagelayer_get_global_id(gEle);
3390
 
3391
  // If global id exist then update the global array and restup the all global element
3392
  if(!pagelayer_empty(gId) && !pagelayer_empty(pagelayer.global_render)){
3395
  pagelayer_global_widgets[gId]['is_dirty'] = true;
3396
  pagelayer_setup_global_widgets(gId, pagelayer_ele_by_id(eleId), true);
3397
  }else{
3398
+ pagelayer_set_atts(gEle, 'global_id', '');
3399
  }
3400
  };
3401
 
3402
+ pagelayer_el_dump_data(jEle);
3403
+
3404
  };
3405
 
3406
  // Is the given tag a group
3584
  inner = pagelayer_shortcodes[tag]['innerHTML'];
3585
  }
3586
 
3587
+ // Data reference
3588
+ var ref_data = pagelayer_el_data_ref(jEle);
3589
+
3590
  // Create the tag
3591
+ var data = JSON.parse(JSON.stringify(ref_data['attr']));
 
 
 
 
 
 
 
 
 
3592
 
3593
  data['pagelayer-id'] = id;
3594
  data = pagelayer_serializeAttributes(data);
4169
  alert(obj['error']);
4170
  }else{
4171
 
4172
+ // Set content
 
 
 
 
 
 
 
 
4173
  jQuery(pagelayer_editable).html(obj['content']);
4174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4175
  // Need to pass true to render table
4176
  pagelayer_element_setup('.pagelayer-ele', true);
4177
  pagelayer_add_widget();
4774
  return text;
4775
  };
4776
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4777
  // Convert the regular URL of a Video to a Embed URL
4778
  function pagelayer_video_url(src){
4779
 
4884
  // Create element
4885
  var ele = jQuery('<div pagelayer-tag="'+tag+'" '+attr+'></div>');
4886
  cEle.find('.pagelayer-col-holder').append(ele);
4887
+ //console.log(ele);
4888
  var id = pagelayer_onadd(ele);
4889
+ //console.log(id);
4890
+ //console.log(col_id);
4891
  var eEle = pagelayer_ele_by_id(col_id);
4892
+ //console.log(eEle);
4893
  // Ensure the column is not empty
4894
  pagelayer_empty_col(cEle.find('.pagelayer-col-holder'));
4895
 
js/properties.js CHANGED
@@ -21,19 +21,11 @@ function pagelayer_data(jEle, clean){
21
  ret.id = pagelayer_id(jEle);;
22
  ret.$ = jEle;
23
 
24
- // Parse the attributes
25
- ret.atts = new Object();
26
- ret.tmp = new Object();
27
 
28
- jQuery.each(jEle[0].attributes, function(index, att){
29
- if(att.name.match(/pagelayer\-a\-/i)){
30
- ret.atts[att.name.substr(12)] = att.value;
31
- }
32
-
33
- if(att.name.match(/pagelayer\-tmp\-/i)){
34
- ret.tmp[att.name.substr(14)] = att.value;
35
- }
36
- });
37
 
38
  //console.log(ret.atts);
39
  //console.log(ret.tmp);
@@ -1207,7 +1199,7 @@ function pagelayer_elp_image(row, prop){
1207
  // On open select the appropriate images in the media manager
1208
  'open': function() {
1209
  var selection = frame.state().get('selection');
1210
- var wp_id = prop.el.$.attr('pagelayer-a-id');
1211
  selection.reset( wp_id ? [ wp.media.attachment( wp_id ) ] : [] );
1212
  }
1213
  });
21
  ret.id = pagelayer_id(jEle);;
22
  ret.$ = jEle;
23
 
24
+ var ref_data = pagelayer_el_data_ref(jEle);
 
 
25
 
26
+ // Parse the attributes
27
+ ret.atts = JSON.parse(JSON.stringify(ref_data['attr']));
28
+ ret.tmp = JSON.parse(JSON.stringify(ref_data['tmp']));
 
 
 
 
 
 
29
 
30
  //console.log(ret.atts);
31
  //console.log(ret.tmp);
1199
  // On open select the appropriate images in the media manager
1200
  'open': function() {
1201
  var selection = frame.state().get('selection');
1202
+ var wp_id = pagelayer_get_att(prop.el.$, prop.c['name']);
1203
  selection.reset( wp_id ? [ wp.media.attachment( wp_id ) ] : [] );
1204
  }
1205
  });
js/widgets.js CHANGED
@@ -1074,8 +1074,16 @@ function pagelayer_render_pl_post_content(el){
1074
 
1075
  // Render the flipbox
1076
  function pagelayer_render_pl_flipbox(el){
 
1077
  el.atts['func_image'] = el.tmp['heading_image-'+el.atts['heading_image_size']+'-url'] || el.tmp['heading_image-url'];
1078
  el.atts['func_image'] = el.atts['func_image'] || el.atts['heading_image'];
 
 
 
 
 
 
 
1079
  }
1080
 
1081
  // Render the Testimonial Slider
@@ -1087,6 +1095,12 @@ function pagelayer_render_end_pl_testimonial_slider(el){
1087
  // Render the countdown
1088
  function pagelayer_render_end_pl_countdown(el){
1089
  var jEle = el.$;
 
 
 
 
 
 
1090
  pagelayer_countdown(jEle);
1091
  }
1092
 
1074
 
1075
  // Render the flipbox
1076
  function pagelayer_render_pl_flipbox(el){
1077
+ var jEle = el.$;
1078
  el.atts['func_image'] = el.tmp['heading_image-'+el.atts['heading_image_size']+'-url'] || el.tmp['heading_image-url'];
1079
  el.atts['func_image'] = el.atts['func_image'] || el.atts['heading_image'];
1080
+
1081
+ var back = pagelayer_get_att(jEle, 'back_section');
1082
+ if(back){
1083
+ jEle.attr('back_section', back);
1084
+ }else{
1085
+ jEle.removeAttr('back_section', back);
1086
+ }
1087
  }
1088
 
1089
  // Render the Testimonial Slider
1095
  // Render the countdown
1096
  function pagelayer_render_end_pl_countdown(el){
1097
  var jEle = el.$;
1098
+ var exp = pagelayer_get_att(jEle, 'display_expired_text');
1099
+ if(exp){
1100
+ jEle.attr('display_expired_text', exp);
1101
+ }else{
1102
+ jEle.removeAttr('display_expired_text', exp);
1103
+ }
1104
  pagelayer_countdown(jEle);
1105
  }
1106
 
languages/en.json CHANGED
@@ -1769,7 +1769,7 @@
1769
  "container" : "Container",
1770
  "hf" : "Header and Footer",
1771
  "body_content" : "Body and Content",
1772
- "color_notice" : "Note : By default the theme colors would be inherited. If you set any value here, it will override your theme values. These colors can be over-written by the individual elements as well !",
1773
  "welcome_to" : "Welcome to ",
1774
  "choose_pagelayer" : "Thanks for Choosing Pagelayer - The most advanced frontend drag & drop page builder. Its very easy to use and very light on the browser.",
1775
  "choose_sitepad" : "Thanks for Choosing Sitepad - Build Professional websites using an easy to use drag and drop editor.",
@@ -1834,5 +1834,9 @@
1834
  "disable_sep" : "Disable Separator",
1835
  "message_style" : "Message Box",
1836
  "clip_hide" : "Hide Clip",
1837
- "show_mega_menu" : "Show Mega Menu"
 
 
 
 
1838
  }
1769
  "container" : "Container",
1770
  "hf" : "Header and Footer",
1771
  "body_content" : "Body and Content",
1772
+ "color_notice" : "Note : By default the theme's (i.e. style.css) font and color settings would be loaded for your website. If you set any value here, it will override your theme's font and color settings. These font and color settings can be over-written by the individual element widgets as well !",
1773
  "welcome_to" : "Welcome to ",
1774
  "choose_pagelayer" : "Thanks for Choosing Pagelayer - The most advanced frontend drag & drop page builder. Its very easy to use and very light on the browser.",
1775
  "choose_sitepad" : "Thanks for Choosing Sitepad - Build Professional websites using an easy to use drag and drop editor.",
1834
  "disable_sep" : "Disable Separator",
1835
  "message_style" : "Message Box",
1836
  "clip_hide" : "Hide Clip",
1837
+ "show_mega_menu" : "Show Mega Menu",
1838
+ "only_top_level" : "Only Top Level",
1839
+ "text_decoration" : "Text Decoration",
1840
+ "elem_styles" : "Element Styles",
1841
+ "body_style" : "Body Style"
1842
  }
main/ajax.php CHANGED
@@ -29,6 +29,8 @@ if(empty($_REQUEST['pagelayer_nonce'])){
29
  return;
30
  }
31
 
 
 
32
  // The ajax handler
33
  add_action('wp_ajax_pagelayer_wp_widget', 'pagelayer_wp_widget_ajax');
34
  function pagelayer_wp_widget_ajax(){
@@ -1789,7 +1791,7 @@ function pagelayer_export_template(){
1789
  }
1790
 
1791
  // Export the settings
1792
- $settings = ['pagelayer_content_width', 'pagelayer_body_font', 'pagelayer_tablet_breakpoint', 'pagelayer_mobile_breakpoint', 'pagelayer_body_typography', 'pagelayer_h1_typography', 'pagelayer_h2_typography', 'pagelayer_h3_typography', 'pagelayer_h4_typography', 'pagelayer_h5_typography', 'pagelayer_h6_typography', 'pagelayer_color', 'pagelayer_header_code', 'pagelayer_footer_code', 'pagelayer_sidebar', 'page_for_posts'];
1793
 
1794
  foreach($settings as $v){
1795
 
@@ -1800,6 +1802,18 @@ function pagelayer_export_template(){
1800
  }
1801
 
1802
  }
 
 
 
 
 
 
 
 
 
 
 
 
1803
 
1804
  // Write the config
1805
  if(!empty($conf)){
29
  return;
30
  }
31
 
32
+ pagelayer_memory_limit(128);
33
+
34
  // The ajax handler
35
  add_action('wp_ajax_pagelayer_wp_widget', 'pagelayer_wp_widget_ajax');
36
  function pagelayer_wp_widget_ajax(){
1791
  }
1792
 
1793
  // Export the settings
1794
+ $settings = ['pagelayer_content_width', 'pagelayer_body_font', 'pagelayer_tablet_breakpoint', 'pagelayer_mobile_breakpoint', 'pagelayer_header_code', 'pagelayer_footer_code', 'pagelayer_sidebar', 'page_for_posts'];
1795
 
1796
  foreach($settings as $v){
1797
 
1802
  }
1803
 
1804
  }
1805
+
1806
+ // Load CSS settings
1807
+ foreach($pagelayer->css_settings as $k => $params){
1808
+ foreach($pagelayer->screens as $sk => $sv){
1809
+ $suffix = (!empty($sv) ? '_'.$sv : '');
1810
+ $setting = empty($params['key']) ? 'pagelayer_'.$k.'_css' : $params['key'];
1811
+ $tmp = get_option($setting.$suffix);
1812
+ if(!empty($tmp)){
1813
+ $conf['conf'][$setting.$suffix] = $tmp;
1814
+ }
1815
+ }
1816
+ }
1817
 
1818
  // Write the config
1819
  if(!empty($conf)){
main/class.php CHANGED
@@ -57,6 +57,9 @@ class PageLayer{
57
  // Tabs visible in the left panel
58
  var $tabs = ['settings', 'options'];
59
 
 
 
 
60
  // Icons set
61
  var $icons = ['font-awesome5'];
62
 
@@ -71,6 +74,9 @@ class PageLayer{
71
 
72
  // For saved sections
73
  var $saved_sections = array();
 
 
 
74
 
75
  function __construct() {
76
 
@@ -80,6 +86,28 @@ class PageLayer{
80
 
81
  // Add after plugins_loaded
82
  add_action('plugins_loaded', [ $this, 'load_extra_languages' ], 11);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
 
85
  function load_extra_languages(){
57
  // Tabs visible in the left panel
58
  var $tabs = ['settings', 'options'];
59
 
60
+ // Tabs visible in the left panel
61
+ var $screens = ['desktop' => '', 'tablet' => 'tablet', 'mobile' => 'mobile'];
62
+
63
  // Icons set
64
  var $icons = ['font-awesome5'];
65
 
74
 
75
  // For saved sections
76
  var $saved_sections = array();
77
+
78
+ var $css = array();
79
+ var $css_settings = array();
80
 
81
  function __construct() {
82
 
86
 
87
  // Add after plugins_loaded
88
  add_action('plugins_loaded', [ $this, 'load_extra_languages' ], 11);
89
+
90
+ // Array of font options
91
+ $this->css_settings = ['body' => ['name' => 'Body', 'key' => 'pagelayer_body_typography'],
92
+ 'header' => ['name' => 'Site Header', 'sel' => '> header'],
93
+ 'main' => ['name' => 'Site Main', 'sel' => '.site-main'],
94
+ 'footer' => ['name' => 'Site Footer', 'sel' => '> footer'],
95
+ 'entry-header' => ['name' => 'Content Header', 'sel' => '.entry-header'],
96
+ 'entry-content' => ['name' => 'Content', 'sel' => '.entry-content'],
97
+ 'entry-footer' => ['name' => 'Content Footer', 'sel' => '.entry-footer'],
98
+ 'p' => ['name' => 'Paragraph'],
99
+ 'aside' => ['name' => 'Sidebar'],
100
+ 'a' => ['name' => 'Link'],
101
+ 'a-hover' => ['name' => 'Link Hover', 'sel' => 'a:hover'],
102
+ 'h1' => ['name' => 'H1', 'key' => 'pagelayer_h1_typography'],
103
+ 'h2' => ['name' => 'H2', 'key' => 'pagelayer_h2_typography'],
104
+ 'h3' => ['name' => 'H3', 'key' => 'pagelayer_h3_typography'],
105
+ 'h4' => ['name' => 'H4', 'key' => 'pagelayer_h4_typography'],
106
+ 'h5' => ['name' => 'H5', 'key' => 'pagelayer_h5_typography'],
107
+ 'h6' => ['name' => 'H6', 'key' => 'pagelayer_h6_typography'],
108
+ 'b' => ['name' => 'Bold', 'sel' => 'strong, b'],
109
+ 'i' => ['name' => 'Italics', 'sel' => 'em, i'],
110
+ ];
111
  }
112
 
113
  function load_extra_languages(){
main/font-options.php CHANGED
@@ -49,4 +49,20 @@ $pagelayer->font_weight = ['' => 'Default',
49
  '600' => '600 Semi Bold',
50
  '700' => '700 Bold',
51
  '800' => '800 Extra Bold',
52
- '900' => '900 Ultra Bold'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  '600' => '600 Semi Bold',
50
  '700' => '700 Bold',
51
  '800' => '800 Extra Bold',
52
+ '900' => '900 Ultra Bold'];
53
+
54
+ $pagelayer->text_decoration_line = ['' => 'Default',
55
+ 'none' => 'None',
56
+ 'overline' => 'Overline',
57
+ 'line-through' => 'Line-through',
58
+ 'underline' => 'Underline',
59
+ 'underline overline' => 'Underline and Overline',
60
+ ];
61
+
62
+ $pagelayer->text_decoration_style = ['' => 'Default',
63
+ 'solid' => 'Solid',
64
+ 'double' => 'Double',
65
+ 'dotted' => 'Dotted',
66
+ 'dashed' => 'Dashed',
67
+ 'wavy' => 'Wavy',
68
+ ];
main/import.php CHANGED
@@ -494,6 +494,12 @@ global $pagelayer, $pl_error, $sitepad;
494
  ///////////////////////////
495
  // Lets import all MEDIA
496
  ///////////////////////////
 
 
 
 
 
 
497
  $_media = list_files($pagelayer_theme_path.'/images', 1);
498
  //r_print($_media);die();
499
 
494
  ///////////////////////////
495
  // Lets import all MEDIA
496
  ///////////////////////////
497
+
498
+ // Now lets download the templates
499
+ if(!function_exists( 'list_files' ) ) {
500
+ require_once ABSPATH . PAGELAYER_CMS_DIR_PREFIX.'-admin/includes/file.php';
501
+ }
502
+
503
  $_media = list_files($pagelayer_theme_path.'/images', 1);
504
  //r_print($_media);die();
505
 
main/live-body.php CHANGED
@@ -159,22 +159,49 @@ echo '</div>
159
  </div>
160
  <script>
161
  var pagelayer_iframe_cw = document.getElementById("pagelayer-iframe").contentWindow;
 
162
 
163
  // Show loading progress
164
  function loader(ran) {
165
  var inner = document.getElementsByClassName("pagelayer-percent")[0];
166
  var w = 0;
167
- var t = setInterval(function() {
168
- w = w + 1;
169
- inner.innerHTML = (w+"<sup>%</sup>");
170
- if (w === ran || inner.getAttribute("loaded") == "1"){
171
- clearInterval(t);
172
- w = 0;
173
- }
174
- }, 50);
175
  }
176
  loader(90);
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  // ErrorBox content copy function
179
  function pagelayer_copy_error(){
180
  var tempInput = document.createElement("textarea");
159
  </div>
160
  <script>
161
  var pagelayer_iframe_cw = document.getElementById("pagelayer-iframe").contentWindow;
162
+ var start_time = new Date().getTime();
163
 
164
  // Show loading progress
165
  function loader(ran) {
166
  var inner = document.getElementsByClassName("pagelayer-percent")[0];
167
  var w = 0;
168
+ var t = setInterval(function() {
169
+ w = w + 1;
170
+ inner.innerHTML = (w+"<sup>%</sup>");
171
+ if (w === ran || inner.getAttribute("loaded") == "1"){
172
+ clearInterval(t);
173
+ w = 0;
174
+ }
175
+ }, 50);
176
  }
177
  loader(90);
178
 
179
+ // Load the window if necessary i.e. an error in the JS of the iframe
180
+ function onIframeLoad(){
181
+ setTimeout(function(){
182
+ force_pagelayer_start();
183
+ }, 5000);
184
+ }
185
+
186
+ function force_pagelayer_start(){
187
+ try{
188
+ if(pagelayer_iframe_cw.pagelayer.loaded == 1){
189
+ return;
190
+ }
191
+ pagelayer_iframe_cw.pagelayer_start();
192
+ var end_time = new Date().getTime();
193
+ var diff = (end_time - start_time) / 1000;
194
+ console.log("['.$pagelayer->BRAND_TEXT.'] Live Body had to load after : "+diff+" seconds");
195
+
196
+ // If this fails, lets just hide the loader
197
+ }catch(e){
198
+ alert("Fatal error within the '.$pagelayer->BRAND_TEXT.' iFrame as pagelayer object not found ! Please contact '.$pagelayer->BRAND_TEXT.' support");
199
+ document.getElementById("pagelayer-loader-wrapper").remove();
200
+ }
201
+ }
202
+
203
+ document.getElementById("pagelayer-iframe").onload = onIframeLoad;
204
+
205
  // ErrorBox content copy function
206
  function pagelayer_copy_error(){
207
  var tempInput = document.createElement("textarea");
main/live.php CHANGED
@@ -147,7 +147,8 @@ pagelayer_loaded_icons = '.json_encode(pagelayer_enabled_icons()).';
147
  pagelayer_social_urls = '.json_encode(pagelayer_get_social_urls()).';
148
  pagelayer_global_widgets = '.json_encode($pagelayer->global_widgets).';
149
  pagelayer_saved_sections = '.json_encode($pagelayer->saved_sections).';
150
- pagelayer_global_sections = '.json_encode($pagelayer->global_sections).';';
 
151
 
152
  // Detect JS via givejs for better performance
153
  if(empty($pagelayer->settings['enable_giver'])){
147
  pagelayer_social_urls = '.json_encode(pagelayer_get_social_urls()).';
148
  pagelayer_global_widgets = '.json_encode($pagelayer->global_widgets).';
149
  pagelayer_saved_sections = '.json_encode($pagelayer->saved_sections).';
150
+ pagelayer_global_sections = '.json_encode($pagelayer->global_sections).';
151
+ pagelayer_brand = "'.addslashes($pagelayer->BRAND_TEXT).'";';
152
 
153
  // Detect JS via givejs for better performance
154
  if(empty($pagelayer->settings['enable_giver'])){
main/shortcode_functions.php CHANGED
@@ -59,6 +59,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
59
  global $pagelayer;
60
 
61
  $is_block = 0;
 
62
 
63
  // Is block ?
64
  if(!empty($atts['is_not_sc'])){
@@ -97,7 +98,9 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
97
  $content = $pagelayer->global_sections[$atts['global_id']]['$'];
98
  return pagelayer_change_id($content);
99
  }
100
-
 
 
101
  }
102
 
103
  // Is there any function ?
@@ -109,7 +112,6 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
109
  }
110
 
111
  // Create the element array. NOTE : This is similar to the JS el and is temporary
112
- $el = [];
113
  $el['atts'] = $atts;
114
  $el['oAtts'] = $atts;
115
  $el['id'] = !empty($atts['pagelayer-id']) ? $atts['pagelayer-id'] : pagelayer_RandomString(16);
@@ -407,6 +409,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
407
  }
408
 
409
  $div = '<div pagelayer-id="'.$el['id'].'">
 
410
  <style pagelayer-style-id="'.$el['id'].'"></style>';
411
 
412
  $is_group = !empty($pagelayer->shortcodes[$tag]['params']['elements']) ? true : false;
@@ -647,7 +650,7 @@ function pagelayer_create_sc(&$el, $is_block = 0){
647
 
648
  $a = $tmp = array();
649
 
650
- if(!empty($el['oAtts'])){
651
 
652
  foreach($el['oAtts'] as $k => $v){
653
  $v = str_replace('&', '&amp;', $v);
@@ -670,7 +673,7 @@ function pagelayer_create_sc(&$el, $is_block = 0){
670
  $el['attr'][] = 'pagelayer-tmp-'.$k.'="'.$v.'"';
671
  }
672
 
673
- }
674
 
675
  // Add the tag
676
  $el['attr'][] = 'pagelayer-tag="'.$el['tag'].'"';
59
  global $pagelayer;
60
 
61
  $is_block = 0;
62
+ $el = [];
63
 
64
  // Is block ?
65
  if(!empty($atts['is_not_sc'])){
98
  $content = $pagelayer->global_sections[$atts['global_id']]['$'];
99
  return pagelayer_change_id($content);
100
  }
101
+
102
+ // Set the global id as attr
103
+ $el['attr'][] = 'pagelayer-global-id="'.$atts['global_id'].'"';
104
  }
105
 
106
  // Is there any function ?
112
  }
113
 
114
  // Create the element array. NOTE : This is similar to the JS el and is temporary
 
115
  $el['atts'] = $atts;
116
  $el['oAtts'] = $atts;
117
  $el['id'] = !empty($atts['pagelayer-id']) ? $atts['pagelayer-id'] : pagelayer_RandomString(16);
409
  }
410
 
411
  $div = '<div pagelayer-id="'.$el['id'].'">
412
+ <!-- '.json_encode(['attr' => $el['oAtts'], 'tmp' => $el['tmp']]).' -->
413
  <style pagelayer-style-id="'.$el['id'].'"></style>';
414
 
415
  $is_group = !empty($pagelayer->shortcodes[$tag]['params']['elements']) ? true : false;
650
 
651
  $a = $tmp = array();
652
 
653
+ /*if(!empty($el['oAtts'])){
654
 
655
  foreach($el['oAtts'] as $k => $v){
656
  $v = str_replace('&', '&amp;', $v);
673
  $el['attr'][] = 'pagelayer-tmp-'.$k.'="'.$v.'"';
674
  }
675
 
676
+ }*/
677
 
678
  // Add the tag
679
  $el['attr'][] = 'pagelayer-tag="'.$el['tag'].'"';
main/template.php CHANGED
@@ -261,7 +261,7 @@ function pagelayer_builder_archives_conditions($post_types = []){
261
  $post_type => array(
262
  'label' => $label,
263
  'check_conditions' => function ( $args = null ) use ($post_type){
264
- return is_post_type_archive( $post_type->name ) || ( 'post' === $post_type->name && is_home() );
265
  },
266
  'no_id_section' => 1, // Id select section not required
267
  ),
261
  $post_type => array(
262
  'label' => $label,
263
  'check_conditions' => function ( $args = null ) use ($post_type){
264
+ return is_post_type_archive( $post_type ) || ( 'post' === $post_type && is_home() );
265
  },
266
  'no_id_section' => 1, // Id select section not required
267
  ),
main/website.php CHANGED
@@ -26,6 +26,23 @@ if(!defined('PAGELAYER_VERSION')) {
26
 
27
  include_once(PAGELAYER_DIR.'/main/settings.php');
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  // The License Page
30
  function pagelayer_website_settings(){
31
 
@@ -39,35 +56,51 @@ function pagelayer_website_settings(){
39
 
40
  if(isset($_POST['submit'])){
41
 
42
- $font_settings = ['body', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pagelayer_color' => 'color', 'pagelayer_sidebar' => 'sidebar'];
43
-
44
- foreach($font_settings as $setting => $key){
45
 
46
- if(isset($_POST[$key])){
47
 
48
- foreach($_POST[$key] as $k => $v){
49
- if($v == 'Default' || empty($v)){
50
- unset($_POST[$key][$k]);
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
- // For sidebar, width default should not be saved
55
- if($key == 'sidebar' && $k == 'width' && $v == 20){
56
- unset($_POST[$key][$k]);
57
- }
58
-
59
- $setting = is_numeric($setting) ? 'pagelayer_'.$key.'_typography' : $setting;
60
-
61
- // Are we to save ?
62
- update_option($setting, (!empty($_POST[$key]) ? $_POST[$key] : []));
63
-
64
  }
65
 
66
- // Blank the old Body font
67
- if(!empty($_POST['body']['font-family'])){
68
- update_option('pagelayer_body_font', '');
69
- }
70
 
 
 
 
71
  }
72
 
73
  //pagelayer_print($_POST);
@@ -131,39 +164,35 @@ function pagelayer_website_settings_T(){
131
  pagelayer_report_error($pl_error);echo '<br />';
132
  }
133
 
 
 
 
 
 
 
 
134
  ?>
135
 
136
  <form class="pagelayer-setting-form" method="post" action="">
137
  <?php wp_nonce_field('pagelayer-options'); ?>
 
138
  <div class="tabs-wrapper">
139
  <h2 class="nav-tab-wrapper pagelayer-wrapper">
140
- <a href="#typography" class="nav-tab"><?php echo __pl('typography');?></a>
141
- <a href="#headings" class="nav-tab "><?php echo __pl('heading_style');?></a>
142
- <a href="#colors" class="nav-tab "><?php echo __pl('color');?></a>
143
  <a href="#website_container" class="nav-tab"><?php echo __pl('container');?></a>
144
  <!--<a href="#pagelayer-sidebar" class="nav-tab">Sidebar</a>-->
145
  <a href="#hf" class="nav-tab "><?php echo __pl('hf');?></a>
146
  </h2>
147
-
148
- <div class="pagelayer-tab-panel" id="typography">
149
 
150
- <center><h2><?php echo __pl('body_content'); ?></h2></center>
151
-
152
- <?php pagelayer_website_font_settings('body');?>
153
-
154
- </div>
155
-
156
  <div class="pagelayer-tab-panel" id="headings">
157
 
158
  <?php
159
 
160
- $headings = ['h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6'];
161
-
162
  echo '<div style="display:inline-block;vertical-align: top;">
163
  <ul class="nav-tab-wrapper pagelayer-wrapper pagelayer-heading-wrapper">';
164
 
165
- foreach($headings as $k => $v){
166
- echo '<li><a href="#tab_'.$k.'" class="nav-tab pagelayer-heading-tab" tab-class="pagelayer-heading-tab-panel">'.$v.' Settings</a></li>';
167
  }
168
 
169
  echo '</ul>
@@ -171,10 +200,27 @@ function pagelayer_website_settings_T(){
171
 
172
  <div style="display:inline-block;vertical-align: top;">';
173
 
174
- foreach($headings as $k => $v){
 
175
  echo '<div class="pagelayer-heading-tab-panel" id="tab_'.$k.'">
176
- <center><h2>'.$v.' Settings</h2></center>';
177
- pagelayer_website_font_settings($k);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  echo '</div>';
179
  }
180
 
@@ -184,19 +230,6 @@ function pagelayer_website_settings_T(){
184
 
185
  </div>
186
 
187
- <div class="pagelayer-tab-panel" id="colors">
188
- <script src="https://unpkg.com/vanilla-picker@2.10.1/dist/vanilla-picker.min.js"></script>
189
- <?php
190
- pagelayer_website_color('Background Color', 'background');
191
- pagelayer_website_color('Text Color', 'text');
192
- pagelayer_website_color('Link Color', 'link');
193
- pagelayer_website_color('Link Hover Color', 'link-hover');
194
- pagelayer_website_color('Heading Color (H1-H6)', 'heading');
195
-
196
- echo __pl('color_notice');
197
- ?>
198
- </div>
199
-
200
  <div class="pagelayer-tab-panel" id="website_container">
201
 
202
  <table>
@@ -279,7 +312,7 @@ function pagelayer_website_settings_T(){
279
  <tr>
280
  <th valign="top"><?php echo __('Width');?> : </th>
281
  <td>
282
- <input type="number" name="sidebar[width]" min="1" step="1" value="<?php echo (!empty($_POST) ? esc_html($_POST['sidebar']['width']) : (!empty($pagelayer->settings['sidebar']['width']) ? esc_html($pagelayer->settings['sidebar']['width']) : '20') );?>" /><span>%</span>
283
  </td>
284
  </tr>
285
  </table>
@@ -313,11 +346,31 @@ function pagelayer_website_settings_T(){
313
  </div>
314
 
315
  </div>
316
- <center><input type="submit" name="submit" class="button button-primary button-submit" value="Save Changes"></center>
 
 
 
317
  <br /><br />
318
  </form>
319
 
320
  <script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
 
322
  // Show the vanilla selector
323
  function pagelayer_show_vanilla(){
@@ -361,6 +414,27 @@ function pagelayer_handle_custom(ele){
361
  }else{
362
  jEle.siblings().hide();
363
  jEle.siblings('input').val('');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
364
  }
365
  }
366
 
@@ -379,23 +453,13 @@ jQuery(document).ready(function(){
379
 
380
  }
381
 
382
- // Shows the font settings
383
- function pagelayer_website_color($text, $field){
384
-
385
- global $pagelayer, $pl_error;
386
-
387
- $val = !empty($_POST) ? @$_POST['color'][$field] : @$pagelayer->settings['color'][$field];
388
-
389
- echo '
390
- <table>
391
- <tr>
392
- <th scope="row">'.$text.'</th>
393
- <td>
394
- <a href="#" class="pagelayer-show-vanilla"><div class="pagelayer-color-div pagelayer-color-none"></div><span class="dashicons dashicons-no"></span></a><input type="hidden" name="color['.$field.']" value="'.esc_html($val).'">
395
- </td>
396
- </tr>
397
- </table>';
398
-
399
  }
400
 
401
  // Shows the font settings
@@ -406,22 +470,51 @@ function pagelayer_website_font_settings($prefix){
406
  if(!empty($_POST)){
407
  $vals = $_POST;
408
  }else{
409
- $vals = $pagelayer->settings;
410
  }
411
 
412
  ?>
413
 
414
  <table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  <tr>
416
  <th scope="row"><?php echo __pl('font_family'); ?></th>
417
  <td>
418
  <label>
419
- <select name="<?php echo $prefix;?>[font-family]">
420
- <?php
421
- foreach($pagelayer->fonts as $k => $font){
422
- echo '<option value="'.esc_html($font).'" '.($vals[$prefix]['font-family'] == $font ? 'selected' : '').'>'. esc_html(empty($font) ? 'Default': $font) .'</option>';
423
- }
424
- ?>
425
  </select>
426
  </label>
427
  </td>
@@ -524,6 +617,53 @@ function pagelayer_website_font_settings($prefix){
524
  </td>
525
  </tr>
526
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  </table>
528
 
529
  <?php
26
 
27
  include_once(PAGELAYER_DIR.'/main/settings.php');
28
 
29
+ function pagelayer_clear_empty_r(&$r){
30
+
31
+ foreach($r as $a => $b){
32
+ if(empty($b)){
33
+ unset($r[$a]);
34
+ continue;
35
+ }
36
+
37
+ if(is_array($b)){
38
+ pagelayer_clear_empty_r($r[$a]);
39
+ }
40
+ }
41
+
42
+ return $r;
43
+
44
+ }
45
+
46
  // The License Page
47
  function pagelayer_website_settings(){
48
 
56
 
57
  if(isset($_POST['submit'])){
58
 
59
+ foreach($pagelayer->css_settings as $set => $params){
 
 
60
 
61
+ foreach($pagelayer->screens as $sk => $sv){
62
 
63
+ $suffix = (!empty($sv) ? '_'.$sv : '');
64
+ $key = $set.$suffix;
65
+ $setting = empty($params['key']) ? 'pagelayer_'.$set.'_css' : $params['key'];
66
+
67
+ if(isset($_POST[$key])){
68
+
69
+ foreach($_POST[$key] as $k => $v){
70
+ if($v == 'Default' || empty($v)){
71
+ unset($_POST[$key][$k]);
72
+ }
73
+
74
+ // For sidebar, width default should not be saved
75
+ if($set == 'sidebar' && $k == 'width' && $v == 20){
76
+ unset($_POST[$key][$k]);
77
+ }
78
  }
79
+
80
+ // Padding and Margins or any array based setting
81
+ if(!empty($_POST[$key]) && is_array($_POST[$key])){
82
+ pagelayer_clear_empty_r($_POST[$key]);
83
+ //pagelayer_print($_POST[$key]);
84
+ }
85
+
86
+ // Are we to save ?
87
+ if(!empty($_POST[$key])){
88
+ update_option($setting.$suffix, (!empty($_POST[$key]) ? $_POST[$key] : []));
89
+ }else{
90
+ delete_option($setting.$suffix);
91
+ }
92
+
93
+ }else{
94
+ delete_option($setting.$suffix);
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
 
99
+ }
 
 
 
100
 
101
+ // Blank the old Body font
102
+ if(!empty($_POST['body']['font-family'])){
103
+ update_option('pagelayer_body_font', '');
104
  }
105
 
106
  //pagelayer_print($_POST);
164
  pagelayer_report_error($pl_error);echo '<br />';
165
  }
166
 
167
+ // Reduce load
168
+ echo '<select id="skeleton_of_fonts" style="display:none">';
169
+ foreach($pagelayer->fonts as $k => $font){
170
+ echo '<option value="'.esc_html($font).'">'. esc_html(empty($font) ? 'Default': $font) .'</option>';
171
+ }
172
+ echo '</select>';
173
+
174
  ?>
175
 
176
  <form class="pagelayer-setting-form" method="post" action="">
177
  <?php wp_nonce_field('pagelayer-options'); ?>
178
+ <script src="https://unpkg.com/vanilla-picker@2.10.1/dist/vanilla-picker.min.js"></script>
179
  <div class="tabs-wrapper">
180
  <h2 class="nav-tab-wrapper pagelayer-wrapper">
181
+ <a href="#headings" class="nav-tab "><?php echo __pl('elem_styles');?></a>
 
 
182
  <a href="#website_container" class="nav-tab"><?php echo __pl('container');?></a>
183
  <!--<a href="#pagelayer-sidebar" class="nav-tab">Sidebar</a>-->
184
  <a href="#hf" class="nav-tab "><?php echo __pl('hf');?></a>
185
  </h2>
 
 
186
 
 
 
 
 
 
 
187
  <div class="pagelayer-tab-panel" id="headings">
188
 
189
  <?php
190
 
 
 
191
  echo '<div style="display:inline-block;vertical-align: top;">
192
  <ul class="nav-tab-wrapper pagelayer-wrapper pagelayer-heading-wrapper">';
193
 
194
+ foreach($pagelayer->css_settings as $k => $v){
195
+ echo '<li><a href="#tab_'.$k.'" class="nav-tab pagelayer-heading-tab" tab-class="pagelayer-heading-tab-panel">'.$v['name'].' Style</a></li>';
196
  }
197
 
198
  echo '</ul>
200
 
201
  <div style="display:inline-block;vertical-align: top;">';
202
 
203
+ foreach($pagelayer->css_settings as $k => $v){
204
+
205
  echo '<div class="pagelayer-heading-tab-panel" id="tab_'.$k.'">
206
+ <center><h2>'.$v['name'].' Style</h2></center>
207
+
208
+ <div style="vertical-align: top;">
209
+ <ul class="nav-tab-wrapper pagelayer-wrapper pagelayer-styles-screens">';
210
+
211
+ foreach($pagelayer->screens as $sk => $sv){
212
+ echo '<li><a href="#tab_'.$k.'_'.$sk.'" class="nav-tab pagelayer-styles-screen-tab" tab-class="pagelayer-styles-screen-panel">'.ucfirst($sk).'</a></li>';
213
+ }
214
+
215
+ echo '</ul>
216
+ </div>';
217
+
218
+ foreach($pagelayer->screens as $sk => $sv){
219
+ echo '<div class="pagelayer-styles-screen-panel" id="tab_'.$k.'_'.$sk.'">';
220
+ pagelayer_website_font_settings($k.(!empty($sv) ? '_'.$sv : ''));
221
+ echo '</div>';
222
+ }
223
+
224
  echo '</div>';
225
  }
226
 
230
 
231
  </div>
232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  <div class="pagelayer-tab-panel" id="website_container">
234
 
235
  <table>
312
  <tr>
313
  <th valign="top"><?php echo __('Width');?> : </th>
314
  <td>
315
+ <input type="number" name="sidebar[width]" min="1" step="1" value="<?php echo (!empty($_POST) ? esc_html($_POST['sidebar']['width']) : (!empty($pagelayer->css['sidebar']['width']) ? esc_html($pagelayer->css['sidebar']['width']) : '20') );?>" /><span>%</span>
316
  </td>
317
  </tr>
318
  </table>
346
  </div>
347
 
348
  </div>
349
+
350
+ <?php echo __pl('color_notice');?>
351
+ <br><br>
352
+ <center><input type="submit" name="submit" class="button button-primary button-submit" value="Save Changes" onclick="pagelayer_handle_website_submit(this)"></center>
353
  <br /><br />
354
  </form>
355
 
356
  <script>
357
+
358
+ function pagelayer_handle_website_submit(ele){
359
+
360
+ var jEle = jQuery(ele);
361
+ jEle.closest('form').find('input, select, textarea').each(function(){
362
+ var j = jQuery(this);
363
+ if(jEle.is(j)){
364
+ return;
365
+ }
366
+
367
+ if(j.val().length == 0){
368
+ j.prop("disabled", true);
369
+ }
370
+ });
371
+
372
+ return true;
373
+ }
374
 
375
  // Show the vanilla selector
376
  function pagelayer_show_vanilla(){
414
  }else{
415
  jEle.siblings().hide();
416
  jEle.siblings('input').val('');
417
+ jEle.siblings().children().val('');
418
+ }
419
+ }
420
+
421
+ // Handle the font family
422
+ function pagelayer_handle_font_family(ele){
423
+ jEle = jQuery(ele);
424
+ if(jEle.children().length <= 1){
425
+ var val = jEle.val();
426
+ jEle.html(jQuery('#skeleton_of_fonts').html());
427
+ jEle.val(val);
428
+ }
429
+ }
430
+
431
+ function pagelayer_handle_textdecor(ele){
432
+ jEle = jQuery(ele);
433
+ if(jEle.val().length > 1 && jEle.val() !== 'none'){
434
+ jEle.siblings().show();
435
+ }else{
436
+ jEle.siblings().hide();
437
+ jEle.siblings().val('');
438
  }
439
  }
440
 
453
 
454
  }
455
 
456
+ function pagelayer_website_padding_field($name, $val){
457
+ ?>
458
+ <input type="number" name="<?php echo $name;?>[0]" step="1" class="pagelayer-website-padding" <?php echo (!empty($val[0]) ? 'value="'.esc_html($val[0]).'"' : '');?> />
459
+ <input type="number" name="<?php echo $name;?>[1]" step="1" class="pagelayer-website-padding" <?php echo (!empty($val[1]) ? 'value="'.esc_html($val[1]).'"' : '');?> />
460
+ <input type="number" name="<?php echo $name;?>[2]" step="1" class="pagelayer-website-padding" <?php echo (!empty($val[2]) ? 'value="'.esc_html($val[2]).'"' : '');?> />
461
+ <input type="number" name="<?php echo $name;?>[3]" step="1" class="pagelayer-website-padding" <?php echo (!empty($val[3]) ? 'value="'.esc_html($val[3]).'"' : '');?> /><span>px</span>
462
+ <?php
 
 
 
 
 
 
 
 
 
 
463
  }
464
 
465
  // Shows the font settings
470
  if(!empty($_POST)){
471
  $vals = $_POST;
472
  }else{
473
+ $vals = $pagelayer->css;
474
  }
475
 
476
  ?>
477
 
478
  <table>
479
+
480
+ <tr>
481
+ <th scope="row"><?php echo __pl('padding');?></th>
482
+ <td>
483
+ <label>
484
+ <select class="pagelayer-show-custom" onchange="pagelayer_handle_custom(this)">
485
+ <option value="" <?php echo (empty($vals[$prefix]['padding']) ? 'selected="seleted"' : '');?>>Default</option>
486
+ <option value="custom" <?php echo (!empty($vals[$prefix]['padding']) ? 'selected="seleted"' : '');?>>Custom</option>
487
+ </select>
488
+ <span>
489
+ <?php pagelayer_website_padding_field($prefix.'[padding]', $vals[$prefix]['padding']);?>
490
+ </span>
491
+ </label>
492
+ </td>
493
+ </tr>
494
+
495
+ <tr>
496
+ <th scope="row"><?php echo __pl('margin');?></th>
497
+ <td>
498
+ <label>
499
+ <select class="pagelayer-show-custom" onchange="pagelayer_handle_custom(this)">
500
+ <option value="" <?php echo (empty($vals[$prefix]['margin']) ? 'selected="seleted"' : '');?>>Default</option>
501
+ <option value="custom" <?php echo (!empty($vals[$prefix]['margin']) ? 'selected="seleted"' : '');?>>Custom</option>
502
+ </select>
503
+ <span>
504
+ <?php pagelayer_website_padding_field($prefix.'[margin]', $vals[$prefix]['margin']);?>
505
+ </span>
506
+ </label>
507
+ </td>
508
+ </tr>
509
+
510
  <tr>
511
  <th scope="row"><?php echo __pl('font_family'); ?></th>
512
  <td>
513
  <label>
514
+ <select name="<?php echo $prefix;?>[font-family]" onclick="pagelayer_handle_font_family(this)">
515
+ <?php
516
+ echo '<option value="'.esc_html(empty($vals[$prefix]['font-family']) ? 'Default': $vals[$prefix]['font-family']).'">'.esc_html(empty($vals[$prefix]['font-family']) ? 'Default': $vals[$prefix]['font-family']).'</option>';
517
+ ?>
 
 
518
  </select>
519
  </label>
520
  </td>
617
  </td>
618
  </tr>
619
 
620
+ <tr>
621
+ <th scope="row"><?php echo __pl('text_decoration');?></th>
622
+ <td>
623
+ <label>
624
+ <table class="pagelayer-internal-table">
625
+ <tr>
626
+ <td>
627
+ <select name="<?php echo $prefix;?>[text-decoration-line]" onchange="pagelayer_handle_textdecor(this)">
628
+ <?php
629
+ foreach($pagelayer->text_decoration_line as $k => $var){
630
+ echo '<option value="'.esc_html($k).'" '.($vals[$prefix]['text-decoration-line'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
631
+ }
632
+ ?>
633
+ </select>
634
+ </td>
635
+ <td>
636
+ <select name="<?php echo $prefix;?>[text-decoration-style]">
637
+ <?php
638
+ foreach($pagelayer->text_decoration_style as $k => $var){
639
+ echo '<option value="'.esc_html($k).'" '.($vals[$prefix]['text-decoration-style'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
640
+ }
641
+ ?>
642
+ </select>
643
+ </td>
644
+ </tr>
645
+ <tr>
646
+ <td>Line</td>
647
+ <td>Style</td>
648
+ </tr>
649
+ </table>
650
+ </label>
651
+ </td>
652
+ </tr>
653
+
654
+ <tr>
655
+ <th scope="row">Background Color</th>
656
+ <td>
657
+ <a href="#" class="pagelayer-show-vanilla"><div class="pagelayer-color-div pagelayer-color-none"></div><span class="dashicons dashicons-no"></span></a><input type="hidden" name="<?php echo $prefix;?>[background-color]" <?php echo (!empty($vals[$prefix]['background-color']) ? 'value="'.esc_html($vals[$prefix]['background-color']).'"' : '');?>>
658
+ </td>
659
+ </tr>
660
+
661
+ <tr>
662
+ <th scope="row">Text Color</th>
663
+ <td>
664
+ <a href="#" class="pagelayer-show-vanilla"><div class="pagelayer-color-div pagelayer-color-none"></div><span class="dashicons dashicons-no"></span></a><input type="hidden" name="<?php echo $prefix;?>[color]" <?php echo (!empty($vals[$prefix]['color']) ? 'value="'.esc_html($vals[$prefix]['color']).'"' : '');?>>
665
+ </td>
666
+ </tr>
667
  </table>
668
 
669
  <?php
pagelayer.php CHANGED
@@ -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.3.8
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.4.0
7
  Author: Pagelayer Team
8
  Author URI: https://pagelayer.com/
9
  License: LGPL v2.1
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: page builder, editor, landing page, drag-and-drop, pagelayer, form-builder
4
  Requires at least: 4.7
5
  Tested up to: 5.6
6
  Requires PHP: 5.5
7
- Stable tag: 1.3.8
8
  License: LGPL v2.1
9
  License URI: http://www.gnu.org/licenses/lgpl-2.1.html
10
 
@@ -109,6 +109,18 @@ Do you have questions related to PageLayer ? Use the following links :
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  = 1.3.8 (December 08, 2020) =
113
  * [Bug-Fix] Default image was seen for blog pages using the Pagelayer Template system. This is fixed.
114
 
4
  Requires at least: 4.7
5
  Tested up to: 5.6
6
  Requires PHP: 5.5
7
+ Stable tag: 1.4.0
8
  License: LGPL v2.1
9
  License URI: http://www.gnu.org/licenses/lgpl-2.1.html
10
 
109
 
110
  == Changelog ==
111
 
112
+ = 1.4.0 (Jan 01, 2021) =
113
+ * [Improvement] While editing the page, the element attributes storing method has been further improved and will reduce your page size.
114
+ * [Improvement] The element pagelayer-id size has been reduced from 16 chars to 8 chars and will reduce your page size.
115
+ * [Added] Added element up and down option. Now you can move elements up and down without dragging the element. The Drag option is also available.
116
+ * [Task] The Website Setting has been further improved. Now you can set the global styles to the elements for any screen modes.
117
+ * [Bug-Fix] In some cases, memory was exhausted while saving the post. This is fixed.
118
+ * [Bug-Fix] In some cases the archive template was not applied properly. This is fixed.
119
+
120
+ = 1.3.9 (December 21, 2020) =
121
+ * [Task] If there is a Javascript error due to any other plugin, Pagelayer will still try to start the live editor and remove the 90% loader if its stuck.
122
+ * [Bug-Fix] PopularFX themes chosen were not getting imported in some cases. This is fixed.
123
+
124
  = 1.3.8 (December 08, 2020) =
125
  * [Bug-Fix] Default image was seen for blog pages using the Pagelayer Template system. This is fixed.
126