Changeset 1538409
- Timestamp:
- 11/22/2016 02:06:26 PM (9 years ago)
- Location:
- wp-libre-form
- Files:
-
- 16 edited
- 1 copied
-
tags/1.2 (copied) (copied from wp-libre-form/trunk)
-
tags/1.2/assets/scripts/wplf-form.js (modified) (2 diffs)
-
tags/1.2/classes/class-cpt-wplf-form.php (modified) (1 diff)
-
tags/1.2/inc/wplf-form-actions.php (modified) (1 diff)
-
tags/1.2/readme.md (modified) (1 diff)
-
tags/1.2/readme.txt (modified) (1 diff)
-
tags/1.2/vendor/autoload.php (modified) (1 diff)
-
tags/1.2/vendor/composer/ClassLoader.php (modified) (4 diffs)
-
tags/1.2/wp-libre-form.php (modified) (3 diffs)
-
trunk/assets/scripts/wplf-form.js (modified) (2 diffs)
-
trunk/classes/class-cpt-wplf-form.php (modified) (1 diff)
-
trunk/inc/wplf-form-actions.php (modified) (1 diff)
-
trunk/readme.md (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (4 diffs)
-
trunk/wp-libre-form.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-libre-form/tags/1.2/assets/scripts/wplf-form.js
r1522309 r1538409 14 14 window.wplf = { 15 15 successCallbacks: [], 16 errorCallbacks: [] 17 }; 16 errorCallbacks: [], 17 attach: function(form){ 18 // form is a selector 19 if (typeof form == 'string') 20 form = document.querySelectorAll(form); 18 21 19 document.addEventListener("DOMContentLoaded", function(){ 20 [].forEach.call(document.querySelectorAll(".libre-form"), function(form){ 22 // form is an array of elements or a node list 23 if (form.constructor === Array || form.constructor === NodeList){ 24 [].forEach.call(form, function(form){ 25 window.wplf.attach(form); 26 }); 27 return; 28 } 21 29 22 30 form.addEventListener("submit", function(e){ … … 92 100 }); 93 101 94 }); 102 } 103 } 104 105 document.addEventListener("DOMContentLoaded", function(){ 106 [].forEach.call(document.querySelectorAll(".libre-form"), wplf.attach); 95 107 }); 96 108 })(); -
wp-libre-form/tags/1.2/classes/class-cpt-wplf-form.php
r1522426 r1538409 162 162 ?> 163 163 <label for="name"><?php _e( 'Please enter your name', 'wp-libre-form' ); ?></label> 164 <input type="text" name="name" placeholder="<?php _ex( 'John Doe', 'Default placeholder name', 'wp-libre-form' ); ?>">164 <input type="text" name="name" id="name" placeholder="<?php _ex( 'John Doe', 'Default placeholder name', 'wp-libre-form' ); ?>"> 165 165 166 166 <label for="email"><?php _e( 'Please enter your email address', 'wp-libre-form' ); ?> <?php _e( '(required)', 'wp-libre-form' ); ?></label> 167 <input type="email" name="email" placeholder="<?php _ex( 'example@email.com', 'Default placeholder email', 'wp-libre-form' ); ?>" required>167 <input type="email" name="email" id="email" placeholder="<?php _ex( 'example@email.com', 'Default placeholder email', 'wp-libre-form' ); ?>" required> 168 168 169 169 <label for="message"><?php _e( 'Write your message below', 'wp-libre-form' ); ?> <?php _e( '(required)', 'wp-libre-form' ); ?></label> 170 <textarea name="message" rows="5" placeholder="<?php _ex( 'I wanted to ask about...', 'Default placeholder message', 'wp-libre-form' ); ?>" required></textarea>170 <textarea name="message" rows="5" id="message" placeholder="<?php _ex( 'I wanted to ask about...', 'Default placeholder message', 'wp-libre-form' ); ?>" required></textarea> 171 171 172 172 <button type="submit"><?php _e( 'Submit', 'wp-libre-form' ); ?></button> -
wp-libre-form/tags/1.2/inc/wplf-form-actions.php
r1522309 r1538409 26 26 continue; 27 27 } 28 if( is_array( $value ) ) { // in case input type="radio" submits an array 29 $value = implode( ', ', $value ); 30 } 28 31 $content .= esc_html( $key ) . ': ' . esc_html( print_r( $value, true ) ) . "\n"; 29 32 } -
wp-libre-form/tags/1.2/readme.md
r1522426 r1538409 186 186 } 187 187 ``` 188 189 ### Multilingual 190 191 You can create multilingual forms using Polylang. WPLF will register and automatically fetch the translation when you use special template tags. 192 193 Example: 194 ```html 195 <input type="text" placeholder="{{ Test string }}" name="test"> 196 ``` 197 198 You can also disable this feature, and create your own middleware for WPML, if you'd like. 199 200 ```php 201 add_filter( 'wplf_load_polylang' , function() { 202 return false; 203 } ); 204 ``` -
wp-libre-form/tags/1.2/readme.txt
r1522463 r1538409 5 5 Requires at least: 4.2 6 6 Tested up to: 4.6.1 7 Stable tag: 1. 1.27 Stable tag: 1.2 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
wp-libre-form/tags/1.2/vendor/autoload.php
r1450039 r1538409 3 3 // autoload.php @generated by Composer 4 4 5 require_once __DIR__ . '/composer ' . '/autoload_real.php';5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 7 return ComposerAutoloaderInit07db012aabccf1e5cc16ff54e8f0754a::getLoader(); -
wp-libre-form/tags/1.2/vendor/composer/ClassLoader.php
r1450039 r1538409 54 54 private $useIncludePath = false; 55 55 private $classMap = array(); 56 57 56 private $classMapAuthoritative = false; 57 private $missingClasses = array(); 58 58 59 59 public function getPrefixes() … … 323 323 return $this->classMap[$class]; 324 324 } 325 if ($this->classMapAuthoritative ) {325 if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { 326 326 return false; 327 327 } … … 330 330 331 331 // Search for Hack files if we are running on HHVM 332 if ( $file === null&& defined('HHVM_VERSION')) {332 if (false === $file && defined('HHVM_VERSION')) { 333 333 $file = $this->findFileWithExtension($class, '.hh'); 334 334 } 335 335 336 if ( $file === null) {336 if (false === $file) { 337 337 // Remember that this class does not exist. 338 return $this->classMap[$class] = false;338 $this->missingClasses[$class] = true; 339 339 } 340 340 … … 400 400 return $file; 401 401 } 402 403 return false; 402 404 } 403 405 } -
wp-libre-form/tags/1.2/wp-libre-form.php
r1522463 r1538409 4 4 * Plugin URI: https://github.com/anttiviljami/wp-libre-form 5 5 * Description: A minimal HTML form builder for WordPress; made for developers 6 * Version: 1. 1.26 * Version: 1.2 7 7 * Author: @anttiviljami 8 8 * Author URI: https://github.com/anttiviljami/ … … 32 32 if ( ! class_exists( 'WP_Libre_Form' ) ) : 33 33 34 define( 'WPLF_VERSION', '1. 1.2' );34 define( 'WPLF_VERSION', '1.2' ); 35 35 36 36 class WP_Libre_Form { … … 56 56 CPT_WPLF_Form::init(); 57 57 CPT_WPLF_Submission::init(); 58 59 add_action( 'after_setup_theme', function() { 60 if ( apply_filters( 'wplf_load_polylang', true ) ) { 61 require_once 'classes/class-wplf-polylang.php'; 62 WPLF_Polylang::init(); 63 } 64 } ); 58 65 59 66 add_action( 'plugins_loaded', array( $this, 'load_our_textdomain' ) ); -
wp-libre-form/trunk/assets/scripts/wplf-form.js
r1522309 r1538409 14 14 window.wplf = { 15 15 successCallbacks: [], 16 errorCallbacks: [] 17 }; 16 errorCallbacks: [], 17 attach: function(form){ 18 // form is a selector 19 if (typeof form == 'string') 20 form = document.querySelectorAll(form); 18 21 19 document.addEventListener("DOMContentLoaded", function(){ 20 [].forEach.call(document.querySelectorAll(".libre-form"), function(form){ 22 // form is an array of elements or a node list 23 if (form.constructor === Array || form.constructor === NodeList){ 24 [].forEach.call(form, function(form){ 25 window.wplf.attach(form); 26 }); 27 return; 28 } 21 29 22 30 form.addEventListener("submit", function(e){ … … 92 100 }); 93 101 94 }); 102 } 103 } 104 105 document.addEventListener("DOMContentLoaded", function(){ 106 [].forEach.call(document.querySelectorAll(".libre-form"), wplf.attach); 95 107 }); 96 108 })(); -
wp-libre-form/trunk/classes/class-cpt-wplf-form.php
r1522426 r1538409 162 162 ?> 163 163 <label for="name"><?php _e( 'Please enter your name', 'wp-libre-form' ); ?></label> 164 <input type="text" name="name" placeholder="<?php _ex( 'John Doe', 'Default placeholder name', 'wp-libre-form' ); ?>">164 <input type="text" name="name" id="name" placeholder="<?php _ex( 'John Doe', 'Default placeholder name', 'wp-libre-form' ); ?>"> 165 165 166 166 <label for="email"><?php _e( 'Please enter your email address', 'wp-libre-form' ); ?> <?php _e( '(required)', 'wp-libre-form' ); ?></label> 167 <input type="email" name="email" placeholder="<?php _ex( 'example@email.com', 'Default placeholder email', 'wp-libre-form' ); ?>" required>167 <input type="email" name="email" id="email" placeholder="<?php _ex( 'example@email.com', 'Default placeholder email', 'wp-libre-form' ); ?>" required> 168 168 169 169 <label for="message"><?php _e( 'Write your message below', 'wp-libre-form' ); ?> <?php _e( '(required)', 'wp-libre-form' ); ?></label> 170 <textarea name="message" rows="5" placeholder="<?php _ex( 'I wanted to ask about...', 'Default placeholder message', 'wp-libre-form' ); ?>" required></textarea>170 <textarea name="message" rows="5" id="message" placeholder="<?php _ex( 'I wanted to ask about...', 'Default placeholder message', 'wp-libre-form' ); ?>" required></textarea> 171 171 172 172 <button type="submit"><?php _e( 'Submit', 'wp-libre-form' ); ?></button> -
wp-libre-form/trunk/inc/wplf-form-actions.php
r1522309 r1538409 26 26 continue; 27 27 } 28 if( is_array( $value ) ) { // in case input type="radio" submits an array 29 $value = implode( ', ', $value ); 30 } 28 31 $content .= esc_html( $key ) . ': ' . esc_html( print_r( $value, true ) ) . "\n"; 29 32 } -
wp-libre-form/trunk/readme.md
r1522426 r1538409 186 186 } 187 187 ``` 188 189 ### Multilingual 190 191 You can create multilingual forms using Polylang. WPLF will register and automatically fetch the translation when you use special template tags. 192 193 Example: 194 ```html 195 <input type="text" placeholder="{{ Test string }}" name="test"> 196 ``` 197 198 You can also disable this feature, and create your own middleware for WPML, if you'd like. 199 200 ```php 201 add_filter( 'wplf_load_polylang' , function() { 202 return false; 203 } ); 204 ``` -
wp-libre-form/trunk/readme.txt
r1522463 r1538409 5 5 Requires at least: 4.2 6 6 Tested up to: 4.6.1 7 Stable tag: 1. 1.27 Stable tag: 1.2 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
wp-libre-form/trunk/vendor/autoload.php
r1450039 r1538409 3 3 // autoload.php @generated by Composer 4 4 5 require_once __DIR__ . '/composer ' . '/autoload_real.php';5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 7 return ComposerAutoloaderInit07db012aabccf1e5cc16ff54e8f0754a::getLoader(); -
wp-libre-form/trunk/vendor/composer/ClassLoader.php
r1450039 r1538409 54 54 private $useIncludePath = false; 55 55 private $classMap = array(); 56 57 56 private $classMapAuthoritative = false; 57 private $missingClasses = array(); 58 58 59 59 public function getPrefixes() … … 323 323 return $this->classMap[$class]; 324 324 } 325 if ($this->classMapAuthoritative ) {325 if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { 326 326 return false; 327 327 } … … 330 330 331 331 // Search for Hack files if we are running on HHVM 332 if ( $file === null&& defined('HHVM_VERSION')) {332 if (false === $file && defined('HHVM_VERSION')) { 333 333 $file = $this->findFileWithExtension($class, '.hh'); 334 334 } 335 335 336 if ( $file === null) {336 if (false === $file) { 337 337 // Remember that this class does not exist. 338 return $this->classMap[$class] = false;338 $this->missingClasses[$class] = true; 339 339 } 340 340 … … 400 400 return $file; 401 401 } 402 403 return false; 402 404 } 403 405 } -
wp-libre-form/trunk/wp-libre-form.php
r1522463 r1538409 4 4 * Plugin URI: https://github.com/anttiviljami/wp-libre-form 5 5 * Description: A minimal HTML form builder for WordPress; made for developers 6 * Version: 1. 1.26 * Version: 1.2 7 7 * Author: @anttiviljami 8 8 * Author URI: https://github.com/anttiviljami/ … … 32 32 if ( ! class_exists( 'WP_Libre_Form' ) ) : 33 33 34 define( 'WPLF_VERSION', '1. 1.2' );34 define( 'WPLF_VERSION', '1.2' ); 35 35 36 36 class WP_Libre_Form { … … 56 56 CPT_WPLF_Form::init(); 57 57 CPT_WPLF_Submission::init(); 58 59 add_action( 'after_setup_theme', function() { 60 if ( apply_filters( 'wplf_load_polylang', true ) ) { 61 require_once 'classes/class-wplf-polylang.php'; 62 WPLF_Polylang::init(); 63 } 64 } ); 58 65 59 66 add_action( 'plugins_loaded', array( $this, 'load_our_textdomain' ) );
Note: See TracChangeset
for help on using the changeset viewer.