Skip to content
Permalink
Browse files

frontend builder support

  • Loading branch information...
ketanshah79 committed Jul 26, 2018
1 parent 11c166f commit c0c6bd9f1a30b8abd56ee92f13b729acb44106af
@@ -1 +1,2 @@
sftp-config.json
node_modules/
@@ -0,0 +1,6 @@
{
"builder.css": "/styles/style.min.css",
"builder.js": "/scripts/builder-bundle.min.js",
"frontend.css": "/styles/style.min.css",
"frontend.js": "/scripts/frontend-bundle.min.js"
}
@@ -21,7 +21,8 @@
},
"autoload" : {
"psr-4" : {
"DF\\Opentable\\" : "src/"
"DF\\Opentable\\" : "src/",
"Opentable_Divi_Modules\\" : "includes/modules/"
}
}
}

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,10 @@
// External Dependencies
import $ from "jquery";

// Internal Dependencies
import modules from "./modules";

$(window).on("et_builder_api_ready", (event, API) => {
API.registerModules(modules);
});

@@ -0,0 +1,51 @@
<?php
namespace Opentable_Divi_Modules;
use DiviExtension;
class OpenTableWidgetExtension extends DiviExtension {
protected $container;
/**
* The gettext domain for the extension's translations.
*
* @since 1.0.0
*
* @var string
*/
public $gettext_domain ;
/**
* The extension's WP Plugin name.
*
* @since 1.0.0
*
* @var string
*/
public $name = 'et_pb_df_opentable_widget';
/**
* The extension's version
*
* @since 1.0.0
*
* @var string
*/
public $version ;
/**
* Constructor.
*
* @param string $name
* @param array $args
*/
public function __construct( $container ) {
$this->gettext = $container['plugin_slug'];
$this->version = $container['plugin_version'];
$this->plugin_dir = $container['plugin_dir'] . '/';
$this->plugin_dir_url = $container['plugin_url'] . '/';
$this->container = $container;
parent::__construct( $this->name, [] );
}
}
@@ -0,0 +1,19 @@
// External Dependencies
import React, { Component } from 'react';
import './style.css';

class OpentableWidgetModule extends Component {

static slug = 'et_pb_df_opentable_widget';

render() {
return (
<div>
<h2>Opentable widget Placeholder</h2>
<p>We cannot show the live preview since divi frontend builder does not support the complexities of this module.</p>
</div>
);
}
}

export default OpentableWidgetModule;
@@ -1,5 +1,5 @@
<?php
namespace DF\Opentable;
namespace Opentable_Divi_Modules\OpentableWidgetModule;
use ET_Builder_Element;
use ET_Builder_Module;
@@ -13,6 +13,14 @@ class OpentableWidgetModule extends ET_Builder_Module
public $slug = 'df_opentable_widget';
public $fields;
protected $container;
public $vb_support = 'on';
protected $module_credits = array(
'module_uri' => 'https://www.diviframework.com',
'author' => 'Divi Framework',
'author_uri' => 'https://www.diviframework.com',
);
public function __construct($container)
{
@@ -190,60 +198,60 @@ protected function wp_add_inline_style()
// iframe-off + wide
$style = '.df-opentable.type-wide.iframe-off input[type="submit"] {
width:25% !important ;
width:25% !important ;
}';
$style .= '.df-opentable.type-wide.iframe-off .ot-time-picker.ot-dtp-picker-selector {
width:25% !important ;
width:25% !important ;
}';
$style .= '.df-opentable.type-wide.iframe-off .ot-date-picker.ot-dtp-picker-selector.wide {
width:25% !important ;
width:25% !important ;
}';
$style .= '.df-opentable.type-wide.iframe-off .ot-party-size-picker {
width:25% !important ;
width:25% !important ;
}';
$style .= '.df-opentable.type-wide.iframe-off table.picker__table {
text-align:center;
text-align:center;
}';
$style .= '.df-opentable.type-wide.iframe-off table.picker__table td[role="presentation"] {
border-top:none !important;
border-top:none !important;
}';
// iframe-off tally
$style .= '.df-opentable.type-tall.iframe-off .ot-dtp-picker.tall .picker__holder {
width:100% !important;
width:100% !important;
}';
$style .= '.df-opentable.type-tall.iframe-off table.picker__table td[role="presentation"] {
border-top:none !important;
border-top:none !important;
}';
$style .= '.df-opentable.type-tall.iframe-off table.picker__table {
text-align:center;
text-align:center;
}';
$style .= '.df-opentable.type-tall.iframe-off .picker__nav--next{
right:20px;
right:20px;
}';
//iframe off , standard
$style .= '.df-opentable.type-standard.iframe-off table.picker__table td[role="presentation"] {
border-top:none !important;
border-top:none !important;
}';
$style .= '.df-opentable.type-standard.iframe-off table.picker__table {
text-align:center;
text-align:center;
}';
$style .= '.df-opentable.type-standard.iframe-off .picker__nav--next{
right:20px;
right:20px;
}';
No changes.
@@ -0,0 +1,4 @@
import OpentableWidgetModule from './OpentableWidgetModule/OpentableWidgetModule';

export default [OpentableWidgetModule];

0 comments on commit c0c6bd9

Please sign in to comment.
You can’t perform that action at this time.