AMP for WP – Accelerated Mobile Pages - Version 0.9.62

Version Description

(25th September 2017) = * View more details on https://ampforwp.com/new/ * INTRODUCING Page Builder 2.0 for AMP! Learn More & Watch the Video * Documentation & Help links improved * Post type specific classes for targetting * Design name restored in Options panel (It was recently renamed to Appearance) * Minor Bug fixes as well

Download this release

Release Info

Developer mohammed_kaludi
Plugin Icon 128x128 AMP for WP – Accelerated Mobile Pages
Version 0.9.62
Comparing to
See all releases

Code changes from version 0.9.61 to 0.9.62

README.md CHANGED
@@ -1,10 +1,10 @@
1
  === AMP for WP - Accelerated Mobile Pages ===
2
  Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
- Donate link: https://www.paypal.me/Kaludi/5
5
  Requires at least: 3.0
6
- Tested up to: 4.8
7
- Stable tag: 0.9.56
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -29,10 +29,13 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
29
 
30
  = Features: =
31
 
 
 
 
32
  * NEW - Page Break / NextPage (Pagination) Support
33
  * NEW - Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
34
  * NEW - Page Builder for AMP! [Watch the Demo](http://ampforwp.com/demo/#pagebuilder) | [How to](https://ampforwp.com/tutorials/page-builder/)
35
- * NEW - Facebook Comments Support
36
  * Github Gist Support
37
  * Email Opt-in Subscription form support in AMP added
38
  * Call to Action boxes and notification bars
@@ -79,11 +82,14 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
79
  * RTL Support
80
  * Custom AMP FrontPage
81
  * Notifications
82
- * Chartbeat (NEW), Hi-stats (NEW), Yandex Metrika (NEW), Piwik, Segment.com, StatCounter, Effective Measure and comScore Support
83
  * Incontent & DoubleClick Support
84
  * Great Support & Active Development.
85
  * Widgets & WooCommerce
86
- * NEW - Facebook Instant Articles Support Added
 
 
 
87
 
88
  **[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
89
 
@@ -137,10 +143,76 @@ You can contact me using this url: http://ampforwp.com/contact/
137
 
138
  == Changelog ==
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  = 0.9.56 (31st July 2017) =
141
  * View more details on https://ampforwp.com/page-break-in-amp/
142
  * Page Break / NextPage (Pagination) Support Added #834 #857 (Improvement)
143
  * Show/Hide AMP for Categories of Posts or All posts #872 (Improvement)
 
144
  * JetPack Plugin Conflict Solved #971
145
  * Social sharing code improved. amp-social-share js is getting added for line and WhatsApp social share #981
146
  * Code improvement for rel canonicals(home and archive)
1
  === AMP for WP - Accelerated Mobile Pages ===
2
  Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
+ Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
+ Tested up to: 4.8.1
7
+ Stable tag: 0.9.61
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
29
 
30
  = Features: =
31
 
32
+ * NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
33
+ * NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
34
+ * NEW - AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
35
  * NEW - Page Break / NextPage (Pagination) Support
36
  * NEW - Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
37
  * NEW - Page Builder for AMP! [Watch the Demo](http://ampforwp.com/demo/#pagebuilder) | [How to](https://ampforwp.com/tutorials/page-builder/)
38
+ * Facebook Comments Support
39
  * Github Gist Support
40
  * Email Opt-in Subscription form support in AMP added
41
  * Call to Action boxes and notification bars
82
  * RTL Support
83
  * Custom AMP FrontPage
84
  * Notifications
85
+ * Chartbeat, Hi-stats, Yandex Metrika, Piwik, Segment.com, StatCounter, Effective Measure and comScore Support
86
  * Incontent & DoubleClick Support
87
  * Great Support & Active Development.
88
  * Widgets & WooCommerce
89
+ * Genesis SEO Support
90
+ * Breadcrumb Support added
91
+ * Facebook Instant Articles Support Added
92
+ * NEW - AMP Theme Framework Core Support Added. You can now create AMP templates of your own in just minutes. **[More](https://ampforwp.com/amp-theme-framework/)**
93
 
94
  **[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
95
 
143
 
144
  == Changelog ==
145
 
146
+ = 0.9.61 (10th September 2017) =
147
+ * View more details on https://ampforwp.com/options-restructured/
148
+ * Options Panel Restructured – Options were dividing into two parts: Settings and Appearance.
149
+ * AMP Theme Framework Core Support Added. You can now create themes of your own in just minutes.
150
+ * WPML Static Front Page Support #1111
151
+ * Notification message disables when CF7 & gravity form is activated. #1107
152
+ * Space after On in Design 3 #1114
153
+
154
+ = 0.9.60 (4th September 2017) =
155
+ * View more details on https://ampforwp.com/0-9-60-released-improved-redirection-66th-update/
156
+ * Class added to View non-amp anchor tag
157
+ * Params added properly to get rid of a warning #1077
158
+ * rel=attachment noopener generating validation errors #1090
159
+ * Breadcrumbs Support Added #701
160
+ * Enable / Disable button added for Navigation Menu #735
161
+ * Move the ad code for Instant Article down after the article #964
162
+ * Add analytics code of FB instant articles properly #1096
163
+ * datetime Tag not stripping properly #1043
164
+ * Mobile redirection on custom post types #1028 #1052
165
+ * Mobile Redirection causing extra redirect #879 #933
166
+ * Proper mobile redirection on Homepage #1052
167
+ * View non-amp on blog will redirect to blog
168
+ * Blog will redirect to blog irrespective of AMP Homepage option #871
169
+ * Dont redirect if archive support is disabled #1052
170
+ * non-amp category pages should redirect to non-amp pages if turned off from Hide AMP #999
171
+ * Disable amp for forum plugin (wpforo) #592
172
+
173
+ = 0.9.59 (23th August 2017) =
174
+ * Design 3 Images were not aligned properly. Fixed. #1040
175
+ * Caption in the design 3 improved
176
+ * Jetpack File not loading throwing fatal error #1038
177
+ * If the mobile redirection is ON and the category is excluded to display the AMP then it should redirect properly
178
+ * Custom Editor Compatibility issue with SiteOrigin PageBuilder fixed #997
179
+ * Native Twitter Embed support
180
+ * Added a hook after the body tag: ampforwp_body_beginning (commit)
181
+ * GTM in AMP Improved #958
182
+ * WP User Avatar compatibility Added #975
183
+ * Alt tag on frontpage featured image added #1050
184
+ * Blurred Images on the frontpage fixed #1050
185
+ * Need to escape alt tag #1049
186
+ * Debug errors & PHP warnings were fixed #859 #811 #830 #810
187
+ * Proper rel canonicals for inner pages #1047
188
+ * Added Video sanitizer for comments #1053
189
+ * When activating the AMP plugin, display a notification in the popup. #1036
190
+ * Video Sanitizer added for Comments
191
+
192
+ = 0.9.58.1 (9th August 2017) =
193
+ * Jetpack conflict issue solved #1038
194
+ * Genesis SEO Support added #1013
195
+ * Fixed Wrong SEO title issue #1013 and #836
196
+ * Design 3 Carousel script loading method improved #990
197
+
198
+ = 0.9.58 (9th August 2017) =
199
+ * View more details on https://ampforwp.com/new/
200
+ * Genesis SEO for AMP support added
201
+ * AMP 0.4.2 Vendor Bundled for making it crash proof
202
+ * Archive desc only on 1st page #1029
203
+ * Ads are not working after 0.9.6 #1030
204
+ * Fixed the Post 0.9.57 Update Bugs #1025
205
+ * All Images are aligned on left side in design 3 #1031
206
+ * Custom frontpage title issue in Design 3 fixed
207
+
208
+ = 0.9.57 (5th August 2017) =
209
+ * See the Full changelog https://ampforwp.com/0-9-57-released-compatibility-issue-fixed-62nd-update/
210
+
211
  = 0.9.56 (31st July 2017) =
212
  * View more details on https://ampforwp.com/page-break-in-amp/
213
  * Page Break / NextPage (Pagination) Support Added #834 #857 (Improvement)
214
  * Show/Hide AMP for Categories of Posts or All posts #872 (Improvement)
215
+ * Adding analytics capabilities to Instant Articles #978
216
  * JetPack Plugin Conflict Solved #971
217
  * Social sharing code improved. amp-social-share js is getting added for line and WhatsApp social share #981
218
  * Code improvement for rel canonicals(home and archive)
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 0.9.61
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -18,7 +18,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
18
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
19
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
20
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
21
- define('AMPFORWP_VERSION','0.9.61');
22
  // any changes to AMP_QUERY_VAR should be refelected here
23
  define('AMPFORWP_AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
24
 
@@ -516,7 +516,7 @@ function ampforwp_update_notice() {
516
  margin-left: 5px;
517
  font-weight: 300;
518
  top: -14px;
519
- font-size: 20px;"> <?php _e( 'AMP has been updated to '.$ampforWPCurrentVersion, 'accelerated-mobile-pages' ); ?></div>
520
  <a href="https://ampforwp.com/new/" target="_blank" style="
521
  position: relative;
522
  top: -17px;
@@ -560,4 +560,5 @@ if(!defined('AMP_FRAMEWORK_COMOPNENT_DIR_PATH')){
560
  define('AMP_FRAMEWORK_COMOPNENT_DIR_PATH', plugin_dir_path( __FILE__ )."/components");
561
  }
562
 
563
- require_once( AMP_FRAMEWORK_COMOPNENT_DIR_PATH . '/components-core.php' );
 
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
+ Version: 0.9.62
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
18
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
19
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
20
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
21
+ define('AMPFORWP_VERSION','0.9.62');
22
  // any changes to AMP_QUERY_VAR should be refelected here
23
  define('AMPFORWP_AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
24
 
516
  margin-left: 5px;
517
  font-weight: 300;
518
  top: -14px;
519
+ font-size: 20px;"> <?php _e( 'Introducing AMP Page Builder in '.$ampforWPCurrentVersion, 'accelerated-mobile-pages' ); ?></div>
520
  <a href="https://ampforwp.com/new/" target="_blank" style="
521
  position: relative;
522
  top: -17px;
560
  define('AMP_FRAMEWORK_COMOPNENT_DIR_PATH', plugin_dir_path( __FILE__ )."/components");
561
  }
562
 
563
+ require_once( AMP_FRAMEWORK_COMOPNENT_DIR_PATH . '/components-core.php' );
564
+ require_once( AMPFORWP_PLUGIN_DIR. 'pagebuilder/amp-page-builder.php' );
includes/admin-style.css CHANGED
@@ -32,6 +32,13 @@ body #toplevel_page_amp_options .wp-menu-image{
32
  top: -1px;
33
  left: 5px;
34
  }
 
 
 
 
 
 
 
35
  .amp-update-notice .notice-dismiss{
36
  display: none
37
  }
32
  top: -1px;
33
  left: 5px;
34
  }
35
+ .redux-container #redux-header .display_header h2{
36
+ background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iI2ZmZiI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+") !important;
37
+ background-size: 18px;
38
+ background-repeat: no-repeat;
39
+ padding-left: 26px;
40
+ background-position: 0px 0;
41
+ }
42
  .amp-update-notice .notice-dismiss{
43
  display: none
44
  }
includes/options/admin-config.php CHANGED
@@ -109,8 +109,8 @@ $extension_listing = '
109
  <li class="first"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=extension-tab_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
110
  <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
111
  <div class="extension_desc">
112
- <h2>More Coming Soon</h2>
113
- <p>Improvements in progress.</p>
114
  </div>
115
  </a></li>
116
 
@@ -203,9 +203,9 @@ $gettingstarted_extension_listing = '
203
  <li class="second"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=gettingstarted_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
204
  <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
205
  <div class="extension_desc">
206
- <h2>More Coming Soon</h2>
207
- <p>Improvements in progress.</p>
208
- </div>
209
  </a></li>
210
 
211
 
@@ -377,20 +377,38 @@ Redux::setArgs( "redux_builder_amp", $args );
377
  'id' => 'basic',
378
  'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin. '. ' ' .
379
 
380
- sprintf( __( ' <h2 style=" width: 150px;
381
- float: right;
382
- padding: 15px 20px;
383
- border: 1px solid #ddd;
384
- font-size: 13px;
385
- line-height: 20px;"><a href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#postform">Like this plugin? Support us by leaving a 5 Star Rating</a></h2>We are actively working on updating the plugin. We have built user friendly options which allows you to make changes on your AMP version.', 'accelerated-mobile-pages' ), 'accelerated-mobile-pages' ) . ampforwp_plugin_activation_notice()
386
- . '<h2>' . __( 'Here are some quick links to help you get started:', 'accelerated-mobile-pages' ) . '</h2>'
387
- . '<p><strong>' . __( '1. <a href="http://ampforwp.com/help/" target="_blank">User Documentation</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'The AMP for WP plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.' ) . '</p>'
388
- . '<p><strong>' . __( '2. <a href="https://ampforwp.com/tutorials/" target="_blank">Tutorials</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We’re bunch of passionate people that are dedicated towards helping our users. We have prepared bunch of tutorials for you' ) . '</p>'
389
- . '<p><strong>' . __( '3. <a href="https://ampforwp.com/help/#extend" target="_blank">Developer Docs</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We have created special documentations for developers and semi technical users who are willing to modify the plugin according to their own needs.' ) . '</p>'
390
- . '<p><strong>' . __( '4. <a href="https://ampforwp.com/priority-support/" target="_blank">Fixing AMP Validation Errors</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We will personally take care that your website’s AMP version is perfectly validated. We will make sure that your AMP version gets approved and indexed by Google Webmaster Tools properly and we will even keep an eye on AMP updates from Google and implement them into your website.' ) . '</p>'
391
- . '<p><strong>' . __( '5. <a href="https://ampforwp.com/help/#support-forum" target="_blank">Community Support Forum</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We have a special community support forum where you can ask us questions and get help about your AMP related questions. Delivering a good user experience means alot to us and so we try our best to reply each and every question that gets asked.' ) . '</p>'
392
- . '<p><strong>' . __( '6. <a href="https://ampforwp.com/help/#contact" target="_blank">Hire Us / Other queries</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We try to answer each and every email, so remember to give us some time. For any other queries, please use the contact form. Please be descriptive as possible.' ) . '</p>'
393
- . '<p><strong>' . __( '7. <a href="http://ampforwp.com/new/" target="_blank"> What\'s New in this Version?</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'If you want to know whats new in the latest version of the plugin, then please use this link. ') . '</p>'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
 
395
  . '</p></div>
396
  <br /><p><h3>Take AMP to the Next Level with Premium Extensions</h3></p>
@@ -519,7 +537,7 @@ Redux::setArgs( "redux_builder_amp", $args );
519
  // AMP Content Page Builder SECTION
520
  Redux::setSection( $opt_name, array(
521
  'title' => __( 'Page Builder', 'accelerated-mobile-pages' ),
522
- 'desc' => __( 'With AMP Content Builder, you can easily build landing pages for AMP from the widgets area. <a href="http://ampforwp.com/tutorials/page-builder">(Need Help?)</a>' , 'accelerated-mobile-pages'),
523
  'id' => 'amp-content-builder',
524
  'class' => 'amp_content_builder',
525
  'subsection' => true,
@@ -528,15 +546,24 @@ Redux::setArgs( "redux_builder_amp", $args );
528
  array(
529
  'id' => 'ampforwp-content-builder',
530
  'type' => 'switch',
531
- 'title' => __('Enable Page Builder for AMP', 'accelerated-mobile-pages'),
532
  'subtitle' => __('Build AMP Landing pages in minutes.', 'accelerated-mobile-pages'),
533
  'true' => 'true',
534
  'desc' => '<div style=" background: #FFF9C4;
535
  display: inline-block;
536
- padding: 12px;
537
- margin-top: 12px;
538
  left: 0;
539
- line-height: 1.6;"><b>Hello!</b> First time here? <br /> <a href="https://ampforwp.com/tutorials/page-builder/" target="_blank">Learn how to use this Feature</a></div>',
 
 
 
 
 
 
 
 
 
540
  'false' => 'false',
541
  'default' => 1
542
  ),
@@ -1800,7 +1827,7 @@ Redux::setSection( $opt_name, array(
1800
 
1801
  // Appearance Section
1802
  Redux::setSection( $opt_name, array(
1803
- 'title' => __( 'Appearance', 'accelerated-mobile-pages' ),
1804
  'icon' => 'el el-adjust-alt',
1805
  'desc' => ''
1806
 
109
  <li class="first"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=extension-tab_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
110
  <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
111
  <div class="extension_desc">
112
+ <h2>View All Extensions</h2>
113
+ <p>See all the extensions available for AMP</p>
114
  </div>
115
  </a></li>
116
 
203
  <li class="second"><a href="https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=gettingstarted_amp-more-comingsoon&utm_campaign=AMP%20Plugin" target="_blank">
204
  <div class="align_left"><img src="'.AMPFORWP_IMAGE_DIR . '/comments.png" /></div>
205
  <div class="extension_desc">
206
+ <h2>View All Extensions</h2>
207
+ <p>See all the extensions available for AMP</p>
208
+ <div class="extension_btn">View All</div> </div>
209
  </a></li>
210
 
211
 
377
  'id' => 'basic',
378
  'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin. '. ' ' .
379
 
380
+ sprintf( __( ' <h2 style="width: 150px;float: right;
381
+ padding: 8px 11px;background: #4CAF50;
382
+ font-size: 13px;margin: -24px 0 0 10px;
383
+ border-radius: 5px;line-height: 22px;"><a style="color: #fff;text-decoration: none;" href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#postform">Like this plugin? <br /> Leave a 5 Star Rating</a></h2>We are actively working on updating the plugin. We have built user friendly options which allows you to make changes on your AMP version.', 'accelerated-mobile-pages' ), 'accelerated-mobile-pages' )
384
+ // . ampforwp_plugin_activation_notice()
385
+ // . '<h2>' . __( 'Here are some quick links to help you get started:', 'accelerated-mobile-pages' ) . '</h2>'
386
+
387
+ . '<div class="getstarted_wrapper">
388
+ <div class="getstarted_options">
389
+ <p><b>Getting Started</b></p>
390
+ <ul class="getstarted_ul">
391
+ <li><a href="https://ampforwp.com/tutorials/article-categories/installation-updating/" target="_blank">Installation & Setup</a></li>
392
+ <li><a href="https://ampforwp.com/tutorials/article-categories/settings-options/" target="_blank">Settings & Options</a></li>
393
+ <li><a href="https://ampforwp.com/tutorials/article-categories/setup-amp/" target="_blank">Setup AMP</a></li>
394
+ <li><a href="https://ampforwp.com/tutorials/article-categories/page-builder/" target="_blank">Page Builder</a></li>
395
+ </ul>
396
+ </div>
397
+ <div class="getstarted_options">
398
+ <p><b>Useful Links</b></p>
399
+ <ul class="getstarted_ul">
400
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extension/" target="_blank">Extensions & Themes Docs</a></li>
401
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extending/" target="_blank">Developers Docs</a></li>
402
+ <li><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">Create a Custom Theme for AMP</a></li>
403
+ <li><a href="https://ampforwp.com/tutorials/article-categories/how-to/" target="_blank">General How To\'s</a></li>
404
+ </ul>
405
+ </div>
406
+ <div class="clear"></div>
407
+ </div>'
408
+ . '<p><strong>' . __( '1. <a href="https://ampforwp.com/priority-support/" target="_blank">Fixing AMP Validation Errors</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We will personally take care that your website’s AMP version is perfectly validated. We will make sure that your AMP version gets approved and indexed by Google Webmaster Tools properly and we will even keep an eye on AMP updates from Google and implement them into your website.' ) . '</p>'
409
+ . '<p><strong>' . __( '2. <a href="https://ampforwp.com/help/#support-forum" target="_blank">Community Support Forum</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We have a special community support forum where you can ask us questions and get help about your AMP related questions. Delivering a good user experience means alot to us and so we try our best to reply each and every question that gets asked.' ) . '</p>'
410
+ . '<p><strong>' . __( '3. <a href="https://ampforwp.com/help/#contact" target="_blank">Hire Us / Other queries</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'We try to answer each and every email, so remember to give us some time. For any other queries, please use the contact form. Please be descriptive as possible.' ) . '</p>'
411
+ . '<p><strong>' . __( '4. <a href="http://ampforwp.com/new/" target="_blank"> What\'s New in this Version?</a>: ', 'accelerated-mobile-pages' ) . '</strong>' . __( 'If you want to know whats new in the latest version of the plugin, then please use this link. ') . '</p>'
412
 
413
  . '</p></div>
414
  <br /><p><h3>Take AMP to the Next Level with Premium Extensions</h3></p>
537
  // AMP Content Page Builder SECTION
538
  Redux::setSection( $opt_name, array(
539
  'title' => __( 'Page Builder', 'accelerated-mobile-pages' ),
540
+ 'desc' => __( 'With AMP Content Builder, you can easily build landing pages for AMP. <a href="https://ampforwp.com/tutorials/article/amp-page-builder-installation/">(See Video Tutorial)</a>' , 'accelerated-mobile-pages'),
541
  'id' => 'amp-content-builder',
542
  'class' => 'amp_content_builder',
543
  'subsection' => true,
546
  array(
547
  'id' => 'ampforwp-content-builder',
548
  'type' => 'switch',
549
+ 'title' => __('Legacy Page Builder (widgets)', 'accelerated-mobile-pages'),
550
  'subtitle' => __('Build AMP Landing pages in minutes.', 'accelerated-mobile-pages'),
551
  'true' => 'true',
552
  'desc' => '<div style=" background: #FFF9C4;
553
  display: inline-block;
554
+ padding: 10px 20px;
555
+ margin-top: 15px;
556
  left: 0;
557
+ line-height: 1.6;
558
+ position: absolute;
559
+ left: 20px;
560
+ font-size: 15px;"><b>Introducing AMP Page Builder 2.0</b>, Re-Engineered! <br /> <a href="https://ampforwp.com/tutorials/article/amp-page-builder-installation/" target="_blank">Learn how to use this Feature</a></div>
561
+
562
+ <iframe style=" position: absolute;
563
+ left: 20px;
564
+ margin-top: 100px;" width="600" height="400" src="https://www.youtube.com/embed/vAGPFKKm5G4" frameborder="0" allowfullscreen></iframe>
565
+
566
+ ',
567
  'false' => 'false',
568
  'default' => 1
569
  ),
1827
 
1828
  // Appearance Section
1829
  Redux::setSection( $opt_name, array(
1830
+ 'title' => __( 'Design', 'accelerated-mobile-pages' ),
1831
  'icon' => 'el el-adjust-alt',
1832
  'desc' => ''
1833
 
includes/welcome.php CHANGED
@@ -75,28 +75,31 @@ function ampforwp_welcome_screen_content() {
75
 
76
 
77
 
78
- <h1 style="color: #303F9F;font-weight: 500;margin-top: 48px;">
79
  <i class="dashicons dashicons-editor-help" style="font-size: 36px; margin-right: 20px; margin-top: -1px;"></i><?php echo __('Need Help?','accelerated-mobile-pages') ?>
80
  </h1>
81
  <p style="font-family: georgia;font-size: 20px;font-style: italic;margin-bottom: 3px;line-height: 1.5;margin-top: 11px;color: #666;"><?php echo __('We\'re bunch of passionate people that are dedicated towards helping our users. We will be happy to help you!','accelerated-mobile-pages') ?></p>
82
- <div class="getstarted_wrapper">
 
83
  <div class="getstarted_options">
84
- <p><b><?php echo __('Links to help you started:','accelerated-mobile-pages') ?></b>
85
  <ul class="getstarted_ul">
86
- <li><a href="https://ampforwp.com/getting-started-with-amp" target="_blank"><?php echo __('Getting Started with AMP','accelerated-mobile-pages') ?></a></li>
87
- <li><a href="https://ampforwp.com/add-menus-amp/" target="_blank"><?php echo __('Adding Navigation Menu','accelerated-mobile-pages') ?></a></li>
88
- <li><a href="https://ampforwp.com/add-analytics-amp/" target="_blank"><?php echo __('Adding Google Analtyics','accelerated-mobile-pages') ?></a></li>
89
- <a class="getstarted_btn" href="https://ampforwp.com/help/" target="_blank"><?php echo __('View all Tutorials','accelerated-mobile-pages') ?></a>
90
- </ul> </p>
91
  </div>
92
- <div class="getstarted_links">
93
- <p><b><?php echo __('There are 3 ways to get help:','accelerated-mobile-pages') ?></b></p>
94
- <ul class="getstarted_ul">
95
- <li><a href="https://wordpress.org/support/plugin/accelerated-mobile-pages" target="_blank"><?php echo __('Support Forum','accelerated-mobile-pages') ?></a></li>
96
- <li><a href="https://ampforwp.com/tutorials/" target="_blank"><?php echo __('Tutorials','accelerated-mobile-pages') ?></a></li>
97
- <li><a href="https://ampforwp.com/help" target="_blank"><?php echo __('View Documentation','accelerated-mobile-pages') ?></a></li>
98
- </ul>
99
- </div><div class="clear"></div>
 
 
100
  </div>
101
 
102
  </div>
@@ -346,14 +349,23 @@ function afdfddf(){?>
346
  font-size: 16px;
347
  border-radius: 3px;
348
  }
349
- .getstarted_wrapper{
350
- max-width: 510px;
351
- margin-top: 20px; }
352
- .getstarted_options{ float: left}
353
- .getstarted_options{float: left; background: #fff; border: 1px solid #ddd; padding: 10px 30px 10px 30px; border-radius: 2px; }
354
  .getstarted_links{float: right; background: #fff; border: 1px solid #ddd; padding: 10px 30px 10px 30px; border-radius: 2px; }
355
  .ampforwp-post-installtion-instructions, .ampforwp-pre-installtion-instructions{ margin-left: 15px;}
356
- .getstarted_ul li{ list-style-type: decimal; list-style-position: inside; }
 
 
 
 
 
 
 
 
 
 
 
357
  a.getstarted_btn{
358
  background: #666;
359
  color: #fff;
75
 
76
 
77
 
78
+ <h1 style="color: #303F9F;font-weight: 500;margin-top: 30px;">
79
  <i class="dashicons dashicons-editor-help" style="font-size: 36px; margin-right: 20px; margin-top: -1px;"></i><?php echo __('Need Help?','accelerated-mobile-pages') ?>
80
  </h1>
81
  <p style="font-family: georgia;font-size: 20px;font-style: italic;margin-bottom: 3px;line-height: 1.5;margin-top: 11px;color: #666;"><?php echo __('We\'re bunch of passionate people that are dedicated towards helping our users. We will be happy to help you!','accelerated-mobile-pages') ?></p>
82
+
83
+ <div class="getstarted_wrapper">
84
  <div class="getstarted_options">
85
+ <p><b>Getting Started</b></p>
86
  <ul class="getstarted_ul">
87
+ <li><a href="https://ampforwp.com/tutorials/article-categories/installation-updating/" target="_blank">Installation &amp; Setup</a></li>
88
+ <li><a href="https://ampforwp.com/tutorials/article-categories/settings-options/" target="_blank">Settings &amp; Options</a></li>
89
+ <li><a href="https://ampforwp.com/tutorials/article-categories/setup-amp/" target="_blank">Setup AMP</a></li>
90
+ <li><a href="https://ampforwp.com/tutorials/article-categories/page-builder/" target="_blank">Page Builder</a></li>
91
+ </ul>
92
  </div>
93
+ <div class="getstarted_options">
94
+ <p><b>Useful Links</b></p>
95
+ <ul class="getstarted_ul">
96
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extension/" target="_blank">Extensions &amp; Themes Docs</a></li>
97
+ <li><a href="https://ampforwp.com/tutorials/article-categories/extending/" target="_blank">Developers Docs</a></li>
98
+ <li><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">Create a Custom Theme for AMP</a></li>
99
+ <li><a href="https://ampforwp.com/tutorials/article-categories/how-to/" target="_blank">General How To's</a></li>
100
+ </ul>
101
+ </div>
102
+ <div class="clear"></div>
103
  </div>
104
 
105
  </div>
349
  font-size: 16px;
350
  border-radius: 3px;
351
  }
352
+ .getstarted_wrapper{ display: inline-block; margin: 15px 0px 5px 0px; }
353
+ .getstarted_options{float: left; margin-right: 15px;
354
+ background: #fff; border: 1px solid #ddd; padding: 5px 25px 10px 23px; border-radius: 2px;}
 
 
355
  .getstarted_links{float: right; background: #fff; border: 1px solid #ddd; padding: 10px 30px 10px 30px; border-radius: 2px; }
356
  .ampforwp-post-installtion-instructions, .ampforwp-pre-installtion-instructions{ margin-left: 15px;}
357
+ .getstarted_ul li{ list-style-type: decimal;
358
+ list-style-position: inside;
359
+ line-height: 28px;
360
+ font-size: 14px; }
361
+ .getstarted_options p {
362
+ font-size: 16px;
363
+ margin-bottom: 0;
364
+ color: #333;
365
+ }
366
+ .getstarted_ul {
367
+ margin-top: 6px;
368
+ }
369
  a.getstarted_btn{
370
  background: #666;
371
  color: #fff;
pagebuilder/amp-page-builder.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ echo "Silence is golden";
4
+ }
5
+
6
+ // Identifies the current plugin version.
7
+ define( 'AMP_PAGE_BUILDER', plugin_dir_path(__FILE__) );
8
+ define( 'AMP_PAGE_BUILDER_URL', plugin_dir_url(__FILE__) );
9
+
10
+ add_action('add_meta_boxes','ampforwp_pagebuilder_content_meta_register');
11
+ function ampforwp_pagebuilder_content_meta_register(){
12
+ $pb_post_type = array('post','page');
13
+ add_meta_box( 'pagebilder_content', __( 'AMP Page Builder', 'amp-page-builder' ), 'amp_content_pagebuilder_title_callback', $pb_post_type, 'normal', 'default' );
14
+ }
15
+
16
+ function amp_content_pagebuilder_title_callback( $post ){
17
+ global $post;
18
+ $amp_current_post_id = $post->ID;
19
+ wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
20
+
21
+ $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
22
+ $editor_id = 'ampforwp_custom_content_editor';
23
+ //wp_editor( $content, $editor_id );
24
+ if(empty($content)){
25
+ echo "<div class='amppb_welcome'>
26
+ <a class='amppb_helper_btn beta_btn' href='https://ampforwp.com/tutorials/article/page-builder-is-in-beta/' target='_blank'><span>Beta Feature</span></a>
27
+ <a class='amppb_helper_btn video_btn' href='https://ampforwp.com/tutorials/article/amp-page-builder-installation/' target='_blank'><span>Video Tutorial</span></a>
28
+
29
+ <a class='amppb_helper_btn leave_review' href='https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#new-post' target='_blank'><span>Rate</span></a>
30
+ </div>";
31
+ }
32
+ //echo "<textarea style='display:none' id='amp-content-preview'>$content</textarea>";
33
+ /*echo "<div class='rander_amp_html'>";
34
+ echo html_entity_decode($content);
35
+ echo "</div>";*/
36
+ wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though...
37
+ wp_enqueue_style( 'wp-jquery-ui-dialog' );
38
+ call_page_builder();
39
+ }
40
+
41
+
42
+
43
+ /* Add page builder form after editor */
44
+ function call_page_builder(){
45
+ global $post;
46
+ global $moduleTemplate;
47
+ add_thickbox();
48
+ $previousData = get_post_meta($post->ID,'amp-page-builder');
49
+ $previousData = isset($previousData[0])? $previousData[0]: null;
50
+ //$previousData = wp_slash($previousData);
51
+ $previousData = (str_replace("'", "", $previousData));
52
+
53
+ $totalRows = 1;
54
+ $totalmodules = 1;
55
+ if(!empty($previousData)){
56
+ //echo ' sdcds '.json_encode($previousData);die;
57
+ $jsonData = json_decode($previousData,true);
58
+ if(count($jsonData['rows'])>0){
59
+ $totalRows = $jsonData['totalrows'];
60
+ $totalmodules = $jsonData['totalmodules'];
61
+ $previousData = json_encode($jsonData);
62
+ }else{
63
+ $jsonData['rows'] = array();
64
+ $jsonData['totalrows']=1;
65
+ $jsonData['totalmodules'] = 1;
66
+ $previousData = json_encode($jsonData);
67
+ }
68
+ }
69
+ ?>
70
+ <div id="amp-page-builder">
71
+ <?php wp_nonce_field( "amppb_nonce_action", "amppb_nonce" ) ?>
72
+ <input type="hidden" name="amp-page-builder" id="amp-page-builder-data" class="amp-data" value='<?php echo $previousData; ?>'>
73
+ <?php /* This is where we gonna add & manage rows */ ?>
74
+
75
+ <div id="sorted_rows" class="amppb-rows droppable">
76
+ <p class="dummy amppb-rows-message">Welcome to AMP Page Builder.</p>
77
+
78
+ </div><!-- .amppb-rows -->
79
+
80
+
81
+ <?php /* This is where our action buttons to add rows
82
+ Modules
83
+ */ ?>
84
+ <div class="amppb-actions" id="amppb-actions-container" data-containerid="<?php echo $totalRows; ?>">
85
+ <span id="action-col-1" class="amppb-add-row button-primary button-large draggable module-col-1" data-template="col-1">1 Column</span>
86
+ <span id="action-col-2" class="amppb-add-row button-primary button-large draggable module-col-2" data-template="col-2">2 Columns</span>
87
+
88
+ </div><!-- .amppb-actions -->
89
+
90
+
91
+
92
+
93
+ <div class="amppb-module-actions" id="amppb-module-actions-container" data-recentid="<?php echo $totalmodules; ?>">
94
+ <?php
95
+ foreach ($moduleTemplate as $key => $module) {
96
+ echo '<span class="amppb-add-row button-primary button-large draggable module-'.strtolower($module['name']).'" data-template="'.strtolower($module['name']).'">'.$module['label'].'</span>';
97
+ }
98
+ ?>
99
+ </div><!-- .amppb-module-actions -->
100
+
101
+
102
+ </div>
103
+ <?php add_thickbox(); ?>
104
+ <div id="my-amppb-dialog" class="hidden" style="max-width:800px">
105
+
106
+ <div class="amp-pb-module-content">
107
+
108
+ </div>
109
+ <div class="amppb-tc-footer">
110
+ <div class="amppb-status remove-module buttons-groups">
111
+ <a class="dashicons dashicons-trash button" href="javascript:void(0)">Delete</a>
112
+ </div>
113
+ <div class="buttons-groups">
114
+ <input type="button" class="button amppb-rowData-content" data-current-container="" data-current-module="" id="amppb-rowData-content-text" data-type="text" value="Submit">
115
+
116
+ <span id="ampb-parents-dialog" data-container=""></span>
117
+
118
+ </div>
119
+ </div>
120
+ </div>
121
+ <div id="amppb-row-setting-dialog" class="hidden" style="max-width:800px">
122
+
123
+ <div class="amp-pb-rowsetting-content">
124
+ <p class="form-control">
125
+ <label for="setting_row_title">Row title</label>
126
+ <input type="text" name="row_title" id="setting_row_title">
127
+ </p>
128
+ <p class="form-control">
129
+ <label for="setting_row_class">Custom class</label>
130
+ <input type="text" name="row_class" id="setting_row_class">
131
+ </p>
132
+ </div>
133
+ <div class="amppb-tc-footer">
134
+ <div class="buttons-groups">
135
+ <input type="button" class="button amppb-rowsetting" data-current-container="" data-current-module="" id="amppb-rowsetting" data-type="text" value="Submit">
136
+
137
+ </div>
138
+ </div>
139
+ </div>
140
+ <!-- <div id="my-image-dialog" class="hidden" style="max-width:800px">
141
+ <input type="button" class="button" value="Select image" id="selectImage">
142
+ <img id="myprefix-preview-image" src="http://via.placeholder.com/350x150" />
143
+ <input type="hidden" name="myprefix_image_id" id="myprefix_image_id" value="" class="regular-text" />
144
+ <div class="amppb-tc-footer">
145
+ <div class="amppb-status"></div>
146
+ <div class="buttons-groups">
147
+ <input type="button" class="button" data-current-container="" data-current-module="" id="amppb-rowData-content-image" data-type="image" value="Submit">
148
+ </div>
149
+ </div>
150
+ </div> -->
151
+ <?php
152
+ }
153
+
154
+ // Ajax action to refresh the user image
155
+ add_action( 'wp_ajax_myprefix_get_image', 'myprefix_get_image' );
156
+ function myprefix_get_image() {
157
+ if(isset($_GET['id']) ){
158
+ $image = wp_get_attachment_image( filter_input( INPUT_GET, 'id', FILTER_VALIDATE_INT ), 'medium', false, array( 'id' => 'myprefix-preview-image' ) );
159
+ $data = array(
160
+ 'image' => $image,
161
+ );
162
+ wp_send_json_success( $data );
163
+ } else {
164
+ wp_send_json_error();
165
+ }
166
+ }
167
+
168
+ require_once "functions.php";
169
+
pagebuilder/config/moduleTemplate.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $moduleTemplate = array();
3
+ $dir = AMP_PAGE_BUILDER.'/modules/';
4
+ if (is_dir($dir)) {
5
+ if ($dh = opendir($dir)) {
6
+
7
+ while (($file = readdir($dh)) !== false) {
8
+ if(is_file($dir.$file)){
9
+ $moduleTemplate[str_replace(".php", "", $file)] = include $dir.$file;
10
+ }
11
+ }
12
+ closedir($dh);
13
+ $moduleTemplate = array_filter($moduleTemplate);
14
+ }
15
+ }
pagebuilder/functions.php ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once("config/moduleTemplate.php");
4
+
5
+ /* Admin Script */
6
+ add_action( 'admin_enqueue_scripts', 'amppbbase_admin_scripts' );
7
+
8
+ /**
9
+ * Admin pagebuilder Scripts
10
+ * @since 1.0.0Scripts
11
+ */
12
+ function amppbbase_admin_scripts( $hook_suffix ){
13
+ global $post_type;
14
+ global $moduleTemplate;
15
+ /* In Page Edit Screen */
16
+ //if( 'page' == $post_type && in_array( $hook_suffix, array( 'post.php', 'post-new.php' ) ) ){
17
+ if($post_type=='post' || $post_type=='page'){
18
+ /* Enqueue CSS & JS For Page Builder */
19
+ wp_enqueue_style( 'amppb-admin', AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.css', array(), '0.0.1' );
20
+
21
+ wp_enqueue_media();
22
+
23
+ wp_enqueue_script( 'amppb-admin', AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.js', array(
24
+ 'jquery',
25
+ 'jquery-ui-resizable',
26
+ 'jquery-ui-sortable',
27
+ 'jquery-ui-draggable',
28
+ 'jquery-ui-droppable',
29
+ 'underscore',
30
+ 'backbone',
31
+ 'plupload',
32
+ 'plupload-all',
33
+ ), '0.0.1', true );
34
+ add_action( 'admin_footer', 'js_templates');
35
+ }
36
+ }
37
+
38
+ function js_templates() {
39
+ include plugin_dir_path( __FILE__ ) . '/inc/js-templates.php';
40
+ }
41
+
42
+ /**
43
+ *
44
+ *
45
+ *
46
+ *
47
+ *
48
+ **/
49
+ /* Save post meta on the 'save_post' hook. */
50
+ add_action( 'save_post', 'amppb_save_post', 10, 2 );
51
+
52
+ /**
53
+ * Save Page Builder Data When Saving Page
54
+ */
55
+ function amppb_save_post( $post_id, $post ){
56
+
57
+ /* Stripslashes Submitted Data */
58
+ $request = stripslashes_deep( $_POST );
59
+
60
+ /* Verify/validate */
61
+ if ( ! isset( $request['amppb_nonce'] ) || ! wp_verify_nonce( $request['amppb_nonce'], 'amppb_nonce_action' ) ){
62
+ return $post_id;
63
+ }
64
+ /* Do not save on autosave */
65
+ if ( defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
66
+ return $post_id;
67
+ }
68
+
69
+ /* == Save, Delete, or Update Page Builder Data == */
70
+
71
+ /* Get (old) saved page builder data */
72
+ $saved_data = get_post_meta( $post_id, 'amp-page-builder', true );
73
+
74
+ /* Get new submitted data and sanitize it. */
75
+ $submitted_data = isset( $request['amp-page-builder'] ) ? $request['amp-page-builder'] : null;
76
+ $submitted_data = (str_replace("'", "", $submitted_data));
77
+ //$submitted_data = json_decode($submitted_data,true);
78
+ // $submitted_data = wp_slash(json_encode($submitted_data));
79
+ $submitted_data = wp_slash($submitted_data);
80
+
81
+ /* New data submitted, No previous data, create it */
82
+ if ( $submitted_data && '' == $saved_data ){
83
+ add_post_meta( $post_id, 'amp-page-builder', $submitted_data, true );
84
+ }
85
+ /* New data submitted, but it's different data than previously stored data, update it */
86
+ elseif( $submitted_data ){
87
+ update_post_meta( $post_id, 'amp-page-builder', $submitted_data );
88
+ }
89
+
90
+ /* New data submitted is empty, but there's old data available, delete it. */
91
+ elseif ( empty( $submitted_data ) && $saved_data ){
92
+ delete_post_meta( $post_id, 'amp-page-builder' );
93
+ }
94
+ }
95
+
96
+
97
+
98
+ add_action("pre_amp_render_post",'amp_pagebuilder_content');
99
+ add_action('amp_post_template_css','amp_pagebuilder_content_styles',100);
100
+ function amp_pagebuilder_content_styles(){
101
+ ?>
102
+ .row{display: inline-flex;width: 100%;}
103
+ .col-2{width:50%;float:left;}
104
+ .amp_blurb{text-align:center}
105
+ .amp_blurb amp-img{margin: 0 auto;}
106
+ .amp_btn{text-align:center}
107
+ .amp_btn a{background: #f92c8b;color: #fff;padding: 9px 20px;border-radius: 3px;display: inline-block;box-shadow: 1px 1px 4px #ccc;}
108
+ <?php
109
+ }
110
+ function amp_pagebuilder_content(){
111
+ add_filter( 'the_content', 'amppb_post_content', 1 ); // Run
112
+ }
113
+
114
+
115
+
116
+ function amppb_post_content($content){
117
+ global $post;
118
+
119
+ $previousData = get_post_meta($post->ID,'amp-page-builder');
120
+ $previousData = isset($previousData[0])? $previousData[0]: null;
121
+ if($previousData!=""){
122
+ $html ="";
123
+ $previousData = (str_replace("'", "", $previousData));
124
+ $previousData = json_decode($previousData,true);
125
+ //Call Sorting for rows
126
+ if(count($previousData['rows'])>0){
127
+ $html = '<div class="amp_pb">';
128
+ $previousData = sortByIndex($previousData['rows']);
129
+
130
+ //rander its html
131
+ foreach ($previousData as $key => $rowsData) {
132
+ $customClass = '';
133
+ if(isset($rowsData['data'][0]['row_class'])){
134
+ $customClass = urldecode($rowsData['data'][0]['row_class']);
135
+ }
136
+ $html .= '<div class="row '.$customClass.'">';
137
+ if(count($rowsData['cell_data'])>0){
138
+ switch ($rowsData['cells']) {
139
+ case '1':
140
+ $html .= rowData($rowsData['cell_data'],$rowsData['cells']);
141
+ break;
142
+ case '2':
143
+ $colData = array();
144
+ foreach($rowsData['cell_data'] as $colDevider){
145
+ $colData[$colDevider['cell_container']][] = $colDevider;
146
+ }
147
+
148
+ foreach($colData as $data)
149
+ $html .= rowData($data,$rowsData['cells']);
150
+ break;
151
+
152
+ default:
153
+ # code...
154
+ break;
155
+ }
156
+ }
157
+ $html .= '</div>';
158
+ }
159
+ $html .= '</div>';
160
+ }
161
+ if(!empty($html)){
162
+ $content = $html;
163
+ }
164
+ }
165
+ return $content;
166
+ }
167
+
168
+ function rowData($container,$col){
169
+ global $moduleTemplate;
170
+ $html = '';
171
+ if(count($container)>0){
172
+ $html .= "<div class='col col-".$col."'>";
173
+ //sort modules by index
174
+ $container = sortByIndex($container);
175
+ if(count($container)>0){
176
+
177
+ foreach($container as $contentArray){
178
+ $moduleFrontHtml = $moduleTemplate[$contentArray['type']]['front_template'];
179
+
180
+ foreach ($moduleTemplate[$contentArray['type']]['fields'] as $key => $field) {
181
+ if(isset($contentArray[$field['name']]) && !empty($contentArray)){
182
+ $moduleFrontHtml = str_replace('{{'.$field['name'].'}}', $contentArray[$field['name']], $moduleFrontHtml);
183
+ }else{
184
+ $moduleFrontHtml = str_replace('{{'.$field['name'].'}}', "", $moduleFrontHtml);
185
+ }
186
+ }
187
+ $html .= $moduleFrontHtml;
188
+ /*if($contentArray['type']=="text"){
189
+ $html .= "<p class='col-wrapper'>".$contentArray['value']."</div>";
190
+ }else{
191
+ $html .= $contentArray['value'];
192
+ }*/
193
+ }
194
+
195
+ }
196
+ $html .= "</div>";
197
+ }
198
+ return $html;
199
+ }
200
+
201
+ function sortByIndex($contentArray){
202
+ $completeSortedArray = array();
203
+ if(count($contentArray)>0){
204
+ foreach ($contentArray as $key => $singleContent) {
205
+ $completeSortedArray[$singleContent['index']] = $singleContent;
206
+ }
207
+ ksort($completeSortedArray);
208
+ return $completeSortedArray;
209
+ }else{
210
+ return $contentArray;
211
+ }
212
+ }
213
+
214
+
215
+
216
+
pagebuilder/inc/admin-amp-page-builder.css ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Page Builder Admin CSS
3
+ **/
4
+ .amppb_welcome{
5
+ position: absolute;
6
+ top: -45px;
7
+ right: 34px;
8
+ }
9
+ #pagebilder_content h2 span{
10
+ padding-left: 29px;
11
+ font-weight: 500;
12
+ }
13
+ #pagebilder_content h2 span:before{
14
+ content: "";
15
+ background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjUycHgiIGhlaWdodD0iMjUycHgiIHZpZXdCb3g9IjAgMCAyNTIgMjUyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPiAgICAgICAgPHRpdGxlPkNhcGFfMTwvdGl0bGU+ICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiAgICA8ZGVmcz48L2RlZnM+ICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9IkFydGJvYXJkLTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yLjAwMDAwMCwgLTIuMDAwMDAwKSIgZmlsbD0iI0VEMUMyNCI+ICAgICAgICAgICAgPGcgaWQ9IkNhcGFfMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMi4wMDAwMDAsIDIuMDAwMDAwKSI+ICAgICAgICAgICAgICAgIDxnIGlkPSJfeDMyXzQwLl9Qb3dlciI+ICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTI1LjYwNTYsMCBDNTYuMjMzNiwwIDAsNTYuMjMzNiAwLDEyNS42MDU2IEMwLDE5NC45NzIgNTYuMjMzNiwyNTEuMjExMiAxMjUuNjA1NiwyNTEuMjExMiBDMTk0Ljk3MjgsMjUxLjIxMTIgMjUxLjIxMTIsMTk0Ljk3MiAyNTEuMjExMiwxMjUuNjA1NiBDMjUxLjIxMTIsNTYuMjMzNiAxOTQuOTcyOCwwIDEyNS42MDU2LDAgWiBNMTI1LjYwNjAwNiwyMjguNDkwNDEyIEM2OC43ODE4MzU5LDIyOC40OTA0MTIgMjIuNzIxNiwxODIuNDIzNjI0IDIyLjcyMTYsMTI1LjYwNjAwNiBDMjIuNzIxNiw2OC43ODE4MzU5IDY4Ljc4MTgzNTksMjIuNzIxNiAxMjUuNjA2MDA2LDIyLjcyMTYgQzE4Mi40MjI4MDQsMjIuNzIxNiAyMjguNDg5NTkzLDY4Ljc4MTgzNTkgMjI4LjQ4OTU5MywxMjUuNjA2MDA2IEMyMjguNDkwNDEyLDE4Mi40MjM2MjQgMTgyLjQyMzYyNCwyMjguNDkwNDEyIDEyNS42MDYwMDYsMjI4LjQ5MDQxMiBaIE0xNjcuNzAwMjE0LDExNC43ODAxNSBMMTMzLjUxNDgzMiwxMTQuOTE4OTcxIEMxMjkuODYzNDExLDExNC45MzU3OTggMTI4LjUyMTQ3MSwxMTIuNDcwNjY4IDEzMC41MDc4NzgsMTA5LjQwNDgyIEwxNjcuMDk5NDk2LDUzLjE0NDMyNDEgQzE3MS4wNzgxOTksNDcuMDI5NDU1MiAxNzAuMTE3Mzg3LDQ2LjI1NjI2MjUgMTY0Ljk2NTg1NCw1MS40MTQ1MjYzIEw4NC41NzA2NDA2LDEzMS44MDIxNjggQzc5LjQxMDY5NDEsMTM2Ljk2MTI3MyA4MS4xNDM4NTczLDE0MS4xMjA4NjUgODguNDQxNjUyMSwxNDEuMDkxNDE4IEwxMTYuMDE0OTMyLDE0MC45Nzk1MTkgQzEyMy4zMDc2NzksMTQwLjk0OTIzMSAxMjYuMDA0MTc4LDE0NS44ODIwMTUgMTIyLjAyNjMxNiwxNTEuOTk4NTY3IEw4NS40MzYzODA4LDIwOC4yNjA3NDUgQzgzLjQ0OTEzMjUsMjExLjMxOTAyMSA4My45Mjg2OTcxLDIxMS43MTM2MSA4Ni41MTgzNDU4LDIwOS4xNDQxNTQgTDE0My45Nzc3NTMsMTUyLjA5Mjc5NyBDMTQ2LjU2MzE5NSwxNDkuNTE5OTc1IDE1MC43Mzc5MzEsMTQ1LjMzNTk4NSAxNTMuMjg5NzE5LDE0Mi43MzYyNCBMMTcxLjYzNTE2NywxMjQuMTMzMzQxIEMxNzYuNzU2NDEyLDExOC45NDM5NDggMTc0Ljk4OTU5NSwxMTQuNzQ4MTc5IDE2Ny43MDAyMTQsMTE0Ljc4MDE1IFoiIGlkPSJTaGFwZSI+PC9wYXRoPiAgICAgICAgICAgICAgICA8L2c+ICAgICAgICAgICAgPC9nPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+);
16
+ width: 24px;
17
+ height: 24px;
18
+ position: absolute;
19
+ display: inline-block;
20
+ background-repeat: no-repeat;
21
+ background-size: 24px;
22
+ top: 6px;
23
+ left: 10px;
24
+ }
25
+ #amp-page-builder{
26
+ margin: 15px 0;
27
+ transition: .2s ease-in-out;
28
+ }
29
+ #amp-page-builder a{
30
+ transition: .2s ease-in-out;
31
+ }
32
+ .hidden{
33
+ display:none;
34
+ }
35
+ /* Rows */
36
+ .amppb-rows{
37
+ margin-bottom: 20px;
38
+ border: 0px solid #ccc;
39
+ padding: 13px;
40
+ background: #eee;
41
+ border-radius: 2px;
42
+ }
43
+
44
+ .amppb-row-fields .ui-droppable{
45
+ min-height: 35px;
46
+ width: 100%;
47
+ border: 1px dashed #999;
48
+ border-radius: 60px;
49
+ line-height: 0;
50
+ display: inline-block;
51
+ }
52
+ .amppb-row-fields .has-module{
53
+ border-color: #fff
54
+ }
55
+ .amppb-row-fields .has-module.hover{
56
+ background: transparent
57
+ }
58
+
59
+ .modules-drop{
60
+ position: relative;
61
+ }
62
+
63
+ .amppb-rows-message{
64
+ border: 2px dashed #ccc;
65
+ padding: 10px 20px;
66
+ text-align: center;
67
+ }
68
+ /* Buttons */
69
+ .amppb-actions{
70
+ margin-bottom: 13px;
71
+ margin-left: 10px;
72
+ position: relative
73
+ }
74
+ .amppb-module-actions{margin-left: 10px;}
75
+ div#amppb-actions-container:before {
76
+ content: "Drag and drop them into the above container";
77
+ display: inline-block;
78
+ width: 100%;
79
+ margin-bottom: 18px;
80
+ }
81
+ /* Row */
82
+ .amppb-row{
83
+ font-size: 16px;
84
+ /* border: 1px solid #ccc; */
85
+ background: #ffffff;
86
+ margin-bottom: 0px;
87
+ box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
88
+ border-radius: 3px;
89
+ margin-bottom: 16px;
90
+ }
91
+ .amppb-row:hover .amppb-handle{ color: #607d8b }
92
+ .amppb-row:last-child{
93
+ margin-bottom: 0px;
94
+ }
95
+ .amppb-row-title{
96
+ }
97
+ .amppb-row-title:after{
98
+ content:".";display:block;height:0;clear:both;visibility:hidden;
99
+ }
100
+ .amppb-handle{
101
+ padding: 10px 8px;
102
+ /* border-right: 1px solid #ccc; */
103
+ cursor: grab;
104
+ cursor: -webkit-grab;
105
+ font-size: 14px;
106
+ position: relative;
107
+ color: #BDBDBD;
108
+ transition: .25s ease-in-out;
109
+ top: initial;
110
+ }
111
+ .amppb-row-title-text{
112
+ font-size: 12px;
113
+ color: #37474F;
114
+ top: 7px;
115
+ position: relative;
116
+ transition: 0.2s ease;
117
+ left: -7px;
118
+ opacity: 0
119
+ }
120
+ .amppb-handle:hover+.amppb-row-title-text{ opacity: 1 }
121
+ .amppb-remove{
122
+ padding: 4px 0px 0px 1px;
123
+ border-left: 0px solid #ccc;
124
+ float: right;
125
+ cursor: pointer;
126
+ line-height: 1;
127
+ color: #9E9E9E;
128
+ font-size: 14px;
129
+ border-radius: 12px;
130
+ width: 23px;
131
+ height: 20px;
132
+ position: relative;
133
+ top: 6px;
134
+ right: 4px;
135
+ }
136
+ .amppb-remove:hover{
137
+ background: #f44336;
138
+ color: #fff;
139
+ }
140
+ .tools-icon{
141
+ display: none;
142
+ padding: 3px 0px 1px 1px;
143
+ float: right;
144
+ cursor: pointer;
145
+ color: #9E9E9E;
146
+ font-size: 18px;
147
+ position: relative;
148
+ top: 5px;
149
+ width: 23px;
150
+ height: 20px;
151
+ border-radius: 60px;
152
+ right: 5px;
153
+ transition: color 0.2s;
154
+ }
155
+ .amppb-row:hover .tools-icon{
156
+ color: #546e7a;
157
+ transition: 0s
158
+ }
159
+ .amppb-row:hover .tools-icon:hover {
160
+ transition: 0s;
161
+ color: #fff;
162
+ background: #546e7a
163
+ }
164
+
165
+ .amppb-row-fields{
166
+ width: 96%;
167
+ border-top: 0px solid #333;
168
+ padding: 10px 13px 15px 13px;
169
+ clear: both;
170
+ position: relative;
171
+ }
172
+ .amppb-row-fields .hover{
173
+ width: 100%;
174
+ background: transparent;
175
+ /*
176
+ margin: 0;
177
+ border-color: #777;
178
+ background: #eee;
179
+ border-radius: 30px;
180
+ */
181
+ }
182
+ .amppb-row-fields .hover:before{
183
+ content: "Drop the module here";
184
+ text-align: center;
185
+ width: 100%;
186
+ color: #999;
187
+ position: absolute;
188
+ top: 18px;
189
+ font-size: 12px;
190
+ }
191
+ .amppb-row-fields:after{
192
+ content:".";display:block;height:0;clear:both;visibility:hidden;
193
+ }
194
+ .amppb-row-fields textarea{
195
+ width: 100%;
196
+ height: 100px;
197
+ }
198
+ /* 1 column template */
199
+ .amppb-col-1{
200
+ }
201
+ /* 2 columns template */
202
+ .amppb-col-2{
203
+ }
204
+ .amppb-column-2-left{
205
+ width: 49%;
206
+ float: left;
207
+ }
208
+ .amppb-column-2-right{
209
+ width: 49%;
210
+ float: right;
211
+ }
212
+
213
+ amppb-row-fields .amppb-column-2:not(:last-child){
214
+ border-right:#ededed;
215
+ }
216
+
217
+ /* Templates */
218
+ .amppb-templates{
219
+ display: none;
220
+ }
221
+
222
+
223
+
224
+ .amppb-module{
225
+ border: 0px solid #f1f1f1;
226
+ position: relative;
227
+ height: 36px;
228
+ cursor: all-scroll;
229
+ vertical-align: middle;
230
+ margin-bottom: 0px;
231
+ display: inline-block;
232
+ background: #FAFAFA;
233
+ border: 1px solid #d6d6d6;
234
+ width: 100%;
235
+ box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
236
+ border-radius: 30px;
237
+ margin-bottom: 10px;
238
+ }
239
+
240
+ .amppb-row-fields .amppb-module:only-child{
241
+ margin-bottom: 0px;
242
+ }
243
+ .amppb-row-fields .has-module .amppb-module:last-child{
244
+ margin-bottom: 0px;
245
+ }
246
+ .amppb-module .module_label {
247
+ position: relative;
248
+ top: 16px;
249
+ font-size: 11px;
250
+ left: 41px;
251
+ color: #666;
252
+ }
253
+
254
+ .amppb-setting-right span{
255
+ display: inline-block;
256
+ right: 0px;
257
+ position: absolute;
258
+ top: 9px;
259
+ padding: 0px 10px 0px 10px;
260
+ cursor: pointer;
261
+ font-size: 16px;
262
+ color: rgba(0, 0, 0, 0.3);
263
+ transition: all 0.25s;
264
+ }
265
+ .amppb-module:hover .amppb-setting-right span{
266
+ color: rgba(0, 0, 0, 0.75);
267
+ }
268
+
269
+
270
+ .ui-state-highlight {
271
+ height: 97px;
272
+ background: #666;
273
+ box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.9);
274
+ margin-bottom: 0px;
275
+ border-radius: 3px;
276
+ margin-bottom: 16px;
277
+ }
278
+ .ui-state-highlight:before{
279
+ content: "Drop Here";
280
+ width: 100%;
281
+ display: inline-block;
282
+ text-align: center;
283
+ color: rgba(255, 255, 255, 0.6);
284
+ font-weight: 300;
285
+ position: relative;
286
+ top: 15px;
287
+ font-size: 14px;
288
+ text-transform: uppercase;
289
+ letter-spacing: 1px;
290
+ }
291
+ .ui-state-highlight-module {
292
+ min-height: 35px;
293
+ width: 100%;
294
+ border: 1px dashed #999;
295
+ border-radius: 60px;
296
+ line-height: 0;
297
+ display: inline-block;
298
+ margin-bottom: 10px
299
+ }
300
+ .ui-state-highlight-module:last-child{
301
+ margin-bottom: 0px;
302
+ }
303
+
304
+ .ui-state-active,
305
+ .ui-widget-content .ui-state-active,
306
+ .ui-widget-header .ui-state-active,
307
+ a.ui-button:active,
308
+ .ui-button:active,
309
+ .ui-button.ui-state-active:hover {
310
+ border: 1px solid #003eff;
311
+ background: #007fff;
312
+ font-weight: normal;
313
+ color: #ffffff;
314
+ }
315
+ .ui-icon-background,
316
+ .ui-state-active .ui-icon-background {
317
+ border: #003eff;
318
+ background-color: #ffffff;
319
+ }
320
+ .ui-state-active a,
321
+ .ui-state-active a:link,
322
+ .ui-state-active a:visited {
323
+ color: #ffffff;
324
+ text-decoration: none;
325
+ }
326
+
327
+ .ui-state-hover,
328
+ .ui-widget-content .ui-state-hover,
329
+ .ui-widget-header .ui-state-hover,
330
+ .ui-state-focus,
331
+ .ui-widget-content .ui-state-focus,
332
+ .ui-widget-header .ui-state-focus,
333
+ .ui-button:hover,
334
+ .ui-button:focus {
335
+ border: 1px solid #cccccc;
336
+ background: #ededed;
337
+ font-weight: normal;
338
+ color: #2b2b2b;
339
+ }
340
+ .ui-state-hover div,
341
+ .ui-state-hover div:hover,
342
+ .ui-state-hover div:link,
343
+ .ui-state-hover div:visited,
344
+ .ui-state-focus div,
345
+ .ui-state-focus div:hover,
346
+ .ui-state-focus div:link,
347
+ .ui-state-focus div:visited,
348
+ a.ui-button:hover,
349
+ a.ui-button:focus {
350
+ color: #2b2b2b;
351
+ text-decoration: none;
352
+ }
353
+ .hover {
354
+ background:red;
355
+ }
356
+
357
+
358
+ .thickbox{
359
+ text-decoration: none;
360
+ }
361
+
362
+
363
+ .amppb-tc-footer{
364
+ left: 0px;
365
+ right: 0px;
366
+ bottom: 0px;
367
+ height: 58px;
368
+ position: absolute;
369
+ background-color: #fafafa;
370
+ border-top: 1px solid #D8D8D8;
371
+ z-index: 100002;
372
+ }
373
+ .amppb-tc-footer .buttons-groups{
374
+ float: right;
375
+ padding: 15px;
376
+ }
377
+ .amppb-tc-footer .amppb-status{
378
+ float: left;
379
+ }
380
+ .buttons-groups .amppb-save{background: #666;
381
+ border-color: #666;
382
+ color: #fff;}
383
+ .amppb-tc-footer .remove-module a{
384
+ display: inline-table;
385
+ font-size: 13px;
386
+ font-family: sans-serif;
387
+ }
388
+ .remove-module a:before{
389
+ font-family: dashicons;
390
+ top: 2px;
391
+ position: relative;
392
+ margin-right: 2px;
393
+ left: -1px;
394
+ }
395
+ .amppb-tc-footer .remove-module a:hover{color: #fff;background: #f44336;border-color:#f44336}
396
+
397
+
398
+ /********
399
+ Module Buttons
400
+ ***********************/
401
+ .modules-drop .ui-sortable-helper{
402
+ width: auto;
403
+ display: inline-block;
404
+ text-align: center;
405
+ width: 40px;
406
+ height: 40px;
407
+ padding: 10px;
408
+ position: absolute;
409
+ z-index: 10000000;
410
+ border-radius: 66px;
411
+ }
412
+ .modules-drop .ui-sortable-helper .module_label, .modules-drop .ui-sortable-helper .amppb-setting-right{
413
+ display: none
414
+ }
415
+ .modules-drop .ui-sortable-helper:before{
416
+ content: "";
417
+ font-size: 35px;
418
+ width: 100%;
419
+ height: 100%;
420
+ left: inherit;
421
+ top: inherit;
422
+ right: initial;
423
+ padding: 0;
424
+ position: relative;
425
+ display: inline-block;
426
+ bottom: inherit;
427
+ }
428
+
429
+ #amppb-actions-container .button-primary,
430
+ #amppb-module-actions-container .button-primary{
431
+ background: #FAFAFA;
432
+ border: 0px;
433
+ box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
434
+ text-shadow: none;
435
+ color: #333;
436
+ border: 1px solid rgba(0, 0, 0, 0.08);
437
+ border-radius: 100px;
438
+ height: auto;
439
+ padding: 6px 18px 8px 18px;
440
+ transition: transform 0.25s, box-shadow 0.25s, border 0.25s;
441
+ }
442
+ #amppb-actions-container .button-primary:hover,
443
+ #amppb-module-actions-container .button-primary:hover{
444
+ box-shadow: 1px 1px 10px 0px rgba(0, 0, 0, 0.15);
445
+ border: 1px solid rgba(0, 0, 0, 0.08);
446
+ transform: rotate(-5deg);
447
+ }
448
+ .amppb-module-actions .ui-draggable-dragging,
449
+ .amppb-actions .ui-draggable-dragging{
450
+ box-shadow: 1px 1px 10px 0px rgba(0, 0, 0, 0.15);
451
+ border: 1px solid rgba(0, 0, 0, 0.08);
452
+ transform: rotate(-5deg);
453
+ z-index: 9000000;
454
+ }
455
+ #amppb-actions-container .button-primary{
456
+ margin-right: 7px;
457
+ }
458
+ #amppb-module-actions-container .button-primary{
459
+ margin-right: 10px;
460
+ }
461
+ /* Button Img Default Values */
462
+ .amppb-add-row:before{
463
+ content: "";
464
+ /* max-width: 256px; */
465
+ /* max-height: 256px; */
466
+ background-repeat: no-repeat;
467
+ background-position: 4px;
468
+ display: inline-block;
469
+ /* box-shadow: 1px 1px 1px #000; */
470
+ width: 20px;
471
+ height: 20px;
472
+ background-size: 20px;
473
+ top: 5px;
474
+ position: relative;
475
+ background-position: 0;
476
+ margin-right: 8px;
477
+ }
478
+ /* Module img defaults */
479
+ .amppb-module:before {
480
+ width: 10px;
481
+ height: 10px;
482
+ display: inline-block;
483
+ background-repeat: no-repeat;
484
+ background-position: 4px;
485
+ display: inline-block;
486
+ /* box-shadow: 1px 1px 1px #000; */
487
+ width: 20px;
488
+ height: 20px;
489
+ background-size: 20px;
490
+ top: 8px;
491
+ position: absolute;
492
+ background-position: 0;
493
+ margin-right: 8px;
494
+ left: 15px;
495
+ opacity: 0.85
496
+ }
497
+ .amppb-row:hover .amppb-module:before{
498
+ opacity: 1
499
+ }
500
+ .modules-drop .ui-sortable-helper.amppb-module:before{
501
+ left: 15px;
502
+ top: 2px;
503
+ transform: scale(1.5);
504
+ }
505
+ .module-col-1:before{
506
+ background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iNDcwcHgiIGhlaWdodD0iNDcwcHgiIHZpZXdCb3g9IjAgMCA0NzAgNDcwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPiAgICAgICAgPHRpdGxlPmNvbHVtbnM8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4gICAgICAgIDxnIGlkPSJjb2x1bW5zIiBmaWxsPSIjMDAwMDAwIj4gICAgICAgICAgICA8cGF0aCBkPSJNNDU4LjY2NywwIEwxMC42NjcsMCBDNC43NzEsMCAwLDQuNzcxIDAsMTAuNjY3IEwwLDQ1OC42NjcgQzAsNDY0LjU2MyA0Ljc3MSw0NjkuMzM0IDEwLjY2Nyw0NjkuMzM0IEw0NTguNjY3LDQ2OS4zMzQgQzQ2NC41NjMsNDY5LjMzNCA0NjkuMzM0LDQ2NC41NjMgNDY5LjMzNCw0NTguNjY3IEw0NjkuMzM0LDEwLjY2NyBDNDY5LjMzMyw0Ljc3MSA0NjQuNTYzLDAgNDU4LjY2NywwIFogTTI1MS42NjY1LDQ0OCBMMjEuMzMzLDQ0OCBMMjEuMzMzLDIxLjMzMyBMMjUxLjY2NjUsMjEuMzMzIEw0NDgsMjEuMzMzIEw0NDgsNDQ4IEwyNTEuNjY2NSw0NDggWiIgaWQ9IlNoYXBlIj48L3BhdGg+ICAgICAgICA8L2c+ICAgIDwvZz48L3N2Zz4=);
507
+
508
+ }
509
+ .module-col-2:before{
510
+ background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0NjkuMzMzIDQ2OS4zMzMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ2OS4zMzMgNDY5LjMzMzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiPgo8Zz4KCTxnPgoJCTxwYXRoIGQ9Ik00NTguNjY3LDBoLTQ0OEM0Ljc3MSwwLDAsNC43NzEsMCwxMC42Njd2NDQ4YzAsNS44OTYsNC43NzEsMTAuNjY3LDEwLjY2NywxMC42NjdoNDQ4ICAgIGM1Ljg5NiwwLDEwLjY2Ny00Ljc3MSwxMC42NjctMTAuNjY3di00NDhDNDY5LjMzMyw0Ljc3MSw0NjQuNTYzLDAsNDU4LjY2NywweiBNMjI0LDQ0OEgyMS4zMzNWMjEuMzMzSDIyNFY0NDh6IE00NDgsNDQ4SDI0NS4zMzMgICAgVjIxLjMzM0g0NDhWNDQ4eiIgZmlsbD0iIzAwMDAwMCIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);
511
+
512
+ }
513
+
514
+
515
+ /* .module-image */
516
+ .module-image:before, .amppb-module-image:before{
517
+ content: "";
518
+ max-width: 256px;max-height: 256px;background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgNDU5IDQ1OSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDU5IDQ1OTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnIGlkPSJkcml2ZS1pbWFnZSI+CgkJPHBhdGggZD0iTTQ1OSw0MDhWNTFjMC0yOC4wNS0yMi45NS01MS01MS01MUg1MUMyMi45NSwwLDAsMjIuOTUsMCw1MXYzNTdjMCwyOC4wNSwyMi45NSw1MSw1MSw1MWgzNTcgICAgQzQzNi4wNSw0NTksNDU5LDQzNi4wNSw0NTksNDA4eiBNMTQwLjI1LDI2Ny43NWw2My43NSw3Ni41bDg5LjI1LTExNC43NUw0MDgsMzgyLjVINTFMMTQwLjI1LDI2Ny43NXoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)
519
+ }
520
+
521
+ .module-text:before, .amppb-module-text:before{
522
+ content: "";
523
+ max-width: 256px;max-height: 256px;background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjMycHgiIGhlaWdodD0iMzJweCIgdmlld0JveD0iMCAwIDM4Mi41IDM4Mi41IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzODIuNSAzODIuNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnIGlkPSJ0ZXh0LWZvcm1hdCI+CgkJPHBhdGggZD0iTTEyLjc1LDMzMS41djUxaDM1N3YtNTFIMTIuNzV6IE0xMjcuNSwyMjQuNEgyNTVsMjIuOTUsNTYuMWg1My41NUwyMTEuNjUsMEgxNzMuNEw1MSwyODAuNWg1My41NUwxMjcuNSwyMjQuNHogICAgIE0xOTEuMjUsNTFsNDguNDUsMTI3LjVoLTk0LjM1TDE5MS4yNSw1MXoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)
524
+ }
525
+
526
+
527
+ .module-blurb:before, .amppb-module-blurb:before{
528
+ content: "";
529
+ max-width: 256px;max-height: 256px;background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMCA1MTAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMCA1MTA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8ZyBpZD0iY29tbWVudCI+CgkJPHBhdGggZD0iTTUxMCw1MWMwLTI4LjA1LTIyLjk1LTUxLTUxLTUxSDUxQzIyLjk1LDAsMCwyMi45NSwwLDUxdjMwNmMwLDI4LjA1LDIyLjk1LDUxLDUxLDUxaDM1N2wxMDIsMTAyVjUxeiBNNDA4LDMwNkgxMDJ2LTUxICAgIGgzMDZWMzA2eiBNNDA4LDIyOS41SDEwMnYtNTFoMzA2VjIyOS41eiBNNDA4LDE1M0gxMDJ2LTUxaDMwNlYxNTN6IiBmaWxsPSIjMDAwMDAwIi8+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)
530
+ }
531
+
532
+
533
+ .module-button:before, .amppb-module-button:before{
534
+ content: "";
535
+ max-width: 256px;max-height: 256px; background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+ICAgIDxwYXRoIGQ9Ik0yMSAzSDNjLTEuMSAwLTIgLjktMiAydjE0YzAgMS4xLjkgMiAyIDJoMThjMS4xIDAgMi0uOSAyLTJWNWMwLTEuMS0uOS0yLTItMnptMCAxNkgzdi0zaDE4djN6Ii8+PC9zdmc+);
536
+
537
+
538
+ }
539
+ #TB_title{
540
+ background: transparent;
541
+ border-color: #fff
542
+ }
543
+ #TB_closeWindowButton{
544
+ background: #fafafa;
545
+ outline: none;
546
+ border: solid #d8d8d8;
547
+ border-width: 0px 0px 1px 1px;}
548
+ #TB_window #TB_ajaxContent{
549
+ padding-bottom: 60px
550
+ }
551
+ .amppb_helper_btn{
552
+ right: 12px;
553
+ color: rgba(0, 0, 0, 0.65);
554
+ font-size: 11px;
555
+ padding: 6px 10px 6px 12px;
556
+ text-decoration: none;
557
+ margin-right: 1px;
558
+ border-radius: 2px;
559
+ border: 1px solid rgba(221, 221, 221, 0.17);
560
+ background: #f1f1f1;
561
+ border-color: rgba(204, 204, 204, 0.35);
562
+ background: #f7f7f7;
563
+ -webkit-box-shadow: 0 1px 0 #ccc;
564
+ box-shadow: 0 0px 0 rgba(204, 204, 204, 0.79);
565
+ }
566
+ .amppb_helper_btn span:before{
567
+ content: "";
568
+ background-size: 17px;
569
+ background-repeat: no-repeat;
570
+ padding: 8px;
571
+ display: inline-block;
572
+ position: relative;
573
+ top: 3px;
574
+ right: 4px;
575
+ opacity: 0.45;
576
+ }
577
+ .leave_review span:before{
578
+ background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTEuOTkgMkM2LjQ3IDIgMiA2LjQ4IDIgMTJzNC40NyAxMCA5Ljk5IDEwQzE3LjUyIDIyIDIyIDE3LjUyIDIyIDEyUzE3LjUyIDIgMTEuOTkgMnptNC4yNCAxNkwxMiAxNS40NSA3Ljc3IDE4bDEuMTItNC44MS0zLjczLTMuMjMgNC45Mi0uNDJMMTIgNWwxLjkyIDQuNTMgNC45Mi40Mi0zLjczIDMuMjNMMTYuMjMgMTh6Ii8+PC9zdmc+);
579
+ }
580
+ .beta_btn span:before{
581
+ background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtNmgydjZ6bTAtOGgtMlY3aDJ2MnoiLz48L3N2Zz4=);
582
+
583
+ }
584
+ .video_btn span:before{
585
+ background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTQuNXYtOWw2IDQuNS02IDQuNXoiLz48L3N2Zz4=);
586
+ }
587
+ a.amppb_helper_btn:hover{
588
+ background: #80858a;
589
+ color: #fff;
590
+ border-color: #80858a
591
+ }
592
+
593
+ /********
594
+ Form Styles
595
+ ***********************/
596
+ .full{
597
+ border-spacing: 0;
598
+ width: 100%;
599
+ clear: both;
600
+ margin: 0;
601
+ }
pagebuilder/inc/admin-amp-page-builder.js ADDED
@@ -0,0 +1,668 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready( function( $ ){
2
+ $( "#sorted_rows" ).sortable({
3
+ placeholder: "ui-state-highlight",
4
+ handle : '.amppb-handle',
5
+ cursor : 'grabbing',
6
+ axis : 'y',
7
+ update : function(){
8
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
9
+ $(this).find('div.amppb-row').each(function(indexKey,val){
10
+ var indexOfRow = $(this).attr('id').replace('conatiner-','');
11
+ $.each(ploatedStructure.rows,function(k,columnVal){
12
+ if(columnVal.id==indexOfRow){
13
+ columnVal.index = indexKey+1;
14
+ }
15
+ });
16
+ });
17
+ storeJsonDataInput(ploatedStructure)
18
+ }
19
+ });
20
+ $( ".draggable" ).draggable({
21
+ helper: "clone",
22
+ revert:'invalid',
23
+ start: function(event, ui){
24
+
25
+ },
26
+ stop: function(event, ui){
27
+
28
+ }
29
+ });
30
+
31
+ $( ".droppable" ).droppable({
32
+ accept:'.amppb-actions > span',
33
+ classes: {
34
+ "ui-droppable-active": "ui-state-active",
35
+ "ui-droppable-hover": "ui-state-hover"
36
+ },
37
+ drop: function( event, ui ) {
38
+
39
+ $containerid = parseInt($('#amppb-actions-container').attr('data-containerid'));
40
+ $('#amppb-actions-container').attr('data-containerid',$containerid+1);
41
+
42
+
43
+ var templateclass = ui.draggable.attr("data-template");
44
+ var template = '.amppb-templates > .amppb-' + templateclass;
45
+ $( template ).clone().attr('id','conatiner-'+$containerid).appendTo(this);
46
+
47
+ var noOfCell = 1;
48
+ if(templateclass=='col-2'){ noOfCell=2; }
49
+ var rowContainer = {
50
+ 'id':$containerid,
51
+ 'index':$containerid,
52
+ 'cells': noOfCell,
53
+ 'cell_data': [],
54
+ 'data':{}
55
+ };
56
+ var ploatedStructure = ($('#amp-page-builder-data').val());
57
+ if(ploatedStructure!=''){
58
+ sampleData = JSON.parse(ploatedStructure);
59
+ }else{
60
+ sampleData = sampleData
61
+ }
62
+ sampleData.rows.push(rowContainer);
63
+ sampleData['totalrows'] = $containerid+1;
64
+
65
+ //store in input box
66
+ storeJsonDataInput(sampleData);
67
+
68
+
69
+ if($(this).find('.dummy')){
70
+ $(this).find('.dummy').remove();
71
+ }
72
+
73
+ moduleLoad();
74
+ }
75
+ });
76
+ $( document.body ).on( 'click', '.amppb-remove', function(e){
77
+ e.preventDefault();
78
+ if(confirm("Are you sure want to delete Row?")){
79
+ /* Delete Row */
80
+ var containerId = $( this ).parents( '.amppb-row' ).attr('id').replace("conatiner-","");
81
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
82
+
83
+ $.each(ploatedStructure.rows,function(key,rowData){
84
+ if(rowData.id==containerId){
85
+ ploatedStructure.rows.splice(key, 1);
86
+ return false;
87
+ }
88
+ });
89
+ //console.log(ploatedStructure);
90
+ storeJsonDataInput(ploatedStructure);
91
+
92
+ $( this ).parents( '.amppb-row' ).remove();
93
+ }
94
+ });
95
+
96
+ $( document.body ).on('click', '.remove-module', function(e){
97
+ e.preventDefault();
98
+ if(confirm("Are you sure want to delete Module?")){
99
+ /* Delete Row */
100
+ var containerdetails = $(this).parents('.amppb-tc-footer').find("#ampb-parents-dialog").attr('data-container');
101
+
102
+ containerdetails = containerdetails.split('--');
103
+
104
+ var containerId = containerdetails[0];
105
+ var moduleId = containerdetails[1];
106
+
107
+ //To remove From main structure
108
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
109
+ $.each(ploatedStructure.rows,function(key,rowData){
110
+ if(rowData.id==containerId){
111
+ $.each(rowData.cell_data,function(cellkey,cellData){
112
+ if(cellData.cell_id==moduleId){
113
+ ploatedStructure.rows[key].cell_data.splice(cellkey, 1);
114
+ return false;
115
+ }
116
+ });
117
+ //ploatedStructure.rows.splice(key, 1);
118
+ return false;
119
+ }
120
+ });
121
+ storeJsonDataInput(ploatedStructure);
122
+ $("#sorted_rows").find("#conatiner-"+containerId).find("#module-"+moduleId).remove();
123
+ tb_remove();
124
+ //$(this).parents(".amppb-module").remove();
125
+ callToRemoveHasModule();
126
+ }
127
+
128
+ });
129
+
130
+ $(document.body).on('click', ".rowBoxContainer", function(e){
131
+ e.preventDefault();
132
+ /* Delete Row */
133
+ var containerId = $( this ).parents( '.amppb-row' ).attr('id').replace("conatiner-","");
134
+ $('#amppb-rowsetting').attr('data-current-container',containerId);
135
+
136
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
137
+ $.each(ploatedStructure.rows,function(rowkey,rowData){
138
+ if(rowData.id==containerId){
139
+ console.log(rowData.data);
140
+
141
+ $( "#amppb-rowsetting" ).parents('.amppb-tc-footer').siblings('.amp-pb-rowsetting-content').find('input').each(function(){
142
+ console.log($(this).attr('name'));
143
+ $(this).val( decodeURI(rowData.data[0][$(this).attr('name')]) );
144
+ });
145
+
146
+
147
+ }
148
+ });
149
+ });
150
+ //Save data of row settings
151
+ $( document.body ).on('click', "#amppb-rowsetting", function(e){
152
+ e.preventDefault();
153
+ console.log("Save button #amppb-rowsetting has clicked");
154
+ var containerId = $(this).attr('data-current-container');
155
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
156
+ var selectedSettings = {};
157
+ console.log(ploatedStructure);
158
+ var currentButton = $(this);
159
+ $.each(ploatedStructure.rows,function(rowkey,rowData){
160
+ if(rowData.id==containerId){
161
+ currentButton.parents('.amppb-tc-footer').siblings('.amp-pb-rowsetting-content').find('input').each(function(){
162
+ selectedSettings[$(this).attr('name')] = encodeURI($(this).val());
163
+
164
+ });
165
+ ploatedStructure.rows[rowkey].data.push(selectedSettings);
166
+ return false;
167
+ }
168
+ });
169
+ storeJsonDataInput(ploatedStructure);
170
+ tb_remove();
171
+ });
172
+
173
+ //save the content of popup
174
+ $( document.body ).on('click', ".amppb-rowData-content", function(){
175
+ var containerdetails = $(this).parents('.buttons-groups').find("#ampb-parents-dialog").attr('data-container');
176
+
177
+ containerdetails = containerdetails.split('--');
178
+
179
+ //Grab value of current modules
180
+ var moduledetails = $(this).parents('.buttons-groups').find("#ampb-parents-dialog").attr('data-modules');
181
+
182
+ moduledetails = JSON.parse(moduledetails);
183
+
184
+ var moduleJson = JSON.parse($('#module-'+containerdetails[1]).find('#selectedModule').val());
185
+
186
+ $.each(moduleJson.fields, function(fieldtype,modData){
187
+ var fieldIdentifier = modData.name+'-'+containerdetails[0]+'-'+containerdetails[1];
188
+ if(modData.type=='text-editor'){
189
+ modData.default = encodeURI(tinymce.get(fieldIdentifier).getContent().replace("'","\'"));
190
+ }else{
191
+ modData.default = encodeURI($('#'+fieldIdentifier).val().replace("'","\'"));
192
+
193
+ }
194
+
195
+ });
196
+ $('#module-'+containerdetails[1]).find('#selectedModule').val(JSON.stringify(moduleJson))
197
+
198
+ /*var fieldValue = [];
199
+ $.each(moduledetails.fields, function(fieldtype,modData){
200
+ var fieldIdentifier = modData.name+'-'+containerdetails[0]+'-'+containerdetails[1];
201
+ fieldValue[modData.name] = $('#'+fieldIdentifier).val();
202
+ });*/
203
+
204
+ //Store it new values in json for DB
205
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
206
+ $.each(ploatedStructure.rows,function(k,row){
207
+ if(row.id==containerdetails[0]){
208
+ if(row.cell_data.length>0){
209
+ $.each(row.cell_data,function(k,cells){
210
+ if(cells.cell_id==containerdetails[1]){
211
+
212
+ $.each(moduledetails.fields, function(fieldtype,modData){
213
+ var fieldIdentifier = modData.name+'-'+containerdetails[0]+'-'+containerdetails[1];
214
+ cells[modData.name] = $('#'+fieldIdentifier).val();
215
+ });
216
+
217
+ }
218
+ })
219
+ }
220
+ }
221
+ });
222
+ storeJsonDataInput(ploatedStructure);
223
+ tb_remove();
224
+ });
225
+
226
+
227
+
228
+ //Thickbox on open
229
+ $(document.body).on('click', ".boxContainer", function(e){
230
+ e.preventDefault();
231
+ $(".amp-pb-module-content").html("");
232
+ var conatinerId = $(this).parents(".amppb-row").attr("id").replace('conatiner-','');
233
+ var moduleId = $(this).parents(".amppb-module").attr("id").replace('module-','');
234
+
235
+ var popupContents = $(this).parents(".amppb-module").find("#selectedModule").val();
236
+
237
+ $('#ampb-parents-dialog').attr('data-container', conatinerId+'--' +moduleId);
238
+ $('#ampb-parents-dialog').attr('data-modules', popupContents);
239
+
240
+ popupContents = JSON.parse(popupContents);
241
+ var popupHtml = '';
242
+ var upload = false; var editor = [];
243
+
244
+ $.each(popupContents.fields, function(fieldsName,fieldReplace){
245
+ var id = fieldReplace.name+"-"+conatinerId+'-' +moduleId;
246
+ var htmlFields = $('.amppb-fields-templates').find("#"+fieldReplace.type).html();
247
+
248
+ popupHtml += htmlFields.replace(/{name}/g,fieldReplace.name).replace(/{label}/g,fieldReplace.label).replace(/{id}/g,id).replace(/{default_value}/g, decodeURI(fieldReplace.default));
249
+ //To load action of fields
250
+ switch(fieldReplace.type){
251
+ case 'upload':
252
+ upload = true;
253
+ break;
254
+ case 'text-editor':
255
+ editor.push(id);
256
+ //loadEditor(id);
257
+
258
+ break;
259
+
260
+ }
261
+ });
262
+ //if(upload){ selectionOfImage(); }
263
+ $(".amp-pb-module-content").html(popupHtml);
264
+ if(editor.length){
265
+ $.each(editor, function(key, value){
266
+ if(tinymce.get('pre-details')){
267
+ tinymce.get('pre-details').remove();
268
+ }
269
+ tinymce.init( {
270
+ mode : "exact",
271
+ elements : value, //'pre-details',
272
+ theme: "modern",
273
+ skin: "lightgray",
274
+ menubar : false,
275
+ statusbar : false,
276
+ toolbar: [
277
+ "bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | undo redo"
278
+ ],
279
+ plugins : "paste",
280
+ paste_auto_cleanup_on_paste : true,
281
+ paste_postprocess : function( pl, o ) {
282
+ o.node.innerHTML = o.node.innerHTML.replace( /&nbsp;+/ig, " " );
283
+ }
284
+ } );
285
+
286
+ })
287
+
288
+ }
289
+ });
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+ var moduleLoad = function(){
337
+ $('.amppb-row-fields .col:not(:last-child)').resizable({
338
+ resizeHeight: false,
339
+ handles : 'e',
340
+ start : function(){
341
+ tot_width = jQuery(this).width() + jQuery(this).next().width();
342
+ jQuery(this).resizable('option', 'maxWidth', ((tot_width /(100-30))*100));
343
+ },
344
+ resize : function(){
345
+ jQuery(this).next().width(tot_width - jQuery(this).width());
346
+ }
347
+ });
348
+
349
+ //Module Droppable Container
350
+ $( ".modules-drop" ).droppable({
351
+ accept:'.amppb-module-actions > span,.amppb-module',
352
+ revert:true,
353
+ hoverClass: "hover",
354
+ tolerance: "touch",
355
+ classes: {
356
+ "ui-droppable-active": "ui-state-active",
357
+ "ui-droppable-hover": "ui-state-hover"
358
+ },
359
+ drop: function( event, ui ) {
360
+ ui.draggable.attr('style','').context;
361
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
362
+ var containerId = $(this).parents('.amppb-row').attr('id').replace('conatiner-','');
363
+ var cellContainerNo = $(this).parents('div.col').attr('data-cell');
364
+
365
+ //when exchange the modules
366
+ if(ui.draggable.hasClass('module-draggable')){
367
+
368
+ $( this ).append(ui.draggable.context);
369
+
370
+ var moduleId = ui.draggable.attr('id').replace("module-","");
371
+ var previousValue = {};
372
+ $.each(ploatedStructure.rows,function(k,rowVal){
373
+ if(rowVal.cell_data.length>0){
374
+ $.each(rowVal.cell_data,function(key,columnVal){
375
+ if(moduleId==columnVal.cell_id){
376
+ previousValue = ploatedStructure.rows[k].cell_data[key];
377
+ ploatedStructure.rows[k].cell_data.splice(key, 1);
378
+ return false;
379
+ }
380
+ });
381
+ console.log(previousValue);
382
+ }
383
+ });
384
+ $.each(ploatedStructure.rows,function(k,rowVal){
385
+ if(containerId==rowVal.id){
386
+ previousValue.container_id = containerId;
387
+ previousValue.cell_container = cellContainerNo;
388
+ ploatedStructure.rows[k].cell_data.push(previousValue);
389
+ }
390
+ });
391
+ storeJsonDataInput(ploatedStructure);
392
+
393
+ }else{ //when
394
+
395
+ $moduleId = parseInt($('#amppb-module-actions-container').attr('data-recentid'));
396
+ $('#amppb-module-actions-container').attr('data-recentid',$moduleId+1);
397
+
398
+ var currentDropZone = this;
399
+ var templateclass = ui.draggable.attr("data-template");
400
+ var template = '.amppb-module-templates > .amppb-module-' + templateclass;
401
+ $( template ).clone().attr('id','module-'+$moduleId).appendTo(this);
402
+
403
+ var moduleJson = JSON.parse($(this).find('div.amppb-module:last').find("#selectedModule").val());
404
+ //Store module inside the array
405
+ $.each(ploatedStructure.rows,function(k,columnVal){
406
+ console.log(columnVal.id+' '+containerId);
407
+ if(columnVal.id==containerId){
408
+
409
+ var moduleIndex = $(currentDropZone).find('div.amppb-module').length;
410
+ var cellData = {
411
+ 'cell_id' : $moduleId,
412
+ 'index' : moduleIndex,
413
+ 'type' : templateclass,
414
+ 'container_id': containerId,
415
+ 'cell_container': cellContainerNo,
416
+ };
417
+
418
+ if(moduleJson.fields.length > 0){
419
+ $.each(moduleJson.fields, function(key, moduleData){
420
+ cellData[moduleData.name] = moduleData.default;
421
+ });
422
+ }
423
+ ploatedStructure.rows[k].cell_data.push(cellData);
424
+
425
+
426
+ }
427
+ });
428
+ ploatedStructure['totalmodules'] = $moduleId+1;
429
+ storeJsonDataInput(ploatedStructure);
430
+ console.log(ploatedStructure);
431
+
432
+ }
433
+ loadAfterModule();
434
+ //Add new class if module present
435
+ $(this).addClass("has-module");
436
+ callToRemoveHasModule();
437
+ }
438
+ });//Module Dropable closed
439
+
440
+
441
+ }
442
+
443
+ var loadAfterModule = function(){
444
+
445
+ $( ".modules-drop" ).sortable({
446
+ placeholder: "ui-state-highlight-module",
447
+ cursor: "move",
448
+ //handle : '.move-modules',
449
+ connectWith: ".modules-drop",
450
+ stack: '.amppb-module',
451
+ forcePlaceholderSize: true,
452
+ activate: function(e, ui){
453
+ ui.helper.width(40);
454
+ ui.item.height(40);
455
+
456
+ },
457
+ over: function(e, ui){
458
+ ui.item.width(40);
459
+ ui.item.height(40);
460
+ },
461
+ // cursorAt : { left: 45,top:45 },
462
+ start: function(event, ui ){
463
+ //$(ui.item).addClass("module-dragging");
464
+ },
465
+ stop:function(){
466
+ callToRemoveHasModule();
467
+ },
468
+ beforeStop: function(){
469
+ //$(ui.item).removeClass("module-dragging");
470
+ },
471
+ receive: function(event, ui) {
472
+ //ui.item.appendTo(".module-draggable");
473
+ },
474
+ update : function(){
475
+ var ploatedStructure = JSON.parse($('#amp-page-builder-data').val());
476
+ var indexOfRow = $(this).parents('.amppb-row').attr('id').replace("conatiner-","");
477
+ $(this).find('div.amppb-module').each(function(indexKey,val){
478
+ console.log(indexKey);
479
+ var indexOfModule = $(this).attr('id').replace('module-','');
480
+ $.each(ploatedStructure.rows,function(k,columnVal){
481
+ if(columnVal.id==indexOfRow){
482
+ $.each(columnVal.cell_data,function(kModule,moduleVal){
483
+ if(moduleVal.cell_id==indexOfModule){
484
+ moduleVal.index = indexKey+1;
485
+ }
486
+ })
487
+ //columnVal.index = indexKey+1;
488
+ }
489
+ });
490
+ });
491
+ storeJsonDataInput(ploatedStructure)
492
+ }
493
+
494
+
495
+ });
496
+ }
497
+
498
+
499
+ //Restored Prebvious Data
500
+ if($('#amp-page-builder-data').length > 0){
501
+ var valTemplate = $('#amp-page-builder-data').val();
502
+ if(valTemplate!=''){
503
+
504
+ valTemplate = JSON.parse(valTemplate);
505
+ sampleData = valTemplate;
506
+ if(valTemplate.rows.length>0){
507
+ if($(".amppb-rows").find('.dummy').length>0){
508
+ $(".amppb-rows").find('.dummy').html("please wait...");
509
+ }
510
+ valTemplate.rows.sort(function(a, b){
511
+ var a1= a.index, b1= b.index;
512
+ if(a1== b1) return 0;
513
+ return a1> b1? 1: -1;
514
+ });
515
+
516
+ $.each(valTemplate.rows, function(val, rowData){
517
+ var templateclass = rowData.cells;
518
+ var containerid = rowData.id;
519
+ var containerIndex = rowData.index;
520
+ var template = '.amppb-templates > .amppb-col-' + templateclass;
521
+ var templateIndex = [];
522
+ $( template ).clone().attr('id','conatiner-'+containerid).appendTo('#sorted_rows');
523
+
524
+ rowData.cell_data.sort(function(a, b){
525
+ var a1= a.index, b1= b.index;
526
+ if(a1== b1) return 0;
527
+ return a1> b1? 1: -1;
528
+ });
529
+ if(rowData.cell_data.length>0){
530
+ $.each(rowData.cell_data, function(val, cellData){
531
+ var moduleclass = cellData.type;
532
+ var cellContainerId = cellData.cell_container;
533
+ var template = '.amppb-module-templates > .amppb-module-' + moduleclass;
534
+ //$( template ).clone().attr('id','module-'+$moduleId).appendTo(this);
535
+ if(template.length>0){
536
+ $templteValue = JSON.parse($( template ).find("#selectedModule").val());
537
+ $.each($templteValue.fields,function(key,value){
538
+ value.default = cellData[value.name]
539
+ });
540
+
541
+ $("#conatiner-"+containerid).find('div.col[data-cell='+cellContainerId+"]").find("div.modules-drop").append($( template ).clone().attr('id','module-'+cellData.cell_id) );
542
+
543
+ $("#conatiner-"+containerid).find('div.col[data-cell='+cellContainerId+"]").find("div.modules-drop").find(".amppb-module:last").find('#selectedModule').val( JSON.stringify($templteValue) );
544
+ //Add new class if module present
545
+ $("#conatiner-"+containerid).find('div.col[data-cell='+cellContainerId+"]").find("div.modules-drop").addClass("has-module");
546
+ }
547
+ loadAfterModule();
548
+ });
549
+ }
550
+
551
+
552
+ });
553
+ moduleLoad();
554
+ if($(".amppb-rows").find('.dummy').length>0){
555
+ $(".amppb-rows").find('.dummy').remove();
556
+ }
557
+ }
558
+
559
+ }//if Checkclosed
560
+ }//$('#amp-page-builder-data') length checked close
561
+
562
+
563
+ /***************
564
+ *
565
+ * Select Image
566
+ *
567
+ ***************/
568
+ $(document.body).on('click', "input.selectImage", function(e){
569
+ e.preventDefault();
570
+ console.log("selectImage click event called");
571
+ var currentSelectfield = $(this);
572
+ var image_frame;
573
+ if(image_frame){
574
+ image_frame.open();
575
+ }
576
+ // Define image_frame as wp.media object
577
+ image_frame = wp.media({
578
+ title: 'Select Media',
579
+ multiple : false,
580
+ library : {
581
+ type : 'image',
582
+ }
583
+ });
584
+
585
+ image_frame.on('close',function() {
586
+ // On close, get selections and save to the hidden input
587
+ // plus other AJAX stuff to refresh the image preview
588
+ var selection = image_frame.state().get('selection');
589
+ var gallery_ids = new Array();
590
+ var my_index = 0;
591
+ selection.each(function(attachment) {
592
+ gallery_ids[my_index] = attachment['id'];
593
+ my_index++;
594
+ });
595
+ var ids = gallery_ids.join(",");
596
+ currentSelectfield.parents('.form-control').find('input[type=hidden]').val(ids);
597
+ Refresh_Image(ids,currentSelectfield);
598
+ });
599
+ image_frame.on('open',function() {
600
+ // On open, get the id from the hidden input
601
+ // and select the appropiate images in the media manager
602
+ var selection = image_frame.state().get('selection');
603
+ ids = currentSelectfield.parents('.form-control').find('input[type=hidden]').val().split(',');
604
+ ids.forEach(function(id) {
605
+ attachment = wp.media.attachment(id);
606
+ attachment.fetch();
607
+ selection.add( attachment ? [ attachment ] : [] );
608
+ });
609
+
610
+ });
611
+ image_frame.open();
612
+ });
613
+
614
+
615
+ function loadEditor(id){
616
+ id = id;//.replace("-","_").replace("-","_");
617
+ console.log("loadEditor function called "+ id);
618
+
619
+
620
+
621
+ }
622
+
623
+ function callToRemoveHasModule(){
624
+ console.log("called Function");
625
+ $(".modules-drop").each(function(index, container){
626
+ if($(this).find('.amppb-module').length==0){
627
+ $(this).removeClass("has-module");
628
+ }
629
+ })
630
+ }
631
+
632
+
633
+ });
634
+
635
+ /**
636
+ *
637
+ *
638
+ * Functions
639
+ *
640
+ *
641
+ *
642
+ **/
643
+ // Ajax request to refresh the image preview
644
+ function Refresh_Image(the_id,currentSelectfield){
645
+ var data = {
646
+ action: 'myprefix_get_image',
647
+ id: the_id
648
+ };
649
+
650
+ jQuery.get(ajaxurl, data, function(response) {
651
+
652
+ if(response.success === true) {
653
+ console.log(response.data.image)
654
+ currentSelectfield.parents('.form-control').find('#myprefix-preview-image').replaceWith( response.data.image );
655
+ }
656
+ });
657
+ }
658
+
659
+
660
+ var sampleData = {
661
+ 'rows':[]
662
+ }
663
+
664
+ function storeJsonDataInput(sampleData){
665
+ jQuery('#amp-page-builder-data').val(JSON.stringify(sampleData));
666
+ }
667
+ jQuery(".customclass_for_addattr").attr('data-bvalidator','required');
668
+
pagebuilder/inc/js-templates.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /* Rows template (Going to be hidden) */ ?>
2
+ <div class="amppb-templates">
3
+ <?php /* == This is the 1 column row template == */ ?>
4
+ <div class="amppb-row amppb-col-1" id="conatiner-{id}">
5
+ <input type="hidden" name="column-data" value="">
6
+ <div class="amppb-row-title">
7
+ <span class="amppb-handle dashicons dashicons-move"></span>
8
+ <span class="amppb-row-title-text">1 Column</span>
9
+ <span data-confirm="Delete Row?" class="amppb-remove dashicons dashicons-trash"></span>
10
+ <a href="#TB_inline?width=100%&height=100%&inlineId=amppb-row-setting-dialog" class="thickbox rowBoxContainer" title="Row settings column 1">
11
+ <span class="tools-icon dashicons dashicons-menu"></span>
12
+ </a>
13
+ </div><!-- .amppb-row-title -->
14
+
15
+ <div class="amppb-row-fields col" data-cell="1">
16
+ <div class="modules-drop"></div>
17
+ </div><!-- .amppb-row-fields -->
18
+
19
+ </div><!-- .amppb-row.amppb-col-1 -->
20
+ <?php /* == This is the 2 columns row template == */ ?>
21
+ <div class="amppb-row amppb-col-2">
22
+ <input type="hidden" name="column-data" value="">
23
+ <div class="amppb-row-title">
24
+ <span class="amppb-handle dashicons dashicons-move"></span>
25
+ <span class="amppb-row-title-text">2 Columns</span>
26
+ <span data-confirm="Delete Row?" class="amppb-remove amppb-item-remove dashicons dashicons-trash"></span>
27
+ <a href="#TB_inline?width=100%&height=100%&inlineId=amppb-row-setting-dialog" class="thickbox rowBoxContainer" title="Row settings column 2">
28
+ <span class="tools-icon dashicons dashicons-menu"></span>
29
+ </a>
30
+ </div><!-- .amppb-row-title -->
31
+
32
+ <div class="amppb-row-fields ">
33
+ <div class="amppb-column-2-left col" data-cell="1">
34
+ <div class="modules-drop"></div>
35
+ </div><!-- .amppb-col-2-left -->
36
+ <div class="amppb-column-2-right col" data-cell="2">
37
+ <div class="resize-handle"></div>
38
+ <div class="modules-drop"></div>
39
+ </div><!-- .amppb-col-2-right -->
40
+ </div><!-- .amppb-row-fields -->
41
+ </div><!-- .amppb-row.amppb-col-2 -->
42
+
43
+ </div><!-- .amppb-templates -->
44
+
45
+ <?php
46
+ /*
47
+ *
48
+ *
49
+ * Module Template
50
+ *
51
+ *
52
+ *
53
+ *
54
+ */
55
+
56
+
57
+
58
+ global $moduleTemplate;
59
+ wp_enqueue_script( 'tinymce_js', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array( 'jquery' ), false, true );
60
+ ?>
61
+ <div class="amppb-module-templates hidden">
62
+ <?php
63
+ foreach ($moduleTemplate as $key => $module) {
64
+ echo '
65
+ <div class="amppb-module module-draggable amppb-module-'.strtolower($module['name']).'" data-tooltip="'.$module['name'].' Module">
66
+ <span class="module_label">'.$module['label'].'</span>
67
+ <input type="hidden" id="selectedModule" value=\''.json_encode($module).'\'>
68
+ <span class="amppb-setting-right">
69
+ <a href="#TB_inline?width=100%&height=100%&inlineId=my-amppb-dialog" class="thickbox boxContainer" title="'.$module['label'].'"><span class="dashicons dashicons-admin-generic"></span>
70
+ </a>
71
+ </span>
72
+ </div>
73
+ ';
74
+ }
75
+ ?>
76
+ </div>
77
+ <div class="amppb-fields-templates hidden">
78
+ <div id="textarea">
79
+ <p class="form-control">
80
+ <label for="{id}">{label}</label>
81
+ <textarea class="full textarea" id="{id}" name="{name}">{default_value}</textarea>
82
+ </p>
83
+ </div>
84
+ <div id="text-editor">
85
+ <p class="form-control">
86
+ <label for="{id}">{label}</label>
87
+ <textarea class="full text-editor tinymce-enabled" id="{id}" name="{id}">{default_value}</textarea>
88
+
89
+ </p>
90
+ </div>
91
+ <div id="text">
92
+ <p class="form-control">
93
+ <label for="{id}">{label}</label>
94
+ <input type="text" class="full text" id="{id}" name="{name}" value="{default_value}">
95
+ </p>
96
+ </div>
97
+ <div id="upload">
98
+ <p class="form-control">
99
+ <label for="{id}">{label}</label>
100
+ <input type="button" class="button selectImage" value="Select image" id="">
101
+ <img id="myprefix-preview-image" src="http://via.placeholder.com/350x150" />
102
+ <input type="hidden" name="myprefix_image_id" id="{id}" value="" class="regular-text" />
103
+ </p>
104
+ </div>
105
+ <div id="select">
106
+ <p class="form-control">
107
+ <label for="{id}">{label}</label>
108
+ <select type="text" class="full text" id="{id}" name="{name}">
109
+ {options}
110
+ </select>
111
+ </p>
112
+ </div>
113
+ </div>
pagebuilder/modules/blurb.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $output .= '<div class="amp_pb_module amp_blurb {{css_class}}"><img src="{{blurb_image}}" width="{{img_width}}" height="{{img_height}}" />
3
+ <h4>{{text_title}}</h4>
4
+ <p>{{text_description}}</p>
5
+ </div>';
6
+
7
+ return array(
8
+ 'label' =>'Blurb',
9
+ 'name' =>'blurb',
10
+ 'fields'=> array(
11
+ array(
12
+ 'type' =>'text',
13
+ 'name' =>"text_title",
14
+ 'label' =>"Title",
15
+ 'default' =>'Heart Of The Landing Page',
16
+ ),
17
+ array(
18
+ 'type' =>'textarea',
19
+ 'name' =>"text_description",
20
+ 'label' =>"Description",
21
+ 'default' =>'This is a sample text which is being used for the dummy purpose to avoid confusion.',
22
+ ),
23
+ array(
24
+ 'type' =>'upload',
25
+ 'name' =>"blurb_image",
26
+ 'label' =>"Image",
27
+ 'default' =>'http://i.imgur.com/5nPXqZG.png',
28
+ ),
29
+ array(
30
+ 'type' =>'text',
31
+ 'name' =>"img_width",
32
+ 'label' =>"Image Width",
33
+ 'default' =>'80px'
34
+ ),
35
+ array(
36
+ 'type' =>'text',
37
+ 'name' =>"img_height",
38
+ 'label' =>"Image Height",
39
+ 'default' =>'80px'
40
+ ),
41
+ array(
42
+ 'type' => 'text',
43
+ 'name' => 'css_class',
44
+ 'label' => 'Custom CSS Class',
45
+ 'default' => ''
46
+ )
47
+ ),
48
+ 'front_template'=> $output
49
+ );
50
+ ?>
pagebuilder/modules/button.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $output = '<div class="amp_pb_module amp_btn {{css_class}}">
2
+ <a href="{{button_link}}">{{button_txt}}</a></div>';
3
+ return array(
4
+ 'label' =>'Button',
5
+ 'name' =>'button',
6
+ 'fields'=> array(
7
+ array(
8
+ 'type' => 'text',
9
+ 'name' => 'button_txt',
10
+ 'label' => 'Button Text',
11
+ 'default' => 'Click Here'
12
+ ),
13
+ array(
14
+ 'type' => 'text',
15
+ 'name' => 'button_link',
16
+ 'label' => 'Button Link',
17
+ 'default' => '#'
18
+ ),
19
+ array(
20
+ 'type' => 'text',
21
+ 'name' => 'css_class',
22
+ 'label' => 'Custom CSS Class',
23
+ 'default' => ''
24
+ )
25
+
26
+ ),
27
+ 'front_template'=>$output
28
+ );
29
+ ?>
pagebuilder/modules/image.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $output = '<img src="{{selected_image}}" class="{{css_class}}" width="150" height="150">';
3
+ return array(
4
+ 'label' =>'Image',
5
+ 'name' => 'image',
6
+ 'fields' => array(
7
+ array(
8
+ 'type' =>'upload',
9
+ 'name' => "selected_image",
10
+ 'label' => "Select Image",
11
+ 'default' =>'http://via.placeholder.com/150x150'
12
+ ),
13
+ array(
14
+ 'type' =>'text',
15
+ 'name'=>"css_class",
16
+ 'label'=>"Custom CSS Class",
17
+ 'default'=>''
18
+ )
19
+ ),
20
+ 'front_template'=> $output
21
+ );
pagebuilder/modules/text.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $output = '<div class="amp_pb_module amp_text {{css_class}}">
2
+ <p>{{text_editor}}</p></div>';
3
+ return array(
4
+ 'label' =>'Text',
5
+ 'name' =>'text',
6
+ 'fields'=> array(
7
+ array(
8
+ 'type' =>'textarea',
9
+ 'name' =>"text_editor",
10
+ 'label' =>'Content',
11
+ 'default' =>'Content Goes Here',
12
+ ),
13
+
14
+ array(
15
+ 'type' =>'text',
16
+ 'name' =>"css_class",
17
+ 'label' =>'Custom CSS Class',
18
+ 'default' =>'Content Goes Here',
19
+ )
20
+ ),
21
+ 'front_template'=>$output
22
+ );
23
+ ?>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
- Tested up to: 4.8.1
7
- Stable tag: 0.9.61
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -15,7 +15,9 @@ AMP for WP automatically adds Accelerated Mobile Pages (Google AMP Project) func
15
 
16
  [What's New in this Version?](http://ampforwp.com/new/) | [Priority Support](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) | [View Demo](https://demo.ampforwp.com/amp/) | [Screenshots](https://wordpress.org/plugins/accelerated-mobile-pages/screenshots/) | [Community](http://ampforwp.com/community/)
17
 
18
- [youtube https://www.youtube.com/watch?v=jglJGmlZyos]
 
 
19
 
20
  <strong>Extensions</strong><br>
21
  Some useful extensions to extend AMP features, check [AMP Adsense Support](https://ampforwp.com/advanced-amp-ads/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Contact Form 7 Support](https://ampforwp.com/contact-form-7/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Email Opt-in Support](https://ampforwp.com/opt-in-forms/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) and [Call To Action Support](https://ampforwp.com/call-to-action/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin). To view more, go to our [Extensions page](https://ampforwp.com/extensions/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin).
@@ -29,12 +31,12 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
29
 
30
  = Features: =
31
 
 
32
  * NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
33
  * NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
34
  * NEW - AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
35
  * NEW - Page Break / NextPage (Pagination) Support
36
- * NEW - Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
37
- * NEW - Page Builder for AMP! [Watch the Demo](http://ampforwp.com/demo/#pagebuilder) | [How to](https://ampforwp.com/tutorials/page-builder/)
38
  * Facebook Comments Support
39
  * Github Gist Support
40
  * Email Opt-in Subscription form support in AMP added
@@ -118,7 +120,7 @@ You can contact me using this url: http://ampforwp.com/contact/
118
  == Installation ==
119
  **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
120
 
121
- [youtube https://www.youtube.com/watch?v=zzRy6Q_VGGc]
122
 
123
  **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
124
 
@@ -143,6 +145,14 @@ You can contact me using this url: http://ampforwp.com/contact/
143
 
144
  == Changelog ==
145
 
 
 
 
 
 
 
 
 
146
  = 0.9.61 (10th September 2017) =
147
  * View more details on https://ampforwp.com/options-restructured/
148
  * Options Panel Restructured – Options were dividing into two parts: Settings and Appearance.
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
+ Tested up to: 4.8.2
7
+ Stable tag: 0.9.62
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
15
 
16
  [What's New in this Version?](http://ampforwp.com/new/) | [Priority Support](https://ampforwp.com/priority-support/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) | [View Demo](https://demo.ampforwp.com/amp/) | [Screenshots](https://wordpress.org/plugins/accelerated-mobile-pages/screenshots/) | [Community](http://ampforwp.com/community/)
17
 
18
+ [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
19
+
20
+ [youtube https://www.youtube.com/watch?v=vAGPFKKm5G4]
21
 
22
  <strong>Extensions</strong><br>
23
  Some useful extensions to extend AMP features, check [AMP Adsense Support](https://ampforwp.com/advanced-amp-ads/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Contact Form 7 Support](https://ampforwp.com/contact-form-7/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin), [Email Opt-in Support](https://ampforwp.com/opt-in-forms/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin) and [Call To Action Support](https://ampforwp.com/call-to-action/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin). To view more, go to our [Extensions page](https://ampforwp.com/extensions/#utm_source=wp_org&utm_medium=description-tab-pro-box&utm_campaign=AMP%20Plugin).
31
 
32
  = Features: =
33
 
34
+ * NEW - Page Builder 2.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
35
  * NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
36
  * NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
37
  * NEW - AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
38
  * NEW - Page Break / NextPage (Pagination) Support
39
+ * Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
 
40
  * Facebook Comments Support
41
  * Github Gist Support
42
  * Email Opt-in Subscription form support in AMP added
120
  == Installation ==
121
  **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
122
 
123
+ [youtube https://www.youtube.com/watch?v=Em1nsE_KaKw]
124
 
125
  **[Visit Help area for the Documentation:](http://ampforwp.com/help/)**
126
 
145
 
146
  == Changelog ==
147
 
148
+ = 0.9.62 (25th September 2017) =
149
+ * View more details on https://ampforwp.com/new/
150
+ * INTRODUCING Page Builder 2.0 for AMP! [Learn More & Watch the Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
151
+ * Documentation & Help links improved
152
+ * Post type specific classes for targetting
153
+ * Design name restored in Options panel (It was recently renamed to Appearance)
154
+ * Minor Bug fixes as well
155
+
156
  = 0.9.61 (10th September 2017) =
157
  * View more details on https://ampforwp.com/options-restructured/
158
  * Options Panel Restructured – Options were dividing into two parts: Settings and Appearance.
templates/design-manager/design-2/archive.php CHANGED
@@ -34,7 +34,16 @@
34
  <?php do_action( 'amp_post_template_css', $this ); ?>
35
  </style>
36
  </head>
37
- <body class="amp_home_body design_2_wrapper">
 
 
 
 
 
 
 
 
 
38
  <?php do_action('ampforwp_body_beginning', $this); ?>
39
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
40
 
34
  <?php do_action( 'amp_post_template_css', $this ); ?>
35
  </style>
36
  </head>
37
+ <body class="amp_home_body design_2_wrapper <?php
38
+ if ( is_post_type_archive() ) {
39
+ $post_type = get_queried_object(); echo'type-'; echo $post_type->rewrite['slug']; }
40
+ ?><?php
41
+ // Show ID on Pages, Post, Post Type's Post
42
+ if ( is_singular() ) { ?>singular-<?php $page_id = get_queried_object_id(); echo $page_id;
43
+ ?><?php } ?> <?php
44
+ // Show ID on category, tag, Author Page, Etc.
45
+ if ( is_archive() ) { ?>archive-<?php $page_id = get_queried_object_id(); echo $page_id;
46
+ ?><?php } ?>">
47
  <?php do_action('ampforwp_body_beginning', $this); ?>
48
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
49
 
templates/design-manager/design-3/archive.php CHANGED
@@ -33,7 +33,16 @@
33
  <?php do_action( 'amp_post_template_css', $this ); ?>
34
  </style>
35
  </head>
36
- <body class="amp_home_body archives_body design_3_wrapper">
 
 
 
 
 
 
 
 
 
37
  <?php do_action('ampforwp_body_beginning', $this); ?>
38
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
39
 
33
  <?php do_action( 'amp_post_template_css', $this ); ?>
34
  </style>
35
  </head>
36
+ <body class="amp_home_body archives_body design_3_wrapper <?php
37
+ if ( is_post_type_archive() ) {
38
+ $post_type = get_queried_object(); echo'type-'; echo $post_type->rewrite['slug']; }
39
+ ?> <?php
40
+ // Show ID on Pages, Post, Post Type's Post
41
+ if ( is_singular() ) { ?>singular-<?php $page_id = get_queried_object_id(); echo $page_id;
42
+ ?><?php } ?> <?php
43
+ // Show ID on category, tag, Author Page, Etc.
44
+ if ( is_archive() ) { ?>archive-<?php $page_id = get_queried_object_id(); echo $page_id;
45
+ ?><?php } ?>">
46
  <?php do_action('ampforwp_body_beginning', $this); ?>
47
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
48
 
templates/features.php CHANGED
@@ -2176,10 +2176,10 @@ function ampforwp_add_widget_support() {
2176
  ));
2177
 
2178
  if ( isset($redux_builder_amp['ampforwp-content-builder']) && $redux_builder_amp['ampforwp-content-builder'] ) {
2179
- $desc = "Drag and Drop the AMP Modules in this Widget Area and then assign this widget area to a page <a href=http://ampforwp.com/tutorials/page-builder>(Need Help?)</a>";
2180
  $placeholder = 'PLACEHOLDER';
2181
  register_sidebar(array(
2182
- 'name' => 'Page Builder (AMP)',
2183
  'id' => 'layout-builder',
2184
  'description' => $placeholder,
2185
  'before_widget' => '',
2176
  ));
2177
 
2178
  if ( isset($redux_builder_amp['ampforwp-content-builder']) && $redux_builder_amp['ampforwp-content-builder'] ) {
2179
+ $desc = "<b>Update: <a target='_blank' href='https://ampforwp.com/tutorials/article/amp-page-builder-installation/'>Introducing PageBuilder 2.0</a></b><br />Drag and Drop the AMP Modules in this Widget Area and then assign this widget area to a page <a href=http://ampforwp.com/tutorials/page-builder>(Need Help?)</a>";
2180
  $placeholder = 'PLACEHOLDER';
2181
  register_sidebar(array(
2182
+ 'name' => 'Page Builder (AMP) [Legacy]',
2183
  'id' => 'layout-builder',
2184
  'description' => $placeholder,
2185
  'before_widget' => '',