Plugin Directory

Changeset 3484733


Ignore:
Timestamp:
03/17/2026 11:59:22 AM (3 weeks ago)
Author:
hotwptemplates
Message:

Contact block removed

Location:
hot-blocks
Files:
26 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • hot-blocks/trunk/build/index.build.js

    r2858274 r3484733  
    120120/***/ }),
    121121
    122 /***/ "./src/contact.js":
    123 /*!************************!*\
    124   !*** ./src/contact.js ***!
    125   \************************/
    126 /*! no static exports found */
    127 /***/ (function(module, exports) {
    128 
    129 eval("var __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar _wp$editor = wp.editor,\n    InspectorControls = _wp$editor.InspectorControls,\n    BlockControls = _wp$editor.BlockControls,\n    AlignmentToolbar = _wp$editor.AlignmentToolbar;\nvar _wp$components = wp.components,\n    PanelBody = _wp$components.PanelBody,\n    PanelRow = _wp$components.PanelRow,\n    TextControl = _wp$components.TextControl;\nvar Fragment = wp.element.Fragment;\nregisterBlockType('hotblocks/contact', {\n  title: \"Hot Contact\",\n  icon: 'email',\n  category: 'hot-blocks',\n  description: __('Simple contact form with anti-spam protection.'),\n  supports: {\n    align: true\n  },\n  attributes: {\n    antiSpamQuestion: {\n      type: 'string',\n      \"default\": '8 + 4 = ?'\n    },\n    antiSpamAnswer: {\n      type: 'string',\n      \"default\": '12'\n    },\n    buttonText: {\n      type: 'string',\n      \"default\": 'Send'\n    }\n  },\n  // props are passed to edit by default\n  // props contains things like setAttributes and attributes\n  edit: function edit(props) {\n    // we are peeling off the things we need\n    var setAttributes = props.setAttributes,\n        attributes = props.attributes,\n        className = props.className,\n        focus = props.focus;\n    var _props$attributes = props.attributes,\n        antiSpamQuestion = _props$attributes.antiSpamQuestion,\n        antiSpamAnswer = _props$attributes.antiSpamAnswer,\n        buttonText = _props$attributes.buttonText;\n\n    function onAntiSpamQuestionChange(changes) {\n      setAttributes({\n        antiSpamQuestion: changes\n      });\n    }\n\n    function onAntiSpamAnswerChange(changes) {\n      setAttributes({\n        antiSpamAnswer: changes\n      });\n    }\n\n    function onButtonTextChange(changes) {\n      setAttributes({\n        buttonText: changes\n      });\n    }\n\n    return [React.createElement(InspectorControls, null, React.createElement(\"div\", {\n      style: {\n        padding: \"4px 16px\"\n      }\n    }, React.createElement(TextControl, {\n      label: __('Question'),\n      value: attributes.antiSpamQuestion,\n      onChange: onAntiSpamQuestionChange\n    })), React.createElement(\"div\", {\n      style: {\n        padding: \"4px 16px\"\n      }\n    }, React.createElement(TextControl, {\n      label: __('Answer'),\n      value: attributes.antiSpamAnswer,\n      onChange: onAntiSpamAnswerChange\n    })), React.createElement(\"div\", {\n      style: {\n        padding: \"4px 16px\"\n      }\n    }, React.createElement(TextControl, {\n      label: __('Button Text'),\n      value: attributes.buttonText,\n      onChange: onButtonTextChange\n    }))), React.createElement(\"div\", {\n      className: className\n    }, React.createElement(\"form\", {\n      method: \"post\"\n    }, React.createElement(\"input\", {\n      type: \"text\",\n      name: \"hb_name\",\n      id: \"hb_name\",\n      size: \"15\",\n      value: \"\",\n      placeholder: __('Name *')\n    }), React.createElement(\"input\", {\n      type: \"email\",\n      name: \"hb_email\",\n      id: \"hb_email\",\n      size: \"15\",\n      value: \"\",\n      placeholder: __('E-mail *')\n    }), React.createElement(\"textarea\", {\n      name: \"hb_message\",\n      id: \"hb_message\",\n      placeholder: __('Message *'),\n      spellcheck: \"false\"\n    }), React.createElement(\"input\", {\n      type: \"text\",\n      name: \"hb_anti_spam_answer\",\n      id: \"hb_anti_spam_answer\",\n      size: \"15\",\n      value: \"\",\n      placeholder: 'Anti-spam: ' + attributes.antiSpamQuestion\n    }), React.createElement(\"input\", {\n      type: \"submit\",\n      name: \"hb_submit\",\n      id: \"hb_submit\",\n      value: attributes.buttonText\n    }), React.createElement(\"input\", {\n      type: \"hidden\",\n      value: attributes.antiSpamAnswer\n    })))];\n  },\n  // again, props are automatically passed to save and edit\n  save: function save(props) {\n    var attributes = props.attributes,\n        className = props.className;\n    var _props$attributes2 = props.attributes,\n        antiSpamQuestion = _props$attributes2.antiSpamQuestion,\n        antiSpamAnswer = _props$attributes2.antiSpamAnswer,\n        buttonText = _props$attributes2.buttonText;\n    return React.createElement(\"div\", {\n      className: className\n    }, React.createElement(\"form\", {\n      method: \"post\"\n    }, React.createElement(\"input\", {\n      type: \"text\",\n      required: true,\n      name: \"hb_name\",\n      id: \"hb_name\",\n      size: \"15\",\n      value: \"\",\n      placeholder: __('Name *')\n    }), React.createElement(\"input\", {\n      type: \"email\",\n      required: true,\n      name: \"hb_email\",\n      id: \"hb_email\",\n      size: \"15\",\n      value: \"\",\n      placeholder: __('E-mail *')\n    }), React.createElement(\"textarea\", {\n      required: true,\n      name: \"hb_message\",\n      id: \"hb_message\",\n      placeholder: __('Message *'),\n      spellcheck: \"false\"\n    }), React.createElement(\"input\", {\n      type: \"text\",\n      required: true,\n      name: \"hb_anti_spam_answer\",\n      id: \"hb_anti_spam_answer\",\n      size: \"15\",\n      value: \"\",\n      placeholder: 'Anti-spam: ' + attributes.antiSpamQuestion\n    }), React.createElement(\"input\", {\n      type: \"submit\",\n      name: \"hb_submit\",\n      id: \"hb_submit\",\n      value: attributes.buttonText\n    }), React.createElement(\"input\", {\n      type: \"hidden\",\n      name: \"hb_anti_spam_correct\",\n      value: attributes.antiSpamAnswer\n    })));\n  }\n});\n\n//# sourceURL=webpack:///./src/contact.js?");
    130 
    131 /***/ }),
    132 
    133122/***/ "./src/header.js":
    134123/*!***********************!*\
     
    150139
    151140"use strict";
    152 eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _accordion_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accordion.js */ \"./src/accordion.js\");\n/* harmony import */ var _accordion_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_accordion_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _background_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./background.js */ \"./src/background.js\");\n/* harmony import */ var _background_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_background_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _button_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button.js */ \"./src/button.js\");\n/* harmony import */ var _button_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_button_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _contact_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contact.js */ \"./src/contact.js\");\n/* harmony import */ var _contact_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_contact_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./header.js */ \"./src/header.js\");\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_header_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _maps_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maps.js */ \"./src/maps.js\");\n/* harmony import */ var _maps_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_maps_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _parallax_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parallax.js */ \"./src/parallax.js\");\n/* harmony import */ var _parallax_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_parallax_js__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./src/index.js?");
     141eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _accordion_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accordion.js */ \"./src/accordion.js\");\n/* harmony import */ var _accordion_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_accordion_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _background_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./background.js */ \"./src/background.js\");\n/* harmony import */ var _background_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_background_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _button_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button.js */ \"./src/button.js\");\n/* harmony import */ var _button_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_button_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./header.js */ \"./src/header.js\");\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_header_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _maps_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./maps.js */ \"./src/maps.js\");\n/* harmony import */ var _maps_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_maps_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _parallax_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parallax.js */ \"./src/parallax.js\");\n/* harmony import */ var _parallax_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_parallax_js__WEBPACK_IMPORTED_MODULE_5__);\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./src/index.js?");
    153142
    154143/***/ }),
  • hot-blocks/trunk/css/view.css

    r2895571 r3484733  
    321321    clear: none;
    322322}
    323 
    324 /*** Contact block ***/
    325 
    326 input#hb_name, input#hb_email, input#hb_anti_spam_answer {
    327     margin: 0 1% 30px;
    328     width: 98%;
    329 }
    330 
    331 input#hb_submit {
    332     float: right;
    333     margin: 0 1% 30px;
    334     cursor: pointer;
    335 }
    336 
    337 .hb_contact_error {
    338     background: red;
    339     color: #fff;
    340     text-align: center;
    341 }
    342 
    343 .hb_contact_success {
    344     background: green;
    345     color: #fff;
    346     text-align: center;
    347 }
    348 
    349 .wp-block-hotblocks-contact input,
    350 .wp-block-hotblocks-contact textarea {
    351     margin-bottom: 15px;
    352     box-sizing: border-box;
    353     padding: 10px;
    354     font-family: inherit;
    355     font-size: inherit;
    356     line-height: 1;
    357     border-radius: 0;
    358     border: 1px solid #333;
    359 }
    360 
    361 .wp-block-hotblocks-contact textarea {
    362     min-height: 100px;
    363     width: 98%;
    364     margin: 0 1% 30px;
    365 }
    366 
    367 @media (min-width: 768px) {
    368     input#hb_name, input#hb_email, input#hb_anti_spam_answer {
    369         width: 48%;
    370         display: block;
    371         float: left;
    372     }
    373 }
    374 
    375 input#hb_anti_spam_answer {
    376     border-top: 0;
    377     border-left: 0;
    378     border-right: 0;
    379 }
  • hot-blocks/trunk/hot_blocks.php

    r2895571 r3484733  
    44 * Plugin URI: https://www.hotjoomlatemplates.com/wordpress-plugins/hot-blocks
    55 * Description: Gutenberg blocks by Hot Themes.
    6  * Version: 1.3.3
     6 * Version: 1.3.4
    77 * Author: Hot Themes
    88 * Author URI: https://www.hotjoomlatemplates.com
     
    8484add_action( 'enqueue_block_assets', 'hot_blocks_assets');
    8585
    86 // contact form block sending mail
    87 function hot_contact_email() {
    88 if ( isset($_POST['hb_submit'] ) ) {
    89 
    90     if ( $_POST['hb_anti_spam_answer'] == $_POST['hb_anti_spam_correct'] ) {
    91 
    92         require_once("wp-load.php");
    93 
    94         $hb_to = get_bloginfo('admin_email');
    95         $hb_subject = __( 'Website inquiry', 'hot-blocks' );
    96         $hb_name = $_POST['hb_name'];
    97         $hb_email = $_POST['hb_email'];
    98         $hb_message = $_POST['hb_message'];
    99         $hb_headers = 'From: '.$hb_name.' <noreply@'.$_SERVER['SERVER_NAME'].'>' . "\r\n" . 'Reply-To: ' . $hb_email;
    100 
    101         if( wp_mail( $hb_to, $hb_subject, $hb_message, $hb_headers ) ) {
    102             echo '<div class="hb_contact_success">'. __( 'E-mail sent successfully!', 'hot-blocks' ) . '</div>';
    103         } else {
    104             echo '<div class="hb_contact_error">'. __( 'E-mail sending failed!', 'hot-blocks' ) . '</div>';
    105         }
    106 
    107     } else {
    108         echo '<div class="hb_contact_error">'. __( 'Wrong anti-spam answer!', 'hot-blocks' ) . '</div>';
    109     }
    110 
    111 }
    112 }
    113 add_action( 'wp_loaded', 'hot_contact_email' );
  • hot-blocks/trunk/readme.txt

    r3409473 r3484733  
    55Requires at least: 5.0
    66Tested up to: 6.9
    7 Stable tag: 1.3.3
     7Stable tag: 1.3.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • hot-blocks/trunk/src/index.js

    r2858274 r3484733  
    22import "./background.js";
    33import "./button.js";
    4 import "./contact.js";
    54import "./header.js";
    65import "./maps.js";
Note: See TracChangeset for help on using the changeset viewer.