Version Description
- Fix address bug where line two was required
- Add starting QUnit tests
- Fix performance bug where duplicate event listeners were being created in the form notifications panel
- Fix required field bug with checkbox fields
- Restructure unit test folder
- Add .jshintrc
- Clean up bower.json and composer.json
Download this release
Release Info
Developer | tlovett1 |
Plugin | Custom Contact Forms |
Version | 6.3.3 |
Comparing to | |
See all releases |
Code changes from version 6.3.2 to 6.3.3
- Gruntfile.js +0 -65
- README.md +37 -4
- bin/install-wp-tests.sh +0 -78
- bin/production-ready.sh +27 -0
- bower.json +9 -19
- bower_components/moment/.bower.json +1 -2
- build/css/form-manager.css +2 -1
- build/css/form-manager.css.map +1 -1
- build/css/form-manager.min.css +1 -1
- build/js/form-cpt-preview.min.js +1 -1
- build/js/form-manager.js +111 -57
- build/js/form-manager.min.js +2 -2
- build/js/form-mce.min.js +1 -1
- build/js/form.min.js +1 -1
- classes/class-ccf-field-renderer.php +1 -9
- classes/class-ccf-form-handler.php +79 -27
- classes/class-ccf-form-manager.php +43 -25
- classes/class-ccf-submission-cpt.php +0 -45
- composer.json +2 -11
- composer.lock +3 -3
- custom-contact-forms.php +1 -1
- js/form-cpt-preview.js +2 -2
- js/form-mce.js +3 -3
- js/form.js +19 -9
- js/manager/models.js +2 -1
- js/manager/utils.js +23 -3
- js/manager/views.js +86 -53
- languages/custom-contact-forms.mo +0 -0
- languages/custom-contact-forms.po +260 -263
- package.json +3 -2
- phpunit.xml +0 -14
- readme.txt +12 -1
- scss/admin.scss +0 -24
- scss/form-cpt.scss +0 -215
- scss/form-manager.scss +0 -703
- scss/form-mce.scss +0 -185
- scss/form-table.scss +0 -3
- scss/form.scss +0 -141
- tests/bootstrap.php +0 -23
- tests/includes/class-ccf-test-base.php +0 -233
- tests/test-api.php +0 -327
- tests/test-field-errors.php +0 -459
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
Gruntfile.js
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
module.exports = function ( grunt ) {
|
2 |
-
grunt.initConfig( {
|
3 |
-
pkg: grunt.file.readJSON( 'package.json' ),
|
4 |
-
uglify: {
|
5 |
-
js: {
|
6 |
-
files: {
|
7 |
-
'build/js/form-manager.min.js': ['build/js/form-manager.js'],
|
8 |
-
'build/js/form-mce.min.js': ['js/form-mce.js'],
|
9 |
-
'build/js/form-cpt-preview.min.js': ['js/form-cpt-preview.js'],
|
10 |
-
'build/js/form.min.js': ['js/form.js']
|
11 |
-
}
|
12 |
-
}
|
13 |
-
},
|
14 |
-
concat: {
|
15 |
-
dist: {
|
16 |
-
src: ['js/manager/utils.js', 'js/manager/mixins.js', 'js/manager/models.js', 'js/manager/collections.js', 'js/manager/views.js', 'js/manager/router.js', 'js/manager/app.js'],
|
17 |
-
dest: 'build/js/form-manager.js'
|
18 |
-
}
|
19 |
-
},
|
20 |
-
jshint: {
|
21 |
-
options: {
|
22 |
-
smarttabs: true
|
23 |
-
},
|
24 |
-
all: ['js/*', 'js/manager/*']
|
25 |
-
},
|
26 |
-
sass: {
|
27 |
-
dist: {
|
28 |
-
files: {
|
29 |
-
'build/css/form-manager.css': 'scss/form-manager.scss',
|
30 |
-
'build/css/form-mce.css': 'scss/form-mce.scss',
|
31 |
-
'build/css/form.css': 'scss/form.scss',
|
32 |
-
'build/css/admin.css': 'scss/admin.scss',
|
33 |
-
'build/css/form-cpt.css': 'scss/form-cpt.scss',
|
34 |
-
'build/css/form-table.css': 'scss/form-table.scss'
|
35 |
-
}
|
36 |
-
}
|
37 |
-
},
|
38 |
-
cssmin: {
|
39 |
-
dist: {
|
40 |
-
files: [{
|
41 |
-
expand: true,
|
42 |
-
cwd: 'build/css/',
|
43 |
-
src: ['*.css', '!*.min.css'],
|
44 |
-
dest: 'build/css/',
|
45 |
-
ext: '.min.css'
|
46 |
-
}]
|
47 |
-
}
|
48 |
-
},
|
49 |
-
watch: {
|
50 |
-
files: [
|
51 |
-
'js/*',
|
52 |
-
'js/manager/*',
|
53 |
-
'scss/*'
|
54 |
-
],
|
55 |
-
tasks: ['concat:dist', 'uglify', 'sass', 'cssmin:dist']
|
56 |
-
}
|
57 |
-
} );
|
58 |
-
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
|
59 |
-
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
60 |
-
grunt.loadNpmTasks( 'grunt-contrib-sass' );
|
61 |
-
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
|
62 |
-
grunt.loadNpmTasks('grunt-contrib-concat');
|
63 |
-
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
64 |
-
grunt.registerTask( 'default', ['jshint', 'concat:dist', 'uglify:js', 'sass', 'cssmin:dist'] );
|
65 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
@@ -13,6 +13,11 @@ WordPress media manager modal. CCF does not have as many features as some of it'
|
|
13 |
you with just what you need. Custom Contact Forms is a legacy plugin name. The plugin can handle all types of forms not
|
14 |
just contact forms.
|
15 |
|
|
|
|
|
|
|
|
|
|
|
16 |
## Installation
|
17 |
|
18 |
Install the plugin in WordPress, you can download a
|
@@ -42,10 +47,20 @@ Each form has a number of settings that you should understand.
|
|
42 |
* `Completion Message` - If you choose to show a message, you can customize the message to be shown.
|
43 |
* `Redirect URL` - If you choose to perform a redirect, you can customize the redirect URL.
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
* `Completion Message` - If you choose to show a message, you can customize the message to be shown.
|
48 |
-
* `Redirect URL` - If you choose to perform a redirect, you can customize the redirect URL.
|
49 |
|
50 |
### Fields
|
51 |
|
@@ -132,6 +147,18 @@ Scroll to the `Submissions` meta box. Click one the eye icon to view more inform
|
|
132 |
In the `Submissions` meta box, you can add and remove columns. Click the cog icon at the top of the meta box to open
|
133 |
the screen options panel. In this panel you can check which columns you would like to see in the table.
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
## Development
|
136 |
|
137 |
#### Setup
|
@@ -189,4 +216,10 @@ Coming soon.
|
|
189 |
|
190 |
#### Issues
|
191 |
If you identify any errors or have an idea for improving the plugin, please
|
192 |
-
[open an issue](https://github.com/tlovett1/custom-contact-forms/issues?state=open).
|
|
|
|
|
|
|
|
|
|
|
|
13 |
you with just what you need. Custom Contact Forms is a legacy plugin name. The plugin can handle all types of forms not
|
14 |
just contact forms.
|
15 |
|
16 |
+
## Requirements
|
17 |
+
|
18 |
+
* WordPress 3.9+
|
19 |
+
* PHP 5.2.4+
|
20 |
+
|
21 |
## Installation
|
22 |
|
23 |
Install the plugin in WordPress, you can download a
|
47 |
* `Completion Message` - If you choose to show a message, you can customize the message to be shown.
|
48 |
* `Redirect URL` - If you choose to perform a redirect, you can customize the redirect URL.
|
49 |
|
50 |
+
### Form Notifications
|
51 |
+
|
52 |
+
* `Send email notifications` - When a form is completed, you can have an email sent with submission information.
|
53 |
+
|
54 |
+
If email notifications are turned on, you can configure the following:
|
55 |
+
|
56 |
+
* `"To" Email Addresses` - Enter email addresses here that should receive the notification. Multiple email addresses
|
57 |
+
should be comma separated.
|
58 |
+
* `"From" Email Address Type` - This allows you to set what email address the notification is sent from. `WordPress
|
59 |
+
Default` will use the default WordPress email address. `Custom Email` will allow you to manually type in a from
|
60 |
+
address. `Form Field` will allow you to choose an email field within the form to dynamically pull a from email
|
61 |
+
address.
|
62 |
+
|
63 |
|
|
|
|
|
64 |
|
65 |
### Fields
|
66 |
|
147 |
In the `Submissions` meta box, you can add and remove columns. Click the cog icon at the top of the meta box to open
|
148 |
the screen options panel. In this panel you can check which columns you would like to see in the table.
|
149 |
|
150 |
+
## Frequently Asked Questions
|
151 |
+
|
152 |
+
* __My form(s) will not save. What's wrong?__
|
153 |
+
|
154 |
+
You most likely have a theme or plugin conflict. Try deactivating other plugins and activating a default theme. If
|
155 |
+
forms still won't save, please create an issue.
|
156 |
+
|
157 |
+
* __When I save, delete, or edit a form, I get a HTTP 501 error. What should I do?__
|
158 |
+
|
159 |
+
CCF uses RESTful HTTP verbs such as PUT and DELETE. If your web server does not support those HTTP requests, the
|
160 |
+
plugin will not work. You will need to contact your host to resolve this.
|
161 |
+
|
162 |
## Development
|
163 |
|
164 |
#### Setup
|
216 |
|
217 |
#### Issues
|
218 |
If you identify any errors or have an idea for improving the plugin, please
|
219 |
+
[open an issue](https://github.com/tlovett1/custom-contact-forms/issues?state=open).
|
220 |
+
|
221 |
+
## License
|
222 |
+
|
223 |
+
Custom Contact Forms is free software; you can redistribute it and/or modify it under the terms of the [GNU General
|
224 |
+
Public License](http://www.gnu.org/licenses/gpl-2.0.html) as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
|
225 |
+
later version.
|
bin/install-wp-tests.sh
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
#!/usr/bin/env bash
|
2 |
-
|
3 |
-
if [ $# -lt 3 ]; then
|
4 |
-
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
|
5 |
-
exit 1
|
6 |
-
fi
|
7 |
-
|
8 |
-
DB_NAME=$1
|
9 |
-
DB_USER=$2
|
10 |
-
DB_PASS=$3
|
11 |
-
DB_HOST=${4-localhost}
|
12 |
-
WP_VERSION=${5-latest}
|
13 |
-
|
14 |
-
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
|
15 |
-
WP_CORE_DIR=/tmp/wordpress/
|
16 |
-
|
17 |
-
set -ex
|
18 |
-
|
19 |
-
install_wp() {
|
20 |
-
mkdir -p $WP_CORE_DIR
|
21 |
-
|
22 |
-
if [ $WP_VERSION == 'latest' ]; then
|
23 |
-
local ARCHIVE_NAME='latest'
|
24 |
-
else
|
25 |
-
local ARCHIVE_NAME="wordpress-$WP_VERSION"
|
26 |
-
fi
|
27 |
-
|
28 |
-
wget -nv -O /tmp/wordpress.tar.gz http://wordpress.org/${ARCHIVE_NAME}.tar.gz
|
29 |
-
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
|
30 |
-
|
31 |
-
wget -nv -O $WP_CORE_DIR/wp-content/db.php https://raw.github.com/markoheijnen/wp-mysqli/master/db.php
|
32 |
-
}
|
33 |
-
|
34 |
-
install_test_suite() {
|
35 |
-
# portable in-place argument for both GNU sed and Mac OSX sed
|
36 |
-
if [[ $(uname -s) == 'Darwin' ]]; then
|
37 |
-
local ioption='-i .bak'
|
38 |
-
else
|
39 |
-
local ioption='-i'
|
40 |
-
fi
|
41 |
-
|
42 |
-
# set up testing suite
|
43 |
-
mkdir -p $WP_TESTS_DIR
|
44 |
-
cd $WP_TESTS_DIR
|
45 |
-
svn co --quiet http://develop.svn.wordpress.org/trunk/tests/phpunit/includes/
|
46 |
-
|
47 |
-
wget -nv -O wp-tests-config.php http://develop.svn.wordpress.org/trunk/wp-tests-config-sample.php
|
48 |
-
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" wp-tests-config.php
|
49 |
-
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" wp-tests-config.php
|
50 |
-
sed $ioption "s/yourusernamehere/$DB_USER/" wp-tests-config.php
|
51 |
-
sed $ioption "s/yourpasswordhere/$DB_PASS/" wp-tests-config.php
|
52 |
-
sed $ioption "s|localhost|${DB_HOST}|" wp-tests-config.php
|
53 |
-
}
|
54 |
-
|
55 |
-
install_db() {
|
56 |
-
# parse DB_HOST for port or socket references
|
57 |
-
local PARTS=(${DB_HOST//\:/ })
|
58 |
-
local DB_HOSTNAME=${PARTS[0]};
|
59 |
-
local DB_SOCK_OR_PORT=${PARTS[1]};
|
60 |
-
local EXTRA=""
|
61 |
-
|
62 |
-
if ! [ -z $DB_HOSTNAME ] ; then
|
63 |
-
if [[ "$DB_SOCK_OR_PORT" =~ ^[0-9]+$ ]] ; then
|
64 |
-
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
|
65 |
-
elif ! [ -z $DB_SOCK_OR_PORT ] ; then
|
66 |
-
EXTRA=" --socket=$DB_SOCK_OR_PORT"
|
67 |
-
elif ! [ -z $DB_HOSTNAME ] ; then
|
68 |
-
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
|
69 |
-
fi
|
70 |
-
fi
|
71 |
-
|
72 |
-
# create database
|
73 |
-
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
|
74 |
-
}
|
75 |
-
|
76 |
-
install_wp
|
77 |
-
install_test_suite
|
78 |
-
install_db
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bin/production-ready.sh
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env bash
|
2 |
+
|
3 |
+
echo "Are you sure you want to do this? Uncommitted work could be lost. [y/n]"
|
4 |
+
read input_variable
|
5 |
+
|
6 |
+
if [ "$input_variable" == "y" ]; then
|
7 |
+
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
8 |
+
|
9 |
+
cd "$DIR/../"
|
10 |
+
|
11 |
+
rm bin/install-wp-tests.sh > /dev/null 2>&1
|
12 |
+
|
13 |
+
rm -rf bower_components > /dev/null 2>&1
|
14 |
+
rm -rf node_modules > /dev/null 2>&1
|
15 |
+
rm -rf scss > /dev/null 2>&1
|
16 |
+
rm -rf tests > /dev/null 2>&1
|
17 |
+
rm -rf .sass-cache > /dev/null 2>&1
|
18 |
+
|
19 |
+
rm .travis.yml > /dev/null 2>&1
|
20 |
+
rm Gruntfile.js > /dev/null 2>&1
|
21 |
+
rm phpunit.xml > /dev/null 2>&1
|
22 |
+
rm .jshintrc > /dev/null 2>&1
|
23 |
+
|
24 |
+
bower install --production > /dev/null 2>&1
|
25 |
+
|
26 |
+
echo "Done! Custom Contact Forms is cleaned up and production ready."
|
27 |
+
fi
|
bower.json
CHANGED
@@ -1,25 +1,15 @@
|
|
1 |
{
|
2 |
"name": "custom-contact-forms",
|
3 |
-
"homepage": "https://github.com/tlovett1/custom-contact-forms",
|
4 |
-
"authors": [
|
5 |
-
"Taylor Lovett <tlovett88@gmail.com>"
|
6 |
-
],
|
7 |
-
"description": "Build beautiful custom forms the WordPress way.",
|
8 |
-
"main": "custom-contact-forms.php",
|
9 |
-
"keywords": [
|
10 |
-
"forms",
|
11 |
-
"wordpress",
|
12 |
-
"contact"
|
13 |
-
],
|
14 |
-
"license": "MIT",
|
15 |
-
"ignore": [
|
16 |
-
"**/.*",
|
17 |
-
"node_modules",
|
18 |
-
"bower_components",
|
19 |
-
"test",
|
20 |
-
"tests"
|
21 |
-
],
|
22 |
"dependencies": {
|
23 |
"moment": "~2.9.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
}
|
1 |
{
|
2 |
"name": "custom-contact-forms",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
"dependencies": {
|
4 |
"moment": "~2.9.0"
|
5 |
+
},
|
6 |
+
"devDependencies": {
|
7 |
+
"jquery": "~2.1.1",
|
8 |
+
"underscore": "~1.6.0",
|
9 |
+
"jquery-migrate": "~1.2.1",
|
10 |
+
"qunit": "~1.17.1",
|
11 |
+
"moment": "~2.9.0",
|
12 |
+
"sinon-1.9.1": "http://sinonjs.org/releases/sinon-1.9.1.js",
|
13 |
+
"sinon-qunit-1.0.0": "http://sinonjs.org/releases/sinon-qunit-1.0.0.js"
|
14 |
}
|
15 |
}
|
bower_components/moment/.bower.json
CHANGED
@@ -26,6 +26,5 @@
|
|
26 |
},
|
27 |
"_source": "git://github.com/moment/moment.git",
|
28 |
"_target": "~2.9.0",
|
29 |
-
"_originalSource": "moment"
|
30 |
-
"_direct": true
|
31 |
}
|
26 |
},
|
27 |
"_source": "git://github.com/moment/moment.git",
|
28 |
"_target": "~2.9.0",
|
29 |
+
"_originalSource": "moment"
|
|
|
30 |
}
|
build/css/form-manager.css
CHANGED
@@ -281,7 +281,8 @@
|
|
281 |
display: none; }
|
282 |
.ccf-main-modal .ccf-form-pane .left-sidebar .explain {
|
283 |
margin-top: 5px;
|
284 |
-
font-style: italic;
|
|
|
285 |
.ccf-main-modal .ccf-form-pane .form-content {
|
286 |
box-sizing: border-box;
|
287 |
position: absolute;
|
281 |
display: none; }
|
282 |
.ccf-main-modal .ccf-form-pane .left-sidebar .explain {
|
283 |
margin-top: 5px;
|
284 |
+
font-style: italic;
|
285 |
+
display: block; }
|
286 |
.ccf-main-modal .ccf-form-pane .form-content {
|
287 |
box-sizing: border-box;
|
288 |
position: absolute;
|
build/css/form-manager.css.map
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"version": 3,
|
3 |
-
"mappings": ";AAAA,UASC;EARA,WAAW,EAAE,MAAM;EACnB,GAAG,EAAC,2BAA2B;EAC/B,GAAG,EAAC,mNAA8D;EAIlE,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGnB,UASC;EARA,WAAW,EAAE,cAAc;EAC3B,GAAG,EAAC,mCAAmC;EACvC,GAAG,EAAC,mPAAsE;EAI1E,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGnB,6BAA8B;EAC7B,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,MAAM;EACpB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,CAAC;EACd,MAAM,EAAE,OAAO;EACf,sBAAsB,EAAE,WAAW;;AAGpC,eAAgB;EAqBf,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,KAAK;EACf,GAAG,EAAE,IAAI;EACT,IAAI,EAAE,IAAI;EACV,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,MAAM;EACf,QAAQ,EAAE,MAAM;EAChB,gBAAgB,EAAE,IAAI;EA5BtB,kCAAmB;IAClB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,CAAC;IACd,MAAM,EAAE,OAAO;IACf,sBAAsB,EAAE,WAAW;EAGpC,2CAA4B;IAC3B,OAAO,EAAE,IAAI;EAGd,uBAAQ;IACP,OAAO,EAAE,KAAK;EAaf,sBAAO;IACN,aAAa,EAAE,GAAG;IAClB,QAAQ,EAAE,IAAI;IAGb,0CAAG;MACF,gBAAgB,EAAE,OAAO;IAK1B,8CAAG;MACF,gBAAgB,EAAE,OAAO;IAI3B,kCAAc;MACb,MAAM,EAAE,cAAc;MAEtB,2CAAS;QACR,MAAM,EAAE,iBAAiB;IAI3B,yBAAG;MACF,kBAAkB,EAAE,6BAAyB;MAC7C,UAAU,EAAE,6BAAyB;MACrC,MAAM,EAAE,iBAAiB;MACzB,UAAU,EAAE,OAAO;MACnB,SAAS,EAAE,IAAI;MACf,MAAM,EAAE,CAAC;MACT,WAAW,EAAE,GAAG;MAChB,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MAEZ,+BAAQ;QACP,MAAM,EAAE,cAAc;IAIxB,6BAAO;MACN,KAAK,EAAE,KAAK;MACZ,+BAAE;QACD,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,GAAG;IAIlB,+BAAS;MACR,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,IAAI;MACb,UAAU,EAAE,IAAI;MAChB,QAAQ,EAAE,IAAI;MACd,KAAK,EAAE,IAAI;MACX,gBAAgB,EAAE,IAAI;MACtB,WAAW,EAAE,iBAAiB;MAC9B,YAAY,EAAE,iBAAiB;MAC/B,aAAa,EAAE,iBAAiB;MAChC,OAAO,EAAE,SAAS;MAElB,sDAAuB;QACtB,UAAU,EAAE,GAAG;MAGhB,qCAAM;QACL,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,GAAG;MAGX,sCAAO;QACN,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,GAAG;MAKV,wTAA2B;QAC1B,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;MAGhB,qJAAW;QACV,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,GAAG;MAGf,oRAAe;QACd,OAAO,EAAE,YAAY;QACrB,YAAY,EAAE,GAAG;QAEjB,wTAAM;UACL,KAAK,EAAE,IAAI;MAIb,yIAAO;QACN,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE,GAAG;QAEnB,8JAAO;UACN,KAAK,EAAE,IAAI;MAMd,wCAAS;QACR,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,cAAc;QAC7B,cAAc,EAAE,GAAG;QACnB,aAAa,EAAE,GAAG;MAGnB,2CAAY;QACX,UAAU,EAAE,MAAM;MAGnB,qCAAM;QACL,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,GAAG;QAClB,MAAM,EAAE,OAAO;QAEf,0CAAK;UACJ,KAAK,EAAE,GAAG;MAIZ,8DAA+B;QAC9B,OAAO,EAAE,YAAY;MAGtB,2DAA4B;QAC3B,OAAO,EAAE,YAAY;MAGtB,4FAA6B;QAC5B,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,IAAI;QACtB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,cAAc;QACtB,kBAAkB,EAAE,mCAAqC;QACzD,UAAU,EAAE,mCAAqC;MAGlD,wCAAS;QACR,MAAM,EAAE,IAAI;EAKf,2BAAY;IACX,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,MAAM;EAGhB,0BAAW;IACV,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,KAAK;IAEb,6BAAG;MACF,OAAO,EAAE,IAAI;IAGd,6BAAG;MACF,MAAM,EAAE,IAAI;MACZ,UAAU,EAAE,UAAU;MACtB,SAAS,EAAE,IAAI;MACf,MAAM,EAAE,CAAC;MACT,eAAe,EAAE,IAAI;MACrB,UAAU,EAAE,cAAc;MAC1B,UAAU,EAAE,OAAO;MACnB,OAAO,EAAE,MAAM;MAEf,gCAAG;QACF,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,IAAI;QACZ,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,IAAI;QACjB,OAAO,EAAE,KAAK;QAEd,kCAAE;UACD,eAAe,EAAE,IAAI;UAErB,yCAAO;YACN,KAAK,EAAE,IAAI;UAGZ,2CAAW;YACV,KAAK,EAAE,IAAI;EAOhB,8BAAe;IACd,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IAET,qCAAS;MACR,GAAG,EAAE,IAAI;MACT,UAAU,EAAE,iBAAiB;MAE7B,wGAA6B;QAC5B,UAAU,EAAE,CAAC;IAIf,gDAAkB;MACjB,QAAQ,EAAE,QAAQ;MAClB,GAAG,EAAE,CAAC;MACN,IAAI,EAAE,CAAC;MACP,KAAK,EAAE,CAAC;MACR,MAAM,EAAE,IAAI;MACZ,gBAAgB,EAAE,IAAI;MACtB,OAAO,EAAE,EAAE;MACX,UAAU,EAAE,oDAAoD;MAChE,MAAM,EAAE,gBAAgB;MACxB,YAAY,EAAE,GAAG;MACjB,cAAc,EAAE,GAAG;MAEnB,OAAO,EAAE,CAAC;MACV,OAAO,EAAE,IAAI;IAGd,sCAAQ;MACP,MAAM,EAAE,CAAC;MACT,IAAI,EAAE,CAAC;MACP,KAAK,EAAE,CAAC;MACR,MAAM,EAAE,IAAI;MACZ,OAAO,EAAE,MAAM;MACf,QAAQ,EAAE,QAAQ;MAClB,UAAU,EAAE,KAAK;MACjB,WAAW,EAAE,IAAI;MACjB,UAAU,EAAE,iBAAiB;MAE7B,+CAAS;QACR,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;MAGjB,4CAAM;QACL,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,GAAG;IAIlB,iDAAmB;MAClB,gBAAgB,EAAE,IAAI;MACtB,aAAa,EAAE,CAAC;MAEhB,6DAAc;QACb,UAAU,EAAE,iBAAiB;MAI7B,2EAAiB;QAChB,OAAO,EAAE,KAAK;MAGf,oEAAU;QACT,OAAO,EAAE,GAAG;MAId,oDAAG;QAcF,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,SAAS;QAClB,aAAa,EAAE,iBAAiB;QAChC,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE,OAAO;QACzB,MAAM,EAAE,CAAC;QAlBT,2DAAS;UACR,YAAY,EAAE,GAAG;UACjB,WAAW,EAAE,cAAc;UAC3B,OAAO,EAAE,GAAG;UACZ,KAAK,EAAE,IAAI;UACX,WAAW,EAAE,MAAM;UACnB,YAAY,EAAE,MAAM;UACpB,cAAc,EAAE,IAAI;UACpB,WAAW,EAAE,CAAC;UACd,MAAM,EAAE,OAAO;UACf,sBAAsB,EAAE,WAAW;MAWrC,kEAAiB;QAChB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,SAAS;QAClB,aAAa,EAAE,iBAAiB;IAIlC,oCAAM;MACL,OAAO,EAAE,KAAK;MACd,aAAa,EAAE,GAAG;IAGnB,4CAAc;MACb,UAAU,EAAE,UAAU;MACtB,gBAAgB,EAAE,OAAO;MACzB,QAAQ,EAAE,QAAQ;MAClB,UAAU,EAAE,cAAc;MAC1B,YAAY,EAAE,cAAc;MAC5B,QAAQ,EAAE,MAAM;MAChB,KAAK,EAAE,GAAG;MACV,GAAG,EAAE,CAAC;MACN,OAAO,EAAE,CAAC;MACV,MAAM,EAAE,IAAI;MACZ,IAAI,EAAE,CAAC;MACP,QAAQ,EAAE,IAAI;MAEd,2EAA+B;QAC9B,UAAU,EAAE,CAAC;MAGd,kLAA4C;QAC3C,OAAO,EAAE,GAAG;QAEZ,gcAA+B;UAC9B,OAAO,EAAE,IAAI;MAIf,qDAAS;QACR,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,MAAM;
|
4 |
"sources": ["../../scss/form-manager.scss"],
|
5 |
"names": [],
|
6 |
"file": "form-manager.css"
|
1 |
{
|
2 |
"version": 3,
|
3 |
+
"mappings": ";AAAA,UASC;EARA,WAAW,EAAE,MAAM;EACnB,GAAG,EAAC,2BAA2B;EAC/B,GAAG,EAAC,mNAA8D;EAIlE,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGnB,UASC;EARA,WAAW,EAAE,cAAc;EAC3B,GAAG,EAAC,mCAAmC;EACvC,GAAG,EAAC,mPAAsE;EAI1E,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGnB,6BAA8B;EAC7B,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,MAAM;EACpB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,CAAC;EACd,MAAM,EAAE,OAAO;EACf,sBAAsB,EAAE,WAAW;;AAGpC,eAAgB;EAqBf,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,KAAK;EACf,GAAG,EAAE,IAAI;EACT,IAAI,EAAE,IAAI;EACV,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,MAAM;EACf,QAAQ,EAAE,MAAM;EAChB,gBAAgB,EAAE,IAAI;EA5BtB,kCAAmB;IAClB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,CAAC;IACd,MAAM,EAAE,OAAO;IACf,sBAAsB,EAAE,WAAW;EAGpC,2CAA4B;IAC3B,OAAO,EAAE,IAAI;EAGd,uBAAQ;IACP,OAAO,EAAE,KAAK;EAaf,sBAAO;IACN,aAAa,EAAE,GAAG;IAClB,QAAQ,EAAE,IAAI;IAGb,0CAAG;MACF,gBAAgB,EAAE,OAAO;IAK1B,8CAAG;MACF,gBAAgB,EAAE,OAAO;IAI3B,kCAAc;MACb,MAAM,EAAE,cAAc;MAEtB,2CAAS;QACR,MAAM,EAAE,iBAAiB;IAI3B,yBAAG;MACF,kBAAkB,EAAE,6BAAyB;MAC7C,UAAU,EAAE,6BAAyB;MACrC,MAAM,EAAE,iBAAiB;MACzB,UAAU,EAAE,OAAO;MACnB,SAAS,EAAE,IAAI;MACf,MAAM,EAAE,CAAC;MACT,WAAW,EAAE,GAAG;MAChB,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MAEZ,+BAAQ;QACP,MAAM,EAAE,cAAc;IAIxB,6BAAO;MACN,KAAK,EAAE,KAAK;MACZ,+BAAE;QACD,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,GAAG;IAIlB,+BAAS;MACR,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,IAAI;MACb,UAAU,EAAE,IAAI;MAChB,QAAQ,EAAE,IAAI;MACd,KAAK,EAAE,IAAI;MACX,gBAAgB,EAAE,IAAI;MACtB,WAAW,EAAE,iBAAiB;MAC9B,YAAY,EAAE,iBAAiB;MAC/B,aAAa,EAAE,iBAAiB;MAChC,OAAO,EAAE,SAAS;MAElB,sDAAuB;QACtB,UAAU,EAAE,GAAG;MAGhB,qCAAM;QACL,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,GAAG;MAGX,sCAAO;QACN,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,GAAG;MAKV,wTAA2B;QAC1B,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;MAGhB,qJAAW;QACV,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,GAAG;MAGf,oRAAe;QACd,OAAO,EAAE,YAAY;QACrB,YAAY,EAAE,GAAG;QAEjB,wTAAM;UACL,KAAK,EAAE,IAAI;MAIb,yIAAO;QACN,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE,GAAG;QAEnB,8JAAO;UACN,KAAK,EAAE,IAAI;MAMd,wCAAS;QACR,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,cAAc;QAC7B,cAAc,EAAE,GAAG;QACnB,aAAa,EAAE,GAAG;MAGnB,2CAAY;QACX,UAAU,EAAE,MAAM;MAGnB,qCAAM;QACL,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,GAAG;QAClB,MAAM,EAAE,OAAO;QAEf,0CAAK;UACJ,KAAK,EAAE,GAAG;MAIZ,8DAA+B;QAC9B,OAAO,EAAE,YAAY;MAGtB,2DAA4B;QAC3B,OAAO,EAAE,YAAY;MAGtB,4FAA6B;QAC5B,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,IAAI;QACtB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,cAAc;QACtB,kBAAkB,EAAE,mCAAqC;QACzD,UAAU,EAAE,mCAAqC;MAGlD,wCAAS;QACR,MAAM,EAAE,IAAI;EAKf,2BAAY;IACX,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,MAAM;EAGhB,0BAAW;IACV,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,KAAK;IAEb,6BAAG;MACF,OAAO,EAAE,IAAI;IAGd,6BAAG;MACF,MAAM,EAAE,IAAI;MACZ,UAAU,EAAE,UAAU;MACtB,SAAS,EAAE,IAAI;MACf,MAAM,EAAE,CAAC;MACT,eAAe,EAAE,IAAI;MACrB,UAAU,EAAE,cAAc;MAC1B,UAAU,EAAE,OAAO;MACnB,OAAO,EAAE,MAAM;MAEf,gCAAG;QACF,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,IAAI;QACZ,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,IAAI;QACjB,OAAO,EAAE,KAAK;QAEd,kCAAE;UACD,eAAe,EAAE,IAAI;UAErB,yCAAO;YACN,KAAK,EAAE,IAAI;UAGZ,2CAAW;YACV,KAAK,EAAE,IAAI;EAOhB,8BAAe;IACd,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IAET,qCAAS;MACR,GAAG,EAAE,IAAI;MACT,UAAU,EAAE,iBAAiB;MAE7B,wGAA6B;QAC5B,UAAU,EAAE,CAAC;IAIf,gDAAkB;MACjB,QAAQ,EAAE,QAAQ;MAClB,GAAG,EAAE,CAAC;MACN,IAAI,EAAE,CAAC;MACP,KAAK,EAAE,CAAC;MACR,MAAM,EAAE,IAAI;MACZ,gBAAgB,EAAE,IAAI;MACtB,OAAO,EAAE,EAAE;MACX,UAAU,EAAE,oDAAoD;MAChE,MAAM,EAAE,gBAAgB;MACxB,YAAY,EAAE,GAAG;MACjB,cAAc,EAAE,GAAG;MAEnB,OAAO,EAAE,CAAC;MACV,OAAO,EAAE,IAAI;IAGd,sCAAQ;MACP,MAAM,EAAE,CAAC;MACT,IAAI,EAAE,CAAC;MACP,KAAK,EAAE,CAAC;MACR,MAAM,EAAE,IAAI;MACZ,OAAO,EAAE,MAAM;MACf,QAAQ,EAAE,QAAQ;MAClB,UAAU,EAAE,KAAK;MACjB,WAAW,EAAE,IAAI;MACjB,UAAU,EAAE,iBAAiB;MAE7B,+CAAS;QACR,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;MAGjB,4CAAM;QACL,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,GAAG;IAIlB,iDAAmB;MAClB,gBAAgB,EAAE,IAAI;MACtB,aAAa,EAAE,CAAC;MAEhB,6DAAc;QACb,UAAU,EAAE,iBAAiB;MAI7B,2EAAiB;QAChB,OAAO,EAAE,KAAK;MAGf,oEAAU;QACT,OAAO,EAAE,GAAG;MAId,oDAAG;QAcF,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,SAAS;QAClB,aAAa,EAAE,iBAAiB;QAChC,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE,OAAO;QACzB,MAAM,EAAE,CAAC;QAlBT,2DAAS;UACR,YAAY,EAAE,GAAG;UACjB,WAAW,EAAE,cAAc;UAC3B,OAAO,EAAE,GAAG;UACZ,KAAK,EAAE,IAAI;UACX,WAAW,EAAE,MAAM;UACnB,YAAY,EAAE,MAAM;UACpB,cAAc,EAAE,IAAI;UACpB,WAAW,EAAE,CAAC;UACd,MAAM,EAAE,OAAO;UACf,sBAAsB,EAAE,WAAW;MAWrC,kEAAiB;QAChB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,SAAS;QAClB,aAAa,EAAE,iBAAiB;IAIlC,oCAAM;MACL,OAAO,EAAE,KAAK;MACd,aAAa,EAAE,GAAG;IAGnB,4CAAc;MACb,UAAU,EAAE,UAAU;MACtB,gBAAgB,EAAE,OAAO;MACzB,QAAQ,EAAE,QAAQ;MAClB,UAAU,EAAE,cAAc;MAC1B,YAAY,EAAE,cAAc;MAC5B,QAAQ,EAAE,MAAM;MAChB,KAAK,EAAE,GAAG;MACV,GAAG,EAAE,CAAC;MACN,OAAO,EAAE,CAAC;MACV,MAAM,EAAE,IAAI;MACZ,IAAI,EAAE,CAAC;MACP,QAAQ,EAAE,IAAI;MAEd,2EAA+B;QAC9B,UAAU,EAAE,CAAC;MAGd,kLAA4C;QAC3C,OAAO,EAAE,GAAG;QAEZ,gcAA+B;UAC9B,OAAO,EAAE,IAAI;MAIf,qDAAS;QACR,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE,KAAK;IAIhB,4CAAc;MACb,UAAU,EAAE,UAAU;MACtB,QAAQ,EAAE,QAAQ;MAClB,KAAK,EAAE,GAAG;MACV,MAAM,EAAE,IAAI;MACZ,IAAI,EAAE,GAAG;MACT,QAAQ,EAAE,MAAM;MAChB,KAAK,EAAE,GAAG;MACV,GAAG,EAAE,CAAC;MACN,QAAQ,EAAE,IAAI;MACd,UAAU,EAAE,cAAc;MAC1B,OAAO,EAAE,IAAI;MAEb,uDAAW;QACV,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,MAAM;IAIpB,6CAAe;MACd,UAAU,EAAE,UAAU;MACtB,OAAO,EAAE,CAAC;MACV,QAAQ,EAAE,QAAQ;MAClB,QAAQ,EAAE,MAAM;MAChB,KAAK,EAAE,GAAG;MACV,GAAG,EAAE,CAAC;MACN,QAAQ,EAAE,IAAI;MACd,gBAAgB,EAAE,OAAO;MACzB,KAAK,EAAE,CAAC;MACR,MAAM,EAAE,IAAI;MACZ,WAAW,EAAE,iBAAiB;MAE9B,oEAAuB;QACtB,aAAa,EAAE,GAAG;MAGnB,uDAAU;QACT,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,IAAI;MAGhB,mDAAM;QACL,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,CAAC;QAET,6DAAU;UACT,KAAK,EAAE,GAAG;MAKX,gEAAM;QACL,YAAY,EAAE,OAAO;QACrB,YAAY,EAAE,GAAG;MAInB,yEAA4B;QAC3B,YAAY,EAAE,OAAO;QACrB,YAAY,EAAE,GAAG;MAGlB,8DAAiB;QAChB,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,GAAG;MAGhB,4EAA+B;QAC9B,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE,MAAM;MAGvB,4DAAe;QACd,OAAO,EAAE,YAAY;MAGtB,sDAAS;QACR,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;MAGb,yDAAY;QACX,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,IAAI;MAKV,4FAAmB;QAClB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;MAGtB,+EAAM;QACL,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,IAAI;QAEZ,sFAAS;UACR,MAAM,EAAE,IAAI;MAId,iKAAc;QACb,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,OAAO;EAOnB,uCAAwB;IACvB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,MAAM;IAChB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE,IAAI;IAEb,6CAAM;MACL,KAAK,EAAE,IAAI;MACX,eAAe,EAAE,QAAQ;MACzB,YAAY,EAAE,KAAK;MACnB,MAAM,EAAE,cAAc;MAEtB,gDAAG;QACF,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,IAAI;MAGjB,+DAAkB;QACjB,UAAU,EAAE,MAAM;MAGnB,wGAAY;QACX,gBAAgB,EAAE,OAAO;QAEzB,8GAAG;UACF,aAAa,EAAE,iBAAiB;UAChC,UAAU,EAAE,iBAAiB;QAG9B,8GAAG;UACF,MAAM,EAAE,CAAC;UACT,UAAU,EAAE,IAAI;UAChB,OAAO,EAAE,SAAS;UAClB,UAAU,EAAE,UAAU;QAGvB,gHAAI;UACH,KAAK,EAAE,EAAE;QAGV,sHAAO;UACN,KAAK,EAAE,GAAG;QAGX,wHAAQ;UACP,KAAK,EAAE,GAAG;QAGX,0HAAS;UACR,KAAK,EAAE,GAAG;QAGX,kIAAa;UACZ,KAAK,EAAE,GAAG;QAGX,4IAAkB;UACjB,KAAK,EAAE,GAAG;QAGX,oHAAM;UACL,KAAK,EAAE,GAAG;MAKX,qEAAkB;QACjB,gBAAgB,EAAE,OAAO;QACzB,MAAM,EAAE,CAAC;MAGV,sDAAG;QACF,gBAAgB,EAAE,IAAI;MAGvB,sDAAG;QACF,cAAc,EAAE,GAAG;QAEnB,wDAAE;UACD,eAAe,EAAE,IAAI;UACrB,MAAM,EAAE,OAAO;QAGhB,6DAAO;UACN,WAAW,EAAE,IAAI;UACjB,SAAS,EAAE,IAAI;QAGhB,+DAAS;UACR,UAAU,EAAE,MAAM;UAClB,UAAU,EAAE,GAAG;UAEf,uEAAQ;YACP,KAAK,EAAE,OAAO;MAKjB,wEAAqB;QACpB,UAAU,EAAE,OAAO;;AAOxB,uBAAwB;EACvB,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,KAAK;EACf,GAAG,EAAE,GAAG;EACR,IAAI,EAAE,GAAG;EACT,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,MAAM;EACf,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,qDAAqD;EACjE,MAAM,EAAE,iBAAiB;EACzB,YAAY,EAAE,GAAG;EACjB,cAAc,EAAE,GAAG;EACnB,gBAAgB,EAAE,IAAI;;AAGvB,eAAgB;EACf,SAAS,EAAE,IAAI;EACf,UAAU,EAAE,GAAG;EACf,UAAU,EAAE,KAAK;EAEjB,sBAAO;IACN,OAAO,EAAE,KAAK;EAGf,0BAAW;IACV,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,GAAG;EAGnB,iBAAE;IACD,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,OAAO;IACnB,eAAe,EAAE,IAAI;IAErB,+FAAgC;MAC/B,SAAS,EAAE,IAAI;MACf,WAAW,EAAE,IAAI;MACjB,OAAO,EAAE,aAAa;MAEtB,uHAAQ;QACP,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,OAAO;IAI3B,0BAAW;MACV,KAAK,EAAE,IAAI;MAEX,gCAAQ;QACP,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,OAAO",
|
4 |
"sources": ["../../scss/form-manager.scss"],
|
5 |
"names": [],
|
6 |
"file": "form-manager.css"
|
build/css/form-manager.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@charset "UTF-8";@font-face{font-family:menu;src:url(../../fonts/menu.eot);src:url(../../fonts/menu.eot?#iefix) format("embedded-opentype"),url(../../fonts/menu.woff) format("woff"),url(../../fonts/menu.ttf) format("truetype"),url(../../fonts/menu.svg#form-manager) format("svg");font-weight:400;font-style:normal}@font-face{font-family:form-manager;src:url(../../fonts/form-manager.eot);src:url(../../fonts/form-manager.eot?#iefix) format("embedded-opentype"),url(../../fonts/form-manager.woff) format("woff"),url(../../fonts/form-manager.ttf) format("truetype"),url(../../fonts/form-manager.svg#form-manager) format("svg");font-weight:400;font-style:normal}.ccf-open-form-manager:before{font-family:menu;content:"";padding-right:4px;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal{display:none;position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000;overflow:hidden;background-color:#fff}.ccf-main-modal [data-icon]:before{font-family:form-manager;content:attr(data-icon);speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .single .insert-form-button{display:none}.ccf-main-modal .hidden{display:block}.ccf-main-modal .field{margin-bottom:5px;overflow:auto}.ccf-main-modal .field.field-incomplete h4{background-color:#ffebe8}.ccf-main-modal .field.field-duplicate-slug h4{background-color:#ffe6a5}.ccf-main-modal .field.ccf-editing{border:#999 1px solid}.ccf-main-modal .field.ccf-editing h4:hover{border:1px solid #e5e5e5}.ccf-main-modal .field h4{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;background:#fafafa;font-size:13px;margin:0;font-weight:600;color:#222;padding:13px;cursor:move}.ccf-main-modal .field h4:hover{border:#999 1px solid}.ccf-main-modal .field .right{float:right}.ccf-main-modal .field .right a{color:inherit;margin-left:3px}.ccf-main-modal .field .preview{clear:both;display:none;text-align:left;overflow:auto;float:none;background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;padding:10px 20px}.ccf-main-modal .field .preview .recaptcha-preview-img{margin-top:7px}.ccf-main-modal .field .preview .left{float:left;clear:both;width:47%}.ccf-main-modal .field .preview .right{float:right;width:47%}.ccf-main-modal .field .preview .full input[type=text],.ccf-main-modal .field .preview .full select,.ccf-main-modal .field .preview .left input[type=text],.ccf-main-modal .field .preview .left select,.ccf-main-modal .field .preview .right input[type=text],.ccf-main-modal .field .preview .right select{width:100%;max-width:100%}.ccf-main-modal .field .preview .full .sub-label,.ccf-main-modal .field .preview .left .sub-label,.ccf-main-modal .field .preview .right .sub-label{margin:3px 0 3px 2px;font-size:90%}.ccf-main-modal .field .preview .full .hour,.ccf-main-modal .field .preview .full .minute,.ccf-main-modal .field .preview .left .hour,.ccf-main-modal .field .preview .left .minute,.ccf-main-modal .field .preview .right .hour,.ccf-main-modal .field .preview .right .minute{display:inline-block;margin-right:5px}.ccf-main-modal .field .preview .full .hour input,.ccf-main-modal .field .preview .full .minute input,.ccf-main-modal .field .preview .left .hour input,.ccf-main-modal .field .preview .left .minute input,.ccf-main-modal .field .preview .right .hour input,.ccf-main-modal .field .preview .right .minute input{width:35px}.ccf-main-modal .field .preview .full .am-pm,.ccf-main-modal .field .preview .left .am-pm,.ccf-main-modal .field .preview .right .am-pm{display:inline-block;vertical-align:top}.ccf-main-modal .field .preview .full .am-pm select,.ccf-main-modal .field .preview .left .am-pm select,.ccf-main-modal .field .preview .right .am-pm select{width:60px}.ccf-main-modal .field .preview .heading{font-size:125%;font-weight:700;border-bottom:1px solid #ccc;padding-bottom:9px;margin-bottom:9px}.ccf-main-modal .field .preview .subheading{font-style:italic}.ccf-main-modal .field .preview label{font-weight:700;margin-bottom:3px;cursor:inherit}.ccf-main-modal .field .preview label span{color:red}.ccf-main-modal .field .preview input[type=checkbox]+label,.ccf-main-modal .field .preview input[type=radio]+label{display:inline-block}.ccf-main-modal .field .preview input[type=text],.ccf-main-modal .field .preview textarea{width:100%;background-color:#fff;color:#333;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.ccf-main-modal .field .preview textarea{height:60px}.ccf-main-modal .close-icon{position:absolute;top:16px;right:16px;font-size:35px;cursor:pointer;color:#333;z-index:160001}.ccf-main-modal .main-menu{position:absolute;top:0;right:0;left:0;height:125px}.ccf-main-modal .main-menu h1{padding:16px}.ccf-main-modal .main-menu ul{height:40px;box-sizing:border-box;font-size:14px;margin:0;list-style-type:none;border-top:1px solid #ddd;background:#f3f3f3;padding:0 16px}.ccf-main-modal .main-menu ul li{margin:0;display:inline-block;height:38px;vertical-align:middle;line-height:40px;padding:0 8px}.ccf-main-modal .main-menu ul li a{text-decoration:none}.ccf-main-modal .main-menu ul li a :hover,.ccf-main-modal .main-menu ul li a.selected{color:#000}.ccf-main-modal .ccf-form-pane{display:none;position:absolute;top:125px;right:0;left:0;bottom:0}.ccf-main-modal .ccf-form-pane.single{top:85px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane.single .form-content,.ccf-main-modal .ccf-form-pane.single .left-sidebar{border-top:0}.ccf-main-modal .ccf-form-pane .disabled-overlay{position:absolute;top:0;left:0;right:0;bottom:50px;background-color:#000;opacity:.1;-ms-filter:"alpha(Opacity=1)";filter:alpha(opacity=1);-moz-opacity:.1;-khtml-opacity:.1;z-index:1;display:none}.ccf-main-modal .ccf-form-pane .bottom{bottom:0;left:0;right:0;height:50px;padding:0 16px;position:absolute;text-align:right;line-height:50px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .bottom .spinner{display:none;float:right;width:16px;height:16px;margin-top:16px}.ccf-main-modal .ccf-form-pane .bottom input{margin-top:11px;float:right;margin-left:6px}.ccf-main-modal .ccf-form-pane .accordion-section{background-color:#fff;border-bottom:0}.ccf-main-modal .ccf-form-pane .accordion-section:first-child{border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .section-content{display:block}.ccf-main-modal .ccf-form-pane .accordion-section.expanded h2:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section h2{cursor:pointer;padding:10px 20px;border-bottom:1px solid #e5e5e5;font-size:150%;background-color:#fafafa;margin:0}.ccf-main-modal .ccf-form-pane .accordion-section h2:before{margin-right:8px;font-family:form-manager;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .ccf-form-pane .accordion-section .section-content{display:none;padding:10px 20px;border-bottom:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane label{display:block;margin-bottom:8px}.ccf-main-modal .ccf-form-pane .left-sidebar{box-sizing:border-box;background-color:#f3f3f3;position:absolute;border-top:1px solid #ddd;border-right:1px solid #ddd;width:25%;top:0;padding:0;bottom:50px;left:0;overflow:auto}.ccf-main-modal .ccf-form-pane .left-sidebar .accordion-section:first-child{border-top:0}.ccf-main-modal .ccf-form-pane .left-sidebar .fields,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields{padding:5px}.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .right{display:none}.ccf-main-modal .ccf-form-pane .left-sidebar .explain{margin-top:5px;font-style:italic}.ccf-main-modal .ccf-form-pane .form-content{box-sizing:border-box;position:absolute;width:40%;bottom:50px;left:25%;right:35%;top:0;overflow:auto;border-top:1px solid #ddd;padding:21px}.ccf-main-modal .ccf-form-pane .form-content .no-fields{font-size:22px;padding:16px;font-style:italic}.ccf-main-modal .ccf-form-pane .right-sidebar{box-sizing:border-box;padding:0;position:absolute;width:35%;top:0;overflow:auto;background-color:#f3f3f3;right:0;bottom:50px;border-left:1px solid #ddd}.ccf-main-modal .ccf-form-pane .right-sidebar .section-content>div{margin-bottom:6px}.ccf-main-modal .ccf-form-pane .right-sidebar .no-field{padding:16px;font-style:italic;font-size:22px}.ccf-main-modal .ccf-form-pane .right-sidebar label{display:inline-block;margin:0}.ccf-main-modal .ccf-form-pane .right-sidebar label .required{color:red}.ccf-main-modal .ccf-form-pane .right-sidebar .field-error input{border-color:red;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-duplicate-slug input{border-color:#ffe6a5;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=text]{width:100%;display:block;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=checkbox]+label{display:inline-block;vertical-align:middle}.ccf-main-modal .ccf-form-pane .right-sidebar label+select{display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar textarea{width:100%;height:80px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-html{height:150px;width:100%}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type=text]{width:100px;display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move{color:inherit;cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move:before{cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .add,.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .delete{cursor:pointer;color:inherit}.ccf-main-modal .ccf-existing-form-pane{display:none;position:absolute;overflow:scroll;top:125px;right:0;left:0;bottom:0;background-color:#fff;padding:16px}.ccf-main-modal .ccf-existing-form-pane table{width:100%;border-collapse:collapse;table-layout:fixed;border:1px solid #ddd}.ccf-main-modal .ccf-existing-form-pane table td{margin:0;padding:14px 21px;text-align:left}.ccf-main-modal .ccf-existing-form-pane table .empty-form-table{text-align:center}.ccf-main-modal .ccf-existing-form-pane table tfoot,.ccf-main-modal .ccf-existing-form-pane table thead{background-color:#f0f0f0}.ccf-main-modal .ccf-existing-form-pane table tfoot tr,.ccf-main-modal .ccf-existing-form-pane table thead tr{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-existing-form-pane table tfoot th,.ccf-main-modal .ccf-existing-form-pane table thead th{margin:0;text-align:left;padding:14px 21px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table tfoot .id,.ccf-main-modal .ccf-existing-form-pane table thead .id{width:5%}.ccf-main-modal .ccf-existing-form-pane table tfoot .title,.ccf-main-modal .ccf-existing-form-pane table thead .title{width:30%}.ccf-main-modal .ccf-existing-form-pane table tfoot .author,.ccf-main-modal .ccf-existing-form-pane table tfoot .entries,.ccf-main-modal .ccf-existing-form-pane table tfoot .submissions,.ccf-main-modal .ccf-existing-form-pane table thead .author,.ccf-main-modal .ccf-existing-form-pane table thead .entries,.ccf-main-modal .ccf-existing-form-pane table thead .submissions{width:10%}.ccf-main-modal .ccf-existing-form-pane table tfoot .number-of-fields,.ccf-main-modal .ccf-existing-form-pane table thead .number-of-fields{width:15%}.ccf-main-modal .ccf-existing-form-pane table tfoot .date,.ccf-main-modal .ccf-existing-form-pane table thead .date{width:20%}.ccf-main-modal .ccf-existing-form-pane table tbody tr:nth-child(odd){background-color:#fafafa;margin:0}.ccf-main-modal .ccf-existing-form-pane table tbody tr{background-color:#fff}.ccf-main-modal .ccf-existing-form-pane table tbody td{vertical-align:top}.ccf-main-modal .ccf-existing-form-pane table tbody td a{text-decoration:none;cursor:pointer}.ccf-main-modal .ccf-existing-form-pane table tbody td .title{font-weight:700;font-size:14px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions{visibility:hidden;margin-top:6px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions .delete{color:red}.ccf-main-modal .ccf-existing-form-pane table tbody tr:hover td .actions{visibility:visible}.ccf-main-modal-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:159900;opacity:.7;-ms-filter:"alpha(Opacity=70)";filter:alpha(opacity=70);-moz-opacity:.7;-khtml-opacity:.7;background-color:#000}.ccf-pagination{font-size:12px;margin-top:8px;text-align:right}.ccf-pagination .pages{padding:0 4px}.ccf-pagination .num-items{font-style:italic;padding-right:4px}.ccf-pagination a{cursor:pointer;color:#0074a2;background:#f0f0f0;text-decoration:none}.ccf-pagination a.first,.ccf-pagination a.last,.ccf-pagination a.next,.ccf-pagination a.prev{font-size:16px;line-height:22px;padding:0 7px 2px}.ccf-pagination a.first:hover,.ccf-pagination a.last:hover,.ccf-pagination a.next:hover,.ccf-pagination a.prev:hover{color:#fff;background-color:#2ea2cc}.ccf-pagination a.disabled{color:#aaa}.ccf-pagination a.disabled:hover{color:#aaa;background:#f0f0f0}
|
1 |
+
@charset "UTF-8";@font-face{font-family:menu;src:url(../../fonts/menu.eot);src:url(../../fonts/menu.eot?#iefix) format("embedded-opentype"),url(../../fonts/menu.woff) format("woff"),url(../../fonts/menu.ttf) format("truetype"),url(../../fonts/menu.svg#form-manager) format("svg");font-weight:400;font-style:normal}@font-face{font-family:form-manager;src:url(../../fonts/form-manager.eot);src:url(../../fonts/form-manager.eot?#iefix) format("embedded-opentype"),url(../../fonts/form-manager.woff) format("woff"),url(../../fonts/form-manager.ttf) format("truetype"),url(../../fonts/form-manager.svg#form-manager) format("svg");font-weight:400;font-style:normal}.ccf-open-form-manager:before{font-family:menu;content:"";padding-right:4px;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal{display:none;position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000;overflow:hidden;background-color:#fff}.ccf-main-modal [data-icon]:before{font-family:form-manager;content:attr(data-icon);speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .single .insert-form-button{display:none}.ccf-main-modal .hidden{display:block}.ccf-main-modal .field{margin-bottom:5px;overflow:auto}.ccf-main-modal .field.field-incomplete h4{background-color:#ffebe8}.ccf-main-modal .field.field-duplicate-slug h4{background-color:#ffe6a5}.ccf-main-modal .field.ccf-editing{border:#999 1px solid}.ccf-main-modal .field.ccf-editing h4:hover{border:1px solid #e5e5e5}.ccf-main-modal .field h4{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;background:#fafafa;font-size:13px;margin:0;font-weight:600;color:#222;padding:13px;cursor:move}.ccf-main-modal .field h4:hover{border:#999 1px solid}.ccf-main-modal .field .right{float:right}.ccf-main-modal .field .right a{color:inherit;margin-left:3px}.ccf-main-modal .field .preview{clear:both;display:none;text-align:left;overflow:auto;float:none;background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;padding:10px 20px}.ccf-main-modal .field .preview .recaptcha-preview-img{margin-top:7px}.ccf-main-modal .field .preview .left{float:left;clear:both;width:47%}.ccf-main-modal .field .preview .right{float:right;width:47%}.ccf-main-modal .field .preview .full input[type=text],.ccf-main-modal .field .preview .full select,.ccf-main-modal .field .preview .left input[type=text],.ccf-main-modal .field .preview .left select,.ccf-main-modal .field .preview .right input[type=text],.ccf-main-modal .field .preview .right select{width:100%;max-width:100%}.ccf-main-modal .field .preview .full .sub-label,.ccf-main-modal .field .preview .left .sub-label,.ccf-main-modal .field .preview .right .sub-label{margin:3px 0 3px 2px;font-size:90%}.ccf-main-modal .field .preview .full .hour,.ccf-main-modal .field .preview .full .minute,.ccf-main-modal .field .preview .left .hour,.ccf-main-modal .field .preview .left .minute,.ccf-main-modal .field .preview .right .hour,.ccf-main-modal .field .preview .right .minute{display:inline-block;margin-right:5px}.ccf-main-modal .field .preview .full .hour input,.ccf-main-modal .field .preview .full .minute input,.ccf-main-modal .field .preview .left .hour input,.ccf-main-modal .field .preview .left .minute input,.ccf-main-modal .field .preview .right .hour input,.ccf-main-modal .field .preview .right .minute input{width:35px}.ccf-main-modal .field .preview .full .am-pm,.ccf-main-modal .field .preview .left .am-pm,.ccf-main-modal .field .preview .right .am-pm{display:inline-block;vertical-align:top}.ccf-main-modal .field .preview .full .am-pm select,.ccf-main-modal .field .preview .left .am-pm select,.ccf-main-modal .field .preview .right .am-pm select{width:60px}.ccf-main-modal .field .preview .heading{font-size:125%;font-weight:700;border-bottom:1px solid #ccc;padding-bottom:9px;margin-bottom:9px}.ccf-main-modal .field .preview .subheading{font-style:italic}.ccf-main-modal .field .preview label{font-weight:700;margin-bottom:3px;cursor:inherit}.ccf-main-modal .field .preview label span{color:red}.ccf-main-modal .field .preview input[type=checkbox]+label,.ccf-main-modal .field .preview input[type=radio]+label{display:inline-block}.ccf-main-modal .field .preview input[type=text],.ccf-main-modal .field .preview textarea{width:100%;background-color:#fff;color:#333;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.ccf-main-modal .field .preview textarea{height:60px}.ccf-main-modal .close-icon{position:absolute;top:16px;right:16px;font-size:35px;cursor:pointer;color:#333;z-index:160001}.ccf-main-modal .main-menu{position:absolute;top:0;right:0;left:0;height:125px}.ccf-main-modal .main-menu h1{padding:16px}.ccf-main-modal .main-menu ul{height:40px;box-sizing:border-box;font-size:14px;margin:0;list-style-type:none;border-top:1px solid #ddd;background:#f3f3f3;padding:0 16px}.ccf-main-modal .main-menu ul li{margin:0;display:inline-block;height:38px;vertical-align:middle;line-height:40px;padding:0 8px}.ccf-main-modal .main-menu ul li a{text-decoration:none}.ccf-main-modal .main-menu ul li a :hover,.ccf-main-modal .main-menu ul li a.selected{color:#000}.ccf-main-modal .ccf-form-pane{display:none;position:absolute;top:125px;right:0;left:0;bottom:0}.ccf-main-modal .ccf-form-pane.single{top:85px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane.single .form-content,.ccf-main-modal .ccf-form-pane.single .left-sidebar{border-top:0}.ccf-main-modal .ccf-form-pane .disabled-overlay{position:absolute;top:0;left:0;right:0;bottom:50px;background-color:#000;opacity:.1;-ms-filter:"alpha(Opacity=1)";filter:alpha(opacity=1);-moz-opacity:.1;-khtml-opacity:.1;z-index:1;display:none}.ccf-main-modal .ccf-form-pane .bottom{bottom:0;left:0;right:0;height:50px;padding:0 16px;position:absolute;text-align:right;line-height:50px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .bottom .spinner{display:none;float:right;width:16px;height:16px;margin-top:16px}.ccf-main-modal .ccf-form-pane .bottom input{margin-top:11px;float:right;margin-left:6px}.ccf-main-modal .ccf-form-pane .accordion-section{background-color:#fff;border-bottom:0}.ccf-main-modal .ccf-form-pane .accordion-section:first-child{border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .section-content{display:block}.ccf-main-modal .ccf-form-pane .accordion-section.expanded h2:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section h2{cursor:pointer;padding:10px 20px;border-bottom:1px solid #e5e5e5;font-size:150%;background-color:#fafafa;margin:0}.ccf-main-modal .ccf-form-pane .accordion-section h2:before{margin-right:8px;font-family:form-manager;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .ccf-form-pane .accordion-section .section-content{display:none;padding:10px 20px;border-bottom:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane label{display:block;margin-bottom:8px}.ccf-main-modal .ccf-form-pane .left-sidebar{box-sizing:border-box;background-color:#f3f3f3;position:absolute;border-top:1px solid #ddd;border-right:1px solid #ddd;width:25%;top:0;padding:0;bottom:50px;left:0;overflow:auto}.ccf-main-modal .ccf-form-pane .left-sidebar .accordion-section:first-child{border-top:0}.ccf-main-modal .ccf-form-pane .left-sidebar .fields,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields{padding:5px}.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .right{display:none}.ccf-main-modal .ccf-form-pane .left-sidebar .explain{margin-top:5px;font-style:italic;display:block}.ccf-main-modal .ccf-form-pane .form-content{box-sizing:border-box;position:absolute;width:40%;bottom:50px;left:25%;right:35%;top:0;overflow:auto;border-top:1px solid #ddd;padding:21px}.ccf-main-modal .ccf-form-pane .form-content .no-fields{font-size:22px;padding:16px;font-style:italic}.ccf-main-modal .ccf-form-pane .right-sidebar{box-sizing:border-box;padding:0;position:absolute;width:35%;top:0;overflow:auto;background-color:#f3f3f3;right:0;bottom:50px;border-left:1px solid #ddd}.ccf-main-modal .ccf-form-pane .right-sidebar .section-content>div{margin-bottom:6px}.ccf-main-modal .ccf-form-pane .right-sidebar .no-field{padding:16px;font-style:italic;font-size:22px}.ccf-main-modal .ccf-form-pane .right-sidebar label{display:inline-block;margin:0}.ccf-main-modal .ccf-form-pane .right-sidebar label .required{color:red}.ccf-main-modal .ccf-form-pane .right-sidebar .field-error input{border-color:red;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-duplicate-slug input{border-color:#ffe6a5;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=text]{width:100%;display:block;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=checkbox]+label{display:inline-block;vertical-align:middle}.ccf-main-modal .ccf-form-pane .right-sidebar label+select{display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar textarea{width:100%;height:80px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-html{height:150px;width:100%}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type=text]{width:100px;display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move{color:inherit;cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move:before{cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .add,.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .delete{cursor:pointer;color:inherit}.ccf-main-modal .ccf-existing-form-pane{display:none;position:absolute;overflow:scroll;top:125px;right:0;left:0;bottom:0;background-color:#fff;padding:16px}.ccf-main-modal .ccf-existing-form-pane table{width:100%;border-collapse:collapse;table-layout:fixed;border:1px solid #ddd}.ccf-main-modal .ccf-existing-form-pane table td{margin:0;padding:14px 21px;text-align:left}.ccf-main-modal .ccf-existing-form-pane table .empty-form-table{text-align:center}.ccf-main-modal .ccf-existing-form-pane table tfoot,.ccf-main-modal .ccf-existing-form-pane table thead{background-color:#f0f0f0}.ccf-main-modal .ccf-existing-form-pane table tfoot tr,.ccf-main-modal .ccf-existing-form-pane table thead tr{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-existing-form-pane table tfoot th,.ccf-main-modal .ccf-existing-form-pane table thead th{margin:0;text-align:left;padding:14px 21px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table tfoot .id,.ccf-main-modal .ccf-existing-form-pane table thead .id{width:5%}.ccf-main-modal .ccf-existing-form-pane table tfoot .title,.ccf-main-modal .ccf-existing-form-pane table thead .title{width:30%}.ccf-main-modal .ccf-existing-form-pane table tfoot .author,.ccf-main-modal .ccf-existing-form-pane table tfoot .entries,.ccf-main-modal .ccf-existing-form-pane table tfoot .submissions,.ccf-main-modal .ccf-existing-form-pane table thead .author,.ccf-main-modal .ccf-existing-form-pane table thead .entries,.ccf-main-modal .ccf-existing-form-pane table thead .submissions{width:10%}.ccf-main-modal .ccf-existing-form-pane table tfoot .number-of-fields,.ccf-main-modal .ccf-existing-form-pane table thead .number-of-fields{width:15%}.ccf-main-modal .ccf-existing-form-pane table tfoot .date,.ccf-main-modal .ccf-existing-form-pane table thead .date{width:20%}.ccf-main-modal .ccf-existing-form-pane table tbody tr:nth-child(odd){background-color:#fafafa;margin:0}.ccf-main-modal .ccf-existing-form-pane table tbody tr{background-color:#fff}.ccf-main-modal .ccf-existing-form-pane table tbody td{vertical-align:top}.ccf-main-modal .ccf-existing-form-pane table tbody td a{text-decoration:none;cursor:pointer}.ccf-main-modal .ccf-existing-form-pane table tbody td .title{font-weight:700;font-size:14px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions{visibility:hidden;margin-top:6px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions .delete{color:red}.ccf-main-modal .ccf-existing-form-pane table tbody tr:hover td .actions{visibility:visible}.ccf-main-modal-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:159900;opacity:.7;-ms-filter:"alpha(Opacity=70)";filter:alpha(opacity=70);-moz-opacity:.7;-khtml-opacity:.7;background-color:#000}.ccf-pagination{font-size:12px;margin-top:8px;text-align:right}.ccf-pagination .pages{padding:0 4px}.ccf-pagination .num-items{font-style:italic;padding-right:4px}.ccf-pagination a{cursor:pointer;color:#0074a2;background:#f0f0f0;text-decoration:none}.ccf-pagination a.first,.ccf-pagination a.last,.ccf-pagination a.next,.ccf-pagination a.prev{font-size:16px;line-height:22px;padding:0 7px 2px}.ccf-pagination a.first:hover,.ccf-pagination a.last:hover,.ccf-pagination a.next:hover,.ccf-pagination a.prev:hover{color:#fff;background-color:#2ea2cc}.ccf-pagination a.disabled{color:#aaa}.ccf-pagination a.disabled:hover{color:#aaa;background:#f0f0f0}
|
build/js/form-cpt-preview.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(e,t){"use strict";wp.ccf.preview=function(t,i){var l=this;l.id=parseInt(t),l.form=null;var s=l.fetch();e.when(s).done(function(){null===l.form?l.form=wp.ccf.forms.findWhere({ID:l.id}):(wp.ccf.forms.add(l.form),delete wp.ccf.forms.formsFetching[l.id]),l.renderPreviews.call(l),i.innerHTML=l.template({form:l.form.toJSON()})}),wp.ccf.dispatcher.on("saveFormComplete",function(){l.renderPreviews(),i.innerHTML=l.template({form:l.form.toJSON()})})},wp.ccf.preview.prototype={template:wp.ccf.utils.template(
|
1 |
+
(function(e,t){"use strict";wp.ccf.preview=function(t,i){var l=this;l.id=parseInt(t),l.form=null;var s=l.fetch();e.when(s).done(function(){null===l.form?l.form=wp.ccf.forms.findWhere({ID:l.id}):(wp.ccf.forms.add(l.form),delete wp.ccf.forms.formsFetching[l.id]),l.renderPreviews.call(l),i.innerHTML=l.template({form:l.form.toJSON()})}),wp.ccf.dispatcher.on("saveFormComplete",function(){l.renderPreviews(),i.innerHTML=l.template({form:l.form.toJSON()})})},wp.ccf.preview.prototype={template:wp.ccf.utils.template("ccf-form-mce-preview"),fetch:function(){var e=this,t=wp.ccf.forms.findWhere({ID:e.id});if(!t){var i;return wp.ccf.forms.formsFetching[e.id]!==void 0?i=wp.ccf.forms.formsFetching[e.id]:(e.form=new wp.ccf.models.Form({ID:e.id}),i=e.form.fetch(),wp.ccf.forms.formsFetching[e.id]=i),i}return!0},renderPreviews:function(){var e=this,t=e.form.get("fields");t.each(function(e){var t=document.getElementById("ccf-"+e.get("type")+"-preview-template");if(t){var i=wp.ccf.utils.template("ccf-"+e.get("type")+"-preview-template")({field:e.toJSON(),mce:!0});e.set("preview",i)}})}};var i=document.querySelectorAll(".ccf-form-cpt-preview");t.each(i,function(e){var t=parseInt(e.getAttribute("data-form-id"));new wp.ccf.preview(t,e)})})(jQuery,_);
|
build/js/form-manager.js
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
delete object.modified_tz;
|
15 |
};
|
16 |
|
17 |
-
wp.ccf.utils.template = function
|
18 |
// Use WordPress style Backbone template syntax
|
19 |
var options = {
|
20 |
evaluate: /<#([\s\S]+?)#>/g,
|
@@ -22,8 +22,8 @@
|
|
22 |
escape: /\{\{([^\}]+?)\}\}(?!\})/g
|
23 |
};
|
24 |
|
25 |
-
return _.template(
|
26 |
-
};
|
27 |
|
28 |
wp.ccf.utils.insertFormShortcode = function( form ) {
|
29 |
var existingForm = wp.ccf.forms.findWhere( { ID: form.get( 'ID' ) } );
|
@@ -74,6 +74,14 @@
|
|
74 |
return false;
|
75 |
};
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
wp.ccf.utils.isFieldAddress = function( value ) {
|
78 |
if ( typeof value.street !== 'undefined' && typeof value.city !== 'undefined' && typeof value.zipcode !== 'undefined' && typeof value.line_two !== 'undefined' ) {
|
79 |
return true;
|
@@ -82,6 +90,18 @@
|
|
82 |
return false;
|
83 |
};
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
wp.ccf.utils.getPrettyFieldDate = function( value ) {
|
86 |
var dateString = '',
|
87 |
output = '';
|
@@ -532,7 +552,8 @@
|
|
532 |
{
|
533 |
defaults: function() {
|
534 |
var defaults = {
|
535 |
-
type: 'website'
|
|
|
536 |
};
|
537 |
|
538 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
@@ -818,7 +839,7 @@
|
|
818 |
|
819 |
wp.ccf.views.FieldChoice = Backbone.View.extend(
|
820 |
{
|
821 |
-
template: wp.ccf.utils.template(
|
822 |
className: 'choice',
|
823 |
|
824 |
events: {
|
@@ -960,7 +981,7 @@
|
|
960 |
|
961 |
wp.ccf.views.Fields['single-line-text'] = wp.ccf.views.Fields['single-line-text'] || wp.ccf.views.FieldBase.extend(
|
962 |
{
|
963 |
-
template: wp.ccf.utils.template(
|
964 |
|
965 |
initialize: function() {
|
966 |
|
@@ -982,7 +1003,7 @@
|
|
982 |
|
983 |
wp.ccf.views.Fields.recaptcha = wp.ccf.views.Fields.recaptcha || wp.ccf.views.FieldBase.extend(
|
984 |
{
|
985 |
-
template: wp.ccf.utils.template(
|
986 |
|
987 |
initialize: function() {
|
988 |
|
@@ -1001,7 +1022,7 @@
|
|
1001 |
|
1002 |
wp.ccf.views.Fields['section-header'] = wp.ccf.views.Fields['section-header'] || wp.ccf.views.FieldBase.extend(
|
1003 |
{
|
1004 |
-
template: wp.ccf.utils.template(
|
1005 |
|
1006 |
initialize: function() {
|
1007 |
|
@@ -1019,7 +1040,7 @@
|
|
1019 |
|
1020 |
wp.ccf.views.Fields.html = wp.ccf.views.Fields.html || wp.ccf.views.FieldBase.extend(
|
1021 |
{
|
1022 |
-
template: wp.ccf.utils.template(
|
1023 |
|
1024 |
initialize: function() {
|
1025 |
|
@@ -1036,7 +1057,7 @@
|
|
1036 |
|
1037 |
wp.ccf.views.Fields['paragraph-text'] = wp.ccf.views.Fields['paragraph-text'] || wp.ccf.views.FieldBase.extend(
|
1038 |
{
|
1039 |
-
template: wp.ccf.utils.template(
|
1040 |
|
1041 |
saveField: function() {
|
1042 |
|
@@ -1054,7 +1075,7 @@
|
|
1054 |
|
1055 |
wp.ccf.views.Fields.hidden = wp.ccf.views.Fields.hidden || wp.ccf.views.FieldBase.extend(
|
1056 |
{
|
1057 |
-
template: wp.ccf.utils.template(
|
1058 |
|
1059 |
saveField: function() {
|
1060 |
|
@@ -1069,7 +1090,7 @@
|
|
1069 |
|
1070 |
wp.ccf.views.Fields.date = wp.ccf.views.Fields.date || wp.ccf.views.FieldBase.extend(
|
1071 |
{
|
1072 |
-
template: wp.ccf.utils.template(
|
1073 |
|
1074 |
saveField: function() {
|
1075 |
|
@@ -1101,7 +1122,7 @@
|
|
1101 |
|
1102 |
wp.ccf.views.Fields.name = wp.ccf.views.Fields.name || wp.ccf.views.FieldBase.extend(
|
1103 |
{
|
1104 |
-
template: wp.ccf.utils.template(
|
1105 |
|
1106 |
saveField: function() {
|
1107 |
|
@@ -1117,7 +1138,7 @@
|
|
1117 |
|
1118 |
wp.ccf.views.Fields.website = wp.ccf.views.Fields.website || wp.ccf.views.FieldBase.extend(
|
1119 |
{
|
1120 |
-
template: wp.ccf.utils.template(
|
1121 |
|
1122 |
saveField: function() {
|
1123 |
|
@@ -1135,7 +1156,7 @@
|
|
1135 |
|
1136 |
wp.ccf.views.Fields.phone = wp.ccf.views.Fields.phone || wp.ccf.views.FieldBase.extend(
|
1137 |
{
|
1138 |
-
template: wp.ccf.utils.template(
|
1139 |
|
1140 |
saveField: function() {
|
1141 |
|
@@ -1154,7 +1175,7 @@
|
|
1154 |
|
1155 |
wp.ccf.views.Fields.address = wp.ccf.views.Fields.address || wp.ccf.views.FieldBase.extend(
|
1156 |
{
|
1157 |
-
template: wp.ccf.utils.template(
|
1158 |
|
1159 |
saveField: function() {
|
1160 |
|
@@ -1171,7 +1192,7 @@
|
|
1171 |
|
1172 |
wp.ccf.views.Fields.email = wp.ccf.views.Fields.email || wp.ccf.views.FieldBase.extend(
|
1173 |
{
|
1174 |
-
template: wp.ccf.utils.template(
|
1175 |
|
1176 |
saveField: function() {
|
1177 |
|
@@ -1207,7 +1228,7 @@
|
|
1207 |
|
1208 |
wp.ccf.views.ChoiceableField = wp.ccf.views.ChoiceableField || wp.ccf.views.FieldBase.extend(
|
1209 |
{
|
1210 |
-
template: wp.ccf.utils.template(
|
1211 |
|
1212 |
initialize: function() {
|
1213 |
var choices = this.model.get( 'choices' );
|
@@ -1278,7 +1299,7 @@
|
|
1278 |
|
1279 |
wp.ccf.views.Fields.dropdown = wp.ccf.views.Fields.dropdown || wp.ccf.views.ChoiceableField.extend(
|
1280 |
{
|
1281 |
-
template: wp.ccf.utils.template(
|
1282 |
events: function() {
|
1283 |
return this.constructor.__super__.events;
|
1284 |
}
|
@@ -1287,7 +1308,7 @@
|
|
1287 |
|
1288 |
wp.ccf.views.Fields.radio = wp.ccf.views.Fields.radio || wp.ccf.views.ChoiceableField.extend(
|
1289 |
{
|
1290 |
-
template: wp.ccf.utils.template(
|
1291 |
events: function() {
|
1292 |
return this.constructor.__super__.events;
|
1293 |
}
|
@@ -1296,7 +1317,7 @@
|
|
1296 |
|
1297 |
wp.ccf.views.Fields.checkboxes = wp.ccf.views.Fields.checkboxes || wp.ccf.views.ChoiceableField.extend(
|
1298 |
{
|
1299 |
-
template: wp.ccf.utils.template(
|
1300 |
events: function() {
|
1301 |
return this.constructor.__super__.events;
|
1302 |
}
|
@@ -1342,7 +1363,7 @@
|
|
1342 |
var context = {};
|
1343 |
|
1344 |
if ( ! field ) {
|
1345 |
-
var template = wp.ccf.utils.template(
|
1346 |
this.el.innerHTML = template( context );
|
1347 |
} else {
|
1348 |
var type = field.get( 'type' );
|
@@ -1377,7 +1398,7 @@
|
|
1377 |
|
1378 |
wp.ccf.views.FieldRowPlaceholder = wp.ccf.views.FieldRowPlaceholder || Backbone.View.extend(
|
1379 |
{
|
1380 |
-
template: wp.ccf.utils.template(
|
1381 |
tagName: 'div',
|
1382 |
className: 'field',
|
1383 |
|
@@ -1398,7 +1419,7 @@
|
|
1398 |
|
1399 |
wp.ccf.views.FieldRow = wp.ccf.views.FieldRow || Backbone.View.extend(
|
1400 |
{
|
1401 |
-
template: wp.ccf.utils.template(
|
1402 |
tagName: 'div',
|
1403 |
className: 'field',
|
1404 |
|
@@ -1482,7 +1503,7 @@
|
|
1482 |
if ( previewTemplate ) {
|
1483 |
var preview = this.el.querySelectorAll( '.preview' )[0];
|
1484 |
preview.style.display = 'block';
|
1485 |
-
preview.innerHTML = wp.ccf.utils.template(
|
1486 |
}
|
1487 |
|
1488 |
return this;
|
@@ -1492,7 +1513,7 @@
|
|
1492 |
|
1493 |
wp.ccf.views.FormSettings = wp.ccf.views.FormSettings || Backbone.View.extend(
|
1494 |
{
|
1495 |
-
template: wp.ccf.utils.template(
|
1496 |
|
1497 |
events: {
|
1498 |
'blur input': 'save',
|
@@ -1575,7 +1596,7 @@
|
|
1575 |
|
1576 |
wp.ccf.views.FormNotifications = wp.ccf.views.FormNotifications || Backbone.View.extend(
|
1577 |
{
|
1578 |
-
template: wp.ccf.utils.template(
|
1579 |
|
1580 |
events: {
|
1581 |
'blur input': 'save',
|
@@ -1589,8 +1610,46 @@
|
|
1589 |
},
|
1590 |
|
1591 |
destroy: function() {
|
1592 |
-
wp.ccf.dispatcher.off( '
|
1593 |
wp.ccf.dispatcher.off( 'mainViewChange', this.save );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1594 |
},
|
1595 |
|
1596 |
toggleNotificationFields: function() {
|
@@ -1607,8 +1666,8 @@
|
|
1607 |
var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0];
|
1608 |
|
1609 |
if ( parseInt( sendEmailNotifications ) ) {
|
1610 |
-
for ( i = 0; i < emailNotificationSettings; i++ ) {
|
1611 |
-
|
1612 |
}
|
1613 |
|
1614 |
emailNotificationFromAddress.style.display = 'none';
|
@@ -1620,8 +1679,8 @@
|
|
1620 |
emailNotificationFromField.style.display = 'block';
|
1621 |
}
|
1622 |
} else {
|
1623 |
-
for ( i = 0; i < emailNotificationSettings; i++ ) {
|
1624 |
-
|
1625 |
}
|
1626 |
|
1627 |
emailNotificationFromAddress.style.display = 'none';
|
@@ -1658,28 +1717,21 @@
|
|
1658 |
},
|
1659 |
|
1660 |
render: function() {
|
1661 |
-
var emailFields = [],
|
1662 |
-
fields = this.model.get( 'fields' );
|
1663 |
-
|
1664 |
-
fields.each( function( field ) {
|
1665 |
-
if ( 'email' === field.get( 'type' ) ) {
|
1666 |
-
emailFields.push( field );
|
1667 |
-
}
|
1668 |
-
});
|
1669 |
-
|
1670 |
var context = {
|
1671 |
-
form: this.model.toJSON()
|
1672 |
-
emailFields: emailFields
|
1673 |
};
|
1674 |
|
|
|
|
|
1675 |
this.el.innerHTML = this.template( context );
|
1676 |
|
1677 |
this.toggleNotificationFields();
|
|
|
1678 |
|
1679 |
wp.ccf.dispatcher.on( 'saveFormNotifications', this.save, this );
|
1680 |
wp.ccf.dispatcher.on( 'mainViewChange', this.save, this );
|
1681 |
-
this.listenTo( fields, 'add', this.
|
1682 |
-
this.listenTo( fields, 'remove', this.
|
1683 |
|
1684 |
return this;
|
1685 |
}
|
@@ -1688,7 +1740,7 @@
|
|
1688 |
|
1689 |
wp.ccf.views.FormPane = wp.ccf.views.FormPane || Backbone.View.extend( _.defaults(
|
1690 |
{
|
1691 |
-
template: wp.ccf.utils.template(
|
1692 |
subViews: {
|
1693 |
'field-sidebar': wp.ccf.views.FieldSidebar,
|
1694 |
'form-settings': wp.ccf.views.FormSettings,
|
@@ -1942,7 +1994,7 @@
|
|
1942 |
wp.ccf.views.ExistingFormTableRow = wp.ccf.views.ExistingFormTableRow || Backbone.View.extend(
|
1943 |
{
|
1944 |
tagName: 'tr',
|
1945 |
-
template: wp.ccf.utils.template(
|
1946 |
events: {
|
1947 |
'click .edit': 'triggerMainViewChange',
|
1948 |
'click .delete': 'triggerDelete',
|
@@ -1991,7 +2043,7 @@
|
|
1991 |
wp.ccf.views.EmptyFormTableRow = wp.ccf.views.EmptyFormTableRow || Backbone.View.extend(
|
1992 |
{
|
1993 |
tagName: 'tr',
|
1994 |
-
template: wp.ccf.utils.template(
|
1995 |
|
1996 |
render: function() {
|
1997 |
this.$el.html( this.template() );
|
@@ -2002,7 +2054,7 @@
|
|
2002 |
|
2003 |
wp.ccf.views.ExistingFormTable = wp.ccf.views.ExistingFormTable || Backbone.View.extend(
|
2004 |
{
|
2005 |
-
template: wp.ccf.utils.template(
|
2006 |
|
2007 |
initialize: function() {
|
2008 |
this.parent = arguments.parent;
|
@@ -2067,7 +2119,7 @@
|
|
2067 |
|
2068 |
wp.ccf.views.ExistingFormPane = wp.ccf.views.ExistingFormPane || Backbone.View.extend( _.defaults(
|
2069 |
{
|
2070 |
-
template: wp.ccf.utils.template(
|
2071 |
subViews: {
|
2072 |
'existing-form-table': wp.ccf.views.ExistingFormTable
|
2073 |
},
|
@@ -2092,7 +2144,7 @@
|
|
2092 |
{
|
2093 |
tagName: 'div',
|
2094 |
className: 'ccf-main-modal',
|
2095 |
-
template: wp.ccf.utils.template(
|
2096 |
events: {
|
2097 |
'click .close-icon': 'hide',
|
2098 |
'click .main-menu a': 'menuClick'
|
@@ -2188,7 +2240,7 @@
|
|
2188 |
wp.ccf.views.SubmissionRow = wp.ccf.views.SubmissionRow || Backbone.View.extend(
|
2189 |
{
|
2190 |
tagName: 'tr',
|
2191 |
-
template: wp.ccf.utils.template(
|
2192 |
events: {
|
2193 |
'click .view': 'view',
|
2194 |
'click .delete': 'delete'
|
@@ -2234,9 +2286,11 @@
|
|
2234 |
isFieldDate: wp.ccf.utils.isFieldDate,
|
2235 |
isFieldName: wp.ccf.utils.isFieldName,
|
2236 |
isFieldAddress: wp.ccf.utils.isFieldAddress,
|
|
|
2237 |
getPrettyFieldDate: wp.ccf.utils.getPrettyFieldDate,
|
2238 |
getPrettyFieldAddress: wp.ccf.utils.getPrettyFieldAddress,
|
2239 |
-
getPrettyFieldName: wp.ccf.utils.getPrettyFieldName
|
|
|
2240 |
}
|
2241 |
} ) );
|
2242 |
|
@@ -2248,7 +2302,7 @@
|
|
2248 |
|
2249 |
wp.ccf.views.SubmissionsTable = wp.ccf.views.SubmissionsTable || Backbone.View.extend(
|
2250 |
{
|
2251 |
-
template: wp.ccf.utils.template(
|
2252 |
events: {
|
2253 |
'click .prev:not(.disabled)': 'previousPage',
|
2254 |
'click .next:not(.disabled)': 'nextPage',
|
@@ -2324,7 +2378,7 @@
|
|
2324 |
|
2325 |
wp.ccf.views.Pagination = wp.ccf.views.Pagination || Backbone.View.extend(
|
2326 |
{
|
2327 |
-
template: wp.ccf.utils.template(
|
2328 |
|
2329 |
events: {
|
2330 |
'click .prev:not(.disabled)': 'previousPage',
|
@@ -2380,7 +2434,7 @@
|
|
2380 |
wp.ccf.views.EmptySubmissionTableRow = wp.ccf.views.EmptySubmissionTableRow || Backbone.View.extend(
|
2381 |
{
|
2382 |
tagName: 'tr',
|
2383 |
-
template: wp.ccf.utils.template(
|
2384 |
|
2385 |
initialize: function( options ) {
|
2386 |
this.parent = options.parent;
|
@@ -2395,7 +2449,7 @@
|
|
2395 |
|
2396 |
wp.ccf.views.SubmissionColumnController = wp.ccf.views.SubmissionColumnController || Backbone.View.extend(
|
2397 |
{
|
2398 |
-
template: wp.ccf.utils.template(
|
2399 |
|
2400 |
events: {
|
2401 |
'click input[type=checkbox]': 'triggerTableRebuild'
|
14 |
delete object.modified_tz;
|
15 |
};
|
16 |
|
17 |
+
wp.ccf.utils.template = _.memoize( function( id ) {
|
18 |
// Use WordPress style Backbone template syntax
|
19 |
var options = {
|
20 |
evaluate: /<#([\s\S]+?)#>/g,
|
22 |
escape: /\{\{([^\}]+?)\}\}(?!\})/g
|
23 |
};
|
24 |
|
25 |
+
return _.template( document.getElementById( id ).innerHTML, null, options );
|
26 |
+
});
|
27 |
|
28 |
wp.ccf.utils.insertFormShortcode = function( form ) {
|
29 |
var existingForm = wp.ccf.forms.findWhere( { ID: form.get( 'ID' ) } );
|
74 |
return false;
|
75 |
};
|
76 |
|
77 |
+
wp.ccf.utils.isFieldEmailConfirm = function( value ) {
|
78 |
+
if ( typeof value.email !== 'undefined' || typeof value.confirm !== 'undefined' ) {
|
79 |
+
return true;
|
80 |
+
}
|
81 |
+
|
82 |
+
return false;
|
83 |
+
};
|
84 |
+
|
85 |
wp.ccf.utils.isFieldAddress = function( value ) {
|
86 |
if ( typeof value.street !== 'undefined' && typeof value.city !== 'undefined' && typeof value.zipcode !== 'undefined' && typeof value.line_two !== 'undefined' ) {
|
87 |
return true;
|
90 |
return false;
|
91 |
};
|
92 |
|
93 |
+
wp.ccf.utils.getPrettyFieldEmailConfirm = function( value ) {
|
94 |
+
if ( value.email ) {
|
95 |
+
return value.email;
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( value.confirm ) {
|
99 |
+
return value.confirm;
|
100 |
+
}
|
101 |
+
|
102 |
+
return '-';
|
103 |
+
};
|
104 |
+
|
105 |
wp.ccf.utils.getPrettyFieldDate = function( value ) {
|
106 |
var dateString = '',
|
107 |
output = '';
|
552 |
{
|
553 |
defaults: function() {
|
554 |
var defaults = {
|
555 |
+
type: 'website',
|
556 |
+
placeholder: 'http://'
|
557 |
};
|
558 |
|
559 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
839 |
|
840 |
wp.ccf.views.FieldChoice = Backbone.View.extend(
|
841 |
{
|
842 |
+
template: wp.ccf.utils.template( 'ccf-field-choice-template' ),
|
843 |
className: 'choice',
|
844 |
|
845 |
events: {
|
981 |
|
982 |
wp.ccf.views.Fields['single-line-text'] = wp.ccf.views.Fields['single-line-text'] || wp.ccf.views.FieldBase.extend(
|
983 |
{
|
984 |
+
template: wp.ccf.utils.template( 'ccf-single-line-text-template' ),
|
985 |
|
986 |
initialize: function() {
|
987 |
|
1003 |
|
1004 |
wp.ccf.views.Fields.recaptcha = wp.ccf.views.Fields.recaptcha || wp.ccf.views.FieldBase.extend(
|
1005 |
{
|
1006 |
+
template: wp.ccf.utils.template( 'ccf-recaptcha-template' ),
|
1007 |
|
1008 |
initialize: function() {
|
1009 |
|
1022 |
|
1023 |
wp.ccf.views.Fields['section-header'] = wp.ccf.views.Fields['section-header'] || wp.ccf.views.FieldBase.extend(
|
1024 |
{
|
1025 |
+
template: wp.ccf.utils.template( 'ccf-section-header-template' ),
|
1026 |
|
1027 |
initialize: function() {
|
1028 |
|
1040 |
|
1041 |
wp.ccf.views.Fields.html = wp.ccf.views.Fields.html || wp.ccf.views.FieldBase.extend(
|
1042 |
{
|
1043 |
+
template: wp.ccf.utils.template( 'ccf-html-template' ),
|
1044 |
|
1045 |
initialize: function() {
|
1046 |
|
1057 |
|
1058 |
wp.ccf.views.Fields['paragraph-text'] = wp.ccf.views.Fields['paragraph-text'] || wp.ccf.views.FieldBase.extend(
|
1059 |
{
|
1060 |
+
template: wp.ccf.utils.template( 'ccf-paragraph-text-template' ),
|
1061 |
|
1062 |
saveField: function() {
|
1063 |
|
1075 |
|
1076 |
wp.ccf.views.Fields.hidden = wp.ccf.views.Fields.hidden || wp.ccf.views.FieldBase.extend(
|
1077 |
{
|
1078 |
+
template: wp.ccf.utils.template( 'ccf-hidden-template' ),
|
1079 |
|
1080 |
saveField: function() {
|
1081 |
|
1090 |
|
1091 |
wp.ccf.views.Fields.date = wp.ccf.views.Fields.date || wp.ccf.views.FieldBase.extend(
|
1092 |
{
|
1093 |
+
template: wp.ccf.utils.template( 'ccf-date-template' ),
|
1094 |
|
1095 |
saveField: function() {
|
1096 |
|
1122 |
|
1123 |
wp.ccf.views.Fields.name = wp.ccf.views.Fields.name || wp.ccf.views.FieldBase.extend(
|
1124 |
{
|
1125 |
+
template: wp.ccf.utils.template( 'ccf-name-template' ),
|
1126 |
|
1127 |
saveField: function() {
|
1128 |
|
1138 |
|
1139 |
wp.ccf.views.Fields.website = wp.ccf.views.Fields.website || wp.ccf.views.FieldBase.extend(
|
1140 |
{
|
1141 |
+
template: wp.ccf.utils.template( 'ccf-website-template' ),
|
1142 |
|
1143 |
saveField: function() {
|
1144 |
|
1156 |
|
1157 |
wp.ccf.views.Fields.phone = wp.ccf.views.Fields.phone || wp.ccf.views.FieldBase.extend(
|
1158 |
{
|
1159 |
+
template: wp.ccf.utils.template( 'ccf-phone-template' ),
|
1160 |
|
1161 |
saveField: function() {
|
1162 |
|
1175 |
|
1176 |
wp.ccf.views.Fields.address = wp.ccf.views.Fields.address || wp.ccf.views.FieldBase.extend(
|
1177 |
{
|
1178 |
+
template: wp.ccf.utils.template( 'ccf-address-template' ),
|
1179 |
|
1180 |
saveField: function() {
|
1181 |
|
1192 |
|
1193 |
wp.ccf.views.Fields.email = wp.ccf.views.Fields.email || wp.ccf.views.FieldBase.extend(
|
1194 |
{
|
1195 |
+
template: wp.ccf.utils.template( 'ccf-email-template' ),
|
1196 |
|
1197 |
saveField: function() {
|
1198 |
|
1228 |
|
1229 |
wp.ccf.views.ChoiceableField = wp.ccf.views.ChoiceableField || wp.ccf.views.FieldBase.extend(
|
1230 |
{
|
1231 |
+
template: wp.ccf.utils.template( 'ccf-dropdown-template' ),
|
1232 |
|
1233 |
initialize: function() {
|
1234 |
var choices = this.model.get( 'choices' );
|
1299 |
|
1300 |
wp.ccf.views.Fields.dropdown = wp.ccf.views.Fields.dropdown || wp.ccf.views.ChoiceableField.extend(
|
1301 |
{
|
1302 |
+
template: wp.ccf.utils.template( 'ccf-dropdown-template' ),
|
1303 |
events: function() {
|
1304 |
return this.constructor.__super__.events;
|
1305 |
}
|
1308 |
|
1309 |
wp.ccf.views.Fields.radio = wp.ccf.views.Fields.radio || wp.ccf.views.ChoiceableField.extend(
|
1310 |
{
|
1311 |
+
template: wp.ccf.utils.template( 'ccf-radio-template' ),
|
1312 |
events: function() {
|
1313 |
return this.constructor.__super__.events;
|
1314 |
}
|
1317 |
|
1318 |
wp.ccf.views.Fields.checkboxes = wp.ccf.views.Fields.checkboxes || wp.ccf.views.ChoiceableField.extend(
|
1319 |
{
|
1320 |
+
template: wp.ccf.utils.template( 'ccf-checkboxes-template' ),
|
1321 |
events: function() {
|
1322 |
return this.constructor.__super__.events;
|
1323 |
}
|
1363 |
var context = {};
|
1364 |
|
1365 |
if ( ! field ) {
|
1366 |
+
var template = wp.ccf.utils.template( 'ccf-empty-field-template' );
|
1367 |
this.el.innerHTML = template( context );
|
1368 |
} else {
|
1369 |
var type = field.get( 'type' );
|
1398 |
|
1399 |
wp.ccf.views.FieldRowPlaceholder = wp.ccf.views.FieldRowPlaceholder || Backbone.View.extend(
|
1400 |
{
|
1401 |
+
template: wp.ccf.utils.template( 'ccf-field-row-template'),
|
1402 |
tagName: 'div',
|
1403 |
className: 'field',
|
1404 |
|
1419 |
|
1420 |
wp.ccf.views.FieldRow = wp.ccf.views.FieldRow || Backbone.View.extend(
|
1421 |
{
|
1422 |
+
template: wp.ccf.utils.template( 'ccf-field-row-template'),
|
1423 |
tagName: 'div',
|
1424 |
className: 'field',
|
1425 |
|
1503 |
if ( previewTemplate ) {
|
1504 |
var preview = this.el.querySelectorAll( '.preview' )[0];
|
1505 |
preview.style.display = 'block';
|
1506 |
+
preview.innerHTML = wp.ccf.utils.template( 'ccf-' + this.model.get( 'type' ) + '-preview-template' )( { field: this.model.toJSON() } );
|
1507 |
}
|
1508 |
|
1509 |
return this;
|
1513 |
|
1514 |
wp.ccf.views.FormSettings = wp.ccf.views.FormSettings || Backbone.View.extend(
|
1515 |
{
|
1516 |
+
template: wp.ccf.utils.template( 'ccf-form-settings-template' ),
|
1517 |
|
1518 |
events: {
|
1519 |
'blur input': 'save',
|
1596 |
|
1597 |
wp.ccf.views.FormNotifications = wp.ccf.views.FormNotifications || Backbone.View.extend(
|
1598 |
{
|
1599 |
+
template: wp.ccf.utils.template( 'ccf-form-notifications-template' ),
|
1600 |
|
1601 |
events: {
|
1602 |
'blur input': 'save',
|
1610 |
},
|
1611 |
|
1612 |
destroy: function() {
|
1613 |
+
wp.ccf.dispatcher.off( 'saveFormNotifications', this.save );
|
1614 |
wp.ccf.dispatcher.off( 'mainViewChange', this.save );
|
1615 |
+
this.undelegateEvents();
|
1616 |
+
this.unbind();
|
1617 |
+
},
|
1618 |
+
|
1619 |
+
updateFromAddressFieldField: function() {
|
1620 |
+
var emailNotificationFromField = this.el.querySelectorAll( '.form-email-notification-from-field' )[0];
|
1621 |
+
emailNotificationFromField.innerHTML = '';
|
1622 |
+
emailNotificationFromField.disabled = false;
|
1623 |
+
|
1624 |
+
var fields = this.model.get( 'fields'),
|
1625 |
+
fieldsAdded = 0;
|
1626 |
+
|
1627 |
+
var currentField = this.model.get( 'emailNotificationFromField' );
|
1628 |
+
|
1629 |
+
if ( fields.length >= 1 ) {
|
1630 |
+
fields.each( function( field ) {
|
1631 |
+
if ( 'email' === field.get( 'type' ) ) {
|
1632 |
+
var option = document.createElement( 'option' );
|
1633 |
+
option.innerHTML = field.get( 'slug' );
|
1634 |
+
option.value = field.get( 'slug' );
|
1635 |
+
|
1636 |
+
if ( field.get( 'slug' ) === currentField ) {
|
1637 |
+
option.selected = true;
|
1638 |
+
}
|
1639 |
+
|
1640 |
+
emailNotificationFromField.appendChild( option );
|
1641 |
+
|
1642 |
+
fieldsAdded++;
|
1643 |
+
}
|
1644 |
+
});
|
1645 |
+
}
|
1646 |
+
|
1647 |
+
if ( 0 === fieldsAdded ) {
|
1648 |
+
var option = document.createElement( 'option' );
|
1649 |
+
option.innerHTML = ccfSettings.noEmailFields;
|
1650 |
+
emailNotificationFromField.appendChild( option );
|
1651 |
+
emailNotificationFromField.disabled = true;
|
1652 |
+
}
|
1653 |
},
|
1654 |
|
1655 |
toggleNotificationFields: function() {
|
1666 |
var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0];
|
1667 |
|
1668 |
if ( parseInt( sendEmailNotifications ) ) {
|
1669 |
+
for ( i = 0; i < emailNotificationSettings.length; i++ ) {
|
1670 |
+
emailNotificationSettings[i].style.display = 'block';
|
1671 |
}
|
1672 |
|
1673 |
emailNotificationFromAddress.style.display = 'none';
|
1679 |
emailNotificationFromField.style.display = 'block';
|
1680 |
}
|
1681 |
} else {
|
1682 |
+
for ( i = 0; i < emailNotificationSettings.length; i++ ) {
|
1683 |
+
emailNotificationSettings[i].style.display = 'none';
|
1684 |
}
|
1685 |
|
1686 |
emailNotificationFromAddress.style.display = 'none';
|
1717 |
},
|
1718 |
|
1719 |
render: function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1720 |
var context = {
|
1721 |
+
form: this.model.toJSON()
|
|
|
1722 |
};
|
1723 |
|
1724 |
+
var fields = this.model.get( 'fields' );
|
1725 |
+
|
1726 |
this.el.innerHTML = this.template( context );
|
1727 |
|
1728 |
this.toggleNotificationFields();
|
1729 |
+
this.updateFromAddressFieldField();
|
1730 |
|
1731 |
wp.ccf.dispatcher.on( 'saveFormNotifications', this.save, this );
|
1732 |
wp.ccf.dispatcher.on( 'mainViewChange', this.save, this );
|
1733 |
+
this.listenTo( fields, 'add', this.updateFromAddressFieldField, this );
|
1734 |
+
this.listenTo( fields, 'remove', this.updateFromAddressFieldField, this );
|
1735 |
|
1736 |
return this;
|
1737 |
}
|
1740 |
|
1741 |
wp.ccf.views.FormPane = wp.ccf.views.FormPane || Backbone.View.extend( _.defaults(
|
1742 |
{
|
1743 |
+
template: wp.ccf.utils.template( 'ccf-form-pane-template' ),
|
1744 |
subViews: {
|
1745 |
'field-sidebar': wp.ccf.views.FieldSidebar,
|
1746 |
'form-settings': wp.ccf.views.FormSettings,
|
1994 |
wp.ccf.views.ExistingFormTableRow = wp.ccf.views.ExistingFormTableRow || Backbone.View.extend(
|
1995 |
{
|
1996 |
tagName: 'tr',
|
1997 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-table-row-template'),
|
1998 |
events: {
|
1999 |
'click .edit': 'triggerMainViewChange',
|
2000 |
'click .delete': 'triggerDelete',
|
2043 |
wp.ccf.views.EmptyFormTableRow = wp.ccf.views.EmptyFormTableRow || Backbone.View.extend(
|
2044 |
{
|
2045 |
tagName: 'tr',
|
2046 |
+
template: wp.ccf.utils.template( 'ccf-empty-form-table-row-template'),
|
2047 |
|
2048 |
render: function() {
|
2049 |
this.$el.html( this.template() );
|
2054 |
|
2055 |
wp.ccf.views.ExistingFormTable = wp.ccf.views.ExistingFormTable || Backbone.View.extend(
|
2056 |
{
|
2057 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-table-template'),
|
2058 |
|
2059 |
initialize: function() {
|
2060 |
this.parent = arguments.parent;
|
2119 |
|
2120 |
wp.ccf.views.ExistingFormPane = wp.ccf.views.ExistingFormPane || Backbone.View.extend( _.defaults(
|
2121 |
{
|
2122 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-pane-template' ),
|
2123 |
subViews: {
|
2124 |
'existing-form-table': wp.ccf.views.ExistingFormTable
|
2125 |
},
|
2144 |
{
|
2145 |
tagName: 'div',
|
2146 |
className: 'ccf-main-modal',
|
2147 |
+
template: wp.ccf.utils.template( 'ccf-main-modal-template' ),
|
2148 |
events: {
|
2149 |
'click .close-icon': 'hide',
|
2150 |
'click .main-menu a': 'menuClick'
|
2240 |
wp.ccf.views.SubmissionRow = wp.ccf.views.SubmissionRow || Backbone.View.extend(
|
2241 |
{
|
2242 |
tagName: 'tr',
|
2243 |
+
template: wp.ccf.utils.template( 'ccf-submission-row-template' ),
|
2244 |
events: {
|
2245 |
'click .view': 'view',
|
2246 |
'click .delete': 'delete'
|
2286 |
isFieldDate: wp.ccf.utils.isFieldDate,
|
2287 |
isFieldName: wp.ccf.utils.isFieldName,
|
2288 |
isFieldAddress: wp.ccf.utils.isFieldAddress,
|
2289 |
+
isFieldEmailConfirm: wp.ccf.utils.isFieldEmailConfirm,
|
2290 |
getPrettyFieldDate: wp.ccf.utils.getPrettyFieldDate,
|
2291 |
getPrettyFieldAddress: wp.ccf.utils.getPrettyFieldAddress,
|
2292 |
+
getPrettyFieldName: wp.ccf.utils.getPrettyFieldName,
|
2293 |
+
getPrettyFieldEmailConfirm: wp.ccf.utils.getPrettyFieldEmailConfirm
|
2294 |
}
|
2295 |
} ) );
|
2296 |
|
2302 |
|
2303 |
wp.ccf.views.SubmissionsTable = wp.ccf.views.SubmissionsTable || Backbone.View.extend(
|
2304 |
{
|
2305 |
+
template: wp.ccf.utils.template( 'ccf-submission-table-template' ),
|
2306 |
events: {
|
2307 |
'click .prev:not(.disabled)': 'previousPage',
|
2308 |
'click .next:not(.disabled)': 'nextPage',
|
2378 |
|
2379 |
wp.ccf.views.Pagination = wp.ccf.views.Pagination || Backbone.View.extend(
|
2380 |
{
|
2381 |
+
template: wp.ccf.utils.template( 'ccf-pagination-template' ),
|
2382 |
|
2383 |
events: {
|
2384 |
'click .prev:not(.disabled)': 'previousPage',
|
2434 |
wp.ccf.views.EmptySubmissionTableRow = wp.ccf.views.EmptySubmissionTableRow || Backbone.View.extend(
|
2435 |
{
|
2436 |
tagName: 'tr',
|
2437 |
+
template: wp.ccf.utils.template( 'ccf-no-submissions-row-template'),
|
2438 |
|
2439 |
initialize: function( options ) {
|
2440 |
this.parent = options.parent;
|
2449 |
|
2450 |
wp.ccf.views.SubmissionColumnController = wp.ccf.views.SubmissionColumnController || Backbone.View.extend(
|
2451 |
{
|
2452 |
+
template: wp.ccf.utils.template( 'ccf-submissions-controller-template'),
|
2453 |
|
2454 |
events: {
|
2455 |
'click input[type=checkbox]': 'triggerTableRebuild'
|
build/js/form-manager.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
(function(e,t,i,l){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.utils=wp.ccf.utils||{},wp.ccf.utils.cleanDateFields=function(e){delete e.date,delete e.date_gmt,delete e.modified,delete e.modified_gmt,delete e.date_tz,delete e.modified_tz},wp.ccf.utils.template=function(e){var t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return i.template(e,null,t)},wp.ccf.utils.insertFormShortcode=function(e){var t=wp.ccf.forms.findWhere({ID:e.get("ID")});t||wp.ccf.forms.add(e);var i=tinymce.get(wpActiveEditor),l='[ccf_form id="'+e.get("ID")+'"]';i&&!i.isHidden()?tinymce.activeEditor.execCommand("mceInsertContent",!1,l):document.getElementById(wpActiveEditor).value+=l},wp.ccf.utils.getPrettyPostDate=function(e){return e=moment(e),e.format("h:mm a M/D/YYYY")},wp.ccf.utils.wordChop=function(e,t){var i=e.substr(0,t);return i.substr(0,Math.min(i.length,i.lastIndexOf(" "))),i.length<e.length&&(i+="..."),i},wp.ccf.utils.isFieldDate=function(e){return e.date!==void 0||e.hour!==void 0&&e.minute!==void 0&&e["am-pm"]!==void 0?!0:!1},wp.ccf.utils.isFieldName=function(e){return e.name!==void 0||e.last!==void 0?!0:!1},wp.ccf.utils.isFieldAddress=function(e){return e.street!==void 0&&e.city!==void 0&&e.zipcode!==void 0&&e.line_two!==void 0?!0:!1},wp.ccf.utils.getPrettyFieldDate=function(e){var t="",i="";if(e.hour&&e.minute&&e["am-pm"]&&(t+=e.hour+":"+e.minute+" "+e["am-pm"]),e.date&&(t+=" "+e.date),!t)return"-";var s=moment(t);return s.isValid()?(e.hour&&e.minute&&e["am-pm"]&&(i+=s.format("h:mm a")),e.date&&(i&&(i+=" "),i+=s.format("M/D/YYYY")),i):l.invalidDate},wp.ccf.utils.getPrettyFieldName=function(e){var t=e.first;return t.length>0&&(t+=" "),e.last&&(t+=e.last),t||(t="-"),t},wp.ccf.utils.getPrettyFieldAddress=function(e){if(!e.street||!e.city)return"-";var t=e.street;return e.line_two&&(t+=" "+e.line_two),t+=", "+e.city,e.state&&(t+=", "+e.state),e.zipcode&&(t+=" "+e.zipcode),e.country&&(t+=" "+e.country),t}})(jQuery,Backbone,_,ccfSettings),function(e,t,i){"use strict";wp.ccf.mixins=wp.ccf.mixins||{},wp.ccf.mixins.subViewable=wp.ccf.mixins.subViewable||{subViews:{},initRenderSubViews:function(e,t,l){this.renderedSubViews||(this.renderedSubViews={});for(var s in this.subViews){var c={el:this.$el.find(".ccf-"+s),parent:this};l&&i.extend(c,l),this.renderedSubViews[s]&&this.renderedSubViews[s].destroy&&this.renderedSubViews[s].destroy(),(t||!this.renderedSubViews[s])&&(this.renderedSubViews[s]=new this.subViews[s](c)),this.renderedSubViews[s].render(),e&&(this.renderedSubViews[s].el.style.display="block")}return this},showView:function(e,t,i){if(this.renderedSubViews!==void 0&&this.renderedSubViews[e]!==void 0){var l=this.renderedSubViews[e];i||l.render(t),l.el.style.display="block",this.currentView=e;for(var s in this.subViews)s!==e&&(this.renderedSubViews[s].el.style.display="none")}}}}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l,s){"use strict";wp.ccf.models=wp.ccf.models||{},wp.ccf.models.Fields=wp.ccf.models.Fields||{};var c=function(e,i,l){return"object"!=typeof i&&""===i&&(i=""),t.Model.prototype.set.call(this,e,i,l)},n=function(e){for(var t in this.attributes)if(-1===e.indexOf(t)){var i=this.get(t);"string"==typeof i&&""!==i&&(i=(i+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/“/g,"”").replace(/”/g,"”").replace(/‘/g,"‘").replace(/'/g,"'"),this.set(t,i))}return this};wp.ccf.models.FieldChoice=wp.ccf.models.FieldChoice||t.Model.extend({defaults:{label:"",value:"",selected:!1},decode:function(){return n.call(this,[])},set:c}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:s.root+"/ccf/forms",set:c,initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",sendEmailNotifications:!1,emailNotificationAddresses:l.adminEmail,emailNotificationFromType:"default",emailNotificationFromAddress:"",emailNotificationFromField:""};return e=i.defaults(e,this.constructor.__super__.defaults),wp.ccf.utils.cleanDateFields(e),e},decode:function(){var e=i.keys(wp.api.models.Post.prototype.defaults);return e=i.without(e,"title"),n.call(this,e)},getFieldSlugs:function(e){var t=wp.ccf.currentForm.get("fields"),i=[];return t.each(function(t){e&&t.isImmutable||i.push(t.get("slug"))}),i},parse:function(e){var t=this;if(e.fields){var l=t.get("fields");if(l&&l.length>0){for(var s=0;e.fields.length>s;s++){var c=e.fields[s],n=l.findWhere({slug:c.slug});if(n){if(c.choices!==void 0){var r=t.get("choices");if(r&&r.length>0)for(var o=0;c.choices>o;o++){var a=r.at(o);a.set(c.choices[o]),a.decode()}delete e.fields[s].choices}n.set(c),n.decode()}}delete e.fields}else{var d=[];i.each(e.fields,function(e){var t=new wp.ccf.models.Fields[e.type](e);t.decode(),d.push(t)}),e.fields=new wp.ccf.collections.Fields(d,{formId:e.ID})}}return this.constructor.__super__.parse.call(this,e)},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.fields&&(e.fields=e.fields.toJSON()),e.author&&(e.author=e.author.toJSON()),e}}),wp.ccf.models.Submission=wp.api.models.Submission||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null,data:{}}}),wp.ccf.models.Field=wp.api.models.Field||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null},set:c,required:function(){return["slug"]},decode:function(){return n.call(this,i.keys(wp.api.models.Post.prototype.defaults))},hasRequiredAttributes:function(){var e=this,t=!0;return i.each(this.required(),function(i){(e.get(i)===void 0||""===e.get(i))&&(t=!1)}),t}}),wp.ccf.models.StandardField=wp.ccf.models.StandardField||wp.ccf.models.Field.extend({idAttribute:"ID",defaults:function(){var e={label:"Field Label",value:"",placeholder:"",slug:"",type:"",required:!1,className:""};return i.defaults(e,this.constructor.__super__.defaults)}}),wp.ccf.models.Fields["single-line-text"]=wp.ccf.models.Fields["single-line-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"single-line-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["paragraph-text"]=wp.ccf.models.Fields["paragraph-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"paragraph-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.hidden=wp.ccf.models.Fields.hidden||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"hidden"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.email=wp.ccf.models.Fields.email||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"email",emailConfirmation:!1};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.website=wp.ccf.models.Fields.website||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"website"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.phone=wp.ccf.models.Fields.phone||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"phone",phoneFormat:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.date=wp.ccf.models.Fields.date||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"date",showDate:!0,showTime:!0};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.name=wp.ccf.models.Fields.name||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"name"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.recaptcha=wp.ccf.models.Fields.recaptcha||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"recaptcha",siteKey:"",secretKey:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return["siteKey","secretKey"]},isImmutable:!0}),wp.ccf.models.Fields.address=wp.ccf.models.Fields.address||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"address",addressType:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["section-header"]=wp.ccf.models.Fields["section-header"]||wp.ccf.models.Field.extend({defaults:function(){var e={type:"section-header",slug:"",heading:"",subheading:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.Fields.html=wp.ccf.models.Fields.html||wp.ccf.models.Field.extend({defaults:function(){var e={type:"html",slug:"",html:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.ChoiceableField=wp.ccf.models.ChoiceableField||wp.ccf.models.StandardField.extend({defaults:function(){var e={choices:new wp.ccf.collections.FieldChoices};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings,WP_API_Settings),function(e,t,i){"use strict";wp.ccf.collections=wp.ccf.collections||{},wp.ccf.collections.Forms=wp.ccf.collections.Forms||wp.api.collections.Posts.extend({model:wp.ccf.models.Form,url:WP_API_Settings.root+"/ccf/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},remove:function(e,t){t=t||{};var l=this.constructor.__super__.remove.call(this,e,t);return t.destroy&&(e instanceof Array?i.each(e,function(e){e.destroy()}):e.destroy()),l}}),wp.ccf.collections.Fields=wp.ccf.collections.Fields||wp.api.collections.Posts.extend({model:wp.ccf.models.Field,url:function(){return WP_API_Settings.root+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return WP_API_Settings.root+"/ccf/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-field-choice-template").innerHTML),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"saveChoice",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},checkSlug:function(){var e=this.el.querySelectorAll(".field-slug");if(e.length>0){var t=e[0],i=!1;t.parentNode.className=t.value&&!t.value.match(/^[a-zA-Z0-9\-_]+$/)?t.parentNode.className.replace(/ field-error/i,"")+" field-error":t.parentNode.className.replace(/ field-error/i,""),this.collection.length>0&&""!==t.value?(this.collection.each(function(e){e!==this.model&&t.value===e.get("slug")&&(i=!0)},this),t.parentNode.className=i?t.parentNode.className.replace(/ field-duplicate-slug/i,"")+" field-duplicate-slug":t.parentNode.className.replace(/ field-duplicate-slug/i,"")):t.parentNode.className=t.parentNode.className.replace(/ field-duplicate-slug/i,"")}},destroy:function(){this.unbind()},render:function(){return this.el.innerHTML=this.template({field:this.model.toJSON()}),this.checkSlug(),this}}),wp.ccf.views.Fields["single-line-text"]=wp.ccf.views.Fields["single-line-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-single-line-text-template").innerHTML),initialize:function(){},saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.recaptcha=wp.ccf.views.Fields.recaptcha||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-recaptcha-template").innerHTML),initialize:function(){},saveField:function(){return this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("siteKey",this.el.querySelectorAll(".field-site-key")[0].value),this.model.set("secretKey",this.el.querySelectorAll(".field-secret-key")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields["section-header"]=wp.ccf.views.Fields["section-header"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-section-header-template").innerHTML),initialize:function(){},saveField:function(){return this.model.set("heading",this.el.querySelectorAll(".field-heading")[0].value),this.model.set("subheading",this.el.querySelectorAll(".field-subheading")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields.html=wp.ccf.views.Fields.html||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-html-template").innerHTML),initialize:function(){},saveField:function(){return this.model.set("html",this.el.querySelectorAll(".field-html")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields["paragraph-text"]=wp.ccf.views.Fields["paragraph-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-paragraph-text-template").innerHTML),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.hidden=wp.ccf.views.Fields.hidden||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-hidden-template").innerHTML),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields.date=wp.ccf.views.Fields.date||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-date-template").innerHTML),saveField:function(){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value);var e=this.el.querySelectorAll(".field-value");e.length>0&&this.model.set("value",e[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("showDate",this.el.querySelectorAll(".field-show-date")[0].checked?!0:!1);var t=this.model.get("showTime"),i=this.el.querySelectorAll(".field-show-time")[0].checked?!0:!1;return this.model.set("showTime",i),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),i!=t&&this.render(),this}}),wp.ccf.views.Fields.name=wp.ccf.views.Fields.name||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-name-template").innerHTML),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.website=wp.ccf.views.Fields.website||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-website-template").innerHTML),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.phone=wp.ccf.views.Fields.phone||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-phone-template").innerHTML),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("phoneFormat",this.el.querySelectorAll(".field-phone-format")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.address=wp.ccf.views.Fields.address||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-address-template").innerHTML),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.email=wp.ccf.views.Fields.email||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-email-template").innerHTML),saveField:function(){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value);var e=this.el.querySelectorAll(".field-value");e.length&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-placeholder");t.length&&this.model.set("placeholder",t[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var i=1==this.el.querySelectorAll(".field-email-confirmation")[0].value?!0:!1,l=this.model.get("emailConfirmation");return this.model.set("emailConfirmation",i),l!=i&&this.render(),this}}),wp.ccf.views.ChoiceableField=wp.ccf.views.ChoiceableField||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template(document.getElementById("ccf-dropdown-template").innerHTML),initialize:function(){var e=this.model.get("choices");this.listenTo(e,"add",this.addChoice)},addChoice:function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:this.model}).render(),i=this.el.querySelectorAll(".repeatable-choices")[0];i.appendChild(t.el)},saveField:function(){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this},render:function(){var t=this;t.el.innerHTML=t.template({field:t.model.toJSON()}),t.checkSlug();var i=t.model.get("choices"),l=this.el.querySelectorAll(".repeatable-choices")[0];if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FieldChoice({model:e,field:t.model}).render();l.appendChild(i.el)});else{var s=new wp.ccf.models.FieldChoice;i.add(s)}return l=this.el.querySelectorAll(".repeatable-choices")[0],e(l).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}}),t}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template(document.getElementById("ccf-dropdown-template").innerHTML),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template(document.getElementById("ccf-radio-template").innerHTML),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template(document.getElementById("ccf-checkboxes-template").innerHTML),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template(document.getElementById("ccf-empty-field-template").innerHTML);this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-field-row-template").innerHTML),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-field-row-template").innerHTML),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template(i.innerHTML)({field:this.model.toJSON()})}return this}}),wp.ccf.views.FormSettings=wp.ccf.views.FormSettings||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-form-settings-template").innerHTML),events:{"blur input":"save","change select":"save","change select.form-completion-action-type":"toggleCompletionFields","change select.form-send-email-notifications":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save)},toggleCompletionFields:function(){var e=this.el.querySelectorAll(".form-completion-action-type")[0].value,t=this.el.querySelectorAll(".completion-message")[0],i=this.el.querySelectorAll(".completion-redirect-url")[0];"text"===e?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",t);var i=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",i);var l=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",l);var s=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",s);var c=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",c);var n=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",n),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e={form:this.model.toJSON()};return this.el.innerHTML=this.template(e),this.toggleCompletionFields(),wp.ccf.dispatcher.on("saveFormSettings",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FormNotifications=wp.ccf.views.FormNotifications||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-form-notifications-template").innerHTML),events:{"blur input":"save","change select":"save","change select.form-send-email-notifications":"toggleNotificationFields","change select.form-email-notification-from-type":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save)},toggleNotificationFields:function(){var e,t=this.el.querySelectorAll(".form-send-email-notifications")[0].value,i=this.el.querySelectorAll(".email-notification-setting"),l=this.el.querySelectorAll(".email-notification-from-address")[0],s=this.el.querySelectorAll(".email-notification-from-field")[0],c=this.el.querySelectorAll(".form-email-notification-from-type")[0];if(parseInt(t)){for(e=0;i>e;e++)emailNotificationAddresses.style.display="block";l.style.display="none",s.style.display="none","custom"===c.value?l.style.display="block":"field"===c.value&&(s.style.display="block")}else{for(e=0;i>e;e++)emailNotificationAddresses.style.display="none";l.style.display="none",s.style.display="none"}},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-send-email-notifications")[0].value;this.model.set("sendEmailNotifications",parseInt(t)?!0:!1);var i=this.el.querySelectorAll(".form-email-notification-addresses")[0].value;this.model.set("emailNotificationAddresses",i);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("emailNotificationFromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("emailNotificationFromAddress",s);var c=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("emailNotificationFromField",c),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e=[],t=this.model.get("fields");t.each(function(t){"email"===t.get("type")&&e.push(t)});var i={form:this.model.toJSON(),emailFields:e};return this.el.innerHTML=this.template(i),this.toggleNotificationFields(),wp.ccf.dispatcher.on("saveFormNotifications",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this.listenTo(t,"add",this.render,this),this.listenTo(t,"remove",this.render,this),this}}),wp.ccf.views.FormPane=wp.ccf.views.FormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template(document.getElementById("ccf-form-pane-template").innerHTML),subViews:{"field-sidebar":wp.ccf.views.FieldSidebar,"form-settings":wp.ccf.views.FormSettings,"form-notifications":wp.ccf.views.FormNotifications},events:{"click .save-button":"sync","click h2":"accordionClick","click .insert-form-button":"insertForm"},initialize:function(){wp.ccf.dispatcher.on("openEditField",this.openEditField,this)
|
2 |
-
},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},accordionClick:function(t){var l=e(t.currentTarget).parents(".accordion-container")[0],s=l.querySelectorAll(".accordion-section");t.currentTarget.parentNode.className.match(/expanded/i)?t.currentTarget.parentNode.className=t.currentTarget.parentNode.className.replace(/expanded/i,""):t.currentTarget.parentNode.className+=" expanded",i.each(s,function(e){e!=t.currentTarget.parentNode&&e.className.match(/expanded/i)&&(e.className=e.className.replace(/expanded/i,""))})},openEditField:function(e){this.renderedSubViews["field-sidebar"].render(e).el.style.display="block"},disable:function(){this.el.querySelectorAll(".save-button")[0].setAttribute("disabled","disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="block"},enable:function(){this.el.querySelectorAll(".save-button")[0].removeAttribute("disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="none"},sync:function(){var t=this,i=e(this.el.querySelectorAll(".spinner")[0]);i.fadeIn(),t.disable();var s=e.Deferred(),c=e.Deferred(),n=e.Deferred();wp.ccf.dispatcher.trigger("saveFormSettings",s),wp.ccf.dispatcher.trigger("saveFormNotifications",n),wp.ccf.dispatcher.trigger("saveField",c),e.when(s,c,n).then(function(){var e=t.model.get("fields"),s=!0,c={};e.each(function(e){var t=e.get("slug");e.hasRequiredAttributes()?t&&!t.match(/^[a-zA-Z0-9\-_]+$/)?(s=!1,e.trigger("requirementsNotMet")):c[e.get("slug")]!==void 0?(s=!1,e.trigger("duplicateSlug"),c[e.get("slug")].trigger("duplicateSlug")):e.trigger("requirementsMet"):(s=!1,e.trigger("requirementsNotMet")),e.get("slug")&&(c[e.get("slug")]=e)}),s?t.model.save({},{context:"edit"}).done(function(){l.single&&!l.postId&&(window.location=l.adminUrl+"post.php?post="+t.model.get("ID")+"&action=edit#ccf-form/"+t.model.get("ID"))}).complete(function(){i.fadeOut(),t.enable(),wp.ccf.dispatcher.trigger("saveFormComplete",t.model)}):(t.enable(),i.fadeOut())})},enableDisableInsert:function(){var e=this.el.querySelectorAll(".insert-form-button")[0];this.model.get("ID")?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")},getNextFieldOrd:function(){var e=this.model.get("fields"),t=e.length+1;return e.each(function(e){var i=e.get("slug"),l=/\-([0-9]+)$/g,s=l.exec(i);if(s&&s[1]){var c=parseInt(s[1]);c>=t&&(t=c+1)}}),t},render:function(t){var s=this;s.model=t?t:new wp.ccf.models.Form,this.listenTo(s.model,"change",this.enableDisableInsert,this);var c={labels:l.fieldLabels,form:s.model.toJSON()};window.form=s.model,s.el.innerHTML=this.template(c);var n=s.el.querySelectorAll(".fields")[0];i.each(l.fieldLabels,function(e,t){n.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var r=s.el.querySelectorAll(".structure-fields")[0];i.each(l.structureFieldLabels,function(e,t){r.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var o=s.el.querySelectorAll(".special-fields")[0];i.each(l.specialFieldLabels,function(e,t){o.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)}),e(s.el.querySelectorAll(".left-sidebar")[0].querySelectorAll(".field")).draggable({cursor:"move",zIndex:160001,scroll:!1,containment:".ccf-form-pane",appendTo:".ccf-main-modal",snap:!0,connectToSortable:".form-content",helper:function(t){var i=e(t.currentTarget),l=e('<div class="field" data-field-type="'+i.attr("data-field-type")+'"><h4>'+i.find(".label").html()+"</h4></div>");return l.css({width:i.width(),height:i.height()})}});var a=s.model.get("fields"),d=s.el.querySelectorAll(".form-content")[0];return a.length>=1&&(d.innerHTML="",a.each(function(e){var t=new wp.ccf.views.FieldRow({model:e,form:s.model}).render(!0).el;d.appendChild(t)})),e(d).sortable({axis:"y",handle:"h4",stop:function(e,t){if(!t.item.hasClass("instantiated")){var i=t.item.attr("data-field-type"),l={};wp.ccf.models.Fields[i].prototype.defaults().slug!==void 0&&(l.slug=i+"-"+s.getNextFieldOrd());var c=new wp.ccf.models.Fields[i](l),n=s.model.get("fields");n.add(c),new wp.ccf.views.FieldRow({model:c,el:t.item,form:s.model}).render(!0),t.item.attr("style","")}t.item.trigger("sorted",t.item.index())}}),s.initRenderSubViews(!0,!0,{form:s.model}),s.enableDisableInsert(),s}},wp.ccf.mixins.subViewable)),wp.ccf.views.ExistingFormTableRow=wp.ccf.views.ExistingFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template(document.getElementById("ccf-existing-form-table-row-template").innerHTML),events:{"click .edit":"triggerMainViewChange","click .delete":"triggerDelete","click .insert-form-button":"insertForm"},initialize:function(e){this.parent=e.parent},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},triggerMainViewChange:function(){wp.ccf.switchToForm(this.model)},triggerDelete:function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},render:function(){return this.$el.html(this.template({form:this.model.toJSON(),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate}})),this}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template(document.getElementById("ccf-empty-form-table-row-template").innerHTML),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.ExistingFormTable=wp.ccf.views.ExistingFormTable||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-existing-form-table-template").innerHTML),initialize:function(){this.parent=arguments.parent,this.collection=new wp.ccf.collections.Forms,wp.ccf.dispatcher.on("changeFormTablePage",this.showPage,this),wp.ccf.dispatcher.on("saveFormComplete",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.done(function(){var e=t.el.querySelectorAll(".rows")[0],i=document.createElement("tbody");i.className="rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.ExistingFormTableRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild((new wp.ccf.views.EmptyFormTableRow).render().el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(){var e=this;return this.el.innerHTML=this.template(),this.el.querySelectorAll(".ccf-pagination")[0],this.showPage(1).done(function(){e.renderPagination()}),this}}),wp.ccf.views.ExistingFormPane=wp.ccf.views.ExistingFormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template(document.getElementById("ccf-existing-form-pane-template").innerHTML),subViews:{"existing-form-table":wp.ccf.views.ExistingFormTable},render:function(){return this.rendered?this:(this.rendered=!0,this.el.innerHTML=this.template(),this.initRenderSubViews(!0),this)}},wp.ccf.mixins.subViewable)),wp.ccf.views.MainModal=wp.ccf.views.MainModal||t.View.extend(i.defaults({tagName:"div",className:"ccf-main-modal",template:wp.ccf.utils.template(document.getElementById("ccf-main-modal-template").innerHTML),events:{"click .close-icon":"hide","click .main-menu a":"menuClick"},subViews:{"form-pane":wp.ccf.views.FormPane},initialize:function(){l.single||(this.subViews["existing-form-pane"]=wp.ccf.views.ExistingFormPane),wp.ccf.dispatcher.on("mainViewChange",this.toggleView,this)},toggleView:function(e){this.showView(e,wp.ccf.currentForm);var t=e;"form-pane"===e&&wp.ccf.currentForm&&(t="existing-form-pane");var l=this.el.querySelectorAll(".menu-item");i.each(l,function(e){var i=e.getAttribute("data-view");e.className=i===t?e.className.replace("selected","")+" selected":e.className.replace("selected","")})},menuClick:function(e){var t=e.target.getAttribute("data-view");"form-pane"===t&&(wp.ccf.currentForm=null),wp.ccf.dispatcher.trigger("mainViewChange",t),e.preventDefault()},render:function(e){return e=e||!1,this.overlay(),this.el.innerHTML=this.template({single:e}),this.initRenderSubViews(),this.showView("form-pane",wp.ccf.currentForm,!0),this},overlay:function(){return this.overlayEl===void 0&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="ccf-main-modal-overlay",document.body.appendChild(this.overlayEl)),this.overlayEl},remove:function(){return document.body.removeChild(this.overlay()),this},show:function(){e(this.overlay()).show(),this.$el.show()},hide:function(){e(this.overlay()).hide(),this.$el.hide()}},wp.ccf.mixins.subViewable)),wp.ccf.views.SubmissionRow=wp.ccf.views.SubmissionRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template(document.getElementById("ccf-submission-row-template").innerHTML),events:{"click .view":"view","click .delete":"delete"},initialize:function(e){this.parent=e.parent},"delete":function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},view:function(e){var t=e.currentTarget.getAttribute("data-submission-id"),i=e.currentTarget.getAttribute("data-submission-date");tb_show(l.thickboxTitle+" - "+wp.ccf.utils.getPrettyPostDate(i),"#TB_inline?height=500&width=700&inlineId=ccf-submission-content-"+parseInt(t),null)},render:function(){return this.$el.html(this.template({submission:this.model.toJSON(),currentColumns:this.parent.columns,columns:wp.ccf.currentForm.getFieldSlugs(!0),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate,wordChop:wp.ccf.utils.wordChop,isFieldDate:wp.ccf.utils.isFieldDate,isFieldName:wp.ccf.utils.isFieldName,isFieldAddress:wp.ccf.utils.isFieldAddress,getPrettyFieldDate:wp.ccf.utils.getPrettyFieldDate,getPrettyFieldAddress:wp.ccf.utils.getPrettyFieldAddress,getPrettyFieldName:wp.ccf.utils.getPrettyFieldName}})),this}}),wp.ccf.views.SubmissionsTable=wp.ccf.views.SubmissionsTable||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-submission-table-template").innerHTML),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(){this.collection=new wp.ccf.collections.Submissions({},{formId:l.postId}),wp.ccf.dispatcher.on("submissionTableRebuild",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.done(function(){var e=t.el.querySelectorAll(".submission-rows")[0],i=document.createElement("tbody");i.className="submission-rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.SubmissionRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild(new wp.ccf.views.EmptySubmissionTableRow({parent:t}).render(wp.ccf.currentForm.getFieldSlugs(!0).concat("date")).el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(e){var t=this;return t.columns=e?e:wp.ccf.currentForm.getFieldSlugs(!0).slice(0,4).concat("date"),1>t.columns.length?t.el.innerHTML="":(t.el.innerHTML=t.template({columns:t.columns}),t.el.querySelectorAll(".ccf-pagination")[0],t.showPage(1).done(function(){t.renderPagination()})),t}}),wp.ccf.views.Pagination=wp.ccf.views.Pagination||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-pagination-template").innerHTML),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(e){this.parent=e.parent},previousPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage-1).done(function(){e.render()})},nextPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage+1).done(function(){e.render()})},firstPage:function(){var e=this;e.parent.showPage(1).done(function(){e.render()})},lastPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.totalPages).done(function(){e.render()})},render:function(){return this.el.innerHTML=this.template({totalPages:this.parent.collection.state.totalPages,currentPage:this.parent.collection.state.currentPage,totalObjects:this.parent.collection.state.totalObjects}),this}}),wp.ccf.views.EmptySubmissionTableRow=wp.ccf.views.EmptySubmissionTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template(document.getElementById("ccf-no-submissions-row-template").innerHTML),initialize:function(e){this.parent=e.parent},render:function(){return this.el.innerHTML=this.template({columns:this.parent.columns}),this}}),wp.ccf.views.SubmissionColumnController=wp.ccf.views.SubmissionColumnController||t.View.extend({template:wp.ccf.utils.template(document.getElementById("ccf-submissions-controller-template").innerHTML),events:{"click input[type=checkbox]":"triggerTableRebuild"},render:function(){this.el.innerHTML=this.template({columns:wp.ccf.currentForm.getFieldSlugs(!0).concat("date")})},triggerTableRebuild:function(){var e=[],t=document.querySelectorAll(".submission-column-checkbox");if(t.length>=1)for(var i=0;t.length>i;i++)t[i].checked&&e.push(t[i].value);wp.ccf.dispatcher.trigger("submissionTableRebuild",e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t){"use strict";wp.ccf.router=wp.ccf.router||t.Router.extend({routes:{"ccf-form":"open","ccf-form/:formId":"open"},open:function(e){wp.ccf.show(e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf=i.defaults(wp.ccf,{forms:new wp.ccf.collections.Forms,currentForm:null,_currentFormDeferred:null,dispatcher:{},show:function(e){return this.switchToForm(e),this.instance.show(),this.instance},switchToForm:function(e){var t=this;if(+e===parseInt(e)){var i=parseInt(e);if(e=t.forms.findWhere({ID:parseInt(i)}),!e){var l;return t.forms.formsFetching[i]!==void 0?(l=t.forms.formsFetching[i],e=null):(e=new wp.ccf.models.Form({ID:i}),l=e.fetch(),t.forms.formsFetching[i]=l),l.done(function(){e?(delete t.forms.formsFetching[i],t.forms.add(e)):e=t.forms.findWhere({ID:i}),t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}),l}t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}else t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane");return!0},hide:function(){return this.instance.hide(),this.instance},toggle:function(e){return this.switchToForm(e),this.instance.$el.is(":visible")?this.instance.hide():this.instance.show(),this.instance},createSubmissionsTable:function(e){var t=document.querySelectorAll(".ccf-submission-column-controller"),i=new wp.ccf.views.SubmissionsTable({el:e});i.render(),t&&new wp.ccf.views.SubmissionColumnController({el:t}).render()},_setupMainModal:function(e){return this.instance=(new wp.ccf.views.MainModal).render(e),document.getElementsByTagName("body")[0].appendChild(this.instance.el),t.history.start(),this.instance},createManager:function(){var s=this;i.extend(this.dispatcher,t.Events),new wp.ccf.router;var c=!1,n=document.querySelectorAll(".ccf-open-form-manager")[0];if(l.single)if(c=!0,l.postId){var r=parseInt(l.postId);if(s.forms.formsFetching[r]===void 0){var o=new wp.ccf.models.Form({ID:r}),a=o.fetch();s.forms.formsFetching[r]=a,s._currentFormDeferred=a,a.done(function(){delete s.forms.formsFetching[r],s.forms.add(o),s.currentForm=o})}else s._currentFormDeferred=s.forms.formsFetching[r],s._currentFormDeferred.done(function(){s.currentForm=s.forms.findWhere({ID:r})});e.when(s._currentFormDeferred).then(function(){s._setupMainModal(!0),n.style.display="inline-block";var e=document.getElementById("ccf-submissions");if(e){var t=e.querySelectorAll(".inside")[0],i=document.createElement("div");i.className="ccf-submission-settings",i.setAttribute("data-icon","");var l=document.getElementById("show-settings-link");i.onclick=function(){l.click()},e.insertBefore(i,e.firstChild.nextSibling.nextSibling),wp.ccf.createSubmissionsTable(t)}})}else s._setupMainModal(!0),n.style.display="inline-block";else s._setupMainModal();var d=function(e){e=e||window.event;var t=e.currentTarget?e.currentTarget:e.srcElement,i=t.getAttribute("data-form-id");wp.ccf.toggle(i)};n.addEventListener?n.addEventListener("click",d,!1):n.attachEvent("onclick",d)}}),wp.ccf.createManager()}(jQuery,Backbone,_,ccfSettings);
|
1 |
+
(function(e,t,i,l){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.utils=wp.ccf.utils||{},wp.ccf.utils.cleanDateFields=function(e){delete e.date,delete e.date_gmt,delete e.modified,delete e.modified_gmt,delete e.date_tz,delete e.modified_tz},wp.ccf.utils.template=i.memoize(function(e){var t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return i.template(document.getElementById(e).innerHTML,null,t)}),wp.ccf.utils.insertFormShortcode=function(e){var t=wp.ccf.forms.findWhere({ID:e.get("ID")});t||wp.ccf.forms.add(e);var i=tinymce.get(wpActiveEditor),l='[ccf_form id="'+e.get("ID")+'"]';i&&!i.isHidden()?tinymce.activeEditor.execCommand("mceInsertContent",!1,l):document.getElementById(wpActiveEditor).value+=l},wp.ccf.utils.getPrettyPostDate=function(e){return e=moment(e),e.format("h:mm a M/D/YYYY")},wp.ccf.utils.wordChop=function(e,t){var i=e.substr(0,t);return i.substr(0,Math.min(i.length,i.lastIndexOf(" "))),i.length<e.length&&(i+="..."),i},wp.ccf.utils.isFieldDate=function(e){return e.date!==void 0||e.hour!==void 0&&e.minute!==void 0&&e["am-pm"]!==void 0?!0:!1},wp.ccf.utils.isFieldName=function(e){return e.name!==void 0||e.last!==void 0?!0:!1},wp.ccf.utils.isFieldEmailConfirm=function(e){return e.email!==void 0||e.confirm!==void 0?!0:!1},wp.ccf.utils.isFieldAddress=function(e){return e.street!==void 0&&e.city!==void 0&&e.zipcode!==void 0&&e.line_two!==void 0?!0:!1},wp.ccf.utils.getPrettyFieldEmailConfirm=function(e){return e.email?e.email:e.confirm?e.confirm:"-"},wp.ccf.utils.getPrettyFieldDate=function(e){var t="",i="";if(e.hour&&e.minute&&e["am-pm"]&&(t+=e.hour+":"+e.minute+" "+e["am-pm"]),e.date&&(t+=" "+e.date),!t)return"-";var s=moment(t);return s.isValid()?(e.hour&&e.minute&&e["am-pm"]&&(i+=s.format("h:mm a")),e.date&&(i&&(i+=" "),i+=s.format("M/D/YYYY")),i):l.invalidDate},wp.ccf.utils.getPrettyFieldName=function(e){var t=e.first;return t.length>0&&(t+=" "),e.last&&(t+=e.last),t||(t="-"),t},wp.ccf.utils.getPrettyFieldAddress=function(e){if(!e.street||!e.city)return"-";var t=e.street;return e.line_two&&(t+=" "+e.line_two),t+=", "+e.city,e.state&&(t+=", "+e.state),e.zipcode&&(t+=" "+e.zipcode),e.country&&(t+=" "+e.country),t}})(jQuery,Backbone,_,ccfSettings),function(e,t,i){"use strict";wp.ccf.mixins=wp.ccf.mixins||{},wp.ccf.mixins.subViewable=wp.ccf.mixins.subViewable||{subViews:{},initRenderSubViews:function(e,t,l){this.renderedSubViews||(this.renderedSubViews={});for(var s in this.subViews){var c={el:this.$el.find(".ccf-"+s),parent:this};l&&i.extend(c,l),this.renderedSubViews[s]&&this.renderedSubViews[s].destroy&&this.renderedSubViews[s].destroy(),(t||!this.renderedSubViews[s])&&(this.renderedSubViews[s]=new this.subViews[s](c)),this.renderedSubViews[s].render(),e&&(this.renderedSubViews[s].el.style.display="block")}return this},showView:function(e,t,i){if(this.renderedSubViews!==void 0&&this.renderedSubViews[e]!==void 0){var l=this.renderedSubViews[e];i||l.render(t),l.el.style.display="block",this.currentView=e;for(var s in this.subViews)s!==e&&(this.renderedSubViews[s].el.style.display="none")}}}}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l,s){"use strict";wp.ccf.models=wp.ccf.models||{},wp.ccf.models.Fields=wp.ccf.models.Fields||{};var c=function(e,i,l){return"object"!=typeof i&&""===i&&(i=""),t.Model.prototype.set.call(this,e,i,l)},r=function(e){for(var t in this.attributes)if(-1===e.indexOf(t)){var i=this.get(t);"string"==typeof i&&""!==i&&(i=(i+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/“/g,"”").replace(/”/g,"”").replace(/‘/g,"‘").replace(/'/g,"'"),this.set(t,i))}return this};wp.ccf.models.FieldChoice=wp.ccf.models.FieldChoice||t.Model.extend({defaults:{label:"",value:"",selected:!1},decode:function(){return r.call(this,[])},set:c}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:s.root+"/ccf/forms",set:c,initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",sendEmailNotifications:!1,emailNotificationAddresses:l.adminEmail,emailNotificationFromType:"default",emailNotificationFromAddress:"",emailNotificationFromField:""};return e=i.defaults(e,this.constructor.__super__.defaults),wp.ccf.utils.cleanDateFields(e),e},decode:function(){var e=i.keys(wp.api.models.Post.prototype.defaults);return e=i.without(e,"title"),r.call(this,e)},getFieldSlugs:function(e){var t=wp.ccf.currentForm.get("fields"),i=[];return t.each(function(t){e&&t.isImmutable||i.push(t.get("slug"))}),i},parse:function(e){var t=this;if(e.fields){var l=t.get("fields");if(l&&l.length>0){for(var s=0;e.fields.length>s;s++){var c=e.fields[s],r=l.findWhere({slug:c.slug});if(r){if(c.choices!==void 0){var n=t.get("choices");if(n&&n.length>0)for(var o=0;c.choices>o;o++){var a=n.at(o);a.set(c.choices[o]),a.decode()}delete e.fields[s].choices}r.set(c),r.decode()}}delete e.fields}else{var d=[];i.each(e.fields,function(e){var t=new wp.ccf.models.Fields[e.type](e);t.decode(),d.push(t)}),e.fields=new wp.ccf.collections.Fields(d,{formId:e.ID})}}return this.constructor.__super__.parse.call(this,e)},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.fields&&(e.fields=e.fields.toJSON()),e.author&&(e.author=e.author.toJSON()),e}}),wp.ccf.models.Submission=wp.api.models.Submission||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null,data:{}}}),wp.ccf.models.Field=wp.api.models.Field||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null},set:c,required:function(){return["slug"]},decode:function(){return r.call(this,i.keys(wp.api.models.Post.prototype.defaults))},hasRequiredAttributes:function(){var e=this,t=!0;return i.each(this.required(),function(i){(e.get(i)===void 0||""===e.get(i))&&(t=!1)}),t}}),wp.ccf.models.StandardField=wp.ccf.models.StandardField||wp.ccf.models.Field.extend({idAttribute:"ID",defaults:function(){var e={label:"Field Label",value:"",placeholder:"",slug:"",type:"",required:!1,className:""};return i.defaults(e,this.constructor.__super__.defaults)}}),wp.ccf.models.Fields["single-line-text"]=wp.ccf.models.Fields["single-line-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"single-line-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["paragraph-text"]=wp.ccf.models.Fields["paragraph-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"paragraph-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.hidden=wp.ccf.models.Fields.hidden||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"hidden"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.email=wp.ccf.models.Fields.email||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"email",emailConfirmation:!1};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.website=wp.ccf.models.Fields.website||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"website",placeholder:"http://"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.phone=wp.ccf.models.Fields.phone||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"phone",phoneFormat:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.date=wp.ccf.models.Fields.date||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"date",showDate:!0,showTime:!0};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.name=wp.ccf.models.Fields.name||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"name"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.recaptcha=wp.ccf.models.Fields.recaptcha||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"recaptcha",siteKey:"",secretKey:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return["siteKey","secretKey"]},isImmutable:!0}),wp.ccf.models.Fields.address=wp.ccf.models.Fields.address||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"address",addressType:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["section-header"]=wp.ccf.models.Fields["section-header"]||wp.ccf.models.Field.extend({defaults:function(){var e={type:"section-header",slug:"",heading:"",subheading:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.Fields.html=wp.ccf.models.Fields.html||wp.ccf.models.Field.extend({defaults:function(){var e={type:"html",slug:"",html:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.ChoiceableField=wp.ccf.models.ChoiceableField||wp.ccf.models.StandardField.extend({defaults:function(){var e={choices:new wp.ccf.collections.FieldChoices};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings,WP_API_Settings),function(e,t,i){"use strict";wp.ccf.collections=wp.ccf.collections||{},wp.ccf.collections.Forms=wp.ccf.collections.Forms||wp.api.collections.Posts.extend({model:wp.ccf.models.Form,url:WP_API_Settings.root+"/ccf/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},remove:function(e,t){t=t||{};var l=this.constructor.__super__.remove.call(this,e,t);return t.destroy&&(e instanceof Array?i.each(e,function(e){e.destroy()}):e.destroy()),l}}),wp.ccf.collections.Fields=wp.ccf.collections.Fields||wp.api.collections.Posts.extend({model:wp.ccf.models.Field,url:function(){return WP_API_Settings.root+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return WP_API_Settings.root+"/ccf/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"saveChoice",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},checkSlug:function(){var e=this.el.querySelectorAll(".field-slug");if(e.length>0){var t=e[0],i=!1;t.parentNode.className=t.value&&!t.value.match(/^[a-zA-Z0-9\-_]+$/)?t.parentNode.className.replace(/ field-error/i,"")+" field-error":t.parentNode.className.replace(/ field-error/i,""),this.collection.length>0&&""!==t.value?(this.collection.each(function(e){e!==this.model&&t.value===e.get("slug")&&(i=!0)},this),t.parentNode.className=i?t.parentNode.className.replace(/ field-duplicate-slug/i,"")+" field-duplicate-slug":t.parentNode.className.replace(/ field-duplicate-slug/i,"")):t.parentNode.className=t.parentNode.className.replace(/ field-duplicate-slug/i,"")}},destroy:function(){this.unbind()},render:function(){return this.el.innerHTML=this.template({field:this.model.toJSON()}),this.checkSlug(),this}}),wp.ccf.views.Fields["single-line-text"]=wp.ccf.views.Fields["single-line-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-single-line-text-template"),initialize:function(){},saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.recaptcha=wp.ccf.views.Fields.recaptcha||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-recaptcha-template"),initialize:function(){},saveField:function(){return this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("siteKey",this.el.querySelectorAll(".field-site-key")[0].value),this.model.set("secretKey",this.el.querySelectorAll(".field-secret-key")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields["section-header"]=wp.ccf.views.Fields["section-header"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-section-header-template"),initialize:function(){},saveField:function(){return this.model.set("heading",this.el.querySelectorAll(".field-heading")[0].value),this.model.set("subheading",this.el.querySelectorAll(".field-subheading")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields.html=wp.ccf.views.Fields.html||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-html-template"),initialize:function(){},saveField:function(){return this.model.set("html",this.el.querySelectorAll(".field-html")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields["paragraph-text"]=wp.ccf.views.Fields["paragraph-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-paragraph-text-template"),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.hidden=wp.ccf.views.Fields.hidden||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-hidden-template"),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this}}),wp.ccf.views.Fields.date=wp.ccf.views.Fields.date||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-date-template"),saveField:function(){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value);var e=this.el.querySelectorAll(".field-value");e.length>0&&this.model.set("value",e[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("showDate",this.el.querySelectorAll(".field-show-date")[0].checked?!0:!1);var t=this.model.get("showTime"),i=this.el.querySelectorAll(".field-show-time")[0].checked?!0:!1;return this.model.set("showTime",i),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),i!=t&&this.render(),this}}),wp.ccf.views.Fields.name=wp.ccf.views.Fields.name||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-name-template"),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.website=wp.ccf.views.Fields.website||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-website-template"),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.phone=wp.ccf.views.Fields.phone||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-phone-template"),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("phoneFormat",this.el.querySelectorAll(".field-phone-format")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.address=wp.ccf.views.Fields.address||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-address-template"),saveField:function(){return this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this}}),wp.ccf.views.Fields.email=wp.ccf.views.Fields.email||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-email-template"),saveField:function(){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value);var e=this.el.querySelectorAll(".field-value");e.length&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-placeholder");t.length&&this.model.set("placeholder",t[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var i=1==this.el.querySelectorAll(".field-email-confirmation")[0].value?!0:!1,l=this.model.get("emailConfirmation");return this.model.set("emailConfirmation",i),l!=i&&this.render(),this}}),wp.ccf.views.ChoiceableField=wp.ccf.views.ChoiceableField||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),initialize:function(){var e=this.model.get("choices");this.listenTo(e,"add",this.addChoice)},addChoice:function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:this.model}).render(),i=this.el.querySelectorAll(".repeatable-choices")[0];i.appendChild(t.el)},saveField:function(){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this},render:function(){var t=this;t.el.innerHTML=t.template({field:t.model.toJSON()}),t.checkSlug();var i=t.model.get("choices"),l=this.el.querySelectorAll(".repeatable-choices")[0];if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FieldChoice({model:e,field:t.model}).render();l.appendChild(i.el)});else{var s=new wp.ccf.models.FieldChoice;i.add(s)}return l=this.el.querySelectorAll(".repeatable-choices")[0],e(l).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}}),t}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.FormSettings=wp.ccf.views.FormSettings||t.View.extend({template:wp.ccf.utils.template("ccf-form-settings-template"),events:{"blur input":"save","change select":"save","change select.form-completion-action-type":"toggleCompletionFields","change select.form-send-email-notifications":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save)},toggleCompletionFields:function(){var e=this.el.querySelectorAll(".form-completion-action-type")[0].value,t=this.el.querySelectorAll(".completion-message")[0],i=this.el.querySelectorAll(".completion-redirect-url")[0];"text"===e?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",t);var i=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",i);var l=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",l);var s=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",s);var c=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",c);var r=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",r),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e={form:this.model.toJSON()};return this.el.innerHTML=this.template(e),this.toggleCompletionFields(),wp.ccf.dispatcher.on("saveFormSettings",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FormNotifications=wp.ccf.views.FormNotifications||t.View.extend({template:wp.ccf.utils.template("ccf-form-notifications-template"),events:{"blur input":"save","change select":"save","change select.form-send-email-notifications":"toggleNotificationFields","change select.form-email-notification-from-type":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormNotifications",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.undelegateEvents(),this.unbind()},updateFromAddressFieldField:function(){var e=this.el.querySelectorAll(".form-email-notification-from-field")[0];e.innerHTML="",e.disabled=!1;var t=this.model.get("fields"),i=0,s=this.model.get("emailNotificationFromField");if(t.length>=1&&t.each(function(t){if("email"===t.get("type")){var l=document.createElement("option");l.innerHTML=t.get("slug"),l.value=t.get("slug"),t.get("slug")===s&&(l.selected=!0),e.appendChild(l),i++}}),0===i){var c=document.createElement("option");c.innerHTML=l.noEmailFields,e.appendChild(c),e.disabled=!0}},toggleNotificationFields:function(){var e,t=this.el.querySelectorAll(".form-send-email-notifications")[0].value,i=this.el.querySelectorAll(".email-notification-setting"),l=this.el.querySelectorAll(".email-notification-from-address")[0],s=this.el.querySelectorAll(".email-notification-from-field")[0],c=this.el.querySelectorAll(".form-email-notification-from-type")[0];if(parseInt(t)){for(e=0;i.length>e;e++)i[e].style.display="block";l.style.display="none",s.style.display="none","custom"===c.value?l.style.display="block":"field"===c.value&&(s.style.display="block")}else{for(e=0;i.length>e;e++)i[e].style.display="none";l.style.display="none",s.style.display="none"}},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-send-email-notifications")[0].value;this.model.set("sendEmailNotifications",parseInt(t)?!0:!1);var i=this.el.querySelectorAll(".form-email-notification-addresses")[0].value;this.model.set("emailNotificationAddresses",i);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("emailNotificationFromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("emailNotificationFromAddress",s);var c=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("emailNotificationFromField",c),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e={form:this.model.toJSON()},t=this.model.get("fields");return this.el.innerHTML=this.template(e),this.toggleNotificationFields(),this.updateFromAddressFieldField(),wp.ccf.dispatcher.on("saveFormNotifications",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this.listenTo(t,"add",this.updateFromAddressFieldField,this),this.listenTo(t,"remove",this.updateFromAddressFieldField,this),this
|
2 |
+
}}),wp.ccf.views.FormPane=wp.ccf.views.FormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-form-pane-template"),subViews:{"field-sidebar":wp.ccf.views.FieldSidebar,"form-settings":wp.ccf.views.FormSettings,"form-notifications":wp.ccf.views.FormNotifications},events:{"click .save-button":"sync","click h2":"accordionClick","click .insert-form-button":"insertForm"},initialize:function(){wp.ccf.dispatcher.on("openEditField",this.openEditField,this)},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},accordionClick:function(t){var l=e(t.currentTarget).parents(".accordion-container")[0],s=l.querySelectorAll(".accordion-section");t.currentTarget.parentNode.className.match(/expanded/i)?t.currentTarget.parentNode.className=t.currentTarget.parentNode.className.replace(/expanded/i,""):t.currentTarget.parentNode.className+=" expanded",i.each(s,function(e){e!=t.currentTarget.parentNode&&e.className.match(/expanded/i)&&(e.className=e.className.replace(/expanded/i,""))})},openEditField:function(e){this.renderedSubViews["field-sidebar"].render(e).el.style.display="block"},disable:function(){this.el.querySelectorAll(".save-button")[0].setAttribute("disabled","disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="block"},enable:function(){this.el.querySelectorAll(".save-button")[0].removeAttribute("disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="none"},sync:function(){var t=this,i=e(this.el.querySelectorAll(".spinner")[0]);i.fadeIn(),t.disable();var s=e.Deferred(),c=e.Deferred(),r=e.Deferred();wp.ccf.dispatcher.trigger("saveFormSettings",s),wp.ccf.dispatcher.trigger("saveFormNotifications",r),wp.ccf.dispatcher.trigger("saveField",c),e.when(s,c,r).then(function(){var e=t.model.get("fields"),s=!0,c={};e.each(function(e){var t=e.get("slug");e.hasRequiredAttributes()?t&&!t.match(/^[a-zA-Z0-9\-_]+$/)?(s=!1,e.trigger("requirementsNotMet")):c[e.get("slug")]!==void 0?(s=!1,e.trigger("duplicateSlug"),c[e.get("slug")].trigger("duplicateSlug")):e.trigger("requirementsMet"):(s=!1,e.trigger("requirementsNotMet")),e.get("slug")&&(c[e.get("slug")]=e)}),s?t.model.save({},{context:"edit"}).done(function(){l.single&&!l.postId&&(window.location=l.adminUrl+"post.php?post="+t.model.get("ID")+"&action=edit#ccf-form/"+t.model.get("ID"))}).complete(function(){i.fadeOut(),t.enable(),wp.ccf.dispatcher.trigger("saveFormComplete",t.model)}):(t.enable(),i.fadeOut())})},enableDisableInsert:function(){var e=this.el.querySelectorAll(".insert-form-button")[0];this.model.get("ID")?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")},getNextFieldOrd:function(){var e=this.model.get("fields"),t=e.length+1;return e.each(function(e){var i=e.get("slug"),l=/\-([0-9]+)$/g,s=l.exec(i);if(s&&s[1]){var c=parseInt(s[1]);c>=t&&(t=c+1)}}),t},render:function(t){var s=this;s.model=t?t:new wp.ccf.models.Form,this.listenTo(s.model,"change",this.enableDisableInsert,this);var c={labels:l.fieldLabels,form:s.model.toJSON()};window.form=s.model,s.el.innerHTML=this.template(c);var r=s.el.querySelectorAll(".fields")[0];i.each(l.fieldLabels,function(e,t){r.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var n=s.el.querySelectorAll(".structure-fields")[0];i.each(l.structureFieldLabels,function(e,t){n.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var o=s.el.querySelectorAll(".special-fields")[0];i.each(l.specialFieldLabels,function(e,t){o.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)}),e(s.el.querySelectorAll(".left-sidebar")[0].querySelectorAll(".field")).draggable({cursor:"move",zIndex:160001,scroll:!1,containment:".ccf-form-pane",appendTo:".ccf-main-modal",snap:!0,connectToSortable:".form-content",helper:function(t){var i=e(t.currentTarget),l=e('<div class="field" data-field-type="'+i.attr("data-field-type")+'"><h4>'+i.find(".label").html()+"</h4></div>");return l.css({width:i.width(),height:i.height()})}});var a=s.model.get("fields"),d=s.el.querySelectorAll(".form-content")[0];return a.length>=1&&(d.innerHTML="",a.each(function(e){var t=new wp.ccf.views.FieldRow({model:e,form:s.model}).render(!0).el;d.appendChild(t)})),e(d).sortable({axis:"y",handle:"h4",stop:function(e,t){if(!t.item.hasClass("instantiated")){var i=t.item.attr("data-field-type"),l={};wp.ccf.models.Fields[i].prototype.defaults().slug!==void 0&&(l.slug=i+"-"+s.getNextFieldOrd());var c=new wp.ccf.models.Fields[i](l),r=s.model.get("fields");r.add(c),new wp.ccf.views.FieldRow({model:c,el:t.item,form:s.model}).render(!0),t.item.attr("style","")}t.item.trigger("sorted",t.item.index())}}),s.initRenderSubViews(!0,!0,{form:s.model}),s.enableDisableInsert(),s}},wp.ccf.mixins.subViewable)),wp.ccf.views.ExistingFormTableRow=wp.ccf.views.ExistingFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-existing-form-table-row-template"),events:{"click .edit":"triggerMainViewChange","click .delete":"triggerDelete","click .insert-form-button":"insertForm"},initialize:function(e){this.parent=e.parent},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},triggerMainViewChange:function(){wp.ccf.switchToForm(this.model)},triggerDelete:function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},render:function(){return this.$el.html(this.template({form:this.model.toJSON(),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate}})),this}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.ExistingFormTable=wp.ccf.views.ExistingFormTable||t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-table-template"),initialize:function(){this.parent=arguments.parent,this.collection=new wp.ccf.collections.Forms,wp.ccf.dispatcher.on("changeFormTablePage",this.showPage,this),wp.ccf.dispatcher.on("saveFormComplete",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.done(function(){var e=t.el.querySelectorAll(".rows")[0],i=document.createElement("tbody");i.className="rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.ExistingFormTableRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild((new wp.ccf.views.EmptyFormTableRow).render().el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(){var e=this;return this.el.innerHTML=this.template(),this.el.querySelectorAll(".ccf-pagination")[0],this.showPage(1).done(function(){e.renderPagination()}),this}}),wp.ccf.views.ExistingFormPane=wp.ccf.views.ExistingFormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-existing-form-pane-template"),subViews:{"existing-form-table":wp.ccf.views.ExistingFormTable},render:function(){return this.rendered?this:(this.rendered=!0,this.el.innerHTML=this.template(),this.initRenderSubViews(!0),this)}},wp.ccf.mixins.subViewable)),wp.ccf.views.MainModal=wp.ccf.views.MainModal||t.View.extend(i.defaults({tagName:"div",className:"ccf-main-modal",template:wp.ccf.utils.template("ccf-main-modal-template"),events:{"click .close-icon":"hide","click .main-menu a":"menuClick"},subViews:{"form-pane":wp.ccf.views.FormPane},initialize:function(){l.single||(this.subViews["existing-form-pane"]=wp.ccf.views.ExistingFormPane),wp.ccf.dispatcher.on("mainViewChange",this.toggleView,this)},toggleView:function(e){this.showView(e,wp.ccf.currentForm);var t=e;"form-pane"===e&&wp.ccf.currentForm&&(t="existing-form-pane");var l=this.el.querySelectorAll(".menu-item");i.each(l,function(e){var i=e.getAttribute("data-view");e.className=i===t?e.className.replace("selected","")+" selected":e.className.replace("selected","")})},menuClick:function(e){var t=e.target.getAttribute("data-view");"form-pane"===t&&(wp.ccf.currentForm=null),wp.ccf.dispatcher.trigger("mainViewChange",t),e.preventDefault()},render:function(e){return e=e||!1,this.overlay(),this.el.innerHTML=this.template({single:e}),this.initRenderSubViews(),this.showView("form-pane",wp.ccf.currentForm,!0),this},overlay:function(){return this.overlayEl===void 0&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="ccf-main-modal-overlay",document.body.appendChild(this.overlayEl)),this.overlayEl},remove:function(){return document.body.removeChild(this.overlay()),this},show:function(){e(this.overlay()).show(),this.$el.show()},hide:function(){e(this.overlay()).hide(),this.$el.hide()}},wp.ccf.mixins.subViewable)),wp.ccf.views.SubmissionRow=wp.ccf.views.SubmissionRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-submission-row-template"),events:{"click .view":"view","click .delete":"delete"},initialize:function(e){this.parent=e.parent},"delete":function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},view:function(e){var t=e.currentTarget.getAttribute("data-submission-id"),i=e.currentTarget.getAttribute("data-submission-date");tb_show(l.thickboxTitle+" - "+wp.ccf.utils.getPrettyPostDate(i),"#TB_inline?height=500&width=700&inlineId=ccf-submission-content-"+parseInt(t),null)},render:function(){return this.$el.html(this.template({submission:this.model.toJSON(),currentColumns:this.parent.columns,columns:wp.ccf.currentForm.getFieldSlugs(!0),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate,wordChop:wp.ccf.utils.wordChop,isFieldDate:wp.ccf.utils.isFieldDate,isFieldName:wp.ccf.utils.isFieldName,isFieldAddress:wp.ccf.utils.isFieldAddress,isFieldEmailConfirm:wp.ccf.utils.isFieldEmailConfirm,getPrettyFieldDate:wp.ccf.utils.getPrettyFieldDate,getPrettyFieldAddress:wp.ccf.utils.getPrettyFieldAddress,getPrettyFieldName:wp.ccf.utils.getPrettyFieldName,getPrettyFieldEmailConfirm:wp.ccf.utils.getPrettyFieldEmailConfirm}})),this}}),wp.ccf.views.SubmissionsTable=wp.ccf.views.SubmissionsTable||t.View.extend({template:wp.ccf.utils.template("ccf-submission-table-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(){this.collection=new wp.ccf.collections.Submissions({},{formId:l.postId}),wp.ccf.dispatcher.on("submissionTableRebuild",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.done(function(){var e=t.el.querySelectorAll(".submission-rows")[0],i=document.createElement("tbody");i.className="submission-rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.SubmissionRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild(new wp.ccf.views.EmptySubmissionTableRow({parent:t}).render(wp.ccf.currentForm.getFieldSlugs(!0).concat("date")).el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(e){var t=this;return t.columns=e?e:wp.ccf.currentForm.getFieldSlugs(!0).slice(0,4).concat("date"),1>t.columns.length?t.el.innerHTML="":(t.el.innerHTML=t.template({columns:t.columns}),t.el.querySelectorAll(".ccf-pagination")[0],t.showPage(1).done(function(){t.renderPagination()})),t}}),wp.ccf.views.Pagination=wp.ccf.views.Pagination||t.View.extend({template:wp.ccf.utils.template("ccf-pagination-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(e){this.parent=e.parent},previousPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage-1).done(function(){e.render()})},nextPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage+1).done(function(){e.render()})},firstPage:function(){var e=this;e.parent.showPage(1).done(function(){e.render()})},lastPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.totalPages).done(function(){e.render()})},render:function(){return this.el.innerHTML=this.template({totalPages:this.parent.collection.state.totalPages,currentPage:this.parent.collection.state.currentPage,totalObjects:this.parent.collection.state.totalObjects}),this}}),wp.ccf.views.EmptySubmissionTableRow=wp.ccf.views.EmptySubmissionTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-no-submissions-row-template"),initialize:function(e){this.parent=e.parent},render:function(){return this.el.innerHTML=this.template({columns:this.parent.columns}),this}}),wp.ccf.views.SubmissionColumnController=wp.ccf.views.SubmissionColumnController||t.View.extend({template:wp.ccf.utils.template("ccf-submissions-controller-template"),events:{"click input[type=checkbox]":"triggerTableRebuild"},render:function(){this.el.innerHTML=this.template({columns:wp.ccf.currentForm.getFieldSlugs(!0).concat("date")})},triggerTableRebuild:function(){var e=[],t=document.querySelectorAll(".submission-column-checkbox");if(t.length>=1)for(var i=0;t.length>i;i++)t[i].checked&&e.push(t[i].value);wp.ccf.dispatcher.trigger("submissionTableRebuild",e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t){"use strict";wp.ccf.router=wp.ccf.router||t.Router.extend({routes:{"ccf-form":"open","ccf-form/:formId":"open"},open:function(e){wp.ccf.show(e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf=i.defaults(wp.ccf,{forms:new wp.ccf.collections.Forms,currentForm:null,_currentFormDeferred:null,dispatcher:{},show:function(e){return this.switchToForm(e),this.instance.show(),this.instance},switchToForm:function(e){var t=this;if(+e===parseInt(e)){var i=parseInt(e);if(e=t.forms.findWhere({ID:parseInt(i)}),!e){var l;return t.forms.formsFetching[i]!==void 0?(l=t.forms.formsFetching[i],e=null):(e=new wp.ccf.models.Form({ID:i}),l=e.fetch(),t.forms.formsFetching[i]=l),l.done(function(){e?(delete t.forms.formsFetching[i],t.forms.add(e)):e=t.forms.findWhere({ID:i}),t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}),l}t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}else t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane");return!0},hide:function(){return this.instance.hide(),this.instance},toggle:function(e){return this.switchToForm(e),this.instance.$el.is(":visible")?this.instance.hide():this.instance.show(),this.instance},createSubmissionsTable:function(e){var t=document.querySelectorAll(".ccf-submission-column-controller"),i=new wp.ccf.views.SubmissionsTable({el:e});i.render(),t&&new wp.ccf.views.SubmissionColumnController({el:t}).render()},_setupMainModal:function(e){return this.instance=(new wp.ccf.views.MainModal).render(e),document.getElementsByTagName("body")[0].appendChild(this.instance.el),t.history.start(),this.instance},createManager:function(){var s=this;i.extend(this.dispatcher,t.Events),new wp.ccf.router;var c=!1,r=document.querySelectorAll(".ccf-open-form-manager")[0];if(l.single)if(c=!0,l.postId){var n=parseInt(l.postId);if(s.forms.formsFetching[n]===void 0){var o=new wp.ccf.models.Form({ID:n}),a=o.fetch();s.forms.formsFetching[n]=a,s._currentFormDeferred=a,a.done(function(){delete s.forms.formsFetching[n],s.forms.add(o),s.currentForm=o})}else s._currentFormDeferred=s.forms.formsFetching[n],s._currentFormDeferred.done(function(){s.currentForm=s.forms.findWhere({ID:n})});e.when(s._currentFormDeferred).then(function(){s._setupMainModal(!0),r.style.display="inline-block";var e=document.getElementById("ccf-submissions");if(e){var t=e.querySelectorAll(".inside")[0],i=document.createElement("div");i.className="ccf-submission-settings",i.setAttribute("data-icon","");var l=document.getElementById("show-settings-link");i.onclick=function(){l.click()},e.insertBefore(i,e.firstChild.nextSibling.nextSibling),wp.ccf.createSubmissionsTable(t)}})}else s._setupMainModal(!0),r.style.display="inline-block";else s._setupMainModal();var d=function(e){e=e||window.event;var t=e.currentTarget?e.currentTarget:e.srcElement,i=t.getAttribute("data-form-id");wp.ccf.toggle(i)};r.addEventListener?r.addEventListener("click",d,!1):r.attachEvent("onclick",d)}}),wp.ccf.createManager()}(jQuery,Backbone,_,ccfSettings);
|
build/js/form-mce.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(e){wp.mce.ccfForm={shortcode_data:{},forms:{},View:{template:wp.ccf.utils.template(
|
1 |
+
(function(e){wp.mce.ccfForm={shortcode_data:{},forms:{},View:{template:wp.ccf.utils.template("ccf-form-mce-preview"),type:"video",postID:document.getElementById("post_ID").value,initialize:function(e){this.shortcode=e.shortcode,wp.ccf.dispatcher.on("saveFormComplete",this.triggerRefresh,this),this.fetch()},triggerRefresh:function(e){e===wp.ccf.forms.findWhere({ID:parseInt(this.shortcode.attrs.named.id)})&&(this.renderPreviews(),this.render(!0))},fetch:function(){var e=this,t=parseInt(e.shortcode.attrs.named.id),i=wp.ccf.forms.findWhere({ID:t});i?(e.renderPreviews(),e.render(!0)):(wp.ccf.forms.formsFetching[t]!==void 0?e.formFetch=wp.ccf.forms.formsFetching[t]:(i=new wp.ccf.models.Form({ID:t}),e.formFetch=i.fetch(),wp.ccf.forms.formsFetching[t]=e.formFetch),e.formFetch.complete(function(){"resolved"===e.formFetch.state()&&i!==void 0&&(wp.ccf.forms.add(i),delete wp.ccf.forms.formsFetching[t]),e.renderPreviews(),e.render(!0)}))},renderPreviews:function(){var e=parseInt(this.shortcode.attrs.named.id),t=wp.ccf.forms.findWhere({ID:e});if(t){var i=t.get("fields");i.each(function(e){var t=document.getElementById("ccf-"+e.get("type")+"-preview-template");if(t){var i=wp.ccf.utils.template("ccf-"+e.get("type")+"-preview-template")({field:e.toJSON(),mce:!0});e.set("preview",i)}})}},getHtml:function(){var e=parseInt(this.shortcode.attrs.named.id);if(this.formFetch===void 0||"resolved"===this.formFetch.state()||"rejected"===this.formFetch.state()){var t=wp.ccf.forms.findWhere({ID:e});return this.formFetch===void 0?this.template({form:t.toJSON()}):"resolved"===this.formFetch.state()?this.template({form:t.toJSON()}):wp.ccf.utils.template("ccf-form-mce-error-preview")()}return!1}},edit:function(t){var i=window.decodeURIComponent(e(t).attr("data-wpview-text")),l=i.replace(/^.*id=('|")([0-9]+)('|").*$/i,"$2"),s=wp.ccf.forms.findWhere({ID:parseInt(l)});return s?(wp.ccf.show(s),void 0):!1}},wp.mce.views.register("ccf_form",wp.mce.ccfForm)})(jQuery);
|
build/js/form.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(e,t){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.validators=wp.ccf.validators||{};var i={};window.ccfRecaptchaOnload=function(){for(var e=document.querySelectorAll(".ccf-recaptcha-wrapper"),l=function(l){grecaptcha.render(e[s],{sitekey:e[s].getAttribute("data-sitekey"),theme:t.recaptcha_theme,callback:function(){i[l]=!0}})},s=0;e.length>s;s++){var r=e[s].getAttribute("data-form-id");l(r)}};var l=function(e){if(this.wrapper=e,this.errors={},e.className.match(" field-required")){this.inputs=this.wrapper.querySelectorAll(".field-input");var i=this.wrapper.querySelectorAll(".error");i.length&&i[0].parentNode.removeChild(i[0]);var l=!1;if(_.each(this.inputs,function(e){(e.checked||e.selected)&&(l=!0)}),!l){this.errors.required
|
1 |
+
(function(e,t){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.validators=wp.ccf.validators||{};var i={};window.ccfRecaptchaOnload=function(){for(var e=document.querySelectorAll(".ccf-recaptcha-wrapper"),l=function(l){grecaptcha.render(e[s],{sitekey:e[s].getAttribute("data-sitekey"),theme:t.recaptcha_theme,callback:function(){i[l]=!0}})},s=0;e.length>s;s++){var r=e[s].getAttribute("data-form-id");l(r)}};var l=function(e){if(this.wrapper=e,this.errors={},e.className.match(" field-required")){this.inputs=this.wrapper.querySelectorAll(".field-input");var i=this.wrapper.querySelectorAll(".error");i.length&&i[0].parentNode.removeChild(i[0]);var l=!1;if(_.each(this.inputs,function(e){(e.checked&&e.value||e.selected)&&(l=!0)}),!l){this.errors[this.inputs[this.inputs.length-1].getAttribute("name")]={required:!0};var s=document.createElement("div");s.className="error required-error",s.innerHTML=t.required,e.appendChild(s)}}},s=function(e,i){return function(l){this.wrapper=l,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);_.each(this.inputs,function(t){var i=t.getAttribute("name");this.errors[i]={},t.getAttribute("aria-required")&&""===t.value&&(this.errors[i].required=t),e&&e.call(this,t)},this),i&&i.call(this);var c;for(var o in this.errors)if(this.errors.hasOwnProperty(o))for(var n in this.errors[o])c=document.createElement("div"),c.className="error "+n+"-error",c.setAttribute("data-field-name",o),c.innerHTML=t[n],this.errors[o][n].parentNode.insertBefore(c,this.errors[o][n].nextSibling)}};wp.ccf.validators["single-line-text"]=wp.ccf.validators["single-line-text"]||s(),wp.ccf.validators["paragraph-text"]=wp.ccf.validators["paragraph-text"]||s(),wp.ccf.validators.name=wp.ccf.validators.name||s(),wp.ccf.validators.email=wp.ccf.validators.email||s(!1,function(){var e=this.inputs[0].value;if(e){2===this.inputs.length&&e!==this.inputs[1].value&&(this.errors[this.inputs[0].getAttribute("name")].match=this.wrapper.lastChild);var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;t.test(e)||(this.errors[this.inputs[0].getAttribute("name")].email=this.wrapper.lastChild)}}),wp.ccf.validators.recaptcha=wp.ccf.validators.recaptcha||function(e,l){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".g-recaptcha-response"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);i[l]||(this.errors["g-recaptcha-response"]={},this.errors["g-recaptcha-response"].recaptcha=this.wrapper.lastChild);var c;for(var o in this.errors)if(this.errors.hasOwnProperty(o))for(var n in this.errors[o])c=document.createElement("div"),c.className="error "+n+"-error",c.setAttribute("data-field-name",o),c.innerHTML=t[n],this.errors[o][n].parentNode.insertBefore(c,this.errors[o][n].nextSibling)},wp.ccf.validators.phone=wp.ccf.validators.phone||s(!1,function(){var e=this.inputs[0].value;if(e){var t=/^[0-9+.)(\-]+$/;if(t.test(e)){if("us"===this.wrapper.getAttribute("data-phone-format")){var i=e.replace(/[^0-9]/,"");10!==i.length&&(this.errors[this.inputs[0].getAttribute("name")].digits=this.wrapper.lastChild)}}else this.errors[this.inputs[0].getAttribute("name")].phone=this.wrapper.lastChild}}),wp.ccf.validators.date=wp.ccf.validators.date||function(e){this.wrapper=e,this.errors={},this.inputs=this.wrapper.querySelectorAll(".field-input");for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);var s;_.each(this.inputs,function(i){var l=i.getAttribute("name");if(this.errors[l]={},i.getAttribute("aria-required")&&""===i.value&&(this.errors[l].required=!0,s=document.createElement("div"),s.className="error required-error",1===this.inputs.length?(s.innerHTML=t.required,s.className+=" right-error",i.parentNode.insertBefore(s,i.nextSibling)):(s.innerHTML=t[l.replace(/.*\[(.*?)\]/i,"$1")+"_required"],e.appendChild(s))),""!==i.value){var r=l.replace(/^.*\[(.*?)\]$/,"$1");"date"===r?i.value.match(/^([0-9]|\/)+$/)||(s=document.createElement("div"),s.className="error date-error",s.innerHTML=t.date,e.appendChild(s)):"hour"===r?i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error hour-error",s.innerHTML=t.hour,e.appendChild(s)):"minute"===r&&(i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error minute-error",s.innerHTML=t.minute,e.appendChild(s)))}},this)},wp.ccf.validators.address=wp.ccf.validators.address||s(),wp.ccf.validators.website=wp.ccf.validators.website||s(function(e){if(e.value){var t=/^http(s?)\:\/\/(([a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+)+)|localhost)(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?([\d\w\.\/\%\+\-\=\&\?\:\\\"\'\,\|\~\;]*)$/;t.test(e.value)||(this.errors[e.getAttribute("name")].website=e)}}),wp.ccf.validators.checkboxes=wp.ccf.validators.checkboxes||l,wp.ccf.validators.dropdown=wp.ccf.validators.dropdown||s(),wp.ccf.validators.radio=wp.ccf.validators.radio||l,wp.ccf.setupDOM=wp.ccf.setupDOM||function(){for(var l=document.querySelectorAll(".ccf-datepicker"),s=0;l.length>s;s++)e(l[s]).datepicker();var r=document.querySelectorAll(".ccf-form-wrapper");r.length>=1&&_.each(r,function(l){var s=parseInt(l.getAttribute("data-form-id")),r=function(r){r.returnFalse=!1,r.preventDefault&&r.preventDefault();var c=l.querySelectorAll(".field"),o=[];_.each(c,function(e){if(!e.className.match(/ skip-field/i)){var t=e.getAttribute("data-field-type"),i=new wp.ccf.validators[t](e,s);if(_.size(i.errors)){var l=0;for(var r in i.errors)i.errors.hasOwnProperty(r)&&_.size(i.errors[r])&&l++;l>0&&o.push(i)}}});var n=e(this.querySelectorAll(".ccf-form")[0]);if(o.length){n.trigger("ccfFormError",o);var a=e(window).scrollTop(),d=a+e(window).height(),f=e(o[0].wrapper),u=f.offset(),p=u.top,h=p+f.height();p>=a&&d>=h||e("html, body").animate({scrollTop:f.offset().top},500)}else{n.trigger("ccfFormSuccess"),l.className=l.className.replace(/ loading/i,"")+" loading";var m=e(l.querySelectorAll(".loading-img")[0]);m.animate({opacity:100}),e.ajax({url:t.ajaxurl,type:"post",data:n.serialize()}).done(function(t){t.success&&("text"===t.action_type&&t.completion_message?(l.innerHTML=t.completion_message,e("html, body").animate({scrollTop:e(l).offset().top},500)):"redirect"===t.action_type&&t.completion_redirect_url&&(document.location=t.completion_redirect_url))}).complete(function(){l.className=l.className.replace(/ loading/i,""),m.animate({opacity:0}),i[s]=!1})}return!1};e(l).on("submit",r)})},e(document).ready(wp.ccf.setupDOM)})(jQuery,ccfSettings);
|
classes/class-ccf-field-renderer.php
CHANGED
@@ -411,10 +411,6 @@ class CCF_Field_Renderer {
|
|
411 |
$line_two_post_value = $_POST['ccf_field_' . $slug]['line_two'];
|
412 |
}
|
413 |
|
414 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['line_two'] ) ) {
|
415 |
-
$line_two_post_value = $_POST['ccf_field_' . $slug]['line_two'];
|
416 |
-
}
|
417 |
-
|
418 |
if ( ! empty( $_POST['ccf_field_' . $slug]['city'] ) ) {
|
419 |
$city_post_value = $_POST['ccf_field_' . $slug]['city'];
|
420 |
}
|
@@ -449,12 +445,8 @@ class CCF_Field_Renderer {
|
|
449 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-street" class="sub-label">Street Address</label>
|
450 |
</div>
|
451 |
<div class="full">
|
452 |
-
<input value="<?php if ( ! empty( $line_two_post_value ) ) echo esc_attr( $line_two_post_value ); ?>" class="
|
453 |
-
<?php if ( ! empty( $errors['line_two_required'] ) ) : ?>
|
454 |
-
<div class="error"><?php echo esc_html( $errors['line_two_required'] ); ?></div>
|
455 |
-
<?php endif; ?>
|
456 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-line_two" class="sub-label">Address Line 2</label>
|
457 |
-
|
458 |
</div>
|
459 |
<div class="left">
|
460 |
<input value="<?php if ( ! empty( $city_post_value ) ) echo esc_attr( $city_post_value ); ?>" class="<?php if ( ! empty( $errors['city_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[city]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-city">
|
411 |
$line_two_post_value = $_POST['ccf_field_' . $slug]['line_two'];
|
412 |
}
|
413 |
|
|
|
|
|
|
|
|
|
414 |
if ( ! empty( $_POST['ccf_field_' . $slug]['city'] ) ) {
|
415 |
$city_post_value = $_POST['ccf_field_' . $slug]['city'];
|
416 |
}
|
445 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-street" class="sub-label">Street Address</label>
|
446 |
</div>
|
447 |
<div class="full">
|
448 |
+
<input value="<?php if ( ! empty( $line_two_post_value ) ) echo esc_attr( $line_two_post_value ); ?>" class=" field-input" id="ccf_field_<?php echo esc_attr( $slug ); ?>-line_two" type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[line_two]">
|
|
|
|
|
|
|
449 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-line_two" class="sub-label">Address Line 2</label>
|
|
|
450 |
</div>
|
451 |
<div class="left">
|
452 |
<input value="<?php if ( ! empty( $city_post_value ) ) echo esc_attr( $city_post_value ); ?>" class="<?php if ( ! empty( $errors['city_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[city]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-city">
|
classes/class-ccf-form-handler.php
CHANGED
@@ -65,15 +65,15 @@ class CCF_Form_Handler {
|
|
65 |
),
|
66 |
'dropdown' => array(
|
67 |
'sanitizer' => 'sanitize_text_field',
|
68 |
-
'validator' => array( $this, '
|
69 |
),
|
70 |
'checkboxes' => array(
|
71 |
'sanitizer' => 'sanitize_text_field',
|
72 |
-
'validator' => array( $this, '
|
73 |
),
|
74 |
'radio' => array(
|
75 |
'sanitizer' => 'sanitize_text_field',
|
76 |
-
'validator' => array( $this, '
|
77 |
),
|
78 |
) );
|
79 |
}
|
@@ -117,6 +117,43 @@ class CCF_Form_Handler {
|
|
117 |
return true;
|
118 |
}
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
public function valid_recaptcha( $value, $field_id, $required ) {
|
121 |
$secret = get_post_meta( $field_id, 'ccf_field_secretKey', true );
|
122 |
|
@@ -192,10 +229,6 @@ class CCF_Form_Handler {
|
|
192 |
$errors['street_required'] = esc_html__( 'This field is required.', 'custom-contact-forms' );
|
193 |
}
|
194 |
|
195 |
-
if ( $required && empty( $value['line_two'] ) ) {
|
196 |
-
$errors['line_two_required'] = esc_html__( 'This field is required.', 'custom-contact-forms' );
|
197 |
-
}
|
198 |
-
|
199 |
if ( $required && empty( $value['city'] ) ) {
|
200 |
$errors['city_required'] = esc_html__( 'This field is required.', 'custom-contact-forms' );
|
201 |
}
|
@@ -558,6 +591,7 @@ class CCF_Form_Handler {
|
|
558 |
foreach ( $submission as $slug => $field ) {
|
559 |
$field_id = $field_slug_to_id[$slug];
|
560 |
$label = get_post_meta( $field_id, 'ccf_field_label', true );
|
|
|
561 |
?>
|
562 |
|
563 |
<div>
|
@@ -568,36 +602,54 @@ class CCF_Form_Handler {
|
|
568 |
<?php endif; ?>
|
569 |
</div>
|
570 |
<div style="margin-bottom: 10px;">
|
571 |
-
<?php if ( ! empty( $field ) )
|
572 |
-
|
573 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
|
575 |
-
|
576 |
|
577 |
-
<?php
|
578 |
|
579 |
-
|
580 |
|
581 |
-
<?php
|
|
|
|
|
|
|
|
|
582 |
|
583 |
-
|
584 |
|
585 |
-
<?php
|
586 |
|
587 |
-
<?php foreach ( $field as $
|
588 |
-
<?php if (
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
|
|
593 |
|
594 |
-
|
595 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
<?php echo esc_html( stripslashes( $field ) ); ?>
|
597 |
-
<?php
|
598 |
-
<?php
|
599 |
<span>-</span>
|
600 |
-
<?php
|
601 |
</div>
|
602 |
|
603 |
<?php
|
65 |
),
|
66 |
'dropdown' => array(
|
67 |
'sanitizer' => 'sanitize_text_field',
|
68 |
+
'validator' => array( $this, 'not_empty_choiceable' ),
|
69 |
),
|
70 |
'checkboxes' => array(
|
71 |
'sanitizer' => 'sanitize_text_field',
|
72 |
+
'validator' => array( $this, 'not_empty_choiceable' ),
|
73 |
),
|
74 |
'radio' => array(
|
75 |
'sanitizer' => 'sanitize_text_field',
|
76 |
+
'validator' => array( $this, 'not_empty_choiceable' ),
|
77 |
),
|
78 |
) );
|
79 |
}
|
117 |
return true;
|
118 |
}
|
119 |
|
120 |
+
/**
|
121 |
+
* Simple callback to determine if a choiceable is "empty"
|
122 |
+
*
|
123 |
+
* @param mixed $value
|
124 |
+
* @param int $field_id
|
125 |
+
* @param bool $required
|
126 |
+
* @since 6.4
|
127 |
+
* @return array|bool
|
128 |
+
*/
|
129 |
+
public function not_empty_choiceable( $value, $field_id, $required ) {
|
130 |
+
$error = false;
|
131 |
+
|
132 |
+
if ( $required ) {
|
133 |
+
if ( ! is_array( $value ) ) {
|
134 |
+
if ( empty( $value ) ) {
|
135 |
+
$error = true;
|
136 |
+
}
|
137 |
+
} else {
|
138 |
+
$error = true;
|
139 |
+
|
140 |
+
if ( ! empty( $value ) ) {
|
141 |
+
foreach ( $value as $something ) {
|
142 |
+
if ( ! empty ( $something ) ) {
|
143 |
+
$error = false;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
if ( $error ) {
|
151 |
+
return array( 'required' => esc_html__( 'This field is required.', 'custom-contact-forms' ) );
|
152 |
+
}
|
153 |
+
|
154 |
+
return true;
|
155 |
+
}
|
156 |
+
|
157 |
public function valid_recaptcha( $value, $field_id, $required ) {
|
158 |
$secret = get_post_meta( $field_id, 'ccf_field_secretKey', true );
|
159 |
|
229 |
$errors['street_required'] = esc_html__( 'This field is required.', 'custom-contact-forms' );
|
230 |
}
|
231 |
|
|
|
|
|
|
|
|
|
232 |
if ( $required && empty( $value['city'] ) ) {
|
233 |
$errors['city_required'] = esc_html__( 'This field is required.', 'custom-contact-forms' );
|
234 |
}
|
591 |
foreach ( $submission as $slug => $field ) {
|
592 |
$field_id = $field_slug_to_id[$slug];
|
593 |
$label = get_post_meta( $field_id, 'ccf_field_label', true );
|
594 |
+
$type = get_post_meta( $field_id, 'ccf_field_type', true );
|
595 |
?>
|
596 |
|
597 |
<div>
|
602 |
<?php endif; ?>
|
603 |
</div>
|
604 |
<div style="margin-bottom: 10px;">
|
605 |
+
<?php if ( ! empty( $field ) ) : ?>
|
606 |
+
|
607 |
+
<?php if ( 'date' === $type ) : ?>
|
608 |
+
|
609 |
+
<?php echo esc_html( stripslashes( CCF_Submission_CPT::factory()->get_pretty_field_date( $field ) ) ); ?>
|
610 |
+
|
611 |
+
<?php elseif ( 'name' === $type ) : ?>
|
612 |
+
|
613 |
+
<?php echo esc_html( stripslashes( CCF_Submission_CPT::factory()->get_pretty_field_name( $field ) ) ); ?>
|
614 |
|
615 |
+
<?php elseif ( 'address' === $type ) : ?>
|
616 |
|
617 |
+
<?php echo esc_html( stripslashes( CCF_Submission_CPT::factory()->get_pretty_field_address( $field ) ) ); ?>
|
618 |
|
619 |
+
<?php elseif ( 'email' === $type ) : ?>
|
620 |
|
621 |
+
<?php if ( is_array( $field ) ) : ?>
|
622 |
+
<?php echo esc_html( stripslashes( $field['email'] ) ); ?>
|
623 |
+
<?php else : ?>
|
624 |
+
<?php echo esc_html( stripslashes( $field ) ); ?>
|
625 |
+
<?php endif; ?>
|
626 |
|
627 |
+
<?php elseif ( 'dropdown' === $type || 'radio' === $type || 'checkboxes' === $type ) : ?>
|
628 |
|
629 |
+
<?php if ( is_array( $field ) ) : ?>
|
630 |
|
631 |
+
<?php $i = 0; foreach ( $field as $value ) : ?>
|
632 |
+
<?php if ( ! empty( $value ) ) : ?>
|
633 |
+
<?php if ( $i !== 0 ) : ?><br><?php endif; ?>
|
634 |
+
<?php echo esc_html( stripslashes( $value ) ); ?>
|
635 |
+
<?php $i++; ?>
|
636 |
+
<?php endif; ?>
|
637 |
+
<?php endforeach; ?>
|
638 |
|
639 |
+
<?php if ( 0 === $i ) : ?>
|
640 |
+
<span>-</span>
|
641 |
+
<?php endif; ?>
|
642 |
+
|
643 |
+
<?php else : ?>
|
644 |
+
<?php echo esc_html( stripslashes( $field ) ); ?>
|
645 |
+
<?php endif; ?>
|
646 |
+
|
647 |
+
<?php else : ?>
|
648 |
<?php echo esc_html( stripslashes( $field ) ); ?>
|
649 |
+
<?php endif; ?>
|
650 |
+
<?php else : ?>
|
651 |
<span>-</span>
|
652 |
+
<?php endif; ?>
|
653 |
</div>
|
654 |
|
655 |
<?php
|
classes/class-ccf-form-manager.php
CHANGED
@@ -180,7 +180,7 @@ class CCF_Form_Manager {
|
|
180 |
<option value="field" <# if ( 'field' === form.emailNotificationFromType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
|
181 |
</select>
|
182 |
|
183 |
-
<
|
184 |
</p>
|
185 |
|
186 |
<p class="email-notification-from-address">
|
@@ -190,16 +190,8 @@ class CCF_Form_Manager {
|
|
190 |
|
191 |
<p class="email-notification-from-field">
|
192 |
<label for="ccf_form_email_notification_from_field"><?php esc_html_e( 'Pull "From" Email Dynamically from Field:', 'custom-contact-forms' ); ?></label>
|
193 |
-
|
194 |
-
|
195 |
-
<input type="hidden" name="email_notification_from_field" value="" class="form-email-notification-from-field">
|
196 |
-
<# } else { #>
|
197 |
-
<select name="email_notification_from_field" class="form-email-notification-from-field" id="ccf_form_email_notification_from_field">
|
198 |
-
<# _.each( emailFields, function( field ) { #>
|
199 |
-
<option <# if ( field.get( 'slug' ) === form.emailNotificationFromField ) { #>selected<# }#>>{{ field.get( 'slug' ) }}</option>
|
200 |
-
<# }); #>
|
201 |
-
</select>
|
202 |
-
<# } #>
|
203 |
</p>
|
204 |
</div>
|
205 |
</script>
|
@@ -1149,27 +1141,37 @@ class CCF_Form_Manager {
|
|
1149 |
<# if ( submission.data[column] ) { #>
|
1150 |
<# if ( submission.data[column] instanceof Object ) { var output = '', i = 0; #>
|
1151 |
<# if ( utils.isFieldDate( submission.data[column] ) ) { #>
|
1152 |
-
{{ utils.getPrettyFieldDate( submission.data[column] ) }}
|
1153 |
<# } else if ( utils.isFieldName( submission.data[column] ) ) { #>
|
1154 |
-
{{ utils.getPrettyFieldName( submission.data[column] ) }}
|
1155 |
<# } else if ( utils.isFieldAddress( submission.data[column] ) ) { #>
|
1156 |
{{ utils.wordChop( utils.getPrettyFieldAddress( submission.data[column] ), 30 ) }}
|
|
|
|
|
1157 |
<# } else { #>
|
1158 |
<# for ( var key in submission.data[column] ) { if ( submission.data[column].hasOwnProperty( key ) ) {
|
1159 |
-
if (
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
|
|
1163 |
|
1164 |
-
|
|
|
1165 |
} } #>
|
1166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1167 |
<# } #>
|
1168 |
<# } else { #>
|
1169 |
-
{{ utils.wordChop( submission.data[column] ) }}
|
1170 |
<# } #>
|
1171 |
<# } else { #>
|
1172 |
-
<span
|
1173 |
<# } #>
|
1174 |
</td>
|
1175 |
<# } #>
|
@@ -1186,17 +1188,32 @@ class CCF_Form_Manager {
|
|
1186 |
</div>
|
1187 |
<div class="field-content">
|
1188 |
<# if ( submission.data[column] ) { #>
|
1189 |
-
<# if ( submission.data[column] instanceof Object ) { #>
|
1190 |
<# if ( utils.isFieldDate( submission.data[column] ) ) { #>
|
1191 |
{{ utils.getPrettyFieldDate( submission.data[column] ) }}
|
1192 |
<# } else if ( utils.isFieldName( submission.data[column] ) ) { #>
|
1193 |
{{ utils.getPrettyFieldName( submission.data[column] ) }}
|
1194 |
<# } else if ( utils.isFieldAddress( submission.data[column] ) ) { #>
|
1195 |
{{ utils.getPrettyFieldAddress( submission.data[column] ) }}
|
|
|
|
|
1196 |
<# } else { #>
|
1197 |
-
<# for ( var key in submission.data[column] ) { if ( submission.data[column].hasOwnProperty( key ) ) {
|
1198 |
-
|
1199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1200 |
<# } #>
|
1201 |
<# } else { #>
|
1202 |
{{ submission.data[column] }}
|
@@ -1302,6 +1319,7 @@ class CCF_Form_Manager {
|
|
1302 |
'postsPerPage' => (int) get_option( 'posts_per_page' ),
|
1303 |
'structureFieldLabels' => $structure_field_labels,
|
1304 |
'specialFieldLabels' => $special_field_labels,
|
|
|
1305 |
'invalidDate' => esc_html__( 'Invalid date', 'custom-contact-forms' ),
|
1306 |
'allLabels' => array_merge( $field_labels, $structure_field_labels, $special_field_labels ),
|
1307 |
'thickboxTitle' => esc_html__( 'Form Submission', 'custom-contact-forms' ),
|
180 |
<option value="field" <# if ( 'field' === form.emailNotificationFromType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
|
181 |
</select>
|
182 |
|
183 |
+
<span class="explain"><?php esc_html_e( 'You can set the notification emails from address to be the WP default, a custom email address, or pull the address from a field in the form.', 'custom-contact-forms' ); ?></span>
|
184 |
</p>
|
185 |
|
186 |
<p class="email-notification-from-address">
|
190 |
|
191 |
<p class="email-notification-from-field">
|
192 |
<label for="ccf_form_email_notification_from_field"><?php esc_html_e( 'Pull "From" Email Dynamically from Field:', 'custom-contact-forms' ); ?></label>
|
193 |
+
<select name="email_notification_from_field" class="form-email-notification-from-field" id="ccf_form_email_notification_from_field">
|
194 |
+
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
</p>
|
196 |
</div>
|
197 |
</script>
|
1141 |
<# if ( submission.data[column] ) { #>
|
1142 |
<# if ( submission.data[column] instanceof Object ) { var output = '', i = 0; #>
|
1143 |
<# if ( utils.isFieldDate( submission.data[column] ) ) { #>
|
1144 |
+
{{ utils.wordChop( utils.getPrettyFieldDate( submission.data[column] ), 30 ) }}
|
1145 |
<# } else if ( utils.isFieldName( submission.data[column] ) ) { #>
|
1146 |
+
{{ utils.wordChop( utils.getPrettyFieldName( submission.data[column] ), 30 ) }}
|
1147 |
<# } else if ( utils.isFieldAddress( submission.data[column] ) ) { #>
|
1148 |
{{ utils.wordChop( utils.getPrettyFieldAddress( submission.data[column] ), 30 ) }}
|
1149 |
+
<# } else if ( utils.isFieldEmailConfirm( submission.data[column] ) ) { #>
|
1150 |
+
{{ utils.wordChop( utils.getPrettyFieldEmailConfirm( submission.data[column] ), 30 ) }}
|
1151 |
<# } else { #>
|
1152 |
<# for ( var key in submission.data[column] ) { if ( submission.data[column].hasOwnProperty( key ) ) {
|
1153 |
+
if ( submission.data[column][key] !== '' ) {
|
1154 |
+
if ( i > 0 ) {
|
1155 |
+
output += ', ';
|
1156 |
+
}
|
1157 |
+
output += submission.data[column][key];
|
1158 |
|
1159 |
+
i++;
|
1160 |
+
}
|
1161 |
} } #>
|
1162 |
+
|
1163 |
+
<# if ( output ) { #>
|
1164 |
+
{{ utils.wordChop( output, 30 ) }}
|
1165 |
+
<# } else { #>
|
1166 |
+
<span>-</span>
|
1167 |
+
<# } #>
|
1168 |
+
|
1169 |
<# } #>
|
1170 |
<# } else { #>
|
1171 |
+
{{ utils.wordChop( submission.data[column], 30 ) }}
|
1172 |
<# } #>
|
1173 |
<# } else { #>
|
1174 |
+
<span>-</span>
|
1175 |
<# } #>
|
1176 |
</td>
|
1177 |
<# } #>
|
1188 |
</div>
|
1189 |
<div class="field-content">
|
1190 |
<# if ( submission.data[column] ) { #>
|
1191 |
+
<# if ( submission.data[column] instanceof Object ) { var output = '', i = 0; #>
|
1192 |
<# if ( utils.isFieldDate( submission.data[column] ) ) { #>
|
1193 |
{{ utils.getPrettyFieldDate( submission.data[column] ) }}
|
1194 |
<# } else if ( utils.isFieldName( submission.data[column] ) ) { #>
|
1195 |
{{ utils.getPrettyFieldName( submission.data[column] ) }}
|
1196 |
<# } else if ( utils.isFieldAddress( submission.data[column] ) ) { #>
|
1197 |
{{ utils.getPrettyFieldAddress( submission.data[column] ) }}
|
1198 |
+
<# } else if ( utils.isFieldEmailConfirm( submission.data[column] ) ) { #>
|
1199 |
+
{{ utils.getPrettyFieldEmailConfirm( submission.data[column] ) }}
|
1200 |
<# } else { #>
|
1201 |
+
<# for ( var key in submission.data[column] ) { if ( submission.data[column].hasOwnProperty( key ) ) {
|
1202 |
+
if ( submission.data[column][key] !== '' ) {
|
1203 |
+
if ( i > 0 ) {
|
1204 |
+
output += ', ';
|
1205 |
+
}
|
1206 |
+
output += submission.data[column][key];
|
1207 |
+
|
1208 |
+
i++;
|
1209 |
+
}
|
1210 |
+
} } #>
|
1211 |
+
|
1212 |
+
<# if ( output ) { #>
|
1213 |
+
{{ output }}
|
1214 |
+
<# } else { #>
|
1215 |
+
-
|
1216 |
+
<# } #>
|
1217 |
<# } #>
|
1218 |
<# } else { #>
|
1219 |
{{ submission.data[column] }}
|
1319 |
'postsPerPage' => (int) get_option( 'posts_per_page' ),
|
1320 |
'structureFieldLabels' => $structure_field_labels,
|
1321 |
'specialFieldLabels' => $special_field_labels,
|
1322 |
+
'noEmailFields' => esc_html__( 'You have no email fields', 'custom-contact-forms' ),
|
1323 |
'invalidDate' => esc_html__( 'Invalid date', 'custom-contact-forms' ),
|
1324 |
'allLabels' => array_merge( $field_labels, $structure_field_labels, $special_field_labels ),
|
1325 |
'thickboxTitle' => esc_html__( 'Form Submission', 'custom-contact-forms' ),
|
classes/class-ccf-submission-cpt.php
CHANGED
@@ -32,51 +32,6 @@ class CCF_Submission_CPT {
|
|
32 |
register_post_type( 'ccf_submission', $args );
|
33 |
}
|
34 |
|
35 |
-
/**
|
36 |
-
* Check if a field is a date
|
37 |
-
*
|
38 |
-
* @param array|string $value
|
39 |
-
* @since 6.0
|
40 |
-
* @return bool
|
41 |
-
*/
|
42 |
-
public function is_field_date( $value ) {
|
43 |
-
if ( ! empty( $value['date'] ) || ( ! empty( $value['hour'] ) && ! empty( $value['minute'] ) && ! empty( $value['am-pm'] ) ) ) {
|
44 |
-
return true;
|
45 |
-
}
|
46 |
-
|
47 |
-
return false;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Check if a field is an name
|
52 |
-
*
|
53 |
-
* @param array|string $value
|
54 |
-
* @since 6.0
|
55 |
-
* @return bool
|
56 |
-
*/
|
57 |
-
public function is_field_name( $value ) {
|
58 |
-
if ( ! empty( $value['first'] ) || ! empty( $value['last'] ) ) {
|
59 |
-
return true;
|
60 |
-
}
|
61 |
-
|
62 |
-
return false;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Check if a field is an address
|
67 |
-
*
|
68 |
-
* @param array|string $value
|
69 |
-
* @since 6.0
|
70 |
-
* @return bool
|
71 |
-
*/
|
72 |
-
public function is_field_address( $value ) {
|
73 |
-
if ( ! empty( $value['street'] ) && ! empty( $value['city'] ) && ! empty( $value['zipcode'] ) && ! empty( $value['line_two'] ) ) {
|
74 |
-
return true;
|
75 |
-
}
|
76 |
-
|
77 |
-
return false;
|
78 |
-
}
|
79 |
-
|
80 |
/**
|
81 |
* Get prettified field date
|
82 |
*
|
32 |
register_post_type( 'ccf_submission', $args );
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
/**
|
36 |
* Get prettified field date
|
37 |
*
|
composer.json
CHANGED
@@ -1,14 +1,6 @@
|
|
1 |
{
|
2 |
"name": "tlovett1/custom-contact-forms",
|
3 |
-
|
4 |
-
"license": "MIT",
|
5 |
-
"authors": [
|
6 |
-
{
|
7 |
-
"name": "Taylor Lovett",
|
8 |
-
"email": "tlovett88@gmail.com"
|
9 |
-
}
|
10 |
-
],
|
11 |
-
"require-dev": {
|
12 |
"wp-api/wp-api": "dev-master#ad9688f450a813fd23d5c008d7d7c9fb58e76b2b"
|
13 |
},
|
14 |
"repositories": [
|
@@ -24,6 +16,5 @@
|
|
24 |
}
|
25 |
}
|
26 |
}
|
27 |
-
]
|
28 |
-
"minimum-stability": "stable"
|
29 |
}
|
1 |
{
|
2 |
"name": "tlovett1/custom-contact-forms",
|
3 |
+
"require": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
"wp-api/wp-api": "dev-master#ad9688f450a813fd23d5c008d7d7c9fb58e76b2b"
|
5 |
},
|
6 |
"repositories": [
|
16 |
}
|
17 |
}
|
18 |
}
|
19 |
+
]
|
|
|
20 |
}
|
composer.lock
CHANGED
@@ -4,9 +4,8 @@
|
|
4 |
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"hash": "
|
8 |
-
"packages": [
|
9 |
-
"packages-dev": [
|
10 |
{
|
11 |
"name": "wp-api/wp-api",
|
12 |
"version": "dev-master",
|
@@ -19,6 +18,7 @@
|
|
19 |
"time": "2014-12-19 22:28:49"
|
20 |
}
|
21 |
],
|
|
|
22 |
"aliases": [],
|
23 |
"minimum-stability": "stable",
|
24 |
"stability-flags": {
|
4 |
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"hash": "1d93aaeab916629d2e1b6fd76199eb35",
|
8 |
+
"packages": [
|
|
|
9 |
{
|
10 |
"name": "wp-api/wp-api",
|
11 |
"version": "dev-master",
|
18 |
"time": "2014-12-19 22:28:49"
|
19 |
}
|
20 |
],
|
21 |
+
"packages-dev": [],
|
22 |
"aliases": [],
|
23 |
"minimum-stability": "stable",
|
24 |
"stability-flags": {
|
custom-contact-forms.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: http://www.taylorlovett.com
|
5 |
* Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
|
6 |
* Author: Taylor Lovett
|
7 |
-
* Version: 6.3.
|
8 |
* Author URI: http://www.taylorlovett.com
|
9 |
*/
|
10 |
|
4 |
* Plugin URI: http://www.taylorlovett.com
|
5 |
* Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
|
6 |
* Author: Taylor Lovett
|
7 |
+
* Version: 6.3.3
|
8 |
* Author URI: http://www.taylorlovett.com
|
9 |
*/
|
10 |
|
js/form-cpt-preview.js
CHANGED
@@ -31,7 +31,7 @@
|
|
31 |
};
|
32 |
|
33 |
wp.ccf.preview.prototype = {
|
34 |
-
template: wp.ccf.utils.template(
|
35 |
|
36 |
fetch: function() {
|
37 |
var SELF = this;
|
@@ -64,7 +64,7 @@
|
|
64 |
var template = document.getElementById( 'ccf-' + field.get( 'type' ) + '-preview-template' );
|
65 |
|
66 |
if ( template ) {
|
67 |
-
var preview = wp.ccf.utils.template(
|
68 |
field.set( 'preview', preview );
|
69 |
}
|
70 |
});
|
31 |
};
|
32 |
|
33 |
wp.ccf.preview.prototype = {
|
34 |
+
template: wp.ccf.utils.template( 'ccf-form-mce-preview' ),
|
35 |
|
36 |
fetch: function() {
|
37 |
var SELF = this;
|
64 |
var template = document.getElementById( 'ccf-' + field.get( 'type' ) + '-preview-template' );
|
65 |
|
66 |
if ( template ) {
|
67 |
+
var preview = wp.ccf.utils.template( 'ccf-' + field.get( 'type' ) + '-preview-template' )( { field: field.toJSON(), mce: true } );
|
68 |
field.set( 'preview', preview );
|
69 |
}
|
70 |
});
|
js/form-mce.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
forms: {},
|
7 |
|
8 |
View: {
|
9 |
-
template: wp.ccf.utils.template(
|
10 |
|
11 |
type: 'video',
|
12 |
|
@@ -72,7 +72,7 @@
|
|
72 |
var template = document.getElementById( 'ccf-' + field.get( 'type' ) + '-preview-template' );
|
73 |
|
74 |
if ( template ) {
|
75 |
-
var preview = wp.ccf.utils.template(
|
76 |
field.set( 'preview', preview );
|
77 |
}
|
78 |
});
|
@@ -91,7 +91,7 @@
|
|
91 |
if ( this.formFetch.state() === 'resolved' ) {
|
92 |
return this.template( { form: form.toJSON() } );
|
93 |
} else {
|
94 |
-
return wp.ccf.utils.template(
|
95 |
}
|
96 |
}
|
97 |
}
|
6 |
forms: {},
|
7 |
|
8 |
View: {
|
9 |
+
template: wp.ccf.utils.template( 'ccf-form-mce-preview' ),
|
10 |
|
11 |
type: 'video',
|
12 |
|
72 |
var template = document.getElementById( 'ccf-' + field.get( 'type' ) + '-preview-template' );
|
73 |
|
74 |
if ( template ) {
|
75 |
+
var preview = wp.ccf.utils.template( 'ccf-' + field.get( 'type' ) + '-preview-template' )( { field: field.toJSON(), mce: true } );
|
76 |
field.set( 'preview', preview );
|
77 |
}
|
78 |
});
|
91 |
if ( this.formFetch.state() === 'resolved' ) {
|
92 |
return this.template( { form: form.toJSON() } );
|
93 |
} else {
|
94 |
+
return wp.ccf.utils.template( 'ccf-form-mce-error-preview' )();
|
95 |
}
|
96 |
}
|
97 |
}
|
js/form.js
CHANGED
@@ -44,13 +44,15 @@
|
|
44 |
var found = false;
|
45 |
|
46 |
_.each( this.inputs, function( input ) {
|
47 |
-
if ( input.checked || input.selected ) {
|
48 |
found = true;
|
49 |
}
|
50 |
});
|
51 |
|
52 |
if ( ! found ) {
|
53 |
-
this.errors.
|
|
|
|
|
54 |
|
55 |
var newErrorNode = document.createElement( 'div' );
|
56 |
newErrorNode.className = 'error required-error';
|
@@ -265,10 +267,7 @@
|
|
265 |
|
266 |
wp.ccf.validators.radio = wp.ccf.validators.radio || choiceValidator;
|
267 |
|
268 |
-
|
269 |
-
* Register listeners on DOM
|
270 |
-
*/
|
271 |
-
$( document ).ready( function() {
|
272 |
var datepickers = document.querySelectorAll( '.ccf-datepicker' );
|
273 |
|
274 |
for ( var i = 0; i < datepickers.length; i++ ) {
|
@@ -306,7 +305,7 @@
|
|
306 |
var validationErrors = 0;
|
307 |
for ( var key in validation.errors ) {
|
308 |
if ( validation.errors.hasOwnProperty( key ) ) {
|
309 |
-
if (_.size( validation.errors[key] ) ) {
|
310 |
validationErrors++;
|
311 |
}
|
312 |
}
|
@@ -318,7 +317,12 @@
|
|
318 |
}
|
319 |
});
|
320 |
|
|
|
|
|
321 |
if ( errors.length ) {
|
|
|
|
|
|
|
322 |
var docViewTop = $( window ).scrollTop();
|
323 |
var docViewBottom = docViewTop + $( window ).height();
|
324 |
|
@@ -334,7 +338,8 @@
|
|
334 |
}, 500 );
|
335 |
}
|
336 |
} else {
|
337 |
-
|
|
|
338 |
|
339 |
form.className = form.className.replace( / loading/i, '' ) + ' loading';
|
340 |
|
@@ -372,5 +377,10 @@
|
|
372 |
|
373 |
});
|
374 |
}
|
375 |
-
}
|
|
|
|
|
|
|
|
|
|
|
376 |
})( jQuery, ccfSettings );
|
44 |
var found = false;
|
45 |
|
46 |
_.each( this.inputs, function( input ) {
|
47 |
+
if ( ( input.checked && input.value ) || input.selected ) {
|
48 |
found = true;
|
49 |
}
|
50 |
});
|
51 |
|
52 |
if ( ! found ) {
|
53 |
+
this.errors[this.inputs[this.inputs.length - 1].getAttribute( 'name' )] = {
|
54 |
+
required: true
|
55 |
+
};
|
56 |
|
57 |
var newErrorNode = document.createElement( 'div' );
|
58 |
newErrorNode.className = 'error required-error';
|
267 |
|
268 |
wp.ccf.validators.radio = wp.ccf.validators.radio || choiceValidator;
|
269 |
|
270 |
+
wp.ccf.setupDOM = wp.ccf.setupDOM || function() {
|
|
|
|
|
|
|
271 |
var datepickers = document.querySelectorAll( '.ccf-datepicker' );
|
272 |
|
273 |
for ( var i = 0; i < datepickers.length; i++ ) {
|
305 |
var validationErrors = 0;
|
306 |
for ( var key in validation.errors ) {
|
307 |
if ( validation.errors.hasOwnProperty( key ) ) {
|
308 |
+
if ( _.size( validation.errors[key] ) ) {
|
309 |
validationErrors++;
|
310 |
}
|
311 |
}
|
317 |
}
|
318 |
});
|
319 |
|
320 |
+
var $form = $( this.querySelectorAll( '.ccf-form' )[0] );
|
321 |
+
|
322 |
if ( errors.length ) {
|
323 |
+
// Trigger errors, mostly for unit testing
|
324 |
+
$form.trigger( 'ccfFormError', errors );
|
325 |
+
|
326 |
var docViewTop = $( window ).scrollTop();
|
327 |
var docViewBottom = docViewTop + $( window ).height();
|
328 |
|
338 |
}, 500 );
|
339 |
}
|
340 |
} else {
|
341 |
+
// Notify form complete, mostly for unit testing
|
342 |
+
$form.trigger( 'ccfFormSuccess' );
|
343 |
|
344 |
form.className = form.className.replace( / loading/i, '' ) + ' loading';
|
345 |
|
377 |
|
378 |
});
|
379 |
}
|
380 |
+
};
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Register listeners on DOM
|
384 |
+
*/
|
385 |
+
$( document ).ready( wp.ccf.setupDOM );
|
386 |
})( jQuery, ccfSettings );
|
js/manager/models.js
CHANGED
@@ -304,7 +304,8 @@
|
|
304 |
{
|
305 |
defaults: function() {
|
306 |
var defaults = {
|
307 |
-
type: 'website'
|
|
|
308 |
};
|
309 |
|
310 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
304 |
{
|
305 |
defaults: function() {
|
306 |
var defaults = {
|
307 |
+
type: 'website',
|
308 |
+
placeholder: 'http://'
|
309 |
};
|
310 |
|
311 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
js/manager/utils.js
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
delete object.modified_tz;
|
15 |
};
|
16 |
|
17 |
-
wp.ccf.utils.template = function
|
18 |
// Use WordPress style Backbone template syntax
|
19 |
var options = {
|
20 |
evaluate: /<#([\s\S]+?)#>/g,
|
@@ -22,8 +22,8 @@
|
|
22 |
escape: /\{\{([^\}]+?)\}\}(?!\})/g
|
23 |
};
|
24 |
|
25 |
-
return _.template(
|
26 |
-
};
|
27 |
|
28 |
wp.ccf.utils.insertFormShortcode = function( form ) {
|
29 |
var existingForm = wp.ccf.forms.findWhere( { ID: form.get( 'ID' ) } );
|
@@ -74,6 +74,14 @@
|
|
74 |
return false;
|
75 |
};
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
wp.ccf.utils.isFieldAddress = function( value ) {
|
78 |
if ( typeof value.street !== 'undefined' && typeof value.city !== 'undefined' && typeof value.zipcode !== 'undefined' && typeof value.line_two !== 'undefined' ) {
|
79 |
return true;
|
@@ -82,6 +90,18 @@
|
|
82 |
return false;
|
83 |
};
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
wp.ccf.utils.getPrettyFieldDate = function( value ) {
|
86 |
var dateString = '',
|
87 |
output = '';
|
14 |
delete object.modified_tz;
|
15 |
};
|
16 |
|
17 |
+
wp.ccf.utils.template = _.memoize( function( id ) {
|
18 |
// Use WordPress style Backbone template syntax
|
19 |
var options = {
|
20 |
evaluate: /<#([\s\S]+?)#>/g,
|
22 |
escape: /\{\{([^\}]+?)\}\}(?!\})/g
|
23 |
};
|
24 |
|
25 |
+
return _.template( document.getElementById( id ).innerHTML, null, options );
|
26 |
+
});
|
27 |
|
28 |
wp.ccf.utils.insertFormShortcode = function( form ) {
|
29 |
var existingForm = wp.ccf.forms.findWhere( { ID: form.get( 'ID' ) } );
|
74 |
return false;
|
75 |
};
|
76 |
|
77 |
+
wp.ccf.utils.isFieldEmailConfirm = function( value ) {
|
78 |
+
if ( typeof value.email !== 'undefined' || typeof value.confirm !== 'undefined' ) {
|
79 |
+
return true;
|
80 |
+
}
|
81 |
+
|
82 |
+
return false;
|
83 |
+
};
|
84 |
+
|
85 |
wp.ccf.utils.isFieldAddress = function( value ) {
|
86 |
if ( typeof value.street !== 'undefined' && typeof value.city !== 'undefined' && typeof value.zipcode !== 'undefined' && typeof value.line_two !== 'undefined' ) {
|
87 |
return true;
|
90 |
return false;
|
91 |
};
|
92 |
|
93 |
+
wp.ccf.utils.getPrettyFieldEmailConfirm = function( value ) {
|
94 |
+
if ( value.email ) {
|
95 |
+
return value.email;
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( value.confirm ) {
|
99 |
+
return value.confirm;
|
100 |
+
}
|
101 |
+
|
102 |
+
return '-';
|
103 |
+
};
|
104 |
+
|
105 |
wp.ccf.utils.getPrettyFieldDate = function( value ) {
|
106 |
var dateString = '',
|
107 |
output = '';
|
js/manager/views.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
|
7 |
wp.ccf.views.FieldChoice = Backbone.View.extend(
|
8 |
{
|
9 |
-
template: wp.ccf.utils.template(
|
10 |
className: 'choice',
|
11 |
|
12 |
events: {
|
@@ -148,7 +148,7 @@
|
|
148 |
|
149 |
wp.ccf.views.Fields['single-line-text'] = wp.ccf.views.Fields['single-line-text'] || wp.ccf.views.FieldBase.extend(
|
150 |
{
|
151 |
-
template: wp.ccf.utils.template(
|
152 |
|
153 |
initialize: function() {
|
154 |
|
@@ -170,7 +170,7 @@
|
|
170 |
|
171 |
wp.ccf.views.Fields.recaptcha = wp.ccf.views.Fields.recaptcha || wp.ccf.views.FieldBase.extend(
|
172 |
{
|
173 |
-
template: wp.ccf.utils.template(
|
174 |
|
175 |
initialize: function() {
|
176 |
|
@@ -189,7 +189,7 @@
|
|
189 |
|
190 |
wp.ccf.views.Fields['section-header'] = wp.ccf.views.Fields['section-header'] || wp.ccf.views.FieldBase.extend(
|
191 |
{
|
192 |
-
template: wp.ccf.utils.template(
|
193 |
|
194 |
initialize: function() {
|
195 |
|
@@ -207,7 +207,7 @@
|
|
207 |
|
208 |
wp.ccf.views.Fields.html = wp.ccf.views.Fields.html || wp.ccf.views.FieldBase.extend(
|
209 |
{
|
210 |
-
template: wp.ccf.utils.template(
|
211 |
|
212 |
initialize: function() {
|
213 |
|
@@ -224,7 +224,7 @@
|
|
224 |
|
225 |
wp.ccf.views.Fields['paragraph-text'] = wp.ccf.views.Fields['paragraph-text'] || wp.ccf.views.FieldBase.extend(
|
226 |
{
|
227 |
-
template: wp.ccf.utils.template(
|
228 |
|
229 |
saveField: function() {
|
230 |
|
@@ -242,7 +242,7 @@
|
|
242 |
|
243 |
wp.ccf.views.Fields.hidden = wp.ccf.views.Fields.hidden || wp.ccf.views.FieldBase.extend(
|
244 |
{
|
245 |
-
template: wp.ccf.utils.template(
|
246 |
|
247 |
saveField: function() {
|
248 |
|
@@ -257,7 +257,7 @@
|
|
257 |
|
258 |
wp.ccf.views.Fields.date = wp.ccf.views.Fields.date || wp.ccf.views.FieldBase.extend(
|
259 |
{
|
260 |
-
template: wp.ccf.utils.template(
|
261 |
|
262 |
saveField: function() {
|
263 |
|
@@ -289,7 +289,7 @@
|
|
289 |
|
290 |
wp.ccf.views.Fields.name = wp.ccf.views.Fields.name || wp.ccf.views.FieldBase.extend(
|
291 |
{
|
292 |
-
template: wp.ccf.utils.template(
|
293 |
|
294 |
saveField: function() {
|
295 |
|
@@ -305,7 +305,7 @@
|
|
305 |
|
306 |
wp.ccf.views.Fields.website = wp.ccf.views.Fields.website || wp.ccf.views.FieldBase.extend(
|
307 |
{
|
308 |
-
template: wp.ccf.utils.template(
|
309 |
|
310 |
saveField: function() {
|
311 |
|
@@ -323,7 +323,7 @@
|
|
323 |
|
324 |
wp.ccf.views.Fields.phone = wp.ccf.views.Fields.phone || wp.ccf.views.FieldBase.extend(
|
325 |
{
|
326 |
-
template: wp.ccf.utils.template(
|
327 |
|
328 |
saveField: function() {
|
329 |
|
@@ -342,7 +342,7 @@
|
|
342 |
|
343 |
wp.ccf.views.Fields.address = wp.ccf.views.Fields.address || wp.ccf.views.FieldBase.extend(
|
344 |
{
|
345 |
-
template: wp.ccf.utils.template(
|
346 |
|
347 |
saveField: function() {
|
348 |
|
@@ -359,7 +359,7 @@
|
|
359 |
|
360 |
wp.ccf.views.Fields.email = wp.ccf.views.Fields.email || wp.ccf.views.FieldBase.extend(
|
361 |
{
|
362 |
-
template: wp.ccf.utils.template(
|
363 |
|
364 |
saveField: function() {
|
365 |
|
@@ -395,7 +395,7 @@
|
|
395 |
|
396 |
wp.ccf.views.ChoiceableField = wp.ccf.views.ChoiceableField || wp.ccf.views.FieldBase.extend(
|
397 |
{
|
398 |
-
template: wp.ccf.utils.template(
|
399 |
|
400 |
initialize: function() {
|
401 |
var choices = this.model.get( 'choices' );
|
@@ -466,7 +466,7 @@
|
|
466 |
|
467 |
wp.ccf.views.Fields.dropdown = wp.ccf.views.Fields.dropdown || wp.ccf.views.ChoiceableField.extend(
|
468 |
{
|
469 |
-
template: wp.ccf.utils.template(
|
470 |
events: function() {
|
471 |
return this.constructor.__super__.events;
|
472 |
}
|
@@ -475,7 +475,7 @@
|
|
475 |
|
476 |
wp.ccf.views.Fields.radio = wp.ccf.views.Fields.radio || wp.ccf.views.ChoiceableField.extend(
|
477 |
{
|
478 |
-
template: wp.ccf.utils.template(
|
479 |
events: function() {
|
480 |
return this.constructor.__super__.events;
|
481 |
}
|
@@ -484,7 +484,7 @@
|
|
484 |
|
485 |
wp.ccf.views.Fields.checkboxes = wp.ccf.views.Fields.checkboxes || wp.ccf.views.ChoiceableField.extend(
|
486 |
{
|
487 |
-
template: wp.ccf.utils.template(
|
488 |
events: function() {
|
489 |
return this.constructor.__super__.events;
|
490 |
}
|
@@ -530,7 +530,7 @@
|
|
530 |
var context = {};
|
531 |
|
532 |
if ( ! field ) {
|
533 |
-
var template = wp.ccf.utils.template(
|
534 |
this.el.innerHTML = template( context );
|
535 |
} else {
|
536 |
var type = field.get( 'type' );
|
@@ -565,7 +565,7 @@
|
|
565 |
|
566 |
wp.ccf.views.FieldRowPlaceholder = wp.ccf.views.FieldRowPlaceholder || Backbone.View.extend(
|
567 |
{
|
568 |
-
template: wp.ccf.utils.template(
|
569 |
tagName: 'div',
|
570 |
className: 'field',
|
571 |
|
@@ -586,7 +586,7 @@
|
|
586 |
|
587 |
wp.ccf.views.FieldRow = wp.ccf.views.FieldRow || Backbone.View.extend(
|
588 |
{
|
589 |
-
template: wp.ccf.utils.template(
|
590 |
tagName: 'div',
|
591 |
className: 'field',
|
592 |
|
@@ -670,7 +670,7 @@
|
|
670 |
if ( previewTemplate ) {
|
671 |
var preview = this.el.querySelectorAll( '.preview' )[0];
|
672 |
preview.style.display = 'block';
|
673 |
-
preview.innerHTML = wp.ccf.utils.template(
|
674 |
}
|
675 |
|
676 |
return this;
|
@@ -680,7 +680,7 @@
|
|
680 |
|
681 |
wp.ccf.views.FormSettings = wp.ccf.views.FormSettings || Backbone.View.extend(
|
682 |
{
|
683 |
-
template: wp.ccf.utils.template(
|
684 |
|
685 |
events: {
|
686 |
'blur input': 'save',
|
@@ -763,7 +763,7 @@
|
|
763 |
|
764 |
wp.ccf.views.FormNotifications = wp.ccf.views.FormNotifications || Backbone.View.extend(
|
765 |
{
|
766 |
-
template: wp.ccf.utils.template(
|
767 |
|
768 |
events: {
|
769 |
'blur input': 'save',
|
@@ -777,8 +777,46 @@
|
|
777 |
},
|
778 |
|
779 |
destroy: function() {
|
780 |
-
wp.ccf.dispatcher.off( '
|
781 |
wp.ccf.dispatcher.off( 'mainViewChange', this.save );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
782 |
},
|
783 |
|
784 |
toggleNotificationFields: function() {
|
@@ -795,8 +833,8 @@
|
|
795 |
var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0];
|
796 |
|
797 |
if ( parseInt( sendEmailNotifications ) ) {
|
798 |
-
for ( i = 0; i < emailNotificationSettings; i++ ) {
|
799 |
-
|
800 |
}
|
801 |
|
802 |
emailNotificationFromAddress.style.display = 'none';
|
@@ -808,8 +846,8 @@
|
|
808 |
emailNotificationFromField.style.display = 'block';
|
809 |
}
|
810 |
} else {
|
811 |
-
for ( i = 0; i < emailNotificationSettings; i++ ) {
|
812 |
-
|
813 |
}
|
814 |
|
815 |
emailNotificationFromAddress.style.display = 'none';
|
@@ -846,28 +884,21 @@
|
|
846 |
},
|
847 |
|
848 |
render: function() {
|
849 |
-
var emailFields = [],
|
850 |
-
fields = this.model.get( 'fields' );
|
851 |
-
|
852 |
-
fields.each( function( field ) {
|
853 |
-
if ( 'email' === field.get( 'type' ) ) {
|
854 |
-
emailFields.push( field );
|
855 |
-
}
|
856 |
-
});
|
857 |
-
|
858 |
var context = {
|
859 |
-
form: this.model.toJSON()
|
860 |
-
emailFields: emailFields
|
861 |
};
|
862 |
|
|
|
|
|
863 |
this.el.innerHTML = this.template( context );
|
864 |
|
865 |
this.toggleNotificationFields();
|
|
|
866 |
|
867 |
wp.ccf.dispatcher.on( 'saveFormNotifications', this.save, this );
|
868 |
wp.ccf.dispatcher.on( 'mainViewChange', this.save, this );
|
869 |
-
this.listenTo( fields, 'add', this.
|
870 |
-
this.listenTo( fields, 'remove', this.
|
871 |
|
872 |
return this;
|
873 |
}
|
@@ -876,7 +907,7 @@
|
|
876 |
|
877 |
wp.ccf.views.FormPane = wp.ccf.views.FormPane || Backbone.View.extend( _.defaults(
|
878 |
{
|
879 |
-
template: wp.ccf.utils.template(
|
880 |
subViews: {
|
881 |
'field-sidebar': wp.ccf.views.FieldSidebar,
|
882 |
'form-settings': wp.ccf.views.FormSettings,
|
@@ -1130,7 +1161,7 @@
|
|
1130 |
wp.ccf.views.ExistingFormTableRow = wp.ccf.views.ExistingFormTableRow || Backbone.View.extend(
|
1131 |
{
|
1132 |
tagName: 'tr',
|
1133 |
-
template: wp.ccf.utils.template(
|
1134 |
events: {
|
1135 |
'click .edit': 'triggerMainViewChange',
|
1136 |
'click .delete': 'triggerDelete',
|
@@ -1179,7 +1210,7 @@
|
|
1179 |
wp.ccf.views.EmptyFormTableRow = wp.ccf.views.EmptyFormTableRow || Backbone.View.extend(
|
1180 |
{
|
1181 |
tagName: 'tr',
|
1182 |
-
template: wp.ccf.utils.template(
|
1183 |
|
1184 |
render: function() {
|
1185 |
this.$el.html( this.template() );
|
@@ -1190,7 +1221,7 @@
|
|
1190 |
|
1191 |
wp.ccf.views.ExistingFormTable = wp.ccf.views.ExistingFormTable || Backbone.View.extend(
|
1192 |
{
|
1193 |
-
template: wp.ccf.utils.template(
|
1194 |
|
1195 |
initialize: function() {
|
1196 |
this.parent = arguments.parent;
|
@@ -1255,7 +1286,7 @@
|
|
1255 |
|
1256 |
wp.ccf.views.ExistingFormPane = wp.ccf.views.ExistingFormPane || Backbone.View.extend( _.defaults(
|
1257 |
{
|
1258 |
-
template: wp.ccf.utils.template(
|
1259 |
subViews: {
|
1260 |
'existing-form-table': wp.ccf.views.ExistingFormTable
|
1261 |
},
|
@@ -1280,7 +1311,7 @@
|
|
1280 |
{
|
1281 |
tagName: 'div',
|
1282 |
className: 'ccf-main-modal',
|
1283 |
-
template: wp.ccf.utils.template(
|
1284 |
events: {
|
1285 |
'click .close-icon': 'hide',
|
1286 |
'click .main-menu a': 'menuClick'
|
@@ -1376,7 +1407,7 @@
|
|
1376 |
wp.ccf.views.SubmissionRow = wp.ccf.views.SubmissionRow || Backbone.View.extend(
|
1377 |
{
|
1378 |
tagName: 'tr',
|
1379 |
-
template: wp.ccf.utils.template(
|
1380 |
events: {
|
1381 |
'click .view': 'view',
|
1382 |
'click .delete': 'delete'
|
@@ -1422,9 +1453,11 @@
|
|
1422 |
isFieldDate: wp.ccf.utils.isFieldDate,
|
1423 |
isFieldName: wp.ccf.utils.isFieldName,
|
1424 |
isFieldAddress: wp.ccf.utils.isFieldAddress,
|
|
|
1425 |
getPrettyFieldDate: wp.ccf.utils.getPrettyFieldDate,
|
1426 |
getPrettyFieldAddress: wp.ccf.utils.getPrettyFieldAddress,
|
1427 |
-
getPrettyFieldName: wp.ccf.utils.getPrettyFieldName
|
|
|
1428 |
}
|
1429 |
} ) );
|
1430 |
|
@@ -1436,7 +1469,7 @@
|
|
1436 |
|
1437 |
wp.ccf.views.SubmissionsTable = wp.ccf.views.SubmissionsTable || Backbone.View.extend(
|
1438 |
{
|
1439 |
-
template: wp.ccf.utils.template(
|
1440 |
events: {
|
1441 |
'click .prev:not(.disabled)': 'previousPage',
|
1442 |
'click .next:not(.disabled)': 'nextPage',
|
@@ -1512,7 +1545,7 @@
|
|
1512 |
|
1513 |
wp.ccf.views.Pagination = wp.ccf.views.Pagination || Backbone.View.extend(
|
1514 |
{
|
1515 |
-
template: wp.ccf.utils.template(
|
1516 |
|
1517 |
events: {
|
1518 |
'click .prev:not(.disabled)': 'previousPage',
|
@@ -1568,7 +1601,7 @@
|
|
1568 |
wp.ccf.views.EmptySubmissionTableRow = wp.ccf.views.EmptySubmissionTableRow || Backbone.View.extend(
|
1569 |
{
|
1570 |
tagName: 'tr',
|
1571 |
-
template: wp.ccf.utils.template(
|
1572 |
|
1573 |
initialize: function( options ) {
|
1574 |
this.parent = options.parent;
|
@@ -1583,7 +1616,7 @@
|
|
1583 |
|
1584 |
wp.ccf.views.SubmissionColumnController = wp.ccf.views.SubmissionColumnController || Backbone.View.extend(
|
1585 |
{
|
1586 |
-
template: wp.ccf.utils.template(
|
1587 |
|
1588 |
events: {
|
1589 |
'click input[type=checkbox]': 'triggerTableRebuild'
|
6 |
|
7 |
wp.ccf.views.FieldChoice = Backbone.View.extend(
|
8 |
{
|
9 |
+
template: wp.ccf.utils.template( 'ccf-field-choice-template' ),
|
10 |
className: 'choice',
|
11 |
|
12 |
events: {
|
148 |
|
149 |
wp.ccf.views.Fields['single-line-text'] = wp.ccf.views.Fields['single-line-text'] || wp.ccf.views.FieldBase.extend(
|
150 |
{
|
151 |
+
template: wp.ccf.utils.template( 'ccf-single-line-text-template' ),
|
152 |
|
153 |
initialize: function() {
|
154 |
|
170 |
|
171 |
wp.ccf.views.Fields.recaptcha = wp.ccf.views.Fields.recaptcha || wp.ccf.views.FieldBase.extend(
|
172 |
{
|
173 |
+
template: wp.ccf.utils.template( 'ccf-recaptcha-template' ),
|
174 |
|
175 |
initialize: function() {
|
176 |
|
189 |
|
190 |
wp.ccf.views.Fields['section-header'] = wp.ccf.views.Fields['section-header'] || wp.ccf.views.FieldBase.extend(
|
191 |
{
|
192 |
+
template: wp.ccf.utils.template( 'ccf-section-header-template' ),
|
193 |
|
194 |
initialize: function() {
|
195 |
|
207 |
|
208 |
wp.ccf.views.Fields.html = wp.ccf.views.Fields.html || wp.ccf.views.FieldBase.extend(
|
209 |
{
|
210 |
+
template: wp.ccf.utils.template( 'ccf-html-template' ),
|
211 |
|
212 |
initialize: function() {
|
213 |
|
224 |
|
225 |
wp.ccf.views.Fields['paragraph-text'] = wp.ccf.views.Fields['paragraph-text'] || wp.ccf.views.FieldBase.extend(
|
226 |
{
|
227 |
+
template: wp.ccf.utils.template( 'ccf-paragraph-text-template' ),
|
228 |
|
229 |
saveField: function() {
|
230 |
|
242 |
|
243 |
wp.ccf.views.Fields.hidden = wp.ccf.views.Fields.hidden || wp.ccf.views.FieldBase.extend(
|
244 |
{
|
245 |
+
template: wp.ccf.utils.template( 'ccf-hidden-template' ),
|
246 |
|
247 |
saveField: function() {
|
248 |
|
257 |
|
258 |
wp.ccf.views.Fields.date = wp.ccf.views.Fields.date || wp.ccf.views.FieldBase.extend(
|
259 |
{
|
260 |
+
template: wp.ccf.utils.template( 'ccf-date-template' ),
|
261 |
|
262 |
saveField: function() {
|
263 |
|
289 |
|
290 |
wp.ccf.views.Fields.name = wp.ccf.views.Fields.name || wp.ccf.views.FieldBase.extend(
|
291 |
{
|
292 |
+
template: wp.ccf.utils.template( 'ccf-name-template' ),
|
293 |
|
294 |
saveField: function() {
|
295 |
|
305 |
|
306 |
wp.ccf.views.Fields.website = wp.ccf.views.Fields.website || wp.ccf.views.FieldBase.extend(
|
307 |
{
|
308 |
+
template: wp.ccf.utils.template( 'ccf-website-template' ),
|
309 |
|
310 |
saveField: function() {
|
311 |
|
323 |
|
324 |
wp.ccf.views.Fields.phone = wp.ccf.views.Fields.phone || wp.ccf.views.FieldBase.extend(
|
325 |
{
|
326 |
+
template: wp.ccf.utils.template( 'ccf-phone-template' ),
|
327 |
|
328 |
saveField: function() {
|
329 |
|
342 |
|
343 |
wp.ccf.views.Fields.address = wp.ccf.views.Fields.address || wp.ccf.views.FieldBase.extend(
|
344 |
{
|
345 |
+
template: wp.ccf.utils.template( 'ccf-address-template' ),
|
346 |
|
347 |
saveField: function() {
|
348 |
|
359 |
|
360 |
wp.ccf.views.Fields.email = wp.ccf.views.Fields.email || wp.ccf.views.FieldBase.extend(
|
361 |
{
|
362 |
+
template: wp.ccf.utils.template( 'ccf-email-template' ),
|
363 |
|
364 |
saveField: function() {
|
365 |
|
395 |
|
396 |
wp.ccf.views.ChoiceableField = wp.ccf.views.ChoiceableField || wp.ccf.views.FieldBase.extend(
|
397 |
{
|
398 |
+
template: wp.ccf.utils.template( 'ccf-dropdown-template' ),
|
399 |
|
400 |
initialize: function() {
|
401 |
var choices = this.model.get( 'choices' );
|
466 |
|
467 |
wp.ccf.views.Fields.dropdown = wp.ccf.views.Fields.dropdown || wp.ccf.views.ChoiceableField.extend(
|
468 |
{
|
469 |
+
template: wp.ccf.utils.template( 'ccf-dropdown-template' ),
|
470 |
events: function() {
|
471 |
return this.constructor.__super__.events;
|
472 |
}
|
475 |
|
476 |
wp.ccf.views.Fields.radio = wp.ccf.views.Fields.radio || wp.ccf.views.ChoiceableField.extend(
|
477 |
{
|
478 |
+
template: wp.ccf.utils.template( 'ccf-radio-template' ),
|
479 |
events: function() {
|
480 |
return this.constructor.__super__.events;
|
481 |
}
|
484 |
|
485 |
wp.ccf.views.Fields.checkboxes = wp.ccf.views.Fields.checkboxes || wp.ccf.views.ChoiceableField.extend(
|
486 |
{
|
487 |
+
template: wp.ccf.utils.template( 'ccf-checkboxes-template' ),
|
488 |
events: function() {
|
489 |
return this.constructor.__super__.events;
|
490 |
}
|
530 |
var context = {};
|
531 |
|
532 |
if ( ! field ) {
|
533 |
+
var template = wp.ccf.utils.template( 'ccf-empty-field-template' );
|
534 |
this.el.innerHTML = template( context );
|
535 |
} else {
|
536 |
var type = field.get( 'type' );
|
565 |
|
566 |
wp.ccf.views.FieldRowPlaceholder = wp.ccf.views.FieldRowPlaceholder || Backbone.View.extend(
|
567 |
{
|
568 |
+
template: wp.ccf.utils.template( 'ccf-field-row-template'),
|
569 |
tagName: 'div',
|
570 |
className: 'field',
|
571 |
|
586 |
|
587 |
wp.ccf.views.FieldRow = wp.ccf.views.FieldRow || Backbone.View.extend(
|
588 |
{
|
589 |
+
template: wp.ccf.utils.template( 'ccf-field-row-template'),
|
590 |
tagName: 'div',
|
591 |
className: 'field',
|
592 |
|
670 |
if ( previewTemplate ) {
|
671 |
var preview = this.el.querySelectorAll( '.preview' )[0];
|
672 |
preview.style.display = 'block';
|
673 |
+
preview.innerHTML = wp.ccf.utils.template( 'ccf-' + this.model.get( 'type' ) + '-preview-template' )( { field: this.model.toJSON() } );
|
674 |
}
|
675 |
|
676 |
return this;
|
680 |
|
681 |
wp.ccf.views.FormSettings = wp.ccf.views.FormSettings || Backbone.View.extend(
|
682 |
{
|
683 |
+
template: wp.ccf.utils.template( 'ccf-form-settings-template' ),
|
684 |
|
685 |
events: {
|
686 |
'blur input': 'save',
|
763 |
|
764 |
wp.ccf.views.FormNotifications = wp.ccf.views.FormNotifications || Backbone.View.extend(
|
765 |
{
|
766 |
+
template: wp.ccf.utils.template( 'ccf-form-notifications-template' ),
|
767 |
|
768 |
events: {
|
769 |
'blur input': 'save',
|
777 |
},
|
778 |
|
779 |
destroy: function() {
|
780 |
+
wp.ccf.dispatcher.off( 'saveFormNotifications', this.save );
|
781 |
wp.ccf.dispatcher.off( 'mainViewChange', this.save );
|
782 |
+
this.undelegateEvents();
|
783 |
+
this.unbind();
|
784 |
+
},
|
785 |
+
|
786 |
+
updateFromAddressFieldField: function() {
|
787 |
+
var emailNotificationFromField = this.el.querySelectorAll( '.form-email-notification-from-field' )[0];
|
788 |
+
emailNotificationFromField.innerHTML = '';
|
789 |
+
emailNotificationFromField.disabled = false;
|
790 |
+
|
791 |
+
var fields = this.model.get( 'fields'),
|
792 |
+
fieldsAdded = 0;
|
793 |
+
|
794 |
+
var currentField = this.model.get( 'emailNotificationFromField' );
|
795 |
+
|
796 |
+
if ( fields.length >= 1 ) {
|
797 |
+
fields.each( function( field ) {
|
798 |
+
if ( 'email' === field.get( 'type' ) ) {
|
799 |
+
var option = document.createElement( 'option' );
|
800 |
+
option.innerHTML = field.get( 'slug' );
|
801 |
+
option.value = field.get( 'slug' );
|
802 |
+
|
803 |
+
if ( field.get( 'slug' ) === currentField ) {
|
804 |
+
option.selected = true;
|
805 |
+
}
|
806 |
+
|
807 |
+
emailNotificationFromField.appendChild( option );
|
808 |
+
|
809 |
+
fieldsAdded++;
|
810 |
+
}
|
811 |
+
});
|
812 |
+
}
|
813 |
+
|
814 |
+
if ( 0 === fieldsAdded ) {
|
815 |
+
var option = document.createElement( 'option' );
|
816 |
+
option.innerHTML = ccfSettings.noEmailFields;
|
817 |
+
emailNotificationFromField.appendChild( option );
|
818 |
+
emailNotificationFromField.disabled = true;
|
819 |
+
}
|
820 |
},
|
821 |
|
822 |
toggleNotificationFields: function() {
|
833 |
var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0];
|
834 |
|
835 |
if ( parseInt( sendEmailNotifications ) ) {
|
836 |
+
for ( i = 0; i < emailNotificationSettings.length; i++ ) {
|
837 |
+
emailNotificationSettings[i].style.display = 'block';
|
838 |
}
|
839 |
|
840 |
emailNotificationFromAddress.style.display = 'none';
|
846 |
emailNotificationFromField.style.display = 'block';
|
847 |
}
|
848 |
} else {
|
849 |
+
for ( i = 0; i < emailNotificationSettings.length; i++ ) {
|
850 |
+
emailNotificationSettings[i].style.display = 'none';
|
851 |
}
|
852 |
|
853 |
emailNotificationFromAddress.style.display = 'none';
|
884 |
},
|
885 |
|
886 |
render: function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
887 |
var context = {
|
888 |
+
form: this.model.toJSON()
|
|
|
889 |
};
|
890 |
|
891 |
+
var fields = this.model.get( 'fields' );
|
892 |
+
|
893 |
this.el.innerHTML = this.template( context );
|
894 |
|
895 |
this.toggleNotificationFields();
|
896 |
+
this.updateFromAddressFieldField();
|
897 |
|
898 |
wp.ccf.dispatcher.on( 'saveFormNotifications', this.save, this );
|
899 |
wp.ccf.dispatcher.on( 'mainViewChange', this.save, this );
|
900 |
+
this.listenTo( fields, 'add', this.updateFromAddressFieldField, this );
|
901 |
+
this.listenTo( fields, 'remove', this.updateFromAddressFieldField, this );
|
902 |
|
903 |
return this;
|
904 |
}
|
907 |
|
908 |
wp.ccf.views.FormPane = wp.ccf.views.FormPane || Backbone.View.extend( _.defaults(
|
909 |
{
|
910 |
+
template: wp.ccf.utils.template( 'ccf-form-pane-template' ),
|
911 |
subViews: {
|
912 |
'field-sidebar': wp.ccf.views.FieldSidebar,
|
913 |
'form-settings': wp.ccf.views.FormSettings,
|
1161 |
wp.ccf.views.ExistingFormTableRow = wp.ccf.views.ExistingFormTableRow || Backbone.View.extend(
|
1162 |
{
|
1163 |
tagName: 'tr',
|
1164 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-table-row-template'),
|
1165 |
events: {
|
1166 |
'click .edit': 'triggerMainViewChange',
|
1167 |
'click .delete': 'triggerDelete',
|
1210 |
wp.ccf.views.EmptyFormTableRow = wp.ccf.views.EmptyFormTableRow || Backbone.View.extend(
|
1211 |
{
|
1212 |
tagName: 'tr',
|
1213 |
+
template: wp.ccf.utils.template( 'ccf-empty-form-table-row-template'),
|
1214 |
|
1215 |
render: function() {
|
1216 |
this.$el.html( this.template() );
|
1221 |
|
1222 |
wp.ccf.views.ExistingFormTable = wp.ccf.views.ExistingFormTable || Backbone.View.extend(
|
1223 |
{
|
1224 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-table-template'),
|
1225 |
|
1226 |
initialize: function() {
|
1227 |
this.parent = arguments.parent;
|
1286 |
|
1287 |
wp.ccf.views.ExistingFormPane = wp.ccf.views.ExistingFormPane || Backbone.View.extend( _.defaults(
|
1288 |
{
|
1289 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-pane-template' ),
|
1290 |
subViews: {
|
1291 |
'existing-form-table': wp.ccf.views.ExistingFormTable
|
1292 |
},
|
1311 |
{
|
1312 |
tagName: 'div',
|
1313 |
className: 'ccf-main-modal',
|
1314 |
+
template: wp.ccf.utils.template( 'ccf-main-modal-template' ),
|
1315 |
events: {
|
1316 |
'click .close-icon': 'hide',
|
1317 |
'click .main-menu a': 'menuClick'
|
1407 |
wp.ccf.views.SubmissionRow = wp.ccf.views.SubmissionRow || Backbone.View.extend(
|
1408 |
{
|
1409 |
tagName: 'tr',
|
1410 |
+
template: wp.ccf.utils.template( 'ccf-submission-row-template' ),
|
1411 |
events: {
|
1412 |
'click .view': 'view',
|
1413 |
'click .delete': 'delete'
|
1453 |
isFieldDate: wp.ccf.utils.isFieldDate,
|
1454 |
isFieldName: wp.ccf.utils.isFieldName,
|
1455 |
isFieldAddress: wp.ccf.utils.isFieldAddress,
|
1456 |
+
isFieldEmailConfirm: wp.ccf.utils.isFieldEmailConfirm,
|
1457 |
getPrettyFieldDate: wp.ccf.utils.getPrettyFieldDate,
|
1458 |
getPrettyFieldAddress: wp.ccf.utils.getPrettyFieldAddress,
|
1459 |
+
getPrettyFieldName: wp.ccf.utils.getPrettyFieldName,
|
1460 |
+
getPrettyFieldEmailConfirm: wp.ccf.utils.getPrettyFieldEmailConfirm
|
1461 |
}
|
1462 |
} ) );
|
1463 |
|
1469 |
|
1470 |
wp.ccf.views.SubmissionsTable = wp.ccf.views.SubmissionsTable || Backbone.View.extend(
|
1471 |
{
|
1472 |
+
template: wp.ccf.utils.template( 'ccf-submission-table-template' ),
|
1473 |
events: {
|
1474 |
'click .prev:not(.disabled)': 'previousPage',
|
1475 |
'click .next:not(.disabled)': 'nextPage',
|
1545 |
|
1546 |
wp.ccf.views.Pagination = wp.ccf.views.Pagination || Backbone.View.extend(
|
1547 |
{
|
1548 |
+
template: wp.ccf.utils.template( 'ccf-pagination-template' ),
|
1549 |
|
1550 |
events: {
|
1551 |
'click .prev:not(.disabled)': 'previousPage',
|
1601 |
wp.ccf.views.EmptySubmissionTableRow = wp.ccf.views.EmptySubmissionTableRow || Backbone.View.extend(
|
1602 |
{
|
1603 |
tagName: 'tr',
|
1604 |
+
template: wp.ccf.utils.template( 'ccf-no-submissions-row-template'),
|
1605 |
|
1606 |
initialize: function( options ) {
|
1607 |
this.parent = options.parent;
|
1616 |
|
1617 |
wp.ccf.views.SubmissionColumnController = wp.ccf.views.SubmissionColumnController || Backbone.View.extend(
|
1618 |
{
|
1619 |
+
template: wp.ccf.utils.template( 'ccf-submissions-controller-template'),
|
1620 |
|
1621 |
events: {
|
1622 |
'click input[type=checkbox]': 'triggerTableRebuild'
|
languages/custom-contact-forms.mo
CHANGED
Binary file
|
languages/custom-contact-forms.po
CHANGED
@@ -5,8 +5,8 @@ msgstr ""
|
|
5 |
"Project-Id-Version: Custom Contact Forms\n"
|
6 |
"Report-Msgid-Bugs-To: https://github.com/tlovett1/editorial-access-manager/"
|
7 |
"issues\n"
|
8 |
-
"POT-Creation-Date: 2015-01-
|
9 |
-
"PO-Revision-Date: 2015-01-
|
10 |
"Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
|
11 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
12 |
"Language: en\n"
|
@@ -67,42 +67,42 @@ msgstr ""
|
|
67 |
msgid "<a href=\"%s\">Forms and Submissions</a>"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: ../classes/class-ccf-field-renderer.php:
|
71 |
-
#: ../classes/class-ccf-field-renderer.php:
|
72 |
-
#: ../classes/class-ccf-form-manager.php:
|
73 |
-
#: ../classes/class-ccf-form-manager.php:
|
74 |
msgid "HH"
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: ../classes/class-ccf-field-renderer.php:
|
78 |
-
#: ../classes/class-ccf-field-renderer.php:
|
79 |
-
#: ../classes/class-ccf-form-manager.php:
|
80 |
-
#: ../classes/class-ccf-form-manager.php:
|
81 |
msgid "MM"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: ../classes/class-ccf-field-renderer.php:
|
85 |
-
#: ../classes/class-ccf-field-renderer.php:
|
86 |
-
#: ../classes/class-ccf-form-manager.php:
|
87 |
-
#: ../classes/class-ccf-form-manager.php:
|
88 |
msgid "AM"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: ../classes/class-ccf-field-renderer.php:
|
92 |
-
#: ../classes/class-ccf-field-renderer.php:
|
93 |
-
#: ../classes/class-ccf-form-manager.php:
|
94 |
-
#: ../classes/class-ccf-form-manager.php:
|
95 |
msgid "PM"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: ../classes/class-ccf-field-renderer.php:
|
99 |
#: ../classes/class-ccf-form-cpt.php:306
|
100 |
-
#: ../classes/class-ccf-form-manager.php:
|
101 |
-
#: ../classes/class-ccf-form-manager.php:
|
102 |
-
#: ../classes/class-ccf-form-manager.php:
|
103 |
-
#: ../classes/class-ccf-form-manager.php:
|
104 |
-
#: ../classes/class-ccf-form-manager.php:
|
105 |
-
#: ../classes/class-ccf-form-manager.php:
|
106 |
msgid "Date"
|
107 |
msgstr ""
|
108 |
|
@@ -112,8 +112,8 @@ msgstr ""
|
|
112 |
|
113 |
#: ../classes/class-ccf-form-cpt.php:123 ../classes/class-ccf-form-cpt.php:141
|
114 |
#: ../classes/class-ccf-form-cpt.php:304
|
115 |
-
#: ../classes/class-ccf-form-manager.php:
|
116 |
-
#: ../classes/class-ccf-form-manager.php:
|
117 |
msgid "Submissions"
|
118 |
msgstr ""
|
119 |
|
@@ -150,6 +150,7 @@ msgid "Move to Trash"
|
|
150 |
msgstr ""
|
151 |
|
152 |
#: ../classes/class-ccf-form-cpt.php:247
|
|
|
153 |
msgid "(No title)"
|
154 |
msgstr ""
|
155 |
|
@@ -162,14 +163,14 @@ msgid "Form Title"
|
|
162 |
msgstr ""
|
163 |
|
164 |
#: ../classes/class-ccf-form-cpt.php:303
|
165 |
-
#: ../classes/class-ccf-form-manager.php:
|
166 |
-
#: ../classes/class-ccf-form-manager.php:
|
167 |
msgid "Author"
|
168 |
msgstr ""
|
169 |
|
170 |
#: ../classes/class-ccf-form-cpt.php:305
|
171 |
-
#: ../classes/class-ccf-form-manager.php:
|
172 |
-
#: ../classes/class-ccf-form-manager.php:
|
173 |
msgid "Number of Fields"
|
174 |
msgstr ""
|
175 |
|
@@ -232,120 +233,120 @@ msgid "No forms found in trash."
|
|
232 |
msgstr ""
|
233 |
|
234 |
#: ../classes/class-ccf-form-handler.php:114
|
235 |
-
#: ../classes/class-ccf-form-handler.php:
|
236 |
-
#: ../classes/class-ccf-form-handler.php:
|
237 |
-
#: ../classes/class-ccf-form-handler.php:
|
238 |
-
#: ../classes/class-ccf-form-handler.php:
|
239 |
-
#: ../classes/class-ccf-form-handler.php:
|
240 |
-
#: ../classes/class-ccf-form-handler.php:213
|
241 |
-
#: ../classes/class-ccf-form-handler.php:238
|
242 |
#: ../classes/class-ccf-form-handler.php:246
|
243 |
-
#: ../classes/class-ccf-form-handler.php:
|
244 |
-
#: ../classes/class-ccf-form-handler.php:
|
|
|
|
|
245 |
#: ../classes/class-ccf-form-renderer.php:53
|
246 |
msgid "This field is required."
|
247 |
msgstr ""
|
248 |
|
249 |
-
#: ../classes/class-ccf-form-handler.php:
|
250 |
#: ../classes/class-ccf-form-renderer.php:60
|
251 |
msgid "Your reCAPTCHA response was incorrect."
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: ../classes/class-ccf-form-handler.php:
|
255 |
msgid "This field is required"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: ../classes/class-ccf-form-handler.php:
|
259 |
msgid "This phone number is too short"
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: ../classes/class-ccf-form-handler.php:
|
263 |
msgid "ccf_field_phoneFormat"
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: ../classes/class-ccf-form-handler.php:
|
267 |
msgid "This phone number contains invalid characters."
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: ../classes/class-ccf-form-handler.php:
|
271 |
msgid "This phone number is not 10 digits."
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: ../classes/class-ccf-form-handler.php:
|
275 |
-
#: ../classes/class-ccf-form-handler.php:
|
276 |
msgid "This is not a valid email"
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: ../classes/class-ccf-form-handler.php:
|
280 |
#: ../classes/class-ccf-form-renderer.php:58
|
281 |
msgid "Emails do not match."
|
282 |
msgstr ""
|
283 |
|
284 |
-
#: ../classes/class-ccf-form-handler.php:
|
285 |
msgid "First name is required."
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: ../classes/class-ccf-form-handler.php:
|
289 |
msgid "Last name is required."
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: ../classes/class-ccf-form-handler.php:
|
293 |
#: ../classes/class-ccf-form-renderer.php:67
|
294 |
msgid "This is not a valid URL. URL's must start with http(s)://"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: ../classes/class-ccf-form-handler.php:
|
298 |
-
#: ../classes/class-ccf-form-handler.php:
|
299 |
#: ../classes/class-ccf-form-renderer.php:54
|
300 |
msgid "Date is required."
|
301 |
msgstr ""
|
302 |
|
303 |
-
#: ../classes/class-ccf-form-handler.php:
|
304 |
-
#: ../classes/class-ccf-form-handler.php:
|
305 |
#: ../classes/class-ccf-form-renderer.php:65
|
306 |
msgid "This date is not valid."
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: ../classes/class-ccf-form-handler.php:
|
310 |
-
#: ../classes/class-ccf-form-handler.php:
|
311 |
#: ../classes/class-ccf-form-renderer.php:55
|
312 |
msgid "Hour is required."
|
313 |
msgstr ""
|
314 |
|
315 |
-
#: ../classes/class-ccf-form-handler.php:
|
316 |
-
#: ../classes/class-ccf-form-handler.php:
|
317 |
#: ../classes/class-ccf-form-renderer.php:64
|
318 |
msgid "This is not a valid hour."
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: ../classes/class-ccf-form-handler.php:
|
322 |
-
#: ../classes/class-ccf-form-handler.php:
|
323 |
#: ../classes/class-ccf-form-renderer.php:56
|
324 |
msgid "Minute is required."
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: ../classes/class-ccf-form-handler.php:
|
328 |
-
#: ../classes/class-ccf-form-handler.php:
|
329 |
#: ../classes/class-ccf-form-renderer.php:66
|
330 |
msgid "This is not a valid minute."
|
331 |
msgstr ""
|
332 |
|
333 |
-
#: ../classes/class-ccf-form-handler.php:
|
334 |
-
#: ../classes/class-ccf-form-handler.php:
|
335 |
#: ../classes/class-ccf-form-renderer.php:57
|
336 |
msgid "AM/PM is required."
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: ../classes/class-ccf-form-handler.php:
|
340 |
msgid "Form submitted from"
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: ../classes/class-ccf-form-handler.php:
|
344 |
#, php-format
|
345 |
msgid "%s: Form Submission to \"%s\""
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: ../classes/class-ccf-form-handler.php:
|
349 |
#: ../classes/class-ccf-form-renderer.php:120
|
350 |
msgid "Thank you for your submission."
|
351 |
msgstr ""
|
@@ -375,7 +376,7 @@ msgid "→ Drag fields here to add them"
|
|
375 |
msgstr ""
|
376 |
|
377 |
#: ../classes/class-ccf-form-manager.php:115
|
378 |
-
#: ../classes/class-ccf-form-manager.php:
|
379 |
msgid "Insert into post"
|
380 |
msgstr ""
|
381 |
|
@@ -428,34 +429,34 @@ msgid "Send Email Notifications:"
|
|
428 |
msgstr ""
|
429 |
|
430 |
#: ../classes/class-ccf-form-manager.php:165
|
431 |
-
#: ../classes/class-ccf-form-manager.php:
|
432 |
-
#: ../classes/class-ccf-form-manager.php:
|
433 |
-
#: ../classes/class-ccf-form-manager.php:
|
434 |
-
#: ../classes/class-ccf-form-manager.php:
|
435 |
-
#: ../classes/class-ccf-form-manager.php:
|
436 |
-
#: ../classes/class-ccf-form-manager.php:
|
437 |
-
#: ../classes/class-ccf-form-manager.php:
|
438 |
-
#: ../classes/class-ccf-form-manager.php:
|
439 |
-
#: ../classes/class-ccf-form-manager.php:
|
440 |
-
#: ../classes/class-ccf-form-manager.php:
|
441 |
-
#: ../classes/class-ccf-form-manager.php:
|
442 |
-
#: ../classes/class-ccf-form-manager.php:
|
443 |
msgid "Yes"
|
444 |
msgstr ""
|
445 |
|
446 |
#: ../classes/class-ccf-form-manager.php:166
|
447 |
-
#: ../classes/class-ccf-form-manager.php:
|
448 |
-
#: ../classes/class-ccf-form-manager.php:
|
449 |
-
#: ../classes/class-ccf-form-manager.php:
|
450 |
-
#: ../classes/class-ccf-form-manager.php:
|
451 |
-
#: ../classes/class-ccf-form-manager.php:
|
452 |
-
#: ../classes/class-ccf-form-manager.php:
|
453 |
-
#: ../classes/class-ccf-form-manager.php:
|
454 |
-
#: ../classes/class-ccf-form-manager.php:
|
455 |
-
#: ../classes/class-ccf-form-manager.php:
|
456 |
-
#: ../classes/class-ccf-form-manager.php:
|
457 |
-
#: ../classes/class-ccf-form-manager.php:
|
458 |
-
#: ../classes/class-ccf-form-manager.php:
|
459 |
msgid "No"
|
460 |
msgstr ""
|
461 |
|
@@ -493,378 +494,374 @@ msgstr ""
|
|
493 |
msgid "Pull \"From\" Email Dynamically from Field:"
|
494 |
msgstr ""
|
495 |
|
496 |
-
#: ../classes/class-ccf-form-manager.php:
|
497 |
-
msgid "There are no email fields in your form."
|
498 |
-
msgstr ""
|
499 |
-
|
500 |
-
#: ../classes/class-ccf-form-manager.php:214
|
501 |
msgid "items"
|
502 |
msgstr ""
|
503 |
|
504 |
-
#: ../classes/class-ccf-form-manager.php:
|
505 |
-
#: ../classes/class-ccf-form-manager.php:
|
506 |
msgid "ID"
|
507 |
msgstr ""
|
508 |
|
509 |
-
#: ../classes/class-ccf-form-manager.php:
|
510 |
-
#: ../classes/class-ccf-form-manager.php:
|
511 |
msgid "Title"
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: ../classes/class-ccf-form-manager.php:
|
515 |
msgid "<span>←</span> Click on a field to edit it."
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: ../classes/class-ccf-form-manager.php:
|
519 |
-
#: ../classes/class-ccf-form-manager.php:
|
520 |
-
#: ../classes/class-ccf-form-manager.php:
|
521 |
msgid "Internal Unique Slug"
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: ../classes/class-ccf-form-manager.php:
|
525 |
-
#: ../classes/class-ccf-form-manager.php:
|
526 |
-
#: ../classes/class-ccf-form-manager.php:
|
527 |
-
#: ../classes/class-ccf-form-manager.php:
|
528 |
-
#: ../classes/class-ccf-form-manager.php:
|
529 |
-
#: ../classes/class-ccf-form-manager.php:
|
530 |
-
#: ../classes/class-ccf-form-manager.php:
|
531 |
-
#: ../classes/class-ccf-form-manager.php:
|
532 |
-
#: ../classes/class-ccf-form-manager.php:
|
533 |
-
#: ../classes/class-ccf-form-manager.php:
|
534 |
-
#: ../classes/class-ccf-form-manager.php:
|
535 |
-
#: ../classes/class-ccf-form-manager.php:
|
536 |
msgid "Label:"
|
537 |
msgstr ""
|
538 |
|
539 |
-
#: ../classes/class-ccf-form-manager.php:
|
540 |
-
#: ../classes/class-ccf-form-manager.php:
|
541 |
-
#: ../classes/class-ccf-form-manager.php:
|
542 |
-
#: ../classes/class-ccf-form-manager.php:
|
543 |
-
#: ../classes/class-ccf-form-manager.php:
|
544 |
-
#: ../classes/class-ccf-form-manager.php:
|
545 |
-
#: ../classes/class-ccf-form-manager.php:
|
546 |
msgid "Initial Value:"
|
547 |
msgstr ""
|
548 |
|
549 |
-
#: ../classes/class-ccf-form-manager.php:
|
550 |
-
#: ../classes/class-ccf-form-manager.php:
|
551 |
-
#: ../classes/class-ccf-form-manager.php:
|
552 |
-
#: ../classes/class-ccf-form-manager.php:
|
553 |
-
#: ../classes/class-ccf-form-manager.php:
|
554 |
-
#: ../classes/class-ccf-form-manager.php:
|
555 |
-
#: ../classes/class-ccf-form-manager.php:
|
556 |
-
#: ../classes/class-ccf-form-manager.php:
|
557 |
-
#: ../classes/class-ccf-form-manager.php:
|
558 |
-
#: ../classes/class-ccf-form-manager.php:
|
559 |
-
#: ../classes/class-ccf-form-manager.php:
|
560 |
msgid "Required:"
|
561 |
msgstr ""
|
562 |
|
563 |
-
#: ../classes/class-ccf-form-manager.php:
|
564 |
-
#: ../classes/class-ccf-form-manager.php:
|
565 |
-
#: ../classes/class-ccf-form-manager.php:
|
566 |
-
#: ../classes/class-ccf-form-manager.php:
|
567 |
-
#: ../classes/class-ccf-form-manager.php:
|
568 |
-
#: ../classes/class-ccf-form-manager.php:
|
569 |
-
#: ../classes/class-ccf-form-manager.php:
|
570 |
-
#: ../classes/class-ccf-form-manager.php:
|
571 |
-
#: ../classes/class-ccf-form-manager.php:
|
572 |
-
#: ../classes/class-ccf-form-manager.php:
|
573 |
-
#: ../classes/class-ccf-form-manager.php:
|
574 |
-
#: ../classes/class-ccf-form-manager.php:
|
575 |
-
#: ../classes/class-ccf-form-manager.php:
|
576 |
-
#: ../classes/class-ccf-form-manager.php:
|
577 |
-
#: ../classes/class-ccf-form-manager.php:
|
578 |
msgid "Advanced"
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: ../classes/class-ccf-form-manager.php:
|
582 |
-
#: ../classes/class-ccf-form-manager.php:
|
583 |
-
#: ../classes/class-ccf-form-manager.php:
|
584 |
-
#: ../classes/class-ccf-form-manager.php:
|
585 |
-
#: ../classes/class-ccf-form-manager.php:
|
586 |
-
#: ../classes/class-ccf-form-manager.php:
|
587 |
-
#: ../classes/class-ccf-form-manager.php:
|
588 |
-
#: ../classes/class-ccf-form-manager.php:
|
589 |
-
#: ../classes/class-ccf-form-manager.php:
|
590 |
-
#: ../classes/class-ccf-form-manager.php:
|
591 |
-
#: ../classes/class-ccf-form-manager.php:
|
592 |
-
#: ../classes/class-ccf-form-manager.php:
|
593 |
-
#: ../classes/class-ccf-form-manager.php:
|
594 |
-
#: ../classes/class-ccf-form-manager.php:
|
595 |
-
#: ../classes/class-ccf-form-manager.php:
|
596 |
msgid "Class Name:"
|
597 |
msgstr ""
|
598 |
|
599 |
-
#: ../classes/class-ccf-form-manager.php:
|
600 |
-
#: ../classes/class-ccf-form-manager.php:
|
601 |
-
#: ../classes/class-ccf-form-manager.php:
|
602 |
-
#: ../classes/class-ccf-form-manager.php:
|
603 |
-
#: ../classes/class-ccf-form-manager.php:
|
604 |
-
#: ../classes/class-ccf-form-manager.php:
|
605 |
msgid "Placeholder Text:"
|
606 |
msgstr ""
|
607 |
|
608 |
-
#: ../classes/class-ccf-form-manager.php:
|
609 |
msgid ""
|
610 |
"reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
|
611 |
"\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
|
612 |
msgstr ""
|
613 |
|
614 |
-
#: ../classes/class-ccf-form-manager.php:
|
615 |
msgid "Site Key:"
|
616 |
msgstr ""
|
617 |
|
618 |
-
#: ../classes/class-ccf-form-manager.php:
|
619 |
-
#: ../classes/class-ccf-form-manager.php:
|
620 |
msgid "Don't have one?"
|
621 |
msgstr ""
|
622 |
|
623 |
-
#: ../classes/class-ccf-form-manager.php:
|
624 |
msgid "Secret Key:"
|
625 |
msgstr ""
|
626 |
|
627 |
-
#: ../classes/class-ccf-form-manager.php:
|
628 |
-
#: ../classes/class-ccf-form-manager.php:
|
629 |
-
#: ../classes/class-ccf-form-manager.php:
|
630 |
-
#: ../classes/class-ccf-form-manager.php:
|
631 |
-
#: ../classes/class-ccf-form-manager.php:
|
632 |
-
#: ../classes/class-ccf-form-manager.php:
|
633 |
-
#: ../classes/class-ccf-form-manager.php:
|
634 |
-
#: ../classes/class-ccf-form-manager.php:
|
635 |
-
#: ../classes/class-ccf-form-manager.php:
|
636 |
-
#: ../classes/class-ccf-form-manager.php:
|
637 |
-
#: ../classes/class-ccf-form-manager.php:
|
638 |
-
#: ../classes/class-ccf-form-manager.php:
|
639 |
msgid "Basic"
|
640 |
msgstr ""
|
641 |
|
642 |
-
#: ../classes/class-ccf-form-manager.php:
|
643 |
msgid "HTML Content:"
|
644 |
msgstr ""
|
645 |
|
646 |
-
#: ../classes/class-ccf-form-manager.php:
|
647 |
msgid "Heading:"
|
648 |
msgstr ""
|
649 |
|
650 |
-
#: ../classes/class-ccf-form-manager.php:
|
651 |
msgid "Sub Heading:"
|
652 |
msgstr ""
|
653 |
|
654 |
-
#: ../classes/class-ccf-form-manager.php:
|
655 |
-
#: ../classes/class-ccf-form-manager.php:
|
656 |
-
#: ../classes/class-ccf-form-manager.php:
|
657 |
-
#: ../classes/class-ccf-form-manager.php:
|
658 |
-
#: ../classes/class-ccf-form-manager.php:
|
659 |
-
#: ../classes/class-ccf-form-manager.php:
|
660 |
-
#: ../classes/class-ccf-form-manager.php:
|
661 |
-
#: ../classes/class-ccf-form-manager.php:
|
662 |
-
#: ../classes/class-ccf-form-manager.php:
|
663 |
msgid "Internal Unique Slug (a-z, 0-9, -, _):"
|
664 |
msgstr ""
|
665 |
|
666 |
-
#: ../classes/class-ccf-form-manager.php:
|
667 |
msgid "Enable Date Select"
|
668 |
msgstr ""
|
669 |
|
670 |
-
#: ../classes/class-ccf-form-manager.php:
|
671 |
msgid "Enable Time Select"
|
672 |
msgstr ""
|
673 |
|
674 |
-
#: ../classes/class-ccf-form-manager.php:
|
675 |
msgid "Format:"
|
676 |
msgstr ""
|
677 |
|
678 |
-
#: ../classes/class-ccf-form-manager.php:
|
679 |
-
#: ../classes/class-ccf-form-manager.php:
|
680 |
msgid "International"
|
681 |
msgstr ""
|
682 |
|
683 |
-
#: ../classes/class-ccf-form-manager.php:
|
684 |
msgid "Type:"
|
685 |
msgstr ""
|
686 |
|
687 |
-
#: ../classes/class-ccf-form-manager.php:
|
688 |
msgid "United States"
|
689 |
msgstr ""
|
690 |
|
691 |
-
#: ../classes/class-ccf-form-manager.php:
|
692 |
msgid "Require Confirmation:"
|
693 |
msgstr ""
|
694 |
|
695 |
-
#: ../classes/class-ccf-form-manager.php:
|
696 |
msgid "Label"
|
697 |
msgstr ""
|
698 |
|
699 |
-
#: ../classes/class-ccf-form-manager.php:
|
700 |
msgid "Value"
|
701 |
msgstr ""
|
702 |
|
703 |
-
#: ../classes/class-ccf-form-manager.php:
|
704 |
-
#: ../classes/class-ccf-form-manager.php:
|
705 |
-
#: ../classes/class-ccf-form-manager.php:
|
706 |
msgid "Manage field choices:"
|
707 |
msgstr ""
|
708 |
|
709 |
-
#: ../classes/class-ccf-form-manager.php:
|
710 |
-
#: ../classes/class-ccf-form-manager.php:
|
711 |
-
#: ../classes/class-ccf-form-manager.php:
|
712 |
msgid "An example choice"
|
713 |
msgstr ""
|
714 |
|
715 |
-
#: ../classes/class-ccf-form-manager.php:
|
716 |
msgid "Arbitrary block of HTML."
|
717 |
msgstr ""
|
718 |
|
719 |
-
#: ../classes/class-ccf-form-manager.php:
|
720 |
msgid "Section Heading"
|
721 |
msgstr ""
|
722 |
|
723 |
-
#: ../classes/class-ccf-form-manager.php:
|
724 |
msgid "This is the sub-heading text."
|
725 |
msgstr ""
|
726 |
|
727 |
-
#: ../classes/class-ccf-form-manager.php:
|
728 |
msgid "First"
|
729 |
msgstr ""
|
730 |
|
731 |
-
#: ../classes/class-ccf-form-manager.php:
|
732 |
msgid "Last"
|
733 |
msgstr ""
|
734 |
|
735 |
-
#: ../classes/class-ccf-form-manager.php:
|
736 |
-
#: ../classes/class-ccf-form-manager.php:
|
737 |
msgid "Street Address"
|
738 |
msgstr ""
|
739 |
|
740 |
-
#: ../classes/class-ccf-form-manager.php:
|
741 |
-
#: ../classes/class-ccf-form-manager.php:
|
742 |
msgid "Address Line 2"
|
743 |
msgstr ""
|
744 |
|
745 |
-
#: ../classes/class-ccf-form-manager.php:
|
746 |
-
#: ../classes/class-ccf-form-manager.php:
|
747 |
msgid "City"
|
748 |
msgstr ""
|
749 |
|
750 |
-
#: ../classes/class-ccf-form-manager.php:
|
751 |
msgid "State"
|
752 |
msgstr ""
|
753 |
|
754 |
-
#: ../classes/class-ccf-form-manager.php:
|
755 |
msgid "ZIP Code"
|
756 |
msgstr ""
|
757 |
|
758 |
-
#: ../classes/class-ccf-form-manager.php:
|
759 |
msgid "State / Region / Province"
|
760 |
msgstr ""
|
761 |
|
762 |
-
#: ../classes/class-ccf-form-manager.php:
|
763 |
msgid "ZIP / Postal Code"
|
764 |
msgstr ""
|
765 |
|
766 |
-
#: ../classes/class-ccf-form-manager.php:
|
767 |
msgid "Country"
|
768 |
msgstr ""
|
769 |
|
770 |
-
#: ../classes/class-ccf-form-manager.php:
|
771 |
msgid "email@example.com"
|
772 |
msgstr ""
|
773 |
|
774 |
-
#: ../classes/class-ccf-form-manager.php:
|
775 |
-
#: ../classes/class-ccf-form-manager.php:
|
776 |
msgid "Email"
|
777 |
msgstr ""
|
778 |
|
779 |
-
#: ../classes/class-ccf-form-manager.php:
|
780 |
msgid "Confirm Email"
|
781 |
msgstr ""
|
782 |
|
783 |
-
#: ../classes/class-ccf-form-manager.php:
|
784 |
msgid "Edit"
|
785 |
msgstr ""
|
786 |
|
787 |
-
#: ../classes/class-ccf-form-manager.php:
|
788 |
msgid "Trash"
|
789 |
msgstr ""
|
790 |
|
791 |
-
#: ../classes/class-ccf-form-manager.php:
|
792 |
msgid "There is a problem with this form. Is it trashed or deleted?"
|
793 |
msgstr ""
|
794 |
|
795 |
-
#: ../classes/class-ccf-form-manager.php:
|
796 |
-
msgid "-"
|
797 |
-
msgstr ""
|
798 |
-
|
799 |
-
#: ../classes/class-ccf-form-manager.php:1216
|
800 |
msgid "There are no submissions."
|
801 |
msgstr ""
|
802 |
|
803 |
-
#: ../classes/class-ccf-form-manager.php:
|
804 |
msgid "Add Form"
|
805 |
msgstr ""
|
806 |
|
807 |
-
#: ../classes/class-ccf-form-manager.php:
|
808 |
msgid "Single Line Text"
|
809 |
msgstr ""
|
810 |
|
811 |
-
#: ../classes/class-ccf-form-manager.php:
|
812 |
msgid "Dropdown"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: ../classes/class-ccf-form-manager.php:
|
816 |
msgid "Checkboxes"
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: ../classes/class-ccf-form-manager.php:
|
820 |
msgid "Radio Buttons"
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: ../classes/class-ccf-form-manager.php:
|
824 |
msgid "Paragraph Text"
|
825 |
msgstr ""
|
826 |
|
827 |
-
#: ../classes/class-ccf-form-manager.php:
|
828 |
msgid "Hidden"
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: ../classes/class-ccf-form-manager.php:
|
832 |
msgid "HTML"
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: ../classes/class-ccf-form-manager.php:
|
836 |
msgid "Section Header"
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: ../classes/class-ccf-form-manager.php:
|
840 |
msgid "Name"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: ../classes/class-ccf-form-manager.php:
|
844 |
msgid "Date/Time"
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: ../classes/class-ccf-form-manager.php:
|
848 |
msgid "Website"
|
849 |
msgstr ""
|
850 |
|
851 |
-
#: ../classes/class-ccf-form-manager.php:
|
852 |
msgid "Address"
|
853 |
msgstr ""
|
854 |
|
855 |
-
#: ../classes/class-ccf-form-manager.php:
|
856 |
msgid "Phone"
|
857 |
msgstr ""
|
858 |
|
859 |
-
#: ../classes/class-ccf-form-manager.php:
|
860 |
msgid "reCAPTCHA"
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: ../classes/class-ccf-form-manager.php:
|
|
|
|
|
|
|
|
|
864 |
msgid "Invalid date"
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: ../classes/class-ccf-form-manager.php:
|
868 |
msgid "Form Submission"
|
869 |
msgstr ""
|
870 |
|
5 |
"Project-Id-Version: Custom Contact Forms\n"
|
6 |
"Report-Msgid-Bugs-To: https://github.com/tlovett1/editorial-access-manager/"
|
7 |
"issues\n"
|
8 |
+
"POT-Creation-Date: 2015-01-27 19:17+0100\n"
|
9 |
+
"PO-Revision-Date: 2015-01-27 19:17+0100\n"
|
10 |
"Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
|
11 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
12 |
"Language: en\n"
|
67 |
msgid "<a href=\"%s\">Forms and Submissions</a>"
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: ../classes/class-ccf-field-renderer.php:804
|
71 |
+
#: ../classes/class-ccf-field-renderer.php:824
|
72 |
+
#: ../classes/class-ccf-form-manager.php:916
|
73 |
+
#: ../classes/class-ccf-form-manager.php:937
|
74 |
msgid "HH"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: ../classes/class-ccf-field-renderer.php:808
|
78 |
+
#: ../classes/class-ccf-field-renderer.php:828
|
79 |
+
#: ../classes/class-ccf-form-manager.php:920
|
80 |
+
#: ../classes/class-ccf-form-manager.php:941
|
81 |
msgid "MM"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: ../classes/class-ccf-field-renderer.php:812
|
85 |
+
#: ../classes/class-ccf-field-renderer.php:832
|
86 |
+
#: ../classes/class-ccf-form-manager.php:924
|
87 |
+
#: ../classes/class-ccf-form-manager.php:945
|
88 |
msgid "AM"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: ../classes/class-ccf-field-renderer.php:813
|
92 |
+
#: ../classes/class-ccf-field-renderer.php:833
|
93 |
+
#: ../classes/class-ccf-form-manager.php:925
|
94 |
+
#: ../classes/class-ccf-form-manager.php:946
|
95 |
msgid "PM"
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: ../classes/class-ccf-field-renderer.php:819
|
99 |
#: ../classes/class-ccf-form-cpt.php:306
|
100 |
+
#: ../classes/class-ccf-form-manager.php:223
|
101 |
+
#: ../classes/class-ccf-form-manager.php:236
|
102 |
+
#: ../classes/class-ccf-form-manager.php:932
|
103 |
+
#: ../classes/class-ccf-form-manager.php:1100
|
104 |
+
#: ../classes/class-ccf-form-manager.php:1114
|
105 |
+
#: ../classes/class-ccf-form-manager.php:1242
|
106 |
msgid "Date"
|
107 |
msgstr ""
|
108 |
|
112 |
|
113 |
#: ../classes/class-ccf-form-cpt.php:123 ../classes/class-ccf-form-cpt.php:141
|
114 |
#: ../classes/class-ccf-form-cpt.php:304
|
115 |
+
#: ../classes/class-ccf-form-manager.php:226
|
116 |
+
#: ../classes/class-ccf-form-manager.php:239
|
117 |
msgid "Submissions"
|
118 |
msgstr ""
|
119 |
|
150 |
msgstr ""
|
151 |
|
152 |
#: ../classes/class-ccf-form-cpt.php:247
|
153 |
+
#: ../classes/class-ccf-form-manager.php:1042
|
154 |
msgid "(No title)"
|
155 |
msgstr ""
|
156 |
|
163 |
msgstr ""
|
164 |
|
165 |
#: ../classes/class-ccf-form-cpt.php:303
|
166 |
+
#: ../classes/class-ccf-form-manager.php:224
|
167 |
+
#: ../classes/class-ccf-form-manager.php:237
|
168 |
msgid "Author"
|
169 |
msgstr ""
|
170 |
|
171 |
#: ../classes/class-ccf-form-cpt.php:305
|
172 |
+
#: ../classes/class-ccf-form-manager.php:225
|
173 |
+
#: ../classes/class-ccf-form-manager.php:238
|
174 |
msgid "Number of Fields"
|
175 |
msgstr ""
|
176 |
|
233 |
msgstr ""
|
234 |
|
235 |
#: ../classes/class-ccf-form-handler.php:114
|
236 |
+
#: ../classes/class-ccf-form-handler.php:151
|
237 |
+
#: ../classes/class-ccf-form-handler.php:229
|
238 |
+
#: ../classes/class-ccf-form-handler.php:233
|
239 |
+
#: ../classes/class-ccf-form-handler.php:237
|
240 |
+
#: ../classes/class-ccf-form-handler.php:241
|
|
|
|
|
241 |
#: ../classes/class-ccf-form-handler.php:246
|
242 |
+
#: ../classes/class-ccf-form-handler.php:271
|
243 |
+
#: ../classes/class-ccf-form-handler.php:279
|
244 |
+
#: ../classes/class-ccf-form-handler.php:287
|
245 |
+
#: ../classes/class-ccf-form-handler.php:341
|
246 |
#: ../classes/class-ccf-form-renderer.php:53
|
247 |
msgid "This field is required."
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: ../classes/class-ccf-form-handler.php:167
|
251 |
#: ../classes/class-ccf-form-renderer.php:60
|
252 |
msgid "Your reCAPTCHA response was incorrect."
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: ../classes/class-ccf-form-handler.php:186
|
256 |
msgid "This field is required"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: ../classes/class-ccf-form-handler.php:191
|
260 |
msgid "This phone number is too short"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: ../classes/class-ccf-form-handler.php:194
|
264 |
msgid "ccf_field_phoneFormat"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: ../classes/class-ccf-form-handler.php:197
|
268 |
msgid "This phone number contains invalid characters."
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: ../classes/class-ccf-form-handler.php:203
|
272 |
msgid "This phone number is not 10 digits."
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: ../classes/class-ccf-form-handler.php:274
|
276 |
+
#: ../classes/class-ccf-form-handler.php:290
|
277 |
msgid "This is not a valid email"
|
278 |
msgstr ""
|
279 |
|
280 |
+
#: ../classes/class-ccf-form-handler.php:282
|
281 |
#: ../classes/class-ccf-form-renderer.php:58
|
282 |
msgid "Emails do not match."
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: ../classes/class-ccf-form-handler.php:315
|
286 |
msgid "First name is required."
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: ../classes/class-ccf-form-handler.php:319
|
290 |
msgid "Last name is required."
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: ../classes/class-ccf-form-handler.php:344
|
294 |
#: ../classes/class-ccf-form-renderer.php:67
|
295 |
msgid "This is not a valid URL. URL's must start with http(s)://"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: ../classes/class-ccf-form-handler.php:372
|
299 |
+
#: ../classes/class-ccf-form-handler.php:404
|
300 |
#: ../classes/class-ccf-form-renderer.php:54
|
301 |
msgid "Date is required."
|
302 |
msgstr ""
|
303 |
|
304 |
+
#: ../classes/class-ccf-form-handler.php:375
|
305 |
+
#: ../classes/class-ccf-form-handler.php:407
|
306 |
#: ../classes/class-ccf-form-renderer.php:65
|
307 |
msgid "This date is not valid."
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: ../classes/class-ccf-form-handler.php:380
|
311 |
+
#: ../classes/class-ccf-form-handler.php:412
|
312 |
#: ../classes/class-ccf-form-renderer.php:55
|
313 |
msgid "Hour is required."
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: ../classes/class-ccf-form-handler.php:383
|
317 |
+
#: ../classes/class-ccf-form-handler.php:415
|
318 |
#: ../classes/class-ccf-form-renderer.php:64
|
319 |
msgid "This is not a valid hour."
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: ../classes/class-ccf-form-handler.php:388
|
323 |
+
#: ../classes/class-ccf-form-handler.php:420
|
324 |
#: ../classes/class-ccf-form-renderer.php:56
|
325 |
msgid "Minute is required."
|
326 |
msgstr ""
|
327 |
|
328 |
+
#: ../classes/class-ccf-form-handler.php:391
|
329 |
+
#: ../classes/class-ccf-form-handler.php:423
|
330 |
#: ../classes/class-ccf-form-renderer.php:66
|
331 |
msgid "This is not a valid minute."
|
332 |
msgstr ""
|
333 |
|
334 |
+
#: ../classes/class-ccf-form-handler.php:396
|
335 |
+
#: ../classes/class-ccf-form-handler.php:428
|
336 |
#: ../classes/class-ccf-form-renderer.php:57
|
337 |
msgid "AM/PM is required."
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: ../classes/class-ccf-form-handler.php:663
|
341 |
msgid "Form submitted from"
|
342 |
msgstr ""
|
343 |
|
344 |
+
#: ../classes/class-ccf-form-handler.php:697
|
345 |
#, php-format
|
346 |
msgid "%s: Form Submission to \"%s\""
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: ../classes/class-ccf-form-handler.php:710
|
350 |
#: ../classes/class-ccf-form-renderer.php:120
|
351 |
msgid "Thank you for your submission."
|
352 |
msgstr ""
|
376 |
msgstr ""
|
377 |
|
378 |
#: ../classes/class-ccf-form-manager.php:115
|
379 |
+
#: ../classes/class-ccf-form-manager.php:1045
|
380 |
msgid "Insert into post"
|
381 |
msgstr ""
|
382 |
|
429 |
msgstr ""
|
430 |
|
431 |
#: ../classes/class-ccf-form-manager.php:165
|
432 |
+
#: ../classes/class-ccf-form-manager.php:272
|
433 |
+
#: ../classes/class-ccf-form-manager.php:344
|
434 |
+
#: ../classes/class-ccf-form-manager.php:430
|
435 |
+
#: ../classes/class-ccf-form-manager.php:491
|
436 |
+
#: ../classes/class-ccf-form-manager.php:529
|
437 |
+
#: ../classes/class-ccf-form-manager.php:586
|
438 |
+
#: ../classes/class-ccf-form-manager.php:629
|
439 |
+
#: ../classes/class-ccf-form-manager.php:667
|
440 |
+
#: ../classes/class-ccf-form-manager.php:674
|
441 |
+
#: ../classes/class-ccf-form-manager.php:721
|
442 |
+
#: ../classes/class-ccf-form-manager.php:758
|
443 |
+
#: ../classes/class-ccf-form-manager.php:795
|
444 |
msgid "Yes"
|
445 |
msgstr ""
|
446 |
|
447 |
#: ../classes/class-ccf-form-manager.php:166
|
448 |
+
#: ../classes/class-ccf-form-manager.php:273
|
449 |
+
#: ../classes/class-ccf-form-manager.php:345
|
450 |
+
#: ../classes/class-ccf-form-manager.php:431
|
451 |
+
#: ../classes/class-ccf-form-manager.php:492
|
452 |
+
#: ../classes/class-ccf-form-manager.php:530
|
453 |
+
#: ../classes/class-ccf-form-manager.php:587
|
454 |
+
#: ../classes/class-ccf-form-manager.php:630
|
455 |
+
#: ../classes/class-ccf-form-manager.php:668
|
456 |
+
#: ../classes/class-ccf-form-manager.php:675
|
457 |
+
#: ../classes/class-ccf-form-manager.php:722
|
458 |
+
#: ../classes/class-ccf-form-manager.php:759
|
459 |
+
#: ../classes/class-ccf-form-manager.php:796
|
460 |
msgid "No"
|
461 |
msgstr ""
|
462 |
|
494 |
msgid "Pull \"From\" Email Dynamically from Field:"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: ../classes/class-ccf-form-manager.php:206
|
|
|
|
|
|
|
|
|
498 |
msgid "items"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: ../classes/class-ccf-form-manager.php:221
|
502 |
+
#: ../classes/class-ccf-form-manager.php:234
|
503 |
msgid "ID"
|
504 |
msgstr ""
|
505 |
|
506 |
+
#: ../classes/class-ccf-form-manager.php:222
|
507 |
+
#: ../classes/class-ccf-form-manager.php:235
|
508 |
msgid "Title"
|
509 |
msgstr ""
|
510 |
|
511 |
+
#: ../classes/class-ccf-form-manager.php:249
|
512 |
msgid "<span>←</span> Click on a field to edit it."
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: ../classes/class-ccf-form-manager.php:258
|
516 |
+
#: ../classes/class-ccf-form-manager.php:330
|
517 |
+
#: ../classes/class-ccf-form-manager.php:416
|
518 |
msgid "Internal Unique Slug"
|
519 |
msgstr ""
|
520 |
|
521 |
+
#: ../classes/class-ccf-form-manager.php:262
|
522 |
+
#: ../classes/class-ccf-form-manager.php:299
|
523 |
+
#: ../classes/class-ccf-form-manager.php:334
|
524 |
+
#: ../classes/class-ccf-form-manager.php:420
|
525 |
+
#: ../classes/class-ccf-form-manager.php:485
|
526 |
+
#: ../classes/class-ccf-form-manager.php:517
|
527 |
+
#: ../classes/class-ccf-form-manager.php:569
|
528 |
+
#: ../classes/class-ccf-form-manager.php:616
|
529 |
+
#: ../classes/class-ccf-form-manager.php:655
|
530 |
+
#: ../classes/class-ccf-form-manager.php:715
|
531 |
+
#: ../classes/class-ccf-form-manager.php:752
|
532 |
+
#: ../classes/class-ccf-form-manager.php:789
|
533 |
msgid "Label:"
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: ../classes/class-ccf-form-manager.php:266
|
537 |
+
#: ../classes/class-ccf-form-manager.php:338
|
538 |
+
#: ../classes/class-ccf-form-manager.php:424
|
539 |
+
#: ../classes/class-ccf-form-manager.php:460
|
540 |
+
#: ../classes/class-ccf-form-manager.php:522
|
541 |
+
#: ../classes/class-ccf-form-manager.php:573
|
542 |
+
#: ../classes/class-ccf-form-manager.php:660
|
543 |
msgid "Initial Value:"
|
544 |
msgstr ""
|
545 |
|
546 |
+
#: ../classes/class-ccf-form-manager.php:270
|
547 |
+
#: ../classes/class-ccf-form-manager.php:342
|
548 |
+
#: ../classes/class-ccf-form-manager.php:428
|
549 |
+
#: ../classes/class-ccf-form-manager.php:489
|
550 |
+
#: ../classes/class-ccf-form-manager.php:527
|
551 |
+
#: ../classes/class-ccf-form-manager.php:584
|
552 |
+
#: ../classes/class-ccf-form-manager.php:627
|
553 |
+
#: ../classes/class-ccf-form-manager.php:665
|
554 |
+
#: ../classes/class-ccf-form-manager.php:719
|
555 |
+
#: ../classes/class-ccf-form-manager.php:756
|
556 |
+
#: ../classes/class-ccf-form-manager.php:793
|
557 |
msgid "Required:"
|
558 |
msgstr ""
|
559 |
|
560 |
+
#: ../classes/class-ccf-form-manager.php:279
|
561 |
+
#: ../classes/class-ccf-form-manager.php:315
|
562 |
+
#: ../classes/class-ccf-form-manager.php:351
|
563 |
+
#: ../classes/class-ccf-form-manager.php:376
|
564 |
+
#: ../classes/class-ccf-form-manager.php:401
|
565 |
+
#: ../classes/class-ccf-form-manager.php:437
|
566 |
+
#: ../classes/class-ccf-form-manager.php:466
|
567 |
+
#: ../classes/class-ccf-form-manager.php:498
|
568 |
+
#: ../classes/class-ccf-form-manager.php:544
|
569 |
+
#: ../classes/class-ccf-form-manager.php:593
|
570 |
+
#: ../classes/class-ccf-form-manager.php:636
|
571 |
+
#: ../classes/class-ccf-form-manager.php:681
|
572 |
+
#: ../classes/class-ccf-form-manager.php:733
|
573 |
+
#: ../classes/class-ccf-form-manager.php:770
|
574 |
+
#: ../classes/class-ccf-form-manager.php:807
|
575 |
msgid "Advanced"
|
576 |
msgstr ""
|
577 |
|
578 |
+
#: ../classes/class-ccf-form-manager.php:282
|
579 |
+
#: ../classes/class-ccf-form-manager.php:318
|
580 |
+
#: ../classes/class-ccf-form-manager.php:354
|
581 |
+
#: ../classes/class-ccf-form-manager.php:379
|
582 |
+
#: ../classes/class-ccf-form-manager.php:404
|
583 |
+
#: ../classes/class-ccf-form-manager.php:440
|
584 |
+
#: ../classes/class-ccf-form-manager.php:469
|
585 |
+
#: ../classes/class-ccf-form-manager.php:501
|
586 |
+
#: ../classes/class-ccf-form-manager.php:547
|
587 |
+
#: ../classes/class-ccf-form-manager.php:596
|
588 |
+
#: ../classes/class-ccf-form-manager.php:639
|
589 |
+
#: ../classes/class-ccf-form-manager.php:684
|
590 |
+
#: ../classes/class-ccf-form-manager.php:736
|
591 |
+
#: ../classes/class-ccf-form-manager.php:773
|
592 |
+
#: ../classes/class-ccf-form-manager.php:810
|
593 |
msgid "Class Name:"
|
594 |
msgstr ""
|
595 |
|
596 |
+
#: ../classes/class-ccf-form-manager.php:286
|
597 |
+
#: ../classes/class-ccf-form-manager.php:358
|
598 |
+
#: ../classes/class-ccf-form-manager.php:444
|
599 |
+
#: ../classes/class-ccf-form-manager.php:552
|
600 |
+
#: ../classes/class-ccf-form-manager.php:600
|
601 |
+
#: ../classes/class-ccf-form-manager.php:689
|
602 |
msgid "Placeholder Text:"
|
603 |
msgstr ""
|
604 |
|
605 |
+
#: ../classes/class-ccf-form-manager.php:297
|
606 |
msgid ""
|
607 |
"reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
|
608 |
"\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
|
609 |
msgstr ""
|
610 |
|
611 |
+
#: ../classes/class-ccf-form-manager.php:303
|
612 |
msgid "Site Key:"
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: ../classes/class-ccf-form-manager.php:305
|
616 |
+
#: ../classes/class-ccf-form-manager.php:310
|
617 |
msgid "Don't have one?"
|
618 |
msgstr ""
|
619 |
|
620 |
+
#: ../classes/class-ccf-form-manager.php:308
|
621 |
msgid "Secret Key:"
|
622 |
msgstr ""
|
623 |
|
624 |
+
#: ../classes/class-ccf-form-manager.php:367
|
625 |
+
#: ../classes/class-ccf-form-manager.php:388
|
626 |
+
#: ../classes/class-ccf-form-manager.php:413
|
627 |
+
#: ../classes/class-ccf-form-manager.php:453
|
628 |
+
#: ../classes/class-ccf-form-manager.php:478
|
629 |
+
#: ../classes/class-ccf-form-manager.php:510
|
630 |
+
#: ../classes/class-ccf-form-manager.php:562
|
631 |
+
#: ../classes/class-ccf-form-manager.php:609
|
632 |
+
#: ../classes/class-ccf-form-manager.php:648
|
633 |
+
#: ../classes/class-ccf-form-manager.php:708
|
634 |
+
#: ../classes/class-ccf-form-manager.php:745
|
635 |
+
#: ../classes/class-ccf-form-manager.php:782
|
636 |
msgid "Basic"
|
637 |
msgstr ""
|
638 |
|
639 |
+
#: ../classes/class-ccf-form-manager.php:370
|
640 |
msgid "HTML Content:"
|
641 |
msgstr ""
|
642 |
|
643 |
+
#: ../classes/class-ccf-form-manager.php:391
|
644 |
msgid "Heading:"
|
645 |
msgstr ""
|
646 |
|
647 |
+
#: ../classes/class-ccf-form-manager.php:395
|
648 |
msgid "Sub Heading:"
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: ../classes/class-ccf-form-manager.php:456
|
652 |
+
#: ../classes/class-ccf-form-manager.php:481
|
653 |
+
#: ../classes/class-ccf-form-manager.php:513
|
654 |
+
#: ../classes/class-ccf-form-manager.php:565
|
655 |
+
#: ../classes/class-ccf-form-manager.php:612
|
656 |
+
#: ../classes/class-ccf-form-manager.php:651
|
657 |
+
#: ../classes/class-ccf-form-manager.php:711
|
658 |
+
#: ../classes/class-ccf-form-manager.php:748
|
659 |
+
#: ../classes/class-ccf-form-manager.php:785
|
660 |
msgid "Internal Unique Slug (a-z, 0-9, -, _):"
|
661 |
msgstr ""
|
662 |
|
663 |
+
#: ../classes/class-ccf-form-manager.php:535
|
664 |
msgid "Enable Date Select"
|
665 |
msgstr ""
|
666 |
|
667 |
+
#: ../classes/class-ccf-form-manager.php:539
|
668 |
msgid "Enable Time Select"
|
669 |
msgstr ""
|
670 |
|
671 |
+
#: ../classes/class-ccf-form-manager.php:577
|
672 |
msgid "Format:"
|
673 |
msgstr ""
|
674 |
|
675 |
+
#: ../classes/class-ccf-form-manager.php:580
|
676 |
+
#: ../classes/class-ccf-form-manager.php:623
|
677 |
msgid "International"
|
678 |
msgstr ""
|
679 |
|
680 |
+
#: ../classes/class-ccf-form-manager.php:620
|
681 |
msgid "Type:"
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: ../classes/class-ccf-form-manager.php:622
|
685 |
msgid "United States"
|
686 |
msgstr ""
|
687 |
|
688 |
+
#: ../classes/class-ccf-form-manager.php:672
|
689 |
msgid "Require Confirmation:"
|
690 |
msgstr ""
|
691 |
|
692 |
+
#: ../classes/class-ccf-form-manager.php:700
|
693 |
msgid "Label"
|
694 |
msgstr ""
|
695 |
|
696 |
+
#: ../classes/class-ccf-form-manager.php:701
|
697 |
msgid "Value"
|
698 |
msgstr ""
|
699 |
|
700 |
+
#: ../classes/class-ccf-form-manager.php:726
|
701 |
+
#: ../classes/class-ccf-form-manager.php:763
|
702 |
+
#: ../classes/class-ccf-form-manager.php:800
|
703 |
msgid "Manage field choices:"
|
704 |
msgstr ""
|
705 |
|
706 |
+
#: ../classes/class-ccf-form-manager.php:842
|
707 |
+
#: ../classes/class-ccf-form-manager.php:855
|
708 |
+
#: ../classes/class-ccf-form-manager.php:870
|
709 |
msgid "An example choice"
|
710 |
msgstr ""
|
711 |
|
712 |
+
#: ../classes/class-ccf-form-manager.php:885
|
713 |
msgid "Arbitrary block of HTML."
|
714 |
msgstr ""
|
715 |
|
716 |
+
#: ../classes/class-ccf-form-manager.php:891
|
717 |
msgid "Section Heading"
|
718 |
msgstr ""
|
719 |
|
720 |
+
#: ../classes/class-ccf-form-manager.php:893
|
721 |
msgid "This is the sub-heading text."
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: ../classes/class-ccf-form-manager.php:900
|
725 |
msgid "First"
|
726 |
msgstr ""
|
727 |
|
728 |
+
#: ../classes/class-ccf-form-manager.php:904
|
729 |
msgid "Last"
|
730 |
msgstr ""
|
731 |
|
732 |
+
#: ../classes/class-ccf-form-manager.php:958
|
733 |
+
#: ../classes/class-ccf-form-manager.php:983
|
734 |
msgid "Street Address"
|
735 |
msgstr ""
|
736 |
|
737 |
+
#: ../classes/class-ccf-form-manager.php:962
|
738 |
+
#: ../classes/class-ccf-form-manager.php:987
|
739 |
msgid "Address Line 2"
|
740 |
msgstr ""
|
741 |
|
742 |
+
#: ../classes/class-ccf-form-manager.php:966
|
743 |
+
#: ../classes/class-ccf-form-manager.php:991
|
744 |
msgid "City"
|
745 |
msgstr ""
|
746 |
|
747 |
+
#: ../classes/class-ccf-form-manager.php:974
|
748 |
msgid "State"
|
749 |
msgstr ""
|
750 |
|
751 |
+
#: ../classes/class-ccf-form-manager.php:978
|
752 |
msgid "ZIP Code"
|
753 |
msgstr ""
|
754 |
|
755 |
+
#: ../classes/class-ccf-form-manager.php:995
|
756 |
msgid "State / Region / Province"
|
757 |
msgstr ""
|
758 |
|
759 |
+
#: ../classes/class-ccf-form-manager.php:999
|
760 |
msgid "ZIP / Postal Code"
|
761 |
msgstr ""
|
762 |
|
763 |
+
#: ../classes/class-ccf-form-manager.php:1007
|
764 |
msgid "Country"
|
765 |
msgstr ""
|
766 |
|
767 |
+
#: ../classes/class-ccf-form-manager.php:1015
|
768 |
msgid "email@example.com"
|
769 |
msgstr ""
|
770 |
|
771 |
+
#: ../classes/class-ccf-form-manager.php:1019
|
772 |
+
#: ../classes/class-ccf-form-manager.php:1300
|
773 |
msgid "Email"
|
774 |
msgstr ""
|
775 |
|
776 |
+
#: ../classes/class-ccf-form-manager.php:1023
|
777 |
msgid "Confirm Email"
|
778 |
msgstr ""
|
779 |
|
780 |
+
#: ../classes/class-ccf-form-manager.php:1044
|
781 |
msgid "Edit"
|
782 |
msgstr ""
|
783 |
|
784 |
+
#: ../classes/class-ccf-form-manager.php:1046
|
785 |
msgid "Trash"
|
786 |
msgstr ""
|
787 |
|
788 |
+
#: ../classes/class-ccf-form-manager.php:1089
|
789 |
msgid "There is a problem with this form. Is it trashed or deleted?"
|
790 |
msgstr ""
|
791 |
|
792 |
+
#: ../classes/class-ccf-form-manager.php:1233
|
|
|
|
|
|
|
|
|
793 |
msgid "There are no submissions."
|
794 |
msgstr ""
|
795 |
|
796 |
+
#: ../classes/class-ccf-form-manager.php:1262
|
797 |
msgid "Add Form"
|
798 |
msgstr ""
|
799 |
|
800 |
+
#: ../classes/class-ccf-form-manager.php:1286
|
801 |
msgid "Single Line Text"
|
802 |
msgstr ""
|
803 |
|
804 |
+
#: ../classes/class-ccf-form-manager.php:1287
|
805 |
msgid "Dropdown"
|
806 |
msgstr ""
|
807 |
|
808 |
+
#: ../classes/class-ccf-form-manager.php:1288
|
809 |
msgid "Checkboxes"
|
810 |
msgstr ""
|
811 |
|
812 |
+
#: ../classes/class-ccf-form-manager.php:1289
|
813 |
msgid "Radio Buttons"
|
814 |
msgstr ""
|
815 |
|
816 |
+
#: ../classes/class-ccf-form-manager.php:1290
|
817 |
msgid "Paragraph Text"
|
818 |
msgstr ""
|
819 |
|
820 |
+
#: ../classes/class-ccf-form-manager.php:1291
|
821 |
msgid "Hidden"
|
822 |
msgstr ""
|
823 |
|
824 |
+
#: ../classes/class-ccf-form-manager.php:1295
|
825 |
msgid "HTML"
|
826 |
msgstr ""
|
827 |
|
828 |
+
#: ../classes/class-ccf-form-manager.php:1296
|
829 |
msgid "Section Header"
|
830 |
msgstr ""
|
831 |
|
832 |
+
#: ../classes/class-ccf-form-manager.php:1301
|
833 |
msgid "Name"
|
834 |
msgstr ""
|
835 |
|
836 |
+
#: ../classes/class-ccf-form-manager.php:1302
|
837 |
msgid "Date/Time"
|
838 |
msgstr ""
|
839 |
|
840 |
+
#: ../classes/class-ccf-form-manager.php:1303
|
841 |
msgid "Website"
|
842 |
msgstr ""
|
843 |
|
844 |
+
#: ../classes/class-ccf-form-manager.php:1304
|
845 |
msgid "Address"
|
846 |
msgstr ""
|
847 |
|
848 |
+
#: ../classes/class-ccf-form-manager.php:1305
|
849 |
msgid "Phone"
|
850 |
msgstr ""
|
851 |
|
852 |
+
#: ../classes/class-ccf-form-manager.php:1306
|
853 |
msgid "reCAPTCHA"
|
854 |
msgstr ""
|
855 |
|
856 |
+
#: ../classes/class-ccf-form-manager.php:1322
|
857 |
+
msgid "You have no email fields"
|
858 |
+
msgstr ""
|
859 |
+
|
860 |
+
#: ../classes/class-ccf-form-manager.php:1323
|
861 |
msgid "Invalid date"
|
862 |
msgstr ""
|
863 |
|
864 |
+
#: ../classes/class-ccf-form-manager.php:1325
|
865 |
msgid "Form Submission"
|
866 |
msgstr ""
|
867 |
|
package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"name": "custom-contact-forms
|
3 |
"devDependencies": {
|
4 |
"grunt": "~0.4.2",
|
5 |
"grunt-contrib-concat": "^0.5.0",
|
@@ -7,6 +7,7 @@
|
|
7 |
"grunt-contrib-jshint": "^0.10.0",
|
8 |
"grunt-contrib-sass": "~0.6.0",
|
9 |
"grunt-contrib-uglify": "0.2.0",
|
10 |
-
"grunt-contrib-watch": "0.5.3"
|
|
|
11 |
}
|
12 |
}
|
1 |
{
|
2 |
+
"name": "custom-contact-forms",
|
3 |
"devDependencies": {
|
4 |
"grunt": "~0.4.2",
|
5 |
"grunt-contrib-concat": "^0.5.0",
|
7 |
"grunt-contrib-jshint": "^0.10.0",
|
8 |
"grunt-contrib-sass": "~0.6.0",
|
9 |
"grunt-contrib-uglify": "0.2.0",
|
10 |
+
"grunt-contrib-watch": "0.5.3",
|
11 |
+
"grunt-contrib-qunit": "~0.4.0"
|
12 |
}
|
13 |
}
|
phpunit.xml
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<phpunit
|
2 |
-
bootstrap="tests/bootstrap.php"
|
3 |
-
backupGlobals="false"
|
4 |
-
colors="true"
|
5 |
-
convertErrorsToExceptions="true"
|
6 |
-
convertNoticesToExceptions="true"
|
7 |
-
convertWarningsToExceptions="true"
|
8 |
-
>
|
9 |
-
<testsuites>
|
10 |
-
<testsuite>
|
11 |
-
<directory prefix="test-" suffix=".php">./tests/</directory>
|
12 |
-
</testsuite>
|
13 |
-
</testsuites>
|
14 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -4,7 +4,9 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 6.3.
|
|
|
|
|
8 |
|
9 |
Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
|
10 |
|
@@ -33,6 +35,15 @@ For questions, feature requests, and support concerning the Custom Contact Forms
|
|
33 |
|
34 |
== Changelog ==
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
= 6.3.2 =
|
37 |
* Change underscores style templating to account for when ASP tags are turned on.
|
38 |
|
4 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 6.3.3
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
|
12 |
|
35 |
|
36 |
== Changelog ==
|
37 |
|
38 |
+
= 6.3.3 =
|
39 |
+
* Fix address bug where line two was required
|
40 |
+
* Add starting QUnit tests
|
41 |
+
* Fix performance bug where duplicate event listeners were being created in the form notifications panel
|
42 |
+
* Fix required field bug with checkbox fields
|
43 |
+
* Restructure unit test folder
|
44 |
+
* Add .jshintrc
|
45 |
+
* Clean up bower.json and composer.json
|
46 |
+
|
47 |
= 6.3.2 =
|
48 |
* Change underscores style templating to account for when ASP tags are turned on.
|
49 |
|
scss/admin.scss
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
@font-face {
|
2 |
-
font-family: 'menu';
|
3 |
-
src:url('../../fonts/menu.eot');
|
4 |
-
src:url('../../fonts/menu.eot?#iefix') format('embedded-opentype'),
|
5 |
-
url('../../fonts/menu.woff') format('woff'),
|
6 |
-
url('../../fonts/menu.ttf') format('truetype'),
|
7 |
-
url('../../fonts/menu.svg#form-manager') format('svg');
|
8 |
-
font-weight: normal;
|
9 |
-
font-style: normal;
|
10 |
-
}
|
11 |
-
|
12 |
-
#menu-posts-ccf_form {
|
13 |
-
.wp-menu-image:before {
|
14 |
-
font-family: 'menu';
|
15 |
-
content: "";
|
16 |
-
speak: none;
|
17 |
-
font-weight: normal;
|
18 |
-
font-variant: normal;
|
19 |
-
text-transform: none;
|
20 |
-
line-height: 1;
|
21 |
-
cursor: pointer;
|
22 |
-
-webkit-font-smoothing: antialiased;
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scss/form-cpt.scss
DELETED
@@ -1,215 +0,0 @@
|
|
1 |
-
#titlediv {
|
2 |
-
display: none;
|
3 |
-
}
|
4 |
-
|
5 |
-
#submitdiv {
|
6 |
-
display: none;
|
7 |
-
}
|
8 |
-
|
9 |
-
#wp-admin-bar-view {
|
10 |
-
display: none;
|
11 |
-
}
|
12 |
-
|
13 |
-
.ccf-title {
|
14 |
-
h1 {
|
15 |
-
margin: 0;
|
16 |
-
|
17 |
-
.button {
|
18 |
-
vertical-align: middle;
|
19 |
-
top: -2px;
|
20 |
-
position: relative;
|
21 |
-
margin-left: 8px;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
#post-body-content .ccf-open-form-manager {
|
27 |
-
display: none;
|
28 |
-
}
|
29 |
-
|
30 |
-
.add-new-h2 {
|
31 |
-
display: none;
|
32 |
-
}
|
33 |
-
|
34 |
-
#ccf-at-a-glance {
|
35 |
-
.inside {
|
36 |
-
margin: 0;
|
37 |
-
padding: 0;
|
38 |
-
|
39 |
-
.line {
|
40 |
-
display: block;
|
41 |
-
}
|
42 |
-
|
43 |
-
.has-icon {
|
44 |
-
display: block;
|
45 |
-
|
46 |
-
&:before {
|
47 |
-
font: normal 20px/1 'dashicons';
|
48 |
-
speak: none;
|
49 |
-
display: inline-block;
|
50 |
-
padding: 0 5px 0 0;
|
51 |
-
left: -1px;
|
52 |
-
position: relative;
|
53 |
-
vertical-align: top;
|
54 |
-
-webkit-font-smoothing: antialiased;
|
55 |
-
-moz-osx-font-smoothing: grayscale;
|
56 |
-
text-decoration: none !important;
|
57 |
-
top: -1px;
|
58 |
-
color: #888;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
#ccf-created-by:before {
|
63 |
-
content: "\f110";
|
64 |
-
}
|
65 |
-
|
66 |
-
#ccf-submission-num:before {
|
67 |
-
content: "\f226";
|
68 |
-
}
|
69 |
-
|
70 |
-
#ccf-field-num:before {
|
71 |
-
content: "\f175";
|
72 |
-
}
|
73 |
-
|
74 |
-
#major-publishing-actions {
|
75 |
-
overflow: auto;
|
76 |
-
|
77 |
-
.submitdelete {
|
78 |
-
color: #a00;
|
79 |
-
text-decoration: none;
|
80 |
-
padding: 1px 2px;
|
81 |
-
}
|
82 |
-
}
|
83 |
-
}
|
84 |
-
}
|
85 |
-
|
86 |
-
.ccf-form-cpt-preview {
|
87 |
-
.ccf-form-preview {
|
88 |
-
border: 0;
|
89 |
-
padding: 0;
|
90 |
-
background-color: inherit;
|
91 |
-
}
|
92 |
-
|
93 |
-
.spinner {
|
94 |
-
display: block;
|
95 |
-
float: none;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
.ccf-submission-column-controller {
|
100 |
-
.spinner {
|
101 |
-
display: block;
|
102 |
-
float: none;
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
#ccf-submissions {
|
107 |
-
[data-icon]:before {
|
108 |
-
font-family: 'form-manager';
|
109 |
-
content: attr(data-icon);
|
110 |
-
speak: none;
|
111 |
-
font-weight: normal;
|
112 |
-
font-variant: normal;
|
113 |
-
text-transform: none;
|
114 |
-
line-height: 1;
|
115 |
-
cursor: pointer;
|
116 |
-
-webkit-font-smoothing: antialiased;
|
117 |
-
}
|
118 |
-
|
119 |
-
.ccf-submission-settings {
|
120 |
-
font: normal 20px/1;
|
121 |
-
speak: none;
|
122 |
-
display: inline-block;
|
123 |
-
padding: 12px 0px 4px 10px;
|
124 |
-
top: 0;
|
125 |
-
position: relative;
|
126 |
-
float: right;
|
127 |
-
width: 23px;
|
128 |
-
height: 30px;
|
129 |
-
cursor: pointer;
|
130 |
-
}
|
131 |
-
|
132 |
-
.inside {
|
133 |
-
padding: 0;
|
134 |
-
margin: 0;
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
table {
|
139 |
-
border: 0;
|
140 |
-
border-collapse: collapse;
|
141 |
-
table-layout: auto;
|
142 |
-
width: 100%;
|
143 |
-
|
144 |
-
td, th {
|
145 |
-
padding: 8px 10px;
|
146 |
-
}
|
147 |
-
|
148 |
-
th input {
|
149 |
-
margin: 0;
|
150 |
-
}
|
151 |
-
|
152 |
-
tbody {
|
153 |
-
tr {
|
154 |
-
background-color: #f9f9f9;
|
155 |
-
|
156 |
-
td {
|
157 |
-
width: auto;
|
158 |
-
}
|
159 |
-
|
160 |
-
.spinner {
|
161 |
-
float: none;
|
162 |
-
display: block;
|
163 |
-
}
|
164 |
-
|
165 |
-
.actions {
|
166 |
-
text-align: right;
|
167 |
-
|
168 |
-
a {
|
169 |
-
cursor: pointer;
|
170 |
-
color: inherit;
|
171 |
-
padding-left: 4px;
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
.submission-wrapper {
|
176 |
-
display: none;
|
177 |
-
}
|
178 |
-
|
179 |
-
&:nth-child(2n-1) {
|
180 |
-
background-color: #fff;
|
181 |
-
}
|
182 |
-
|
183 |
-
td.no-submissions {
|
184 |
-
text-align: center;
|
185 |
-
width: auto;
|
186 |
-
padding-bottom: 8px;
|
187 |
-
}
|
188 |
-
}
|
189 |
-
}
|
190 |
-
}
|
191 |
-
|
192 |
-
.ccf-pagination {
|
193 |
-
border-top: 1px solid #eee;
|
194 |
-
margin-top: 0;
|
195 |
-
padding: 8px;
|
196 |
-
}
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
200 |
-
.ccf-submission-content {
|
201 |
-
.field-slug {
|
202 |
-
font-weight: bold;
|
203 |
-
font-size: 15px;
|
204 |
-
padding: 7px;
|
205 |
-
}
|
206 |
-
|
207 |
-
.field-content {
|
208 |
-
padding: 7px;
|
209 |
-
background-color: #f9f9f9;
|
210 |
-
|
211 |
-
span {
|
212 |
-
font-style: italic;
|
213 |
-
}
|
214 |
-
}
|
215 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scss/form-manager.scss
DELETED
@@ -1,703 +0,0 @@
|
|
1 |
-
@font-face {
|
2 |
-
font-family: 'menu';
|
3 |
-
src:url('../../fonts/menu.eot');
|
4 |
-
src:url('../../fonts/menu.eot?#iefix') format('embedded-opentype'),
|
5 |
-
url('../../fonts/menu.woff') format('woff'),
|
6 |
-
url('../../fonts/menu.ttf') format('truetype'),
|
7 |
-
url('../../fonts/menu.svg#form-manager') format('svg');
|
8 |
-
font-weight: normal;
|
9 |
-
font-style: normal;
|
10 |
-
}
|
11 |
-
|
12 |
-
@font-face {
|
13 |
-
font-family: 'form-manager';
|
14 |
-
src:url('../../fonts/form-manager.eot');
|
15 |
-
src:url('../../fonts/form-manager.eot?#iefix') format('embedded-opentype'),
|
16 |
-
url('../../fonts/form-manager.woff') format('woff'),
|
17 |
-
url('../../fonts/form-manager.ttf') format('truetype'),
|
18 |
-
url('../../fonts/form-manager.svg#form-manager') format('svg');
|
19 |
-
font-weight: normal;
|
20 |
-
font-style: normal;
|
21 |
-
}
|
22 |
-
|
23 |
-
.ccf-open-form-manager:before {
|
24 |
-
font-family: 'menu';
|
25 |
-
content: "";
|
26 |
-
padding-right: 4px;
|
27 |
-
speak: none;
|
28 |
-
font-weight: normal;
|
29 |
-
font-variant: normal;
|
30 |
-
text-transform: none;
|
31 |
-
line-height: 1;
|
32 |
-
cursor: pointer;
|
33 |
-
-webkit-font-smoothing: antialiased;
|
34 |
-
}
|
35 |
-
|
36 |
-
.ccf-main-modal {
|
37 |
-
[data-icon]:before {
|
38 |
-
font-family: 'form-manager';
|
39 |
-
content: attr(data-icon);
|
40 |
-
speak: none;
|
41 |
-
font-weight: normal;
|
42 |
-
font-variant: normal;
|
43 |
-
text-transform: none;
|
44 |
-
line-height: 1;
|
45 |
-
cursor: pointer;
|
46 |
-
-webkit-font-smoothing: antialiased;
|
47 |
-
}
|
48 |
-
|
49 |
-
.single .insert-form-button {
|
50 |
-
display: none;
|
51 |
-
}
|
52 |
-
|
53 |
-
.hidden {
|
54 |
-
display: block;
|
55 |
-
}
|
56 |
-
|
57 |
-
display: none;
|
58 |
-
position: fixed;
|
59 |
-
top: 30px;
|
60 |
-
left: 30px;
|
61 |
-
right: 30px;
|
62 |
-
bottom: 30px;
|
63 |
-
z-index: 160000;
|
64 |
-
overflow: hidden;
|
65 |
-
background-color: #fff;
|
66 |
-
|
67 |
-
.field {
|
68 |
-
margin-bottom: 5px;
|
69 |
-
overflow: auto;
|
70 |
-
|
71 |
-
&.field-incomplete {
|
72 |
-
h4 {
|
73 |
-
background-color: #ffebe8;
|
74 |
-
}
|
75 |
-
}
|
76 |
-
|
77 |
-
&.field-duplicate-slug {
|
78 |
-
h4 {
|
79 |
-
background-color: #ffe6a5;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
&.ccf-editing {
|
84 |
-
border: #999 1px solid;
|
85 |
-
|
86 |
-
h4:hover {
|
87 |
-
border: 1px solid #e5e5e5;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
h4 {
|
92 |
-
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
93 |
-
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
94 |
-
border: 1px solid #e5e5e5;
|
95 |
-
background: #fafafa;
|
96 |
-
font-size: 13px;
|
97 |
-
margin: 0;
|
98 |
-
font-weight: 600;
|
99 |
-
color: #222;
|
100 |
-
padding: 13px;
|
101 |
-
cursor: move;
|
102 |
-
|
103 |
-
&:hover {
|
104 |
-
border: #999 1px solid;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
.right {
|
109 |
-
float: right;
|
110 |
-
a {
|
111 |
-
color: inherit;
|
112 |
-
margin-left: 3px;
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
.preview {
|
117 |
-
clear: both;
|
118 |
-
display: none;
|
119 |
-
text-align: left;
|
120 |
-
overflow: auto;
|
121 |
-
float: none;
|
122 |
-
background-color: #fff;
|
123 |
-
border-left: 1px solid #e5e5e5;
|
124 |
-
border-right: 1px solid #e5e5e5;
|
125 |
-
border-bottom: 1px solid #e5e5e5;
|
126 |
-
padding: 10px 20px;
|
127 |
-
|
128 |
-
.recaptcha-preview-img {
|
129 |
-
margin-top: 7px;
|
130 |
-
}
|
131 |
-
|
132 |
-
.left {
|
133 |
-
float: left;
|
134 |
-
clear: both;
|
135 |
-
width: 47%;
|
136 |
-
}
|
137 |
-
|
138 |
-
.right {
|
139 |
-
float: right;
|
140 |
-
width: 47%;
|
141 |
-
}
|
142 |
-
|
143 |
-
.left, .right, .full {
|
144 |
-
|
145 |
-
input[type="text"], select {
|
146 |
-
width: 100%;
|
147 |
-
max-width: 100%;
|
148 |
-
}
|
149 |
-
|
150 |
-
.sub-label {
|
151 |
-
margin: 3px 0 3px 2px;
|
152 |
-
font-size: 90%;
|
153 |
-
}
|
154 |
-
|
155 |
-
.hour, .minute {
|
156 |
-
display: inline-block;
|
157 |
-
margin-right: 5px;
|
158 |
-
|
159 |
-
input {
|
160 |
-
width: 35px;
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
.am-pm {
|
165 |
-
display: inline-block;
|
166 |
-
vertical-align: top;
|
167 |
-
|
168 |
-
select {
|
169 |
-
width: 60px;
|
170 |
-
|
171 |
-
}
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
.heading {
|
176 |
-
font-size: 125%;
|
177 |
-
font-weight: bold;
|
178 |
-
border-bottom: 1px solid #ccc;
|
179 |
-
padding-bottom: 9px;
|
180 |
-
margin-bottom: 9px;
|
181 |
-
}
|
182 |
-
|
183 |
-
.subheading {
|
184 |
-
font-style: italic;
|
185 |
-
}
|
186 |
-
|
187 |
-
label {
|
188 |
-
font-weight: bold;
|
189 |
-
margin-bottom: 3px;
|
190 |
-
cursor: inherit;
|
191 |
-
|
192 |
-
span {
|
193 |
-
color: red;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
|
197 |
-
input[type="checkbox"] + label {
|
198 |
-
display: inline-block;
|
199 |
-
}
|
200 |
-
|
201 |
-
input[type="radio"] + label {
|
202 |
-
display: inline-block;
|
203 |
-
}
|
204 |
-
|
205 |
-
input[type="text"], textarea {
|
206 |
-
border: inherit;
|
207 |
-
width: 100%;
|
208 |
-
background-color: #fff;
|
209 |
-
color: #333;
|
210 |
-
border: 1px solid #ddd;
|
211 |
-
-webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
|
212 |
-
box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
|
213 |
-
}
|
214 |
-
|
215 |
-
textarea {
|
216 |
-
height: 60px;
|
217 |
-
}
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
.close-icon {
|
222 |
-
position: absolute;
|
223 |
-
top: 16px;
|
224 |
-
right: 16px;
|
225 |
-
font-size: 35px;
|
226 |
-
cursor: pointer;
|
227 |
-
color: #333;
|
228 |
-
z-index: 160001;
|
229 |
-
}
|
230 |
-
|
231 |
-
.main-menu {
|
232 |
-
position: absolute;
|
233 |
-
top: 0;
|
234 |
-
right: 0;
|
235 |
-
left: 0;
|
236 |
-
height: 125px;
|
237 |
-
|
238 |
-
h1 {
|
239 |
-
padding: 16px;
|
240 |
-
}
|
241 |
-
|
242 |
-
ul {
|
243 |
-
height: 40px;
|
244 |
-
box-sizing: border-box;
|
245 |
-
font-size: 14px;
|
246 |
-
margin: 0;
|
247 |
-
list-style-type: none;
|
248 |
-
border-top: 1px solid #ddd;
|
249 |
-
background: #f3f3f3;
|
250 |
-
padding: 0 16px;
|
251 |
-
|
252 |
-
li {
|
253 |
-
display: inline-block;
|
254 |
-
margin: 0;
|
255 |
-
padding: 0;
|
256 |
-
display: inline-block;
|
257 |
-
height: 38px;
|
258 |
-
vertical-align: middle;
|
259 |
-
line-height: 40px;
|
260 |
-
padding: 0 8px;
|
261 |
-
|
262 |
-
a {
|
263 |
-
text-decoration: none;
|
264 |
-
|
265 |
-
:hover {
|
266 |
-
color: #000;
|
267 |
-
}
|
268 |
-
|
269 |
-
&.selected {
|
270 |
-
color: #000;
|
271 |
-
}
|
272 |
-
}
|
273 |
-
}
|
274 |
-
}
|
275 |
-
}
|
276 |
-
|
277 |
-
.ccf-form-pane {
|
278 |
-
display: none;
|
279 |
-
position: absolute;
|
280 |
-
top: 125px;
|
281 |
-
right: 0;
|
282 |
-
left: 0;
|
283 |
-
bottom: 0;
|
284 |
-
|
285 |
-
&.single {
|
286 |
-
top: 85px;
|
287 |
-
border-top: 1px solid #e5e5e5;
|
288 |
-
|
289 |
-
.form-content, .left-sidebar {
|
290 |
-
border-top: 0;
|
291 |
-
}
|
292 |
-
}
|
293 |
-
|
294 |
-
.disabled-overlay {
|
295 |
-
position: absolute;
|
296 |
-
top: 0;
|
297 |
-
left: 0;
|
298 |
-
right: 0;
|
299 |
-
bottom: 50px;;
|
300 |
-
background-color: #000;
|
301 |
-
opacity: .1;
|
302 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";
|
303 |
-
filter: alpha(opacity=1);
|
304 |
-
-moz-opacity: 0.1;
|
305 |
-
-khtml-opacity: 0.1;
|
306 |
-
|
307 |
-
z-index: 1;
|
308 |
-
display: none;
|
309 |
-
}
|
310 |
-
|
311 |
-
.bottom {
|
312 |
-
bottom: 0;
|
313 |
-
left: 0;
|
314 |
-
right: 0;
|
315 |
-
height: 50px;
|
316 |
-
padding: 0 16px;
|
317 |
-
position: absolute;
|
318 |
-
text-align: right;
|
319 |
-
line-height: 50px;
|
320 |
-
border-top: 1px solid #e5e5e5;
|
321 |
-
|
322 |
-
.spinner {
|
323 |
-
display: none;
|
324 |
-
float: right;
|
325 |
-
width: 16px;
|
326 |
-
height: 16px;
|
327 |
-
margin-top: 16px;
|
328 |
-
}
|
329 |
-
|
330 |
-
input {
|
331 |
-
margin-top: 11px;
|
332 |
-
float: right;
|
333 |
-
margin-left: 6px;
|
334 |
-
}
|
335 |
-
}
|
336 |
-
|
337 |
-
.accordion-section {
|
338 |
-
background-color: #fff;
|
339 |
-
border-bottom: 0;
|
340 |
-
|
341 |
-
&:first-child {
|
342 |
-
border-top: 1px solid #e5e5e5;
|
343 |
-
}
|
344 |
-
|
345 |
-
&.expanded {
|
346 |
-
.section-content {
|
347 |
-
display: block;
|
348 |
-
}
|
349 |
-
|
350 |
-
h2:before {
|
351 |
-
content: "";
|
352 |
-
}
|
353 |
-
}
|
354 |
-
|
355 |
-
h2 {
|
356 |
-
&:before {
|
357 |
-
margin-right: 8px;
|
358 |
-
font-family: 'form-manager';
|
359 |
-
content: "";
|
360 |
-
speak: none;
|
361 |
-
font-weight: normal;
|
362 |
-
font-variant: normal;
|
363 |
-
text-transform: none;
|
364 |
-
line-height: 1;
|
365 |
-
cursor: pointer;
|
366 |
-
-webkit-font-smoothing: antialiased;
|
367 |
-
}
|
368 |
-
|
369 |
-
cursor: pointer;
|
370 |
-
padding: 10px 20px;
|
371 |
-
border-bottom: 1px solid #e5e5e5;
|
372 |
-
font-size: 150%;
|
373 |
-
background-color: #fafafa;
|
374 |
-
margin: 0;
|
375 |
-
}
|
376 |
-
|
377 |
-
.section-content {
|
378 |
-
display: none;
|
379 |
-
padding: 10px 20px;
|
380 |
-
border-bottom: 1px solid #e5e5e5;
|
381 |
-
}
|
382 |
-
}
|
383 |
-
|
384 |
-
label {
|
385 |
-
display: block;
|
386 |
-
margin-bottom: 8px;
|
387 |
-
}
|
388 |
-
|
389 |
-
.left-sidebar {
|
390 |
-
box-sizing: border-box;
|
391 |
-
background-color: #f3f3f3;
|
392 |
-
position: absolute;
|
393 |
-
border-top: 1px solid #ddd;
|
394 |
-
border-right: 1px solid #ddd;
|
395 |
-
overflow: scroll;
|
396 |
-
width: 25%;
|
397 |
-
top: 0;
|
398 |
-
padding: 0;
|
399 |
-
bottom: 50px;
|
400 |
-
left: 0;
|
401 |
-
overflow: auto;
|
402 |
-
|
403 |
-
.accordion-section:first-child {
|
404 |
-
border-top: 0;
|
405 |
-
}
|
406 |
-
|
407 |
-
.fields, .structure-fields, .special-fields {
|
408 |
-
padding: 5px;
|
409 |
-
|
410 |
-
.field .right, .field .preview {
|
411 |
-
display: none;
|
412 |
-
}
|
413 |
-
}
|
414 |
-
|
415 |
-
.explain {
|
416 |
-
margin-top: 5px;
|
417 |
-
font-style: italic;
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
.form-content {
|
422 |
-
box-sizing: border-box;
|
423 |
-
position: absolute;
|
424 |
-
width: 40%;
|
425 |
-
bottom: 50px;
|
426 |
-
left: 25%;
|
427 |
-
overflow: scroll;
|
428 |
-
right: 35%;
|
429 |
-
top: 0;
|
430 |
-
overflow: auto;
|
431 |
-
border-top: 1px solid #ddd;
|
432 |
-
padding: 21px;
|
433 |
-
|
434 |
-
.no-fields {
|
435 |
-
font-size: 22px;
|
436 |
-
padding: 16px;
|
437 |
-
font-style: italic;
|
438 |
-
}
|
439 |
-
}
|
440 |
-
|
441 |
-
.right-sidebar {
|
442 |
-
box-sizing: border-box;
|
443 |
-
padding: 0;
|
444 |
-
position: absolute;
|
445 |
-
overflow: scroll;
|
446 |
-
width: 35%;
|
447 |
-
top: 0;
|
448 |
-
overflow: auto;
|
449 |
-
background-color: #f3f3f3;
|
450 |
-
right: 0;
|
451 |
-
bottom: 50px;
|
452 |
-
border-left: 1px solid #dddddd;
|
453 |
-
|
454 |
-
.section-content > div {
|
455 |
-
margin-bottom: 6px;
|
456 |
-
}
|
457 |
-
|
458 |
-
.no-field {
|
459 |
-
padding: 16px;
|
460 |
-
font-style: italic;
|
461 |
-
font-size: 22px;
|
462 |
-
}
|
463 |
-
|
464 |
-
label {
|
465 |
-
display: inline-block;
|
466 |
-
margin: 0;
|
467 |
-
|
468 |
-
.required {
|
469 |
-
color: red;
|
470 |
-
}
|
471 |
-
}
|
472 |
-
|
473 |
-
.field-error {
|
474 |
-
input {
|
475 |
-
border-color: #ff0000;
|
476 |
-
border-width: 2px;
|
477 |
-
}
|
478 |
-
}
|
479 |
-
|
480 |
-
.field-duplicate-slug input {
|
481 |
-
border-color: #ffe6a5;
|
482 |
-
border-width: 2px;
|
483 |
-
}
|
484 |
-
|
485 |
-
input[type=text] {
|
486 |
-
width: 100%;
|
487 |
-
display: block;
|
488 |
-
margin-top: 5px;
|
489 |
-
}
|
490 |
-
|
491 |
-
input[type="checkbox"] + label {
|
492 |
-
display: inline-block;
|
493 |
-
vertical-align: middle;
|
494 |
-
}
|
495 |
-
|
496 |
-
label + select {
|
497 |
-
display: inline-block;
|
498 |
-
}
|
499 |
-
|
500 |
-
textarea {
|
501 |
-
width: 100%;
|
502 |
-
height: 80px;
|
503 |
-
}
|
504 |
-
|
505 |
-
.field-html {
|
506 |
-
height: 150px;
|
507 |
-
width: 100%;
|
508 |
-
}
|
509 |
-
|
510 |
-
.repeatable-choices {
|
511 |
-
.choice {
|
512 |
-
input[type='text'] {
|
513 |
-
width: 100px;
|
514 |
-
display: inline-block;
|
515 |
-
}
|
516 |
-
|
517 |
-
.move {
|
518 |
-
color: inherit;
|
519 |
-
cursor: move;
|
520 |
-
|
521 |
-
&:before {
|
522 |
-
cursor: move;
|
523 |
-
}
|
524 |
-
}
|
525 |
-
|
526 |
-
.add, .delete {
|
527 |
-
cursor: pointer;
|
528 |
-
color: inherit;
|
529 |
-
}
|
530 |
-
}
|
531 |
-
}
|
532 |
-
}
|
533 |
-
}
|
534 |
-
|
535 |
-
.ccf-existing-form-pane {
|
536 |
-
display: none;
|
537 |
-
position: absolute;
|
538 |
-
overflow: scroll;
|
539 |
-
top: 125px;
|
540 |
-
right: 0;
|
541 |
-
left: 0;
|
542 |
-
bottom: 0;
|
543 |
-
background-color: #fff;
|
544 |
-
padding: 16px;
|
545 |
-
|
546 |
-
table {
|
547 |
-
width: 100%;
|
548 |
-
border-collapse: collapse;
|
549 |
-
table-layout: fixed;
|
550 |
-
border: 1px solid #ddd;
|
551 |
-
|
552 |
-
td {
|
553 |
-
margin: 0;
|
554 |
-
padding: 14px 21px;
|
555 |
-
text-align: left;
|
556 |
-
}
|
557 |
-
|
558 |
-
.empty-form-table {
|
559 |
-
text-align: center;
|
560 |
-
}
|
561 |
-
|
562 |
-
thead,tfoot {
|
563 |
-
background-color: #f0f0f0;
|
564 |
-
|
565 |
-
tr {
|
566 |
-
border-bottom: 1px solid #e5e5e5;
|
567 |
-
border-top: 1px solid #e5e5e5;
|
568 |
-
}
|
569 |
-
|
570 |
-
th {
|
571 |
-
margin: 0;
|
572 |
-
text-align: left;
|
573 |
-
padding: 14px 21px;
|
574 |
-
box-sizing: border-box;
|
575 |
-
}
|
576 |
-
|
577 |
-
.id {
|
578 |
-
width: 5%;
|
579 |
-
}
|
580 |
-
|
581 |
-
.title {
|
582 |
-
width: 30%;
|
583 |
-
}
|
584 |
-
|
585 |
-
.author {
|
586 |
-
width: 10%;
|
587 |
-
}
|
588 |
-
|
589 |
-
.entries {
|
590 |
-
width: 10%;
|
591 |
-
}
|
592 |
-
|
593 |
-
.submissions {
|
594 |
-
width: 10%;
|
595 |
-
}
|
596 |
-
|
597 |
-
.number-of-fields {
|
598 |
-
width: 15%;
|
599 |
-
}
|
600 |
-
|
601 |
-
.date {
|
602 |
-
width: 20%;
|
603 |
-
}
|
604 |
-
}
|
605 |
-
|
606 |
-
tbody {
|
607 |
-
tr:nth-child(odd) {
|
608 |
-
background-color: #fafafa;
|
609 |
-
margin: 0;
|
610 |
-
}
|
611 |
-
|
612 |
-
tr {
|
613 |
-
background-color: #fff;
|
614 |
-
}
|
615 |
-
|
616 |
-
td {
|
617 |
-
vertical-align: top;
|
618 |
-
|
619 |
-
a {
|
620 |
-
text-decoration: none;
|
621 |
-
cursor: pointer;
|
622 |
-
}
|
623 |
-
|
624 |
-
.title {
|
625 |
-
font-weight: bold;
|
626 |
-
font-size: 14px;
|
627 |
-
}
|
628 |
-
|
629 |
-
.actions {
|
630 |
-
visibility: hidden;
|
631 |
-
margin-top: 6px;
|
632 |
-
|
633 |
-
.delete {
|
634 |
-
color: #ff0000;
|
635 |
-
}
|
636 |
-
}
|
637 |
-
}
|
638 |
-
|
639 |
-
tr:hover td .actions {
|
640 |
-
visibility: visible;
|
641 |
-
}
|
642 |
-
}
|
643 |
-
}
|
644 |
-
}
|
645 |
-
}
|
646 |
-
|
647 |
-
.ccf-main-modal-overlay {
|
648 |
-
display: none;
|
649 |
-
position: fixed;
|
650 |
-
top: 0px;
|
651 |
-
left: 0px;
|
652 |
-
width: 100%;
|
653 |
-
height: 100%;
|
654 |
-
z-index: 159900;
|
655 |
-
opacity: 0.7;
|
656 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
657 |
-
filter: alpha(opacity=70);
|
658 |
-
-moz-opacity: 0.7;
|
659 |
-
-khtml-opacity: 0.7;
|
660 |
-
background-color: #000;
|
661 |
-
}
|
662 |
-
|
663 |
-
.ccf-pagination {
|
664 |
-
font-size: 12px;
|
665 |
-
margin-top: 8px;
|
666 |
-
text-align: right;
|
667 |
-
|
668 |
-
.pages {
|
669 |
-
padding: 0 4px;
|
670 |
-
}
|
671 |
-
|
672 |
-
.num-items {
|
673 |
-
font-style: italic;
|
674 |
-
padding-right: 4px;
|
675 |
-
}
|
676 |
-
|
677 |
-
a {
|
678 |
-
cursor: pointer;
|
679 |
-
color: #0074a2;
|
680 |
-
background: #f0f0f0;
|
681 |
-
text-decoration: none;
|
682 |
-
|
683 |
-
&.next, &.prev, &.first, &.last {
|
684 |
-
font-size: 16px;
|
685 |
-
line-height: 22px;
|
686 |
-
padding: 0 7px 2px 7px;
|
687 |
-
|
688 |
-
&:hover {
|
689 |
-
color: #fff;
|
690 |
-
background-color: #2ea2cc;
|
691 |
-
}
|
692 |
-
}
|
693 |
-
|
694 |
-
&.disabled {
|
695 |
-
color: #aaa;
|
696 |
-
|
697 |
-
&:hover {
|
698 |
-
color: #aaa;
|
699 |
-
background: #f0f0f0;
|
700 |
-
}
|
701 |
-
}
|
702 |
-
}
|
703 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scss/form-mce.scss
DELETED
@@ -1,185 +0,0 @@
|
|
1 |
-
.ccf-form-preview {
|
2 |
-
border: 1px solid #e5e5e5;
|
3 |
-
background-color: #fcfcfc;
|
4 |
-
padding: 3.5% 7.5%;
|
5 |
-
font-size: 14px;
|
6 |
-
font-family: "Open Sans",sans-serif;
|
7 |
-
|
8 |
-
&.preview-error {
|
9 |
-
text-align: center;
|
10 |
-
}
|
11 |
-
|
12 |
-
h2 {
|
13 |
-
margin: 0 0 10px 0;
|
14 |
-
padding: 0;
|
15 |
-
}
|
16 |
-
|
17 |
-
.field-submit {
|
18 |
-
margin-top: 15px;
|
19 |
-
|
20 |
-
input {
|
21 |
-
color: #555;
|
22 |
-
border-color: #ccc;
|
23 |
-
background: #f7f7f7;
|
24 |
-
-webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
|
25 |
-
box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
|
26 |
-
vertical-align: top;
|
27 |
-
display: inline-block;
|
28 |
-
text-decoration: none;
|
29 |
-
font-size: 13px;
|
30 |
-
line-height: 26px;
|
31 |
-
height: 28px;
|
32 |
-
margin: 0;
|
33 |
-
padding: 0 10px 1px;
|
34 |
-
cursor: pointer;
|
35 |
-
border-width: 1px;
|
36 |
-
border-style: solid;
|
37 |
-
-webkit-appearance: none;
|
38 |
-
-webkit-border-radius: 3px;
|
39 |
-
border-radius: 3px;
|
40 |
-
white-space: nowrap;
|
41 |
-
-webkit-box-sizing: border-box;
|
42 |
-
-moz-box-sizing: border-box;
|
43 |
-
box-sizing: border-box;
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
.field {
|
48 |
-
clear: both;
|
49 |
-
text-align: left;
|
50 |
-
float: none;
|
51 |
-
padding: 15px 0;
|
52 |
-
|
53 |
-
&:after {
|
54 |
-
content: ' ';
|
55 |
-
clear: both;
|
56 |
-
height: 0;
|
57 |
-
display: block;
|
58 |
-
}
|
59 |
-
|
60 |
-
label {
|
61 |
-
display: block;
|
62 |
-
}
|
63 |
-
|
64 |
-
.left {
|
65 |
-
float: left;
|
66 |
-
clear: both;
|
67 |
-
width: 47%;
|
68 |
-
}
|
69 |
-
|
70 |
-
.right {
|
71 |
-
float: right;
|
72 |
-
width: 47%;
|
73 |
-
}
|
74 |
-
|
75 |
-
.left, .right, .full {
|
76 |
-
|
77 |
-
input[type="text"], select {
|
78 |
-
width: 100%;
|
79 |
-
max-width: 100%;
|
80 |
-
}
|
81 |
-
|
82 |
-
.sub-label {
|
83 |
-
margin: 3px 0 3px 2px;
|
84 |
-
font-size: 90%;
|
85 |
-
}
|
86 |
-
}
|
87 |
-
|
88 |
-
.heading {
|
89 |
-
font-size: 125%;
|
90 |
-
font-weight: bold;
|
91 |
-
border-bottom: 1px solid #ccc;
|
92 |
-
padding-bottom: 9px;
|
93 |
-
margin-bottom: 9px;
|
94 |
-
}
|
95 |
-
|
96 |
-
.subheading {
|
97 |
-
font-style: italic;
|
98 |
-
}
|
99 |
-
|
100 |
-
label {
|
101 |
-
font-weight: bold;
|
102 |
-
margin-bottom: 7px;
|
103 |
-
cursor: inherit;
|
104 |
-
|
105 |
-
span {
|
106 |
-
color: red;
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
.choice {
|
111 |
-
padding-left: 15px;
|
112 |
-
|
113 |
-
label {
|
114 |
-
font-weight: normal;
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
input[type="checkbox"] + label {
|
119 |
-
display: inline-block;
|
120 |
-
}
|
121 |
-
|
122 |
-
input[type="radio"] + label {
|
123 |
-
display: inline-block;
|
124 |
-
}
|
125 |
-
|
126 |
-
input[type="text"], textarea {
|
127 |
-
border: 1px solid #ddd;
|
128 |
-
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
129 |
-
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
130 |
-
background-color: #fff;
|
131 |
-
color: #333;
|
132 |
-
height: 28px;
|
133 |
-
box-sizing: border-box;
|
134 |
-
width: 100%;
|
135 |
-
display: block;
|
136 |
-
}
|
137 |
-
|
138 |
-
input[type="text"], textarea, select {
|
139 |
-
padding: 3px 6px;
|
140 |
-
font-size: 14px;
|
141 |
-
}
|
142 |
-
|
143 |
-
textarea {
|
144 |
-
height: 80px;
|
145 |
-
}
|
146 |
-
|
147 |
-
select {
|
148 |
-
border: 1px solid #ddd;
|
149 |
-
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
150 |
-
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
151 |
-
background-color: #fff;
|
152 |
-
color: #333;
|
153 |
-
outline: 0;
|
154 |
-
padding: 2px;
|
155 |
-
line-height: 28px;
|
156 |
-
height: 28px;
|
157 |
-
vertical-align: middle;
|
158 |
-
font-size: 14px;
|
159 |
-
}
|
160 |
-
|
161 |
-
&.date {
|
162 |
-
.hour, .minute {
|
163 |
-
display: inline-block;
|
164 |
-
margin-right: 5px;
|
165 |
-
|
166 |
-
input {
|
167 |
-
width: 35px;
|
168 |
-
}
|
169 |
-
|
170 |
-
label {
|
171 |
-
font-weight: normal;
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
.am-pm {
|
176 |
-
display: inline-block;
|
177 |
-
vertical-align: top;
|
178 |
-
|
179 |
-
select {
|
180 |
-
width: 60px;
|
181 |
-
}
|
182 |
-
}
|
183 |
-
}
|
184 |
-
}
|
185 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scss/form-table.scss
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
.view-switch {
|
2 |
-
display: none;
|
3 |
-
}
|
|
|
|
|
|
scss/form.scss
DELETED
@@ -1,141 +0,0 @@
|
|
1 |
-
.ccf-form-wrapper {
|
2 |
-
margin: 20px 0;
|
3 |
-
|
4 |
-
.form-title {
|
5 |
-
font-size: 150%;
|
6 |
-
padding: 20px 0;
|
7 |
-
}
|
8 |
-
|
9 |
-
.form-description {
|
10 |
-
padding: 0 0 20px 0;
|
11 |
-
}
|
12 |
-
|
13 |
-
.form-submit {
|
14 |
-
img {
|
15 |
-
vertical-align: middle;
|
16 |
-
display: inline-block;
|
17 |
-
border: 0;
|
18 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
19 |
-
filter: alpha(opacity=0);
|
20 |
-
-moz-opacity: 0;
|
21 |
-
-khtml-opacity: 0;
|
22 |
-
opacity: 0;
|
23 |
-
float: none;
|
24 |
-
margin: 0 0 0 6px;
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
.field {
|
29 |
-
margin-bottom: 24px;
|
30 |
-
clear: both;
|
31 |
-
overflow: auto;
|
32 |
-
|
33 |
-
&[data-field-type="recaptcha"],&[data-field-type="dropdown"], &[data-field-type="radio"], &[data-field-type="checkboxes"], &[data-field-type="date"] {
|
34 |
-
.error {
|
35 |
-
float: none;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
.error {
|
40 |
-
color: #ff0000;
|
41 |
-
float: right;
|
42 |
-
font-size: 85%;
|
43 |
-
margin-top: 3px;
|
44 |
-
|
45 |
-
&.match-error, &.email-error {
|
46 |
-
float: none;
|
47 |
-
}
|
48 |
-
|
49 |
-
&.right-error {
|
50 |
-
float: right;
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
.field-error-input {
|
55 |
-
border: 1px solid #ff0000;
|
56 |
-
}
|
57 |
-
|
58 |
-
label {
|
59 |
-
display: block;
|
60 |
-
clear: both;
|
61 |
-
margin-bottom: 6px;
|
62 |
-
font-weight: bold;
|
63 |
-
|
64 |
-
.required {
|
65 |
-
color: #ff0000;
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
input[type="text"], textarea {
|
70 |
-
width: 100%;
|
71 |
-
box-sizing: border-box;
|
72 |
-
}
|
73 |
-
|
74 |
-
textarea {
|
75 |
-
min-height: 100px;
|
76 |
-
color: inherit;
|
77 |
-
font-family: inherit;
|
78 |
-
}
|
79 |
-
|
80 |
-
.left {
|
81 |
-
width: 50%;
|
82 |
-
float: left;
|
83 |
-
box-sizing: border-box;
|
84 |
-
padding-right: 10px;
|
85 |
-
clear: both;
|
86 |
-
}
|
87 |
-
|
88 |
-
.right {
|
89 |
-
width: 50%;
|
90 |
-
float: right;
|
91 |
-
box-sizing: border-box;
|
92 |
-
padding-left: 10px;
|
93 |
-
}
|
94 |
-
|
95 |
-
.sub-label {
|
96 |
-
margin-top: 3px;
|
97 |
-
font-size: 85%;
|
98 |
-
clear: none;
|
99 |
-
font-weight: normal;
|
100 |
-
}
|
101 |
-
|
102 |
-
&.section-header {
|
103 |
-
|
104 |
-
.heading {
|
105 |
-
font-size: 125%;
|
106 |
-
border-bottom: 1px solid #ccc;
|
107 |
-
padding-bottom: 5px;
|
108 |
-
}
|
109 |
-
|
110 |
-
.subheading {
|
111 |
-
margin-top: 10px;
|
112 |
-
font-size: 85%;
|
113 |
-
font-style: italic;
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
&.date {
|
118 |
-
.hour, .minute {
|
119 |
-
display: inline-block;
|
120 |
-
margin-right: 5px;
|
121 |
-
|
122 |
-
input {
|
123 |
-
width: 2.5em;
|
124 |
-
}
|
125 |
-
|
126 |
-
label {
|
127 |
-
font-weight: normal;
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
.am-pm {
|
132 |
-
display: inline-block;
|
133 |
-
vertical-align: top;
|
134 |
-
|
135 |
-
select {
|
136 |
-
width: auto;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
}
|
140 |
-
}
|
141 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tests/bootstrap.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$_tests_dir = getenv( 'WP_TESTS_DIR' );
|
4 |
-
if ( ! $_tests_dir ) {
|
5 |
-
$_tests_dir = '/tmp/wordpress-tests-lib';
|
6 |
-
}
|
7 |
-
|
8 |
-
require_once( $_tests_dir . '/includes/functions.php' );
|
9 |
-
|
10 |
-
function _manually_load_plugin() {
|
11 |
-
require( dirname( __FILE__ ) . '/../custom-contact-forms.php' );
|
12 |
-
|
13 |
-
if ( ! class_exists( 'WP_JSON_Server' ) ) {
|
14 |
-
require( dirname( __FILE__ ) . '/../vendor/wp-api/wp-api/plugin.php' );
|
15 |
-
}
|
16 |
-
|
17 |
-
require_once( dirname( __FILE__ ) . '/../classes/class-ccf-api.php' );
|
18 |
-
}
|
19 |
-
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
|
20 |
-
|
21 |
-
require_once( $_tests_dir . '/includes/bootstrap.php' );
|
22 |
-
|
23 |
-
require_once( dirname( __FILE__ ) . '/includes/class-ccf-test-base.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tests/includes/class-ccf-test-base.php
DELETED
@@ -1,233 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class CCFTestBase extends WP_UnitTestCase {
|
4 |
-
public $api;
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Default filed information
|
8 |
-
*
|
9 |
-
* @var array
|
10 |
-
* @since 6.0
|
11 |
-
*/
|
12 |
-
public $default_field = array(
|
13 |
-
'type' => 'single-line-text',
|
14 |
-
'label' => 'Field Label',
|
15 |
-
'value' => 'value',
|
16 |
-
'placeholder' => 'placeholder',
|
17 |
-
'slug' => 'slug',
|
18 |
-
'required' => false,
|
19 |
-
'className' => 'class-name',
|
20 |
-
'ID' => null,
|
21 |
-
);
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Advanced field data
|
25 |
-
*
|
26 |
-
* @var array
|
27 |
-
* @since 6.0
|
28 |
-
*/
|
29 |
-
public $advanced_fields = array(
|
30 |
-
array(
|
31 |
-
'type' => 'single-line-text',
|
32 |
-
),
|
33 |
-
array(
|
34 |
-
'type' => 'paragraph-text',
|
35 |
-
),
|
36 |
-
array(
|
37 |
-
'type' => 'single-line-text',
|
38 |
-
),
|
39 |
-
array(
|
40 |
-
'type' => 'html',
|
41 |
-
),
|
42 |
-
array(
|
43 |
-
'type' => 'section-header',
|
44 |
-
),
|
45 |
-
array(
|
46 |
-
'type' => 'dropdown',
|
47 |
-
'choices' => array(
|
48 |
-
array(
|
49 |
-
'label' => 'label1',
|
50 |
-
'value' => 'value1',
|
51 |
-
'selected' => true,
|
52 |
-
),
|
53 |
-
array(
|
54 |
-
'label' => 'label 2',
|
55 |
-
'value' => 'value 2',
|
56 |
-
'selected' => false,
|
57 |
-
),
|
58 |
-
array(
|
59 |
-
'label' => 'label 3',
|
60 |
-
'value' => '3',
|
61 |
-
'selected' => true,
|
62 |
-
),
|
63 |
-
),
|
64 |
-
),
|
65 |
-
array(
|
66 |
-
'type' => 'checkbox',
|
67 |
-
'choices' => array(
|
68 |
-
array(
|
69 |
-
'label' => 'check label1',
|
70 |
-
'value' => 'check value1',
|
71 |
-
'selected' => false,
|
72 |
-
),
|
73 |
-
array(
|
74 |
-
'label' => 'check label 2',
|
75 |
-
'value' => 'check value 2',
|
76 |
-
'selected' => true,
|
77 |
-
),
|
78 |
-
array(
|
79 |
-
'label' => 'check label 3',
|
80 |
-
'value' => 'check 3',
|
81 |
-
'selected' => true,
|
82 |
-
),
|
83 |
-
),
|
84 |
-
),
|
85 |
-
array(
|
86 |
-
'type' => 'phone',
|
87 |
-
),
|
88 |
-
array(
|
89 |
-
'type' => 'hidden',
|
90 |
-
),
|
91 |
-
);
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Advanced field data
|
95 |
-
*
|
96 |
-
* @var array
|
97 |
-
* @since 6.0
|
98 |
-
*/
|
99 |
-
public $advanced_fields2 = array(
|
100 |
-
array(
|
101 |
-
'type' => 'single-line-text',
|
102 |
-
'label' => 'special label',
|
103 |
-
),
|
104 |
-
array(
|
105 |
-
'type' => 'dropdown',
|
106 |
-
'label' => 'special label',
|
107 |
-
'choices' => array(
|
108 |
-
array(
|
109 |
-
'label' => 'label1',
|
110 |
-
'value' => 'value1',
|
111 |
-
'selected' => true,
|
112 |
-
),
|
113 |
-
array(
|
114 |
-
'label' => 'label 3',
|
115 |
-
'value' => '3',
|
116 |
-
'selected' => true,
|
117 |
-
),
|
118 |
-
),
|
119 |
-
),
|
120 |
-
);
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Test creating a submission
|
124 |
-
*
|
125 |
-
* @param int $form_id
|
126 |
-
* @since 6.0
|
127 |
-
* @return object
|
128 |
-
*/
|
129 |
-
public function _createSubmission( $form_id ) {
|
130 |
-
$submission_id = wp_insert_post( array(
|
131 |
-
'post_status' => 'publish',
|
132 |
-
'post_type' => 'ccf_submission',
|
133 |
-
'post_parent' => $form_id,
|
134 |
-
'post_author' => 1,
|
135 |
-
'post_title' => 'Form Submission ' . $form_id,
|
136 |
-
));
|
137 |
-
|
138 |
-
$submission = array(
|
139 |
-
'test_key' => 'test value',
|
140 |
-
'test_key2' => 'test value 2',
|
141 |
-
'test_key3' => 3,
|
142 |
-
'test_key4' => array( 1, 2, 3 ),
|
143 |
-
);
|
144 |
-
|
145 |
-
if ( ! is_wp_error( $submission_id ) ) {
|
146 |
-
update_post_meta( $submission_id, 'ccf_submission_data', $submission );
|
147 |
-
}
|
148 |
-
|
149 |
-
return get_post( $submission_id );
|
150 |
-
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* Create a form for testing
|
154 |
-
*
|
155 |
-
* @param array $fields
|
156 |
-
* @since 6.0
|
157 |
-
* @return object
|
158 |
-
*/
|
159 |
-
public function _createForm( $fields = array( array( 'type' => 'single-line-text' ) ) ) {
|
160 |
-
|
161 |
-
$i = 1;
|
162 |
-
foreach ( $fields as &$field ) {
|
163 |
-
$field = wp_parse_args( $field, $this->default_field );
|
164 |
-
$field['label'] .= ' ' . $i;
|
165 |
-
$field['value'] .= ' ' . $i;
|
166 |
-
$field['placeholder'] .= ' ' . $i;
|
167 |
-
$field['slug'] .= $i;
|
168 |
-
$field['className'] .= $i;
|
169 |
-
|
170 |
-
$i++;
|
171 |
-
}
|
172 |
-
|
173 |
-
$data = array(
|
174 |
-
'fields' => $fields,
|
175 |
-
'type' => 'ccf_form',
|
176 |
-
'status' => 'publish',
|
177 |
-
'ID' => null,
|
178 |
-
'title' => 'Test Form',
|
179 |
-
'description' => 'Test form description',
|
180 |
-
'buttonText' => 'Submit Text',
|
181 |
-
'author' => array(),
|
182 |
-
'excerpt' => '',
|
183 |
-
'link' => '',
|
184 |
-
'parent' => 0,
|
185 |
-
'format' => 'standard',
|
186 |
-
'slug' => '',
|
187 |
-
'guid' => '',
|
188 |
-
'comment_status' => 'open',
|
189 |
-
'ping_status' => 'open',
|
190 |
-
'menu_order' => 0,
|
191 |
-
'terms' => array(),
|
192 |
-
'post_meta' => array(),
|
193 |
-
'meta' => array(
|
194 |
-
'links' => array(),
|
195 |
-
),
|
196 |
-
'ping_status' => false,
|
197 |
-
'featured_image' => null,
|
198 |
-
);
|
199 |
-
|
200 |
-
return $this->api->create_form( $data );
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Setup plugin for testing
|
205 |
-
*
|
206 |
-
* @since 6.0
|
207 |
-
*/
|
208 |
-
public function setUp() {
|
209 |
-
set_time_limit(0);
|
210 |
-
|
211 |
-
if ( ! self::$hooks_saved ) {
|
212 |
-
$this->_backup_hooks();
|
213 |
-
}
|
214 |
-
|
215 |
-
global $wpdb;
|
216 |
-
$wpdb->suppress_errors = false;
|
217 |
-
$wpdb->show_errors = true;
|
218 |
-
$wpdb->db_connect();
|
219 |
-
ini_set('display_errors', 1 );
|
220 |
-
$this->factory = new WP_UnitTest_Factory;
|
221 |
-
$this->clean_up_global_scope();
|
222 |
-
$this->start_transaction();
|
223 |
-
$this->expectDeprecated();
|
224 |
-
add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) );
|
225 |
-
|
226 |
-
$admin_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
|
227 |
-
|
228 |
-
wp_set_current_user( $admin_id );
|
229 |
-
|
230 |
-
$wp_json_server = new WP_JSON_Server;
|
231 |
-
$this->api = new CCF_API( $wp_json_server );
|
232 |
-
}
|
233 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tests/test-api.php
DELETED
@@ -1,327 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class CCFTestAPI extends CCFTestBase {
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Test getting a single form
|
7 |
-
*
|
8 |
-
* @since 6.0
|
9 |
-
*/
|
10 |
-
public function testGetForm() {
|
11 |
-
$this->_createForm();
|
12 |
-
$form = $this->_createForm();
|
13 |
-
$this->_createForm();
|
14 |
-
|
15 |
-
$get_form_result = $this->api->get_form( $form->data['ID'] );
|
16 |
-
|
17 |
-
$this->assertTrue( ! is_wp_error( $get_form_result ) );
|
18 |
-
|
19 |
-
$this->assertTrue( ! empty( $get_form_result->data['ID'] ) );
|
20 |
-
|
21 |
-
$form = get_post( $get_form_result->data['ID'] );
|
22 |
-
|
23 |
-
$this->assertTrue( ! empty( $form ) );
|
24 |
-
|
25 |
-
$button_text = get_post_meta( $get_form_result->data['ID'], 'ccf_form_buttonText', true );
|
26 |
-
$this->assertTrue( ! empty( $button_text ) );
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Test getting forms
|
31 |
-
*
|
32 |
-
* @since 6.0
|
33 |
-
*/
|
34 |
-
public function testGetForms() {
|
35 |
-
$this->_createForm();
|
36 |
-
$this->_createForm();
|
37 |
-
$this->_createForm();
|
38 |
-
$this->_createForm();
|
39 |
-
$this->_createForm();
|
40 |
-
|
41 |
-
$get_forms_result = $this->api->get_forms();
|
42 |
-
|
43 |
-
$forms = $get_forms_result->data;
|
44 |
-
|
45 |
-
$this->assertEquals( 5, count( $forms ) );
|
46 |
-
|
47 |
-
foreach ( $forms as $form_object ) {
|
48 |
-
$form = get_post( $form_object['ID'] );
|
49 |
-
|
50 |
-
$this->assertTrue( ! empty( $form ) );
|
51 |
-
|
52 |
-
$button_text = get_post_meta( $form_object['ID'], 'ccf_form_buttonText', true );
|
53 |
-
$this->assertTrue( ! empty( $button_text ) );
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Test creating a basic new form
|
59 |
-
*
|
60 |
-
* @since 6.0
|
61 |
-
*/
|
62 |
-
public function testNewForm() {
|
63 |
-
|
64 |
-
$form_result = $this->_createForm();
|
65 |
-
|
66 |
-
$this->assertTrue( ! is_wp_error( $form_result ) );
|
67 |
-
|
68 |
-
$this->assertTrue( ! empty( $form_result->data['ID'] ) );
|
69 |
-
|
70 |
-
$form = get_post( $form_result->data['ID'] );
|
71 |
-
|
72 |
-
$this->assertTrue( ! empty( $form ) );
|
73 |
-
|
74 |
-
$this->assertEquals( 'Test Form', get_the_title( $form_result->data['ID'] ) );
|
75 |
-
|
76 |
-
$description = get_post_meta( $form_result->data['ID'], 'ccf_form_description', true );
|
77 |
-
$this->assertEquals( 'Test form description', $description );
|
78 |
-
|
79 |
-
$button_text = get_post_meta( $form_result->data['ID'], 'ccf_form_buttonText', true );
|
80 |
-
$this->assertTrue( ! empty( $button_text ) );
|
81 |
-
|
82 |
-
$fields = get_post_meta( $form_result->data['ID'], 'ccf_attached_fields', true );
|
83 |
-
|
84 |
-
$this->assertTrue( ! empty( $fields ) );
|
85 |
-
|
86 |
-
$field = get_post( $fields[0] );
|
87 |
-
|
88 |
-
$this->assertTrue( ! empty( $field ) );
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Test an advanced new form
|
93 |
-
*
|
94 |
-
* @since 6.0
|
95 |
-
*/
|
96 |
-
public function testNewFormAdvanced() {
|
97 |
-
|
98 |
-
$this->_createForm();
|
99 |
-
$form_result = $this->_createForm( $this->advanced_fields );
|
100 |
-
$this->_createForm();
|
101 |
-
$this->_createForm( $this->advanced_fields );
|
102 |
-
|
103 |
-
$this->assertTrue( ! is_wp_error( $form_result ) );
|
104 |
-
|
105 |
-
$this->assertTrue( ! empty( $form_result->data['ID'] ) );
|
106 |
-
|
107 |
-
$form = get_post( $form_result->data['ID'] );
|
108 |
-
|
109 |
-
$this->assertTrue( ! empty( $form ) );
|
110 |
-
|
111 |
-
$this->assertEquals( 'Test Form', get_the_title( $form_result->data['ID'] ) );
|
112 |
-
|
113 |
-
$description = get_post_meta( $form_result->data['ID'], 'ccf_form_description', true );
|
114 |
-
$this->assertEquals( 'Test form description', $description );
|
115 |
-
|
116 |
-
$button_text = get_post_meta( $form_result->data['ID'], 'ccf_form_buttonText', true );
|
117 |
-
|
118 |
-
$this->assertTrue( ! empty( $button_text ) );
|
119 |
-
|
120 |
-
$attached_fields = get_post_meta( $form_result->data['ID'], 'ccf_attached_fields', true );
|
121 |
-
|
122 |
-
$this->assertTrue( ! empty( $attached_fields ) );
|
123 |
-
|
124 |
-
foreach ( $attached_fields as $field_id ) {
|
125 |
-
$field = get_post( $field_id );
|
126 |
-
|
127 |
-
$this->assertTrue( ! empty( $field ) );
|
128 |
-
|
129 |
-
$field_type = get_post_meta( $field_id, 'ccf_field_type', true );
|
130 |
-
$this->assertTrue( ! empty( $field_type ) );
|
131 |
-
|
132 |
-
$label = get_post_meta( $field_id, 'ccf_field_label', true );
|
133 |
-
$this->assertTrue( ! empty( $label ) );
|
134 |
-
|
135 |
-
$class_name = get_post_meta( $field_id, 'ccf_field_className', true );
|
136 |
-
$this->assertTrue( ! empty( $class_name ) );
|
137 |
-
|
138 |
-
$placeholder = get_post_meta( $field_id, 'ccf_field_placeholder', true );
|
139 |
-
$this->assertTrue( ! empty( $placeholder ) );
|
140 |
-
|
141 |
-
if ( in_array( $field_type, array( 'dropdown', 'checkbox', 'radio' ) ) ) {
|
142 |
-
$choices = get_post_meta( $field_id, 'ccf_attached_choices', true );
|
143 |
-
|
144 |
-
foreach ( $choices as $choice_id ) {
|
145 |
-
$choice = get_post( $choice_id );
|
146 |
-
|
147 |
-
$this->assertTrue( ! empty( $choice ) );
|
148 |
-
|
149 |
-
$label = get_post_meta( $choice_id, 'ccf_choice_label', true );
|
150 |
-
$this->assertTrue( ! empty( $label ) );
|
151 |
-
}
|
152 |
-
}
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* Test editing a form
|
158 |
-
*
|
159 |
-
* @since 6.0
|
160 |
-
*/
|
161 |
-
public function testEditForm() {
|
162 |
-
$this->_createForm();
|
163 |
-
$this->_createForm();
|
164 |
-
$form = $this->_createForm();
|
165 |
-
$this->_createForm();
|
166 |
-
$this->_createForm();
|
167 |
-
|
168 |
-
$fields = $this->advanced_fields2;
|
169 |
-
|
170 |
-
$i = 1;
|
171 |
-
foreach ( $fields as &$field ) {
|
172 |
-
$field = wp_parse_args( $field, $this->default_field );
|
173 |
-
$field['label'] .= ' ' . $i;
|
174 |
-
$field['value'] .= ' ' . $i;
|
175 |
-
$field['placeholder'] .= ' ' . $i;
|
176 |
-
$field['slug'] .= $i;
|
177 |
-
$field['className'] .= $i;
|
178 |
-
|
179 |
-
$i++;
|
180 |
-
}
|
181 |
-
|
182 |
-
$edit_data = array(
|
183 |
-
'fields' => $fields,
|
184 |
-
'type' => 'ccf_form',
|
185 |
-
'status' => 'publish',
|
186 |
-
'ID' => null,
|
187 |
-
'title' => 'Edit Test Form',
|
188 |
-
'description' => 'Edit test form description',
|
189 |
-
'buttonText' => 'Edit Submit Text',
|
190 |
-
'author' => array(),
|
191 |
-
'excerpt' => '',
|
192 |
-
'link' => '',
|
193 |
-
'parent' => 0,
|
194 |
-
'format' => 'standard',
|
195 |
-
'slug' => '',
|
196 |
-
'guid' => '',
|
197 |
-
'comment_status' => 'open',
|
198 |
-
'ping_status' => 'open',
|
199 |
-
'menu_order' => 0,
|
200 |
-
'terms' => array(),
|
201 |
-
'post_meta' => array(),
|
202 |
-
'meta' => array(
|
203 |
-
'links' => array(),
|
204 |
-
),
|
205 |
-
'ping_status' => false,
|
206 |
-
'featured_image' => null,
|
207 |
-
);
|
208 |
-
|
209 |
-
$edit_form_result = $this->api->edit_form( $form->data['ID'], $edit_data );
|
210 |
-
|
211 |
-
$this->assertTrue( ! empty( $edit_form_result->data['ID'] ) );
|
212 |
-
|
213 |
-
$form = get_post( $edit_form_result->data['ID'] );
|
214 |
-
|
215 |
-
$this->assertTrue( ! empty( $form ) );
|
216 |
-
|
217 |
-
$this->assertEquals( 'Edit Test Form', get_the_title( $edit_form_result->data['ID'] ) );
|
218 |
-
|
219 |
-
$description = get_post_meta( $edit_form_result->data['ID'], 'ccf_form_description', true );
|
220 |
-
$this->assertEquals( 'Edit test form description', $description );
|
221 |
-
|
222 |
-
$button_text = get_post_meta( $edit_form_result->data['ID'], 'ccf_form_buttonText', true );
|
223 |
-
|
224 |
-
$this->assertEquals( 'Edit Submit Text', $button_text );
|
225 |
-
|
226 |
-
$attached_fields = get_post_meta( $edit_form_result->data['ID'], 'ccf_attached_fields', true );
|
227 |
-
|
228 |
-
$this->assertTrue( ! empty( $attached_fields ) );
|
229 |
-
|
230 |
-
$this->assertEquals( count( $attached_fields ), 2 );
|
231 |
-
|
232 |
-
foreach ( $attached_fields as $field_id ) {
|
233 |
-
$field_type = get_post_meta( $field_id, 'ccf_field_type', true );
|
234 |
-
$field_label = get_post_meta( $field_id, 'ccf_field_label', true );
|
235 |
-
|
236 |
-
$this->assertTrue( strpos( $field_label, 'special label' ) !== false );
|
237 |
-
|
238 |
-
if ( in_array( $field_type, array( 'dropdown', 'checkbox', 'radio' ) ) ) {
|
239 |
-
$choices = get_post_meta( $field_id, 'ccf_attached_choices', true );
|
240 |
-
|
241 |
-
$this->assertEquals( count( $choices ), 2 );
|
242 |
-
}
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
/**
|
247 |
-
* Test form deletion
|
248 |
-
*
|
249 |
-
* @since 6.0
|
250 |
-
*/
|
251 |
-
public function testDeleteForm() {
|
252 |
-
$this->_createForm();
|
253 |
-
$this->_createForm();
|
254 |
-
$form = $this->_createForm();
|
255 |
-
$this->_createForm();
|
256 |
-
$this->_createForm();
|
257 |
-
|
258 |
-
$this->api->delete_form( $form->data['ID'] );
|
259 |
-
|
260 |
-
$form = get_post( $form->data['ID'] );
|
261 |
-
|
262 |
-
$this->assertTrue( $form->post_status === 'trash' );
|
263 |
-
}
|
264 |
-
|
265 |
-
/**
|
266 |
-
* Test cleanup of fields/choices on form deletion
|
267 |
-
*
|
268 |
-
* @since 6.0
|
269 |
-
*/
|
270 |
-
public function testDeleteFormCleanup() {
|
271 |
-
$this->_createForm();
|
272 |
-
$this->_createForm();
|
273 |
-
$form = $this->_createForm( $this->advanced_fields );
|
274 |
-
$this->_createForm();
|
275 |
-
$this->_createForm();
|
276 |
-
|
277 |
-
$attached_fields = get_post_meta( $form->data['ID'], 'ccf_attached_fields', true );
|
278 |
-
|
279 |
-
$attached_choices = get_post_meta( $attached_fields[5], 'ccf_attached_choices', true );
|
280 |
-
|
281 |
-
wp_delete_post( $form->data['ID'], true );
|
282 |
-
|
283 |
-
$form = get_post( $form->data['ID'] );
|
284 |
-
|
285 |
-
$this->assertTrue( $form === null );
|
286 |
-
|
287 |
-
foreach ( $attached_fields as $field_id ) {
|
288 |
-
$field = get_post( $field_id );
|
289 |
-
|
290 |
-
$this->assertTrue( $field === null );
|
291 |
-
}
|
292 |
-
|
293 |
-
foreach ( $attached_choices as $choice_id ) {
|
294 |
-
$choice = get_post( $choice_id );
|
295 |
-
|
296 |
-
$this->assertTrue( $choice === null );
|
297 |
-
}
|
298 |
-
}
|
299 |
-
|
300 |
-
/**
|
301 |
-
* Test getting submissions
|
302 |
-
*
|
303 |
-
* @since 6.0
|
304 |
-
*/
|
305 |
-
public function testGetSubmissions() {
|
306 |
-
$form = $this->_createForm();
|
307 |
-
$this->_createSubmission( $form->data['ID'] );
|
308 |
-
$this->_createSubmission( $form->data['ID'] );
|
309 |
-
$this->_createSubmission( $form->data['ID'] );
|
310 |
-
$this->_createSubmission( $form->data['ID'] );
|
311 |
-
|
312 |
-
$get_submissions_result = $this->api->get_submissions( $form->data['ID'] );
|
313 |
-
|
314 |
-
$submissions = $get_submissions_result->data;
|
315 |
-
|
316 |
-
$this->assertEquals( 4, count( $submissions ) );
|
317 |
-
|
318 |
-
foreach ( $submissions as $submission_object ) {
|
319 |
-
$submission = get_post( $submission_object['ID'] );
|
320 |
-
|
321 |
-
$this->assertTrue( ! empty( $submission ) );
|
322 |
-
|
323 |
-
$data = get_post_meta( $submission_object['ID'], 'ccf_submission_data', true );
|
324 |
-
$this->assertTrue( ! empty( $data ) );
|
325 |
-
}
|
326 |
-
}
|
327 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tests/test-field-errors.php
DELETED
@@ -1,459 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class CCFTestFieldErrors extends CCFTestBase {
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Test single line text field errors
|
7 |
-
*
|
8 |
-
* @since 6.0
|
9 |
-
*/
|
10 |
-
public function testSingleLineText() {
|
11 |
-
$slug = 'single-line-text';
|
12 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'single-line-text', 'required' => true ) ) );
|
13 |
-
|
14 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
15 |
-
$_POST['ccf_form'] = true;
|
16 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
17 |
-
|
18 |
-
CCF_Form_Handler::factory()->submit_listen();
|
19 |
-
|
20 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['required'] ) );
|
21 |
-
|
22 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
23 |
-
|
24 |
-
$_POST['ccf_field_' . $slug . '1'] = 'value';
|
25 |
-
|
26 |
-
CCF_Form_Handler::factory()->submit_listen();
|
27 |
-
|
28 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Test that empty recaptcha field produces an error
|
33 |
-
*
|
34 |
-
* @since 6.2
|
35 |
-
*/
|
36 |
-
public function testRecaptchaText() {
|
37 |
-
$slug = 'recaptcha';
|
38 |
-
$form_response = $this->_createForm( array( array( 'type' => 'recaptcha', 'slug' => $slug ) ) );
|
39 |
-
|
40 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
41 |
-
$_POST['ccf_form'] = true;
|
42 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
43 |
-
|
44 |
-
CCF_Form_Handler::factory()->submit_listen();
|
45 |
-
|
46 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['recaptcha'] ) );
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Test paragraph field errors
|
51 |
-
*
|
52 |
-
* @since 6.0
|
53 |
-
*/
|
54 |
-
public function testParagraphText() {
|
55 |
-
$slug = 'paragraph-text';
|
56 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'paragraph-text', 'required' => true ) ) );
|
57 |
-
|
58 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
59 |
-
$_POST['ccf_form'] = true;
|
60 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
61 |
-
|
62 |
-
CCF_Form_Handler::factory()->submit_listen();
|
63 |
-
|
64 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['required'] ) );
|
65 |
-
|
66 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
67 |
-
|
68 |
-
$_POST['ccf_field_' . $slug . '1'] = 'value';
|
69 |
-
|
70 |
-
CCF_Form_Handler::factory()->submit_listen();
|
71 |
-
|
72 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Test dropdown field errors
|
77 |
-
*
|
78 |
-
* @since 6.0
|
79 |
-
*/
|
80 |
-
public function testDropdown() {
|
81 |
-
$slug = 'dropdown';
|
82 |
-
$choices = array(
|
83 |
-
array(
|
84 |
-
'label' => 'label1',
|
85 |
-
'value' => 'value1',
|
86 |
-
'selected' => true,
|
87 |
-
),
|
88 |
-
array(
|
89 |
-
'label' => 'label 3',
|
90 |
-
'value' => '3',
|
91 |
-
'selected' => true,
|
92 |
-
),
|
93 |
-
);
|
94 |
-
|
95 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'dropdown', 'required' => true, 'choices' => $choices ) ) );
|
96 |
-
|
97 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
98 |
-
$_POST['ccf_form'] = true;
|
99 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
100 |
-
|
101 |
-
CCF_Form_Handler::factory()->submit_listen();
|
102 |
-
|
103 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['required'] ) );
|
104 |
-
|
105 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
106 |
-
|
107 |
-
$_POST['ccf_field_' . $slug . '1']['key'] = 'value';
|
108 |
-
$_POST['ccf_field_' . $slug . '1']['key2'] = 'value2';
|
109 |
-
|
110 |
-
CCF_Form_Handler::factory()->submit_listen();
|
111 |
-
|
112 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Test radio field errors
|
117 |
-
*
|
118 |
-
* @since 6.0
|
119 |
-
*/
|
120 |
-
public function testRadio() {
|
121 |
-
$slug = 'radio';
|
122 |
-
|
123 |
-
$choices = array(
|
124 |
-
array(
|
125 |
-
'label' => 'label1',
|
126 |
-
'value' => 'value1',
|
127 |
-
'selected' => true,
|
128 |
-
),
|
129 |
-
array(
|
130 |
-
'label' => 'label 3',
|
131 |
-
'value' => '3',
|
132 |
-
'selected' => true,
|
133 |
-
),
|
134 |
-
);
|
135 |
-
|
136 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'radio', 'required' => true, 'choices' => $choices ) ) );
|
137 |
-
|
138 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
139 |
-
$_POST['ccf_form'] = true;
|
140 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
141 |
-
|
142 |
-
CCF_Form_Handler::factory()->submit_listen();
|
143 |
-
|
144 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['required'] ) );
|
145 |
-
|
146 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
147 |
-
|
148 |
-
$_POST['ccf_field_' . $slug . '1']['key'] = 'value';
|
149 |
-
|
150 |
-
CCF_Form_Handler::factory()->submit_listen();
|
151 |
-
|
152 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Test checkboxes field errors
|
157 |
-
*
|
158 |
-
* @since 6.0
|
159 |
-
*/
|
160 |
-
public function testCheckboxes() {
|
161 |
-
$slug = 'checkboxes';
|
162 |
-
|
163 |
-
$choices = array(
|
164 |
-
array(
|
165 |
-
'label' => 'label1',
|
166 |
-
'value' => 'value1',
|
167 |
-
'selected' => true,
|
168 |
-
),
|
169 |
-
array(
|
170 |
-
'label' => 'label 3',
|
171 |
-
'value' => '3',
|
172 |
-
'selected' => true,
|
173 |
-
),
|
174 |
-
);
|
175 |
-
|
176 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'checkboxes', 'required' => true, 'choices' => $choices ) ) );
|
177 |
-
|
178 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
179 |
-
$_POST['ccf_form'] = true;
|
180 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
181 |
-
|
182 |
-
CCF_Form_Handler::factory()->submit_listen();
|
183 |
-
|
184 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
185 |
-
|
186 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
187 |
-
|
188 |
-
$_POST['ccf_field_' . $slug . '1']['key'] = 'value';
|
189 |
-
|
190 |
-
CCF_Form_Handler::factory()->submit_listen();
|
191 |
-
|
192 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Test phone field errors
|
197 |
-
*
|
198 |
-
* @since 6.0
|
199 |
-
*/
|
200 |
-
public function testPhone() {
|
201 |
-
$slug = 'phone';
|
202 |
-
|
203 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'phone', 'required' => true ) ) );
|
204 |
-
|
205 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
206 |
-
$_POST['ccf_form'] = true;
|
207 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
208 |
-
|
209 |
-
CCF_Form_Handler::factory()->submit_listen();
|
210 |
-
|
211 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['required'] ) );
|
212 |
-
|
213 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
214 |
-
|
215 |
-
$_POST['ccf_field_' . $slug . '1'] = '5555a';
|
216 |
-
|
217 |
-
CCF_Form_Handler::factory()->submit_listen();
|
218 |
-
|
219 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['digits'] ) );
|
220 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['chars'] ) );
|
221 |
-
|
222 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
223 |
-
|
224 |
-
$_POST['ccf_field_' . $slug . '1'] = '3019998999';
|
225 |
-
|
226 |
-
CCF_Form_Handler::factory()->submit_listen();
|
227 |
-
|
228 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
229 |
-
|
230 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
231 |
-
|
232 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'phone', 'required' => true, 'phoneFormat' => 'us' ) ) );
|
233 |
-
|
234 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
235 |
-
$_POST['ccf_field_' . $slug . '1'] = '12345678';
|
236 |
-
|
237 |
-
CCF_Form_Handler::factory()->submit_listen();
|
238 |
-
|
239 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['digits'] ) );
|
240 |
-
}
|
241 |
-
|
242 |
-
/**
|
243 |
-
* Test email field errors
|
244 |
-
*
|
245 |
-
* @since 6.0
|
246 |
-
*/
|
247 |
-
public function testEmail() {
|
248 |
-
$slug = 'email';
|
249 |
-
|
250 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'email', 'required' => true ) ) );
|
251 |
-
|
252 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
253 |
-
|
254 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
255 |
-
$_POST['ccf_form'] = true;
|
256 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
257 |
-
|
258 |
-
CCF_Form_Handler::factory()->submit_listen();
|
259 |
-
|
260 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['email_required'] ) );
|
261 |
-
|
262 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
263 |
-
|
264 |
-
$_POST['ccf_field_' . $slug . '1'] = 'test';
|
265 |
-
|
266 |
-
CCF_Form_Handler::factory()->submit_listen();
|
267 |
-
|
268 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['email'] ) );
|
269 |
-
|
270 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
271 |
-
|
272 |
-
$_POST['ccf_field_' . $slug . '1'] = 'test@test.com';
|
273 |
-
|
274 |
-
CCF_Form_Handler::factory()->submit_listen();
|
275 |
-
|
276 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
277 |
-
}
|
278 |
-
|
279 |
-
/**
|
280 |
-
* Test email confirm field errors
|
281 |
-
*
|
282 |
-
* @since 6.0
|
283 |
-
*/
|
284 |
-
public function testEmailConfirm() {
|
285 |
-
$slug = 'email';
|
286 |
-
|
287 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'email', 'required' => true, 'emailConfirmation' => true ) ) );
|
288 |
-
|
289 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
290 |
-
$_POST['ccf_form'] = true;
|
291 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
292 |
-
|
293 |
-
$_POST['ccf_field_' . $slug . '1']['email'] = '';
|
294 |
-
$_POST['ccf_field_' . $slug . '1']['confirm'] = '';
|
295 |
-
|
296 |
-
CCF_Form_Handler::factory()->submit_listen();
|
297 |
-
|
298 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['email_required'] ) );
|
299 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['confirm_required'] ) );
|
300 |
-
|
301 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
302 |
-
|
303 |
-
$_POST['ccf_field_' . $slug . '1']['email'] = 'test';
|
304 |
-
$_POST['ccf_field_' . $slug . '1']['confirm'] = 'test2';
|
305 |
-
|
306 |
-
CCF_Form_Handler::factory()->submit_listen();
|
307 |
-
|
308 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['email'] ) );
|
309 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['match'] ) );
|
310 |
-
|
311 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
312 |
-
|
313 |
-
$_POST['ccf_field_' . $slug . '1']['email'] = 'test@test.com';
|
314 |
-
$_POST['ccf_field_' . $slug . '1']['confirm'] = 'test@test.com';
|
315 |
-
|
316 |
-
CCF_Form_Handler::factory()->submit_listen();
|
317 |
-
|
318 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
319 |
-
}
|
320 |
-
|
321 |
-
/**
|
322 |
-
* Test name field errors
|
323 |
-
*
|
324 |
-
* @since 6.0
|
325 |
-
*/
|
326 |
-
public function testName() {
|
327 |
-
$slug = 'name';
|
328 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'name', 'required' => true ) ) );
|
329 |
-
|
330 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
331 |
-
$_POST['ccf_form'] = true;
|
332 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
333 |
-
|
334 |
-
CCF_Form_Handler::factory()->submit_listen();
|
335 |
-
|
336 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['first_required'] ) );
|
337 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['last_required'] ) );
|
338 |
-
|
339 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
340 |
-
|
341 |
-
$_POST['ccf_field_' . $slug . '1']['first'] = 'first';
|
342 |
-
$_POST['ccf_field_' . $slug . '1']['last'] = 'last';
|
343 |
-
|
344 |
-
CCF_Form_Handler::factory()->submit_listen();
|
345 |
-
|
346 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
347 |
-
}
|
348 |
-
|
349 |
-
/**
|
350 |
-
* Test website field errors
|
351 |
-
*
|
352 |
-
* @since 6.0
|
353 |
-
*/
|
354 |
-
public function testWebsite() {
|
355 |
-
$slug = 'phone';
|
356 |
-
|
357 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'website', 'required' => true ) ) );
|
358 |
-
|
359 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
360 |
-
$_POST['ccf_form'] = true;
|
361 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
362 |
-
|
363 |
-
CCF_Form_Handler::factory()->submit_listen();
|
364 |
-
|
365 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['website_required'] ) );
|
366 |
-
|
367 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
368 |
-
|
369 |
-
$_POST['ccf_field_' . $slug . '1'] = '5555a';
|
370 |
-
|
371 |
-
CCF_Form_Handler::factory()->submit_listen();
|
372 |
-
|
373 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['website'] ) );
|
374 |
-
|
375 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
376 |
-
|
377 |
-
$_POST['ccf_field_' . $slug . '1'] = 'http://google.com';
|
378 |
-
|
379 |
-
CCF_Form_Handler::factory()->submit_listen();
|
380 |
-
|
381 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
382 |
-
}
|
383 |
-
|
384 |
-
/**
|
385 |
-
* Test us address field errors
|
386 |
-
*
|
387 |
-
* @since 6.0
|
388 |
-
*/
|
389 |
-
public function testUSAddress() {
|
390 |
-
$slug = 'address';
|
391 |
-
|
392 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'address', 'addressType' => 'us', 'required' => true ) ) );
|
393 |
-
|
394 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
395 |
-
$_POST['ccf_form'] = true;
|
396 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
397 |
-
|
398 |
-
CCF_Form_Handler::factory()->submit_listen();
|
399 |
-
|
400 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['street_required'] ) );
|
401 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['line_two_required'] ) );
|
402 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['city_required'] ) );
|
403 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['zipcode_required'] ) );
|
404 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['state_required'] ) );
|
405 |
-
|
406 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
407 |
-
|
408 |
-
$_POST['ccf_field_' . $slug . '1']['street'] = 'test';
|
409 |
-
$_POST['ccf_field_' . $slug . '1']['line_two'] = 'test';
|
410 |
-
$_POST['ccf_field_' . $slug . '1']['state'] = 'test';
|
411 |
-
$_POST['ccf_field_' . $slug . '1']['city'] = 'test';
|
412 |
-
$_POST['ccf_field_' . $slug . '1']['zipcode'] = 'test';
|
413 |
-
|
414 |
-
CCF_Form_Handler::factory()->submit_listen();
|
415 |
-
|
416 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
417 |
-
}
|
418 |
-
|
419 |
-
/**
|
420 |
-
* Test us address field errors
|
421 |
-
*
|
422 |
-
* @since 6.0
|
423 |
-
*/
|
424 |
-
public function testInternationalAddress() {
|
425 |
-
$slug = 'address';
|
426 |
-
|
427 |
-
$form_response = $this->_createForm( array( array( 'slug' => $slug, 'type' => 'address', 'addressType' => 'international', 'required' => true ) ) );
|
428 |
-
|
429 |
-
$_POST['form_id'] = $form_response->data['ID'];
|
430 |
-
$_POST['ccf_form'] = true;
|
431 |
-
$_POST['form_nonce'] = wp_create_nonce( 'ccf_form' );
|
432 |
-
|
433 |
-
CCF_Form_Handler::factory()->submit_listen();
|
434 |
-
|
435 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['street_required'] ) );
|
436 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['line_two_required'] ) );
|
437 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['city_required'] ) );
|
438 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['zipcode_required'] ) );
|
439 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['state_required'] ) );
|
440 |
-
$this->assertTrue( ! empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1']['country_required'] ) );
|
441 |
-
|
442 |
-
CCF_Form_Handler::factory()->errors_by_form = array();
|
443 |
-
|
444 |
-
$_POST['ccf_field_' . $slug . '1']['street'] = 'test';
|
445 |
-
$_POST['ccf_field_' . $slug . '1']['line_two'] = 'test';
|
446 |
-
$_POST['ccf_field_' . $slug . '1']['state'] = 'test';
|
447 |
-
$_POST['ccf_field_' . $slug . '1']['city'] = 'test';
|
448 |
-
$_POST['ccf_field_' . $slug . '1']['zipcode'] = 'test';
|
449 |
-
$_POST['ccf_field_' . $slug . '1']['country'] = 'test';
|
450 |
-
|
451 |
-
CCF_Form_Handler::factory()->submit_listen();
|
452 |
-
|
453 |
-
$this->assertTrue( empty( CCF_Form_Handler::factory()->errors_by_form[$form_response->data['ID']][$slug . '1'] ) );
|
454 |
-
}
|
455 |
-
|
456 |
-
// Todo: testDate
|
457 |
-
|
458 |
-
// Todo: testAddress
|
459 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit39462c84ad13b61335b8c477812ac9fc::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit2cc297056d45b87257d3c44a23d868f5
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
@@ -44,7 +44,7 @@ class ComposerAutoloaderInit2cc297056d45b87257d3c44a23d868f5
|
|
44 |
}
|
45 |
}
|
46 |
|
47 |
-
function
|
48 |
{
|
49 |
require $file;
|
50 |
}
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit39462c84ad13b61335b8c477812ac9fc
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit39462c84ad13b61335b8c477812ac9fc', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit39462c84ad13b61335b8c477812ac9fc', 'loadClassLoader'));
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
44 |
}
|
45 |
}
|
46 |
|
47 |
+
function composerRequire39462c84ad13b61335b8c477812ac9fc($file)
|
48 |
{
|
49 |
require $file;
|
50 |
}
|