WP User Frontend – Membership, Profile, Registration & Post Submission Plugin for WordPress - Version 2.5.1

Version Description

Download this release

Release Info

Developer tareq1988
Plugin Icon 128x128 WP User Frontend – Membership, Profile, Registration & Post Submission Plugin for WordPress
Version 2.5.1
Comparing to
See all releases

Code changes from version 2.5 to 2.5.1

Files changed (170) hide show
  1. .svnignore +7 -0
  2. admin/add-ons.php +0 -100
  3. admin/form-builder/assets/js/components/builder-stage/index.js +0 -167
  4. admin/form-builder/assets/js/components/builder-stage/template.php +0 -73
  5. admin/form-builder/assets/js/components/field-checkbox/index.js +0 -41
  6. admin/form-builder/assets/js/components/field-checkbox/template.php +0 -12
  7. admin/form-builder/assets/js/components/field-html_help_text/index.js +0 -7
  8. admin/form-builder/assets/js/components/field-html_help_text/template.php +0 -1
  9. admin/form-builder/assets/js/components/field-option-data/index.js +0 -121
  10. admin/form-builder/assets/js/components/field-option-data/template.php +0 -64
  11. admin/form-builder/assets/js/components/field-option-pro-feature-alert/index.js +0 -13
  12. admin/form-builder/assets/js/components/field-option-pro-feature-alert/template.php +0 -6
  13. admin/form-builder/assets/js/components/field-options/index.js +0 -68
  14. admin/form-builder/assets/js/components/field-options/template.php +0 -45
  15. admin/form-builder/assets/js/components/field-radio/index.js +0 -23
  16. admin/form-builder/assets/js/components/field-radio/template.php +0 -13
  17. admin/form-builder/assets/js/components/field-select/index.js +0 -23
  18. admin/form-builder/assets/js/components/field-select/template.php +0 -10
  19. admin/form-builder/assets/js/components/field-text-meta/index.js +0 -40
  20. admin/form-builder/assets/js/components/field-text-meta/template.php +0 -9
  21. admin/form-builder/assets/js/components/field-text/index.js +0 -28
  22. admin/form-builder/assets/js/components/field-text/template.php +0 -21
  23. admin/form-builder/assets/js/components/field-textarea/index.js +0 -19
  24. admin/form-builder/assets/js/components/field-textarea/template.php +0 -7
  25. admin/form-builder/assets/js/components/form-checkbox_field/index.js +0 -10
  26. admin/form-builder/assets/js/components/form-checkbox_field/template.php +0 -16
  27. admin/form-builder/assets/js/components/form-custom_hidden_field/index.js +0 -10
  28. admin/form-builder/assets/js/components/form-custom_hidden_field/template.php +0 -10
  29. admin/form-builder/assets/js/components/form-custom_html/index.js +0 -16
  30. admin/form-builder/assets/js/components/form-custom_html/template.php +0 -1
  31. admin/form-builder/assets/js/components/form-dropdown_field/index.js +0 -10
  32. admin/form-builder/assets/js/components/form-dropdown_field/template.php +0 -16
  33. admin/form-builder/assets/js/components/form-email_address/index.js +0 -10
  34. admin/form-builder/assets/js/components/form-email_address/template.php +0 -10
  35. admin/form-builder/assets/js/components/form-featured_image/index.js +0 -10
  36. admin/form-builder/assets/js/components/form-featured_image/template.php +0 -11
  37. admin/form-builder/assets/js/components/form-fields/index.js +0 -117
  38. admin/form-builder/assets/js/components/form-fields/template.php +0 -49
  39. admin/form-builder/assets/js/components/form-image_upload/index.js +0 -10
  40. admin/form-builder/assets/js/components/form-image_upload/template.php +0 -11
  41. admin/form-builder/assets/js/components/form-multiple_select/index.js +0 -10
  42. admin/form-builder/assets/js/components/form-multiple_select/template.php +0 -17
  43. admin/form-builder/assets/js/components/form-post_content/index.js +0 -10
  44. admin/form-builder/assets/js/components/form-post_content/template.php +0 -20
  45. admin/form-builder/assets/js/components/form-post_excerpt/index.js +0 -10
  46. admin/form-builder/assets/js/components/form-post_excerpt/template.php +0 -9
  47. admin/form-builder/assets/js/components/form-post_tags/index.js +0 -10
  48. admin/form-builder/assets/js/components/form-post_tags/template.php +0 -11
  49. admin/form-builder/assets/js/components/form-post_title/index.js +0 -10
  50. admin/form-builder/assets/js/components/form-post_title/template.php +0 -10
  51. admin/form-builder/assets/js/components/form-radio_field/index.js +0 -10
  52. admin/form-builder/assets/js/components/form-radio_field/template.php +0 -16
  53. admin/form-builder/assets/js/components/form-section_break/index.js +0 -10
  54. admin/form-builder/assets/js/components/form-section_break/template.php +0 -4
  55. admin/form-builder/assets/js/components/form-taxonomy/index.js +0 -163
  56. admin/form-builder/assets/js/components/form-taxonomy/template.php +0 -41
  57. admin/form-builder/assets/js/components/form-text_field/index.js +0 -10
  58. admin/form-builder/assets/js/components/form-text_field/template.php +0 -10
  59. admin/form-builder/assets/js/components/form-textarea_field/index.js +0 -7
  60. admin/form-builder/assets/js/components/form-textarea_field/template.php +0 -13
  61. admin/form-builder/assets/js/components/form-website_url/index.js +0 -10
  62. admin/form-builder/assets/js/components/form-website_url/template.php +0 -10
  63. admin/form-builder/assets/js/components/help-text/index.js +0 -14
  64. admin/form-builder/assets/js/components/help-text/template.php +0 -1
  65. admin/form-builder/assets/js/components/text-editor/editor.less +0 -63
  66. admin/form-builder/assets/js/components/text-editor/index.js +0 -15
  67. admin/form-builder/assets/js/components/text-editor/style.less +0 -53
  68. admin/form-builder/assets/js/components/text-editor/template.php +0 -70
  69. admin/form-builder/assets/js/form-builder-assets.js +0 -46
  70. admin/form-builder/assets/js/form-builder.js +0 -427
  71. admin/form-builder/assets/js/jquery-siaf-end.js +0 -1
  72. admin/form-builder/assets/js/jquery-siaf-start.js +0 -2
  73. admin/form-builder/assets/js/mixins/form-field.js +0 -53
  74. admin/form-builder/assets/js/mixins/global.js +0 -67
  75. admin/form-builder/assets/js/mixins/option-field.js +0 -57
  76. admin/form-builder/assets/less/form-builder.less +0 -947
  77. admin/form-builder/assets/less/mixins/center-block.less +0 -7
  78. admin/form-builder/assets/less/mixins/clearfix.less +0 -22
  79. admin/form-builder/assets/less/mixins/custom-mixins.less +0 -70
  80. admin/form-builder/assets/less/mixins/hide-text.less +0 -21
  81. admin/form-builder/assets/less/mixins/opacity.less +0 -8
  82. admin/form-builder/assets/less/mixins/reset-text.less +0 -18
  83. admin/form-builder/assets/less/mixins/size.less +0 -10
  84. admin/form-builder/assets/less/mixins/text-overflow.less +0 -8
  85. admin/form-builder/assets/less/mixins/vendor-prefixes.less +0 -227
  86. admin/form-builder/assets/less/variables.less +0 -8
  87. admin/form-builder/class-wpuf-admin-form-builder-ajax.php +0 -58
  88. admin/form-builder/class-wpuf-admin-form-builder.php +0 -411
  89. admin/form-builder/class-wpuf-form-builder-field-settings.php +0 -771
  90. admin/form-builder/views/form-builder.php +0 -115
  91. admin/form-handler.php +0 -372
  92. admin/form-template.php +0 -214
  93. admin/form.php +0 -1243
  94. admin/html/modal.php +0 -105
  95. admin/installer.php +0 -177
  96. admin/post-forms-list-table-view.php +0 -36
  97. admin/post-forms-list-table.php +0 -418
  98. admin/posting.php +0 -303
  99. admin/promotion.php +0 -174
  100. admin/settings-options.php +0 -445
  101. admin/settings.php +0 -287
  102. admin/subscription.php +0 -609
  103. admin/template-post.php +0 -306
  104. admin/template.php +0 -651
  105. admin/tools.php +0 -445
  106. admin/transactions.php +0 -27
  107. assets/css/admin.css +0 -168
  108. assets/css/chosen/chosen-sprite.png +0 -0
  109. assets/css/chosen/chosen-sprite@2x.png +0 -0
  110. assets/css/chosen/chosen.css +0 -436
  111. assets/css/formbuilder.css +0 -343
  112. assets/css/formbuilder.less +0 -423
  113. assets/css/frontend-forms.css +0 -1096
  114. assets/css/frontend-forms.less +0 -1219
  115. assets/css/images/ui-bg_diagonals-small_75_cccccc_40x40.png +0 -0
  116. assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  117. assets/css/images/ui-bg_flat_0_ffffff_40x100.png +0 -0
  118. assets/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  119. assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  120. assets/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  121. assets/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  122. assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  123. assets/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  124. assets/css/images/ui-icons_222222_256x240.png +0 -0
  125. assets/css/images/ui-icons_2e83ff_256x240.png +0 -0
  126. assets/css/images/ui-icons_454545_256x240.png +0 -0
  127. assets/css/images/ui-icons_888888_256x240.png +0 -0
  128. assets/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  129. assets/css/jquery-ui-1.9.1.custom.css +0 -461
  130. assets/css/jquery.smallipop.css +0 -117
  131. assets/css/wpuf-form-builder.css +0 -725
  132. assets/css/wpuf.css +0 -467
  133. assets/images/add.png +0 -0
  134. assets/images/arrow-move.png +0 -0
  135. assets/images/arrows.png +0 -0
  136. assets/images/completed.png +0 -0
  137. assets/images/cross.png +0 -0
  138. assets/images/del.png +0 -0
  139. assets/images/delete.png +0 -0
  140. assets/images/edit.png +0 -0
  141. assets/images/help.png +0 -0
  142. assets/images/icon-minus.png +0 -0
  143. assets/images/icon-plus.png +0 -0
  144. assets/images/no-image.png +0 -0
  145. assets/images/paypal.png +0 -0
  146. assets/images/processing.png +0 -0
  147. assets/images/remove.png +0 -0
  148. assets/images/tick.png +0 -0
  149. assets/images/wpspin_light.gif +0 -0
  150. assets/js/chosen.jquery.js +0 -1211
  151. assets/js/conditional-logic.js +0 -139
  152. assets/js/conditional.js +0 -321
  153. assets/js/countries.json +0 -245
  154. assets/js/formbuilder.js +0 -398
  155. assets/js/formbuilder.min.js +0 -1
  156. assets/js/frontend-form.js +0 -892
  157. assets/js/frontend-form.min.js +0 -1
  158. assets/js/jquery-ui-timepicker-addon.js +0 -1919
  159. assets/js/jquery.smallipop-0.4.0.min.js +0 -9
  160. assets/js/jquery.validate.min.js +0 -4
  161. assets/js/subscriptions.js +0 -306
  162. assets/js/upload.js +0 -214
  163. assets/js/upload.min.js +0 -1
  164. assets/js/wpuf-form-builder-components.js +0 -1068
  165. assets/js/wpuf-form-builder-mixins.js +0 -184
  166. assets/js/wpuf-form-builder-wpuf-forms.js +0 -134
  167. assets/js/wpuf-form-builder.js +0 -427
  168. assets/vendor/clipboard/clipboard.js +0 -778
  169. assets/vendor/clipboard/clipboard.min.js +0 -7
  170. assets/vendor/vue/vue.js +1146 -1153
.svnignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ includes/pro
2
+ nbproject
3
+ Gruntfile.js
4
+ package.json
5
+ docs.md
6
+ changelog.txt
7
+ plugin-deploy.sh
admin/add-ons.php DELETED
@@ -1,100 +0,0 @@
1
- <div class="wrap">
2
- <h2><?php _e( 'WP User Frontend - Add-Ons', 'wpuf' ); ?></h2>
3
-
4
- <?php
5
- $add_ons = get_transient( 'wpuf_addons' );
6
-
7
- if ( false === $add_ons ) {
8
- $response = wp_remote_get( 'https://wedevs.com/api/wpuf/addons.php', array('timeout' => 15) );
9
- $update = wp_remote_retrieve_body( $response );
10
-
11
- if ( is_wp_error( $response ) || $response['response']['code'] != 200 ) {
12
- return false;
13
- }
14
-
15
- set_transient( 'wpuf_addons', $update, 12 * HOUR_IN_SECONDS );
16
- $add_ons = $update;
17
- }
18
-
19
- $add_ons = json_decode( $add_ons );
20
-
21
- if ( count( $add_ons ) ) {
22
- foreach ($add_ons as $addon) {
23
- ?>
24
-
25
- <div class="wpuf-addon">
26
- <div class="wpuf-addon-thumb">
27
- <a href="<?php echo $addon->url; ?>" target="_blank">
28
- <img src="<?php echo $addon->thumbnail; ?>" alt="<?php echo esc_attr( $addon->title ); ?>" />
29
- </a>
30
- </div>
31
-
32
- <div class="wpuf-detail">
33
- <h3 class="title">
34
- <a href="<?php echo $addon->url; ?>" target="_blank"><?php echo $addon->title; ?></a>
35
- </h3>
36
-
37
- <div class="text"><?php echo $addon->desc; ?></div>
38
- </div>
39
-
40
- <div class="wpuf-links">
41
- <?php if ( class_exists( $addon->class ) ) { ?>
42
- <a class="button button-disabled" href="<?php echo $addon->url; ?>" target="_blank">Installed</a>
43
- <?php } else { ?>
44
- <a class="button" href="<?php echo $addon->url; ?>" target="_blank">View Details</a>
45
- <?php } ?>
46
- </div>
47
- </div>
48
-
49
- <?php
50
- }
51
- } else {
52
- echo '<div class="error"><p>Error fetching add-ons. Please refresh the page again.</p></div>';
53
- }
54
- ?>
55
-
56
- <style type="text/css">
57
- .wpuf-addon {
58
- width: 22%;
59
- float: left;
60
- margin: 10px;
61
- border: 1px solid #E6E6E6;
62
- }
63
-
64
- .wpuf-addon:nth-child(5n+1) {
65
- clear: both;
66
- }
67
-
68
- .wpuf-addon-thumb img {
69
- max-width: 100%;
70
- /*max-height: 140px;*/
71
- }
72
-
73
- .wpuf-detail {
74
- padding: 6px 10px 10px;
75
- min-height: 110px;
76
- background: #fff;
77
- }
78
-
79
- .wpuf-detail h3.title {
80
- margin: 5px 0 10px;
81
- padding: 0;
82
- }
83
-
84
- .wpuf-detail h3.title a {
85
- text-decoration: none;
86
- color: #111;
87
- }
88
-
89
- .wpuf-links {
90
- padding: 10px;
91
- background: #F5F5F5;
92
- border-top: 1px solid #E6E6E6;
93
- }
94
-
95
- a.button.disabled {
96
- background: #eee;
97
- }
98
- </style>
99
-
100
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/builder-stage/index.js DELETED
@@ -1,167 +0,0 @@
1
- Vue.component('builder-stage', {
2
- template: '#tmpl-wpuf-builder-stage',
3
-
4
- mixins: wpuf_form_builder_mixins(wpuf_mixins.builder_stage),
5
-
6
- computed: {
7
- form_fields: function () {
8
- return this.$store.state.form_fields;
9
- },
10
-
11
- field_settings: function () {
12
- return this.$store.state.field_settings;
13
- },
14
-
15
- hidden_fields: function () {
16
- return this.$store.state.form_fields.filter(function (item) {
17
- return 'hidden' === item.input_type;
18
- });
19
- },
20
-
21
- editing_form_id: function () {
22
- return this.$store.state.editing_field_id;
23
- },
24
-
25
- pro_link: function () {
26
- return wpuf_form_builder.pro_link;
27
- }
28
- },
29
-
30
- mounted: function () {
31
- var self = this;
32
-
33
- // bind jquery ui sortable
34
- $('#form-preview-stage .wpuf-form.sortable-list').sortable({
35
- placeholder: 'form-preview-stage-dropzone',
36
- items: '.field-items',
37
- handle: '.control-buttons .move',
38
- scroll: true,
39
- update: function (e, ui) {
40
- var item = ui.item[0],
41
- data = item.dataset,
42
- source = data.source,
43
- toIndex = parseInt($(ui.item).index()),
44
- payload = {
45
- toIndex: toIndex
46
- };
47
-
48
- if ('panel' === source) {
49
- // prepare the payload to add new form element
50
- var field_template = ui.item[0].dataset.formField,
51
- field = $.extend(true, {}, self.field_settings[field_template].field_props);
52
-
53
- // add a random integer id
54
- field.id = self.get_random_id();
55
-
56
- // add meta key
57
- if ('yes' === field.is_meta && !field.name) {
58
- field.name = field.label.replace(/\W/g, '_').toLowerCase() + '_' + field.id;
59
- }
60
-
61
- payload.field = field;
62
-
63
- // add new form element
64
- self.$store.commit('add_form_field_element', payload);
65
-
66
- // remove button from stage
67
- $(this).find('.button.ui-draggable.ui-draggable-handle').remove();
68
-
69
- } else if ('stage' === source) {
70
- payload.fromIndex = parseInt(data.index);
71
-
72
- self.$store.commit('swap_form_field_elements', payload);
73
- }
74
-
75
- }
76
- });
77
- },
78
-
79
- methods: {
80
- open_field_settings: function(field_id) {
81
- this.$store.commit('open_field_settings', field_id);
82
- },
83
-
84
- clone_field: function(field_id, index) {
85
- var payload = {
86
- field_id: field_id,
87
- index: index,
88
- new_id: this.get_random_id()
89
- };
90
-
91
- // single instance checking
92
- var field = _.find(this.$store.state.form_fields, function (item) {
93
- return parseInt(item.id) === parseInt(payload.field_id);
94
- });
95
-
96
- // check if these are already inserted
97
- if ( this.isSingleInstance( field.template ) && this.containsField( field.template ) ) {
98
- swal({
99
- title: "Oops...",
100
- text: "You already have this field in the form"
101
- });
102
- return;
103
- }
104
-
105
- this.$store.commit('clone_form_field_element', payload);
106
- },
107
-
108
- delete_field: function(index) {
109
- var self = this;
110
-
111
- self.warn({
112
- text: self.i18n.delete_field_warn_msg,
113
- confirmButtonText: self.i18n.yes_delete_it,
114
- cancelButtonText: self.i18n.no_cancel_it,
115
- }, function (is_confirm) {
116
- if (is_confirm) {
117
- self.$store.commit('delete_form_field_element', index);
118
- }
119
- });
120
- },
121
-
122
- delete_hidden_field: function (field_id) {
123
- var i = 0;
124
-
125
- for (i = 0; i < this.form_fields.length; i++) {
126
- if (parseInt(field_id) === parseInt(this.form_fields[i].id)) {
127
- this.delete_field(i);
128
- }
129
- }
130
- },
131
-
132
- is_pro_feature: function (template) {
133
- return (this.field_settings[template] && this.field_settings[template].pro_feature) ? true : false;
134
- },
135
-
136
- is_template_available: function (field) {
137
- var template = field.template;
138
-
139
- if (this.field_settings[template]) {
140
- if (this.is_pro_feature(template)) {
141
- return false;
142
- }
143
-
144
- return true;
145
- }
146
-
147
- // for example see 'mixin_builder_stage' mixin's 'is_taxonomy_template_available' method
148
- if (_.isFunction(this['is_' + template + '_template_available'])) {
149
- return this['is_' + template + '_template_available'].call(this, field);
150
- }
151
-
152
- return false;
153
- },
154
-
155
- is_full_width: function (template) {
156
- if (this.field_settings[template] && this.field_settings[template].is_full_width) {
157
- return true;
158
- }
159
-
160
- return false;
161
- },
162
-
163
- get_field_name: function (template) {
164
- return this.field_settings[template].title;
165
- }
166
- }
167
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/builder-stage/template.php DELETED
@@ -1,73 +0,0 @@
1
- <div id="form-preview-stage">
2
- <h4 v-if="!form_fields.length" class="text-center">
3
- <?php _e( 'Add fields by dragging the fields from the right sidebar to this area.', 'wpuf' ) ?>
4
- </h4>
5
-
6
- <ul class="wpuf-form sortable-list">
7
- <li
8
- v-for="(field, index) in form_fields"
9
- :key="field.id"
10
- :class="[
11
- 'field-items', 'wpuf-el', field.name, field.css, 'form-field-' + field.template,
12
- ('hidden' === field.input_type) ? 'hidden-field' : '',
13
- parseInt(editing_form_id) === parseInt(field.id) ? 'current-editing' : ''
14
- ]"
15
- :data-index="index"
16
- data-source="stage"
17
- >
18
- <div v-if="!is_full_width(field.template)" class="wpuf-label">
19
- <label :for="'wpuf-' + field.name ? field.name : 'cls'">
20
- {{ field.label }} <span v-if="field.required && 'yes' === field.required" class="required">*</span>
21
- </label>
22
- </div>
23
-
24
- <component v-if="is_template_available(field)" :is="'form-' + field.template" :field="field"></component>
25
-
26
- <div v-if="is_pro_feature(field.template)" class="stage-pro-alert">
27
- <label class="wpuf-pro-text-alert">
28
- <a :href="pro_link" target="_blank"><strong>{{ get_field_name(field.template) }}</strong> <?php _e( 'is available in Pro Version', 'wpuf' ); ?></a>
29
- </label>
30
- </div>
31
-
32
- <div v-if="is_template_available(field) && !is_failed_to_validate(field.template)" class="control-buttons">
33
- <p>
34
- <i class="fa fa-arrows move"></i>
35
- <i class="fa fa-pencil" @click="open_field_settings(field.id)"></i>
36
- <i class="fa fa-clone" @click="clone_field(field.id, index)"></i>
37
- <i class="fa fa-trash-o" @click="delete_field(index)"></i>
38
- </p>
39
- </div>
40
- </li>
41
-
42
- <li v-if="!form_fields.length" class="field-items empty-list-item"></li>
43
-
44
- <li class="wpuf-submit">
45
- <div class="wpuf-label">&nbsp;</div>
46
-
47
- <?php do_action( 'wpuf-form-builder-template-builder-stage-submit-area' ); ?>
48
- </li>
49
- </ul><!-- .wpuf-form -->
50
-
51
- <div v-if="hidden_fields.length" class="hidden-field-list">
52
- <h4><?php _e( 'Hidden Fields', 'wpuf' ); ?></h4>
53
-
54
- <ul class="wpuf-form">
55
- <li
56
- v-for="(field, index) in hidden_fields"
57
- :class="['field-items', parseInt(editing_form_id) === parseInt(field.id) ? 'current-editing' : '']"
58
- >
59
- <strong><?php _e('key', 'wpuf'); ?></strong>: {{ field.name }} | <strong><?php _e( 'value', 'wpuf' ); ?></strong>: {{ field.meta_value }}
60
-
61
- <div class="control-buttons">
62
- <p>
63
- <i class="fa fa-pencil" @click="open_field_settings(field.id)"></i>
64
- <i class="fa fa-clone" @click="clone_field(field.id, index)"></i>
65
- <i class="fa fa-trash-o" @click="delete_hidden_field(field.id)"></i>
66
- </p>
67
- </div>
68
- </li>
69
- </ul>
70
- </div>
71
-
72
- <?php do_action( 'wpuf-form-builder-template-builder-stage-bottom-area' ); ?>
73
- </div><!-- #form-preview-stage -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-checkbox/index.js DELETED
@@ -1,41 +0,0 @@
1
- Vue.component('field-checkbox', {
2
- template: '#tmpl-wpuf-field-checkbox',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
-
8
- computed: {
9
- value: {
10
- get: function () {
11
- var value = this.editing_form_field[this.option_field.name];
12
-
13
- if (this.option_field.is_single_opt) {
14
- var option = Object.keys(this.option_field.options)[0];
15
-
16
- if (value === option) {
17
- return true;
18
-
19
- } else {
20
- return false;
21
- }
22
- }
23
-
24
- return this.editing_form_field[this.option_field.name];
25
- },
26
-
27
- set: function (value) {
28
- if (this.option_field.is_single_opt) {
29
- value = value ? Object.keys(this.option_field.options)[0] : '';
30
- }
31
-
32
-
33
- this.$store.commit('update_editing_form_field', {
34
- editing_field_id: this.editing_form_field.id,
35
- field_name: this.option_field.name,
36
- value: value
37
- });
38
- }
39
- }
40
- }
41
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-checkbox/template.php DELETED
@@ -1,12 +0,0 @@
1
- <div v-if="met_dependencies" class="panel-field-opt panel-field-opt-checkbox">
2
- <label v-if="option_field.title" :class="option_field.title_class">
3
- {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
4
- </label>
5
- <ul :class="[option_field.inline ? 'list-inline' : '']">
6
- <li v-for="(option, key) in option_field.options">
7
- <label>
8
- <input type="checkbox" :value="key" v-model="value"> {{ option }}
9
- </label>
10
- </li>
11
- </ul>
12
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-html_help_text/index.js DELETED
@@ -1,7 +0,0 @@
1
- Vue.component('field-html_help_text', {
2
- template: '#tmpl-wpuf-field-html_help_text',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
- });
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-html_help_text/template.php DELETED
@@ -1 +0,0 @@
1
- <div class="panel-field-opt panel-field-html-help-text" v-html="option_field.text"></div>
 
admin/form-builder/assets/js/components/field-option-data/index.js DELETED
@@ -1,121 +0,0 @@
1
- /**
2
- * Common settings component for option based fields
3
- * like select, multiselect, checkbox, radio
4
- */
5
- Vue.component('field-option-data', {
6
- template: '#tmpl-wpuf-field-option-data',
7
-
8
- mixins: [
9
- wpuf_mixins.option_field_mixin
10
- ],
11
-
12
- data: function () {
13
- return {
14
- show_value: false,
15
- options: [],
16
- selected: [],
17
-
18
- };
19
- },
20
-
21
- computed: {
22
- field_options: function () {
23
- return this.editing_form_field.options;
24
- },
25
-
26
- field_selected: function () {
27
- return this.editing_form_field.selected;
28
- }
29
- },
30
-
31
- mounted: function () {
32
- var self = this;
33
-
34
- this.set_options();
35
-
36
- $(this.$el).find('.option-field-option-chooser').sortable({
37
- items: '.option-field-option',
38
- handle: '.sort-handler',
39
- update: function (e, ui) {
40
- var item = ui.item[0],
41
- data = item.dataset,
42
- toIndex = parseInt($(ui.item).index()),
43
- fromIndex = parseInt(data.index);
44
-
45
- self.options.swap(fromIndex, toIndex);
46
- }
47
- });
48
- },
49
-
50
- methods: {
51
- set_options: function () {
52
- var self = this;
53
- var field_options = $.extend(true, {}, this.editing_form_field.options);
54
-
55
- _.each(field_options, function (label, value) {
56
- self.options.push({label: label, value: value, id: self.get_random_id()});
57
- });
58
-
59
- if (this.option_field.is_multiple && !_.isArray(this.field_selected)) {
60
- this.selected = [this.field_selected];
61
- } else {
62
- this.selected = this.field_selected;
63
- }
64
- },
65
-
66
- // in case of select or radio buttons, user should deselect default value
67
- clear_selection: function (e, label) {
68
- if (label === this.selected) {
69
- this.selected = '';
70
- $(e.target).prop('checked', false);
71
- }
72
- },
73
-
74
- add_option: function () {
75
- var count = this.options.length,
76
- new_opt = this.i18n.option + ' - ' + (count + 1);
77
-
78
- this.options.push({
79
- label: new_opt , value: new_opt, id: this.get_random_id()
80
- });
81
- },
82
-
83
- delete_option: function (index) {
84
- if (this.options.length === 1) {
85
- this.warn({
86
- text: this.i18n.last_choice_warn_msg,
87
- showCancelButton: false,
88
- confirmButtonColor: "#46b450",
89
- });
90
-
91
- return;
92
- }
93
-
94
- this.options.splice(index, 1);
95
- },
96
-
97
- set_option_label: function (index, label) {
98
- this.options[index].value = label.toLocaleLowerCase().replace(' ', '_');
99
- }
100
- },
101
-
102
- watch: {
103
- options: {
104
- deep: true,
105
- handler: function (new_opts) {
106
- var options = {},
107
- i = 0;
108
-
109
- for (i = 0; i < new_opts.length; i++) {
110
- options[new_opts[i].value] = new_opts[i].label;
111
- }
112
-
113
- this.update_value('options', options);
114
- }
115
- },
116
-
117
- selected: function (new_val) {
118
- this.update_value('selected', new_val);
119
- }
120
- }
121
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-option-data/template.php DELETED
@@ -1,64 +0,0 @@
1
- <div class="panel-field-opt panel-field-opt-text">
2
- <label class="clearfix">
3
- {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
4
- <span class="pull-right">
5
- <input type="checkbox" v-model="show_value"> <?php _e( 'Show values', 'wpuf' ); ?>
6
- </span>
7
- </label>
8
-
9
- <ul :class="['option-field-option-chooser', show_value ? 'show-value' : '']">
10
- <li class="clearfix margin-0 header">
11
- <div class="selector">&nbsp;</div>
12
-
13
- <div class="sort-handler">&nbsp;</div>
14
-
15
- <div class="label">
16
- <?php _e( 'Label', 'wpuf' ); ?>
17
- </div>
18
-
19
- <div v-if="show_value" class="value">
20
- <?php _e( 'Value', 'wpuf' ) ?>
21
- </div>
22
-
23
- <div class="action-buttons">&nbsp;</div>
24
- </li>
25
- </ul>
26
-
27
- <ul :class="['option-field-option-chooser margin-0', show_value ? 'show-value' : '']">
28
- <li v-for="(option, index) in options" :key="option.id" :data-index="index" class="clearfix option-field-option">
29
- <div class="selector">
30
- <input
31
- v-if="option_field.is_multiple"
32
- type="checkbox"
33
- :value="option.label"
34
- v-model="selected"
35
- >
36
- <input
37
- v-else
38
- type="radio"
39
- :value="option.label"
40
- v-model="selected"
41
- class="option-chooser-radio"
42
- @click="clear_selection($event, option.label)"
43
- >
44
- </div>
45
-
46
- <div class="sort-handler">
47
- <i class="fa fa-bars"></i>
48
- </div>
49
-
50
- <div class="label">
51
- <input type="text" v-model="option.label" @input="set_option_label(index, option.label)">
52
- </div>
53
-
54
- <div v-if="show_value" class="value">
55
- <input type="text" v-model="option.value">
56
- </div>
57
-
58
- <div class="action-buttons clearfix">
59
- <i class="fa fa-plus-circle" @click="add_option"></i>
60
- <i class="fa fa-minus-circle pull-right" @click="delete_option(index)"></i>
61
- </div>
62
- </li>
63
- </ul>
64
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-option-pro-feature-alert/index.js DELETED
@@ -1,13 +0,0 @@
1
- Vue.component('field-option-pro-feature-alert', {
2
- template: '#tmpl-wpuf-field-option-pro-feature-alert',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
-
8
- computed: {
9
- pro_link: function () {
10
- return wpuf_form_builder.pro_link;
11
- }
12
- }
13
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-option-pro-feature-alert/template.php DELETED
@@ -1,6 +0,0 @@
1
- <div class="panel-field-opt panel-field-opt-pro-feature">
2
- <label>{{ option_field.title }}</label><br>
3
- <label class="wpuf-pro-text-alert">
4
- <a :href="pro_link" target="_blank"><?php _e( 'Available in Pro Version', 'wpuf' ); ?></a>
5
- </label>
6
- </div>
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-options/index.js DELETED
@@ -1,68 +0,0 @@
1
- /**
2
- * Sidebar field options panel
3
- */
4
- Vue.component('field-options', {
5
- template: '#tmpl-wpuf-field-options',
6
-
7
- mixins: wpuf_form_builder_mixins(wpuf_mixins.field_options),
8
-
9
- data: function() {
10
- return {
11
- show_basic_settings: true,
12
- show_advanced_settings: false
13
- };
14
- },
15
-
16
- computed: {
17
- editing_field_id: function () {
18
- this.show_basic_settings = true;
19
- this.show_advanced_settings = false;
20
-
21
- return parseInt(this.$store.state.editing_field_id);
22
- },
23
-
24
- editing_form_field: function () {
25
- var self = this;
26
- return _.find(this.$store.state.form_fields, function (item) {
27
- return parseInt(item.id) === parseInt(self.editing_field_id);
28
- });
29
- },
30
-
31
- settings: function() {
32
- var settings = [],
33
- template = this.editing_form_field.template;
34
-
35
- if (_.isFunction(this['settings_' + template])) {
36
- settings = this['settings_' + template].call(this, this.editing_form_field);
37
- } else {
38
- settings = this.$store.state.field_settings[template].settings;
39
- }
40
-
41
- return _.sortBy(settings, function (item) {
42
- return parseInt(item.priority);
43
- });
44
- },
45
-
46
- basic_settings: function () {
47
- return this.settings.filter(function (item) {
48
- return 'basic' === item.section;
49
- });
50
- },
51
-
52
- advanced_settings: function () {
53
- return this.settings.filter(function (item) {
54
- return 'advanced' === item.section;
55
- });
56
- },
57
-
58
- form_field_type_title: function() {
59
- var template = this.editing_form_field.template;
60
-
61
- if (_.isFunction(this['form_field_' + template + '_title'])) {
62
- return this['form_field_' + template + '_title'].call(this, this.editing_form_field);
63
- }
64
-
65
- return this.$store.state.field_settings[template].title;
66
- }
67
- }
68
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-options/template.php DELETED
@@ -1,45 +0,0 @@
1
- <div class="wpuf-form-builder-field-options">
2
- <div v-if="!parseInt(editing_field_id)" class="options-fileds-section text-center">
3
- <p>
4
- <span class="loader"></span>
5
- </p>
6
- </div>
7
-
8
- <div v-else>
9
- <div class="option-fields-section">
10
- <h3 class="section-title clearfix" @click="show_basic_settings = !show_basic_settings">
11
- {{ form_field_type_title }} <i :class="[show_basic_settings ? 'fa fa-angle-down' : 'fa fa-angle-right']"></i>
12
- </h3>
13
-
14
- <transition name="slide-fade">
15
- <div v-show="show_basic_settings" class="option-field-section-fields">
16
- <component
17
- v-for="option_field in basic_settings"
18
- :is="'field-' + option_field.type"
19
- :option_field="option_field"
20
- :editing_form_field="editing_form_field"
21
- ></component>
22
- </div>
23
- </transition>
24
- </div>
25
-
26
-
27
- <div v-if="advanced_settings.length" class="option-fields-section">
28
- <h3 class="section-title" @click="show_advanced_settings = !show_advanced_settings">
29
- {{ i18n.advanced_options }} <i :class="[show_advanced_settings ? 'fa fa-angle-down' : 'fa fa-angle-right']"></i>
30
- </h3>
31
-
32
- <transition name="slide-fade">
33
- <div v-show="show_advanced_settings" class="option-field-section-fields">
34
- <component
35
- v-for="option_field in advanced_settings"
36
- :is="'field-' + option_field.type"
37
- :option_field="option_field"
38
- :editing_form_field="editing_form_field"
39
- ></component>
40
- </div>
41
- </transition>
42
- </div>
43
- </div>
44
-
45
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-radio/index.js DELETED
@@ -1,23 +0,0 @@
1
- Vue.component('field-radio', {
2
- template: '#tmpl-wpuf-field-radio',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
-
8
- computed: {
9
- value: {
10
- get: function () {
11
- return this.editing_form_field[this.option_field.name];
12
- },
13
-
14
- set: function (value) {
15
- this.$store.commit('update_editing_form_field', {
16
- editing_field_id: this.editing_form_field.id,
17
- field_name: this.option_field.name,
18
- value: value
19
- });
20
- }
21
- }
22
- }
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-radio/template.php DELETED
@@ -1,13 +0,0 @@
1
- <div class="panel-field-opt panel-field-opt-radio">
2
- <label v-if="option_field.title">
3
- {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
4
- </label>
5
-
6
- <ul :class="[option_field.inline ? 'list-inline' : '']">
7
- <li v-for="(option, key) in option_field.options">
8
- <label>
9
- <input type="radio" :value="key" v-model="value"> {{ option }}
10
- </label>
11
- </li>
12
- </ul>
13
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-select/index.js DELETED
@@ -1,23 +0,0 @@
1
- Vue.component('field-select', {
2
- template: '#tmpl-wpuf-field-select',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
-
8
- computed: {
9
- value: {
10
- get: function () {
11
- return this.editing_form_field[this.option_field.name];
12
- },
13
-
14
- set: function (value) {
15
- this.$store.commit('update_editing_form_field', {
16
- editing_field_id: this.editing_form_field.id,
17
- field_name: this.option_field.name,
18
- value: value
19
- });
20
- }
21
- }
22
- }
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-select/template.php DELETED
@@ -1,10 +0,0 @@
1
- <div class="panel-field-opt panel-field-opt-select">
2
- <label v-if="option_field.title">
3
- {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
4
- </label>
5
-
6
- <select class="opt-select-element" v-model="value">
7
- <option value=""><?php _e( 'Select an option', 'wpuf' ); ?></option>
8
- <option v-for="(option, key) in option_field.options" :value="key">{{ option }}</option>
9
- </select>
10
- </div>
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-text-meta/index.js DELETED
@@ -1,40 +0,0 @@
1
- Vue.component('field-text-meta', {
2
- template: '#tmpl-wpuf-field-text-meta',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
-
8
- computed: {
9
- value: {
10
- get: function () {
11
- return this.editing_form_field[this.option_field.name];
12
- },
13
-
14
- set: function (value) {
15
- this.update_value(this.option_field.name, value);
16
- }
17
- }
18
- },
19
-
20
- created: function () {
21
- if ('yes' === this.editing_form_field.is_meta) {
22
- if (!this.value) {
23
- this.value = this.editing_form_field.label.replace(/\W/g, '_').toLowerCase();
24
- }
25
-
26
- wpuf_form_builder.event_hub.$on('field-text-keyup', this.meta_key_autocomplete);
27
- }
28
- },
29
-
30
- methods: {
31
- meta_key_autocomplete: function (e, label_vm) {
32
- if (
33
- 'label' === label_vm.option_field.name &&
34
- parseInt(this.editing_form_field.id) === parseInt(label_vm.editing_form_field.id)
35
- ) {
36
- this.value = label_vm.value.replace(/\W/g, '_').toLowerCase();
37
- }
38
- }
39
- }
40
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-text-meta/template.php DELETED
@@ -1,9 +0,0 @@
1
- <div class="panel-field-opt panel-field-opt-text panel-field-opt-text-meta">
2
- <label>
3
- {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
4
- <input
5
- type="text"
6
- v-model="value"
7
- >
8
- </label>
9
- </div>
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-text/index.js DELETED
@@ -1,28 +0,0 @@
1
- Vue.component('field-text', {
2
- template: '#tmpl-wpuf-field-text',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
-
8
- computed: {
9
- value: {
10
- get: function () {
11
- return this.editing_form_field[this.option_field.name];
12
- },
13
-
14
- set: function (value) {
15
- this.update_value(this.option_field.name, value);
16
- }
17
- }
18
- },
19
-
20
- methods: {
21
- on_focusout: function (e) {
22
- wpuf_form_builder.event_hub.$emit('field-text-focusout', e, this);
23
- },
24
- on_keyup: function (e) {
25
- wpuf_form_builder.event_hub.$emit('field-text-keyup', e, this);
26
- }
27
- }
28
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-text/template.php DELETED
@@ -1,21 +0,0 @@
1
- <div v-if="met_dependencies" class="panel-field-opt panel-field-opt-text">
2
- <label>
3
- {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
4
-
5
- <input
6
- v-if="option_field.variation && 'number' === option_field.variation"
7
- type="number"
8
- v-model="value"
9
- @focusout="on_focusout"
10
- @keyup="on_keyup"
11
- >
12
-
13
- <input
14
- v-if="!option_field.variation"
15
- type="text"
16
- v-model="value"
17
- @focusout="on_focusout"
18
- @keyup="on_keyup"
19
- >
20
- </label>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-textarea/index.js DELETED
@@ -1,19 +0,0 @@
1
- Vue.component('field-textarea', {
2
- template: '#tmpl-wpuf-field-textarea',
3
-
4
- mixins: [
5
- wpuf_mixins.option_field_mixin
6
- ],
7
-
8
- computed: {
9
- value: {
10
- get: function () {
11
- return this.editing_form_field[this.option_field.name];
12
- },
13
-
14
- set: function (value) {
15
- this.update_value(this.option_field.name, value);
16
- }
17
- }
18
- },
19
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/field-textarea/template.php DELETED
@@ -1,7 +0,0 @@
1
- <div class="panel-field-opt panel-field-opt-textarea">
2
- <label>
3
- {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
4
-
5
- <textarea :rows="option_field.rows || 5" v-model="value"></textarea>
6
- </label>
7
- </div>
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-checkbox_field/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Checkbox
3
- */
4
- Vue.component('form-checkbox_field', {
5
- template: '#tmpl-wpuf-form-checkbox_field',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-checkbox_field/template.php DELETED
@@ -1,16 +0,0 @@
1
- <div class="wpuf-fields">
2
- <ul :class="['wpuf-fields-list', ('yes' === field.inline) ? 'wpuf-list-inline' : '']">
3
- <li v-if="has_options" v-for="(label, val) in field.options">
4
- <label>
5
- <input
6
- type="checkbox"
7
- :value="label"
8
- :checked="is_selected(label)"
9
- :class="class_names('checkbox_btns')"
10
- > {{ label }}
11
- </label>
12
- </li>
13
- </ul>
14
-
15
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
16
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-custom_hidden_field/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Hidden
3
- */
4
- Vue.component('form-custom_hidden_field', {
5
- template: '#tmpl-wpuf-form-custom_hidden_field',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-custom_hidden_field/template.php DELETED
@@ -1,10 +0,0 @@
1
- <div class="wpuf-fields">
2
- <input
3
- type="text"
4
- :class="class_names('textfield')"
5
- :placeholder="field.placeholder"
6
- :value="field.default"
7
- :size="field.size"
8
- >
9
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
10
- </div>
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-custom_html/index.js DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * Field template: Custom HTML
3
- */
4
- Vue.component('form-custom_html', {
5
- template: '#tmpl-wpuf-form-custom_html',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ],
10
-
11
- data: function () {
12
- return {
13
- raw_html: '<p>from data</p>'
14
- };
15
- }
16
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-custom_html/template.php DELETED
@@ -1 +0,0 @@
1
- <div class="wpuf-fields" v-html="field.html"></div>
 
admin/form-builder/assets/js/components/form-dropdown_field/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Dropdown/Select
3
- */
4
- Vue.component('form-dropdown_field', {
5
- template: '#tmpl-wpuf-form-dropdown_field',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-dropdown_field/template.php DELETED
@@ -1,16 +0,0 @@
1
- <div class="wpuf-fields">
2
- <select
3
- :class="class_names('select_lbl')"
4
- >
5
- <option v-if="field.first" value="">{{ field.first }}</option>
6
-
7
- <option
8
- v-if="has_options"
9
- v-for="(label, val) in field.options"
10
- :value="label"
11
- :selected="is_selected(label)"
12
- >{{ label }}</option>
13
- </select>
14
-
15
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
16
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-email_address/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Email
3
- */
4
- Vue.component('form-email_address', {
5
- template: '#tmpl-wpuf-form-email_address',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-email_address/template.php DELETED
@@ -1,10 +0,0 @@
1
- <div class="wpuf-fields">
2
- <input
3
- type="email"
4
- :class="class_names('email')"
5
- :placeholder="field.placeholder"
6
- :value="field.default"
7
- :size="field.size"
8
- >
9
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
10
- </div>
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-featured_image/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Featured Image
3
- */
4
- Vue.component('form-featured_image', {
5
- template: '#tmpl-wpuf-form-featured_image',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-featured_image/template.php DELETED
@@ -1,11 +0,0 @@
1
- <div class="wpuf-fields">
2
- <div :id="'wpuf-img_label-' + field.id + '-upload-container'">
3
- <div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes">
4
- <a class="button file-selector" href="#">
5
- <?php _e( 'Select Image', 'wpuf' ); ?>
6
- </a>
7
- </div>
8
- </div>
9
-
10
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-fields/index.js DELETED
@@ -1,117 +0,0 @@
1
- /**
2
- * Sidebar form fields panel
3
- */
4
- Vue.component('form-fields', {
5
- template: '#tmpl-wpuf-form-fields',
6
-
7
- mixins: wpuf_form_builder_mixins(wpuf_mixins.form_fields),
8
-
9
- computed: {
10
- panel_sections: function () {
11
- return this.$store.state.panel_sections;
12
- },
13
-
14
- field_settings: function () {
15
- return this.$store.state.field_settings;
16
- },
17
-
18
- form_fields: function () {
19
- return this.$store.state.form_fields;
20
- }
21
- },
22
-
23
- mounted: function () {
24
- // bind jquery ui draggable
25
- $(this.$el).find('.panel-form-field-buttons .button').draggable({
26
- connectToSortable: '#form-preview-stage .wpuf-form',
27
- helper: 'clone',
28
- revert: 'invalid',
29
- cancel: '.button-faded',
30
- }).disableSelection();
31
- },
32
-
33
- methods: {
34
- panel_toggle: function (index) {
35
- this.$store.commit('panel_toggle', index);
36
- },
37
-
38
- add_form_field: function (field_template) {
39
- var payload = {
40
- toIndex: this.$store.state.form_fields.length,
41
- };
42
-
43
- // check if these are already inserted
44
- if ( this.isSingleInstance( field_template ) && this.containsField( field_template ) ) {
45
- swal({
46
- title: "Oops...",
47
- text: "You already have this field in the form"
48
- });
49
- return;
50
- }
51
-
52
- var field = $.extend(true, {}, this.$store.state.field_settings[field_template].field_props);
53
-
54
- field.id = this.get_random_id();
55
-
56
- if (!field.name && field.label) {
57
- field.name = field.label.replace(/\W/g, '_').toLowerCase();
58
-
59
- var same_template_fields = this.form_fields.filter(function (form_field) {
60
- return (form_field.template === field.template);
61
- });
62
-
63
- if (same_template_fields.length) {
64
- field.name += '_' + same_template_fields.length;
65
- }
66
- }
67
-
68
- payload.field = field;
69
-
70
- // add new form element
71
- this.$store.commit('add_form_field_element', payload);
72
- },
73
-
74
- is_pro_feature: function (field) {
75
- return this.field_settings[field].pro_feature;
76
- },
77
-
78
- alert_pro_feature: function (field) {
79
- var title = this.field_settings[field].title;
80
-
81
- swal({
82
- title: '<i class="fa fa-lock"></i> ' + title + ' <br>' + this.i18n.is_a_pro_feature,
83
- text: this.i18n.pro_feature_msg,
84
- type: '',
85
- html: true,
86
- showCancelButton: true,
87
- cancelButtonText: this.i18n.close,
88
- confirmButtonColor: '#46b450',
89
- confirmButtonText: this.i18n.upgrade_to_pro
90
- }, function (is_confirm) {
91
- if (is_confirm) {
92
- window.open(wpuf_form_builder.pro_link, '_blank');
93
- }
94
- });
95
- },
96
-
97
- alert_invalidate_msg: function (field) {
98
- var validator = this.field_settings[field].validator;
99
-
100
- if (validator && validator.msg) {
101
- this.warn({
102
- title: validator.msg_title || '',
103
- text: validator.msg,
104
- html: true,
105
- type: 'warning',
106
- showCancelButton: false,
107
- confirmButtonColor: '#46b450',
108
- confirmButtonText: this.i18n.ok
109
- });
110
- }
111
- },
112
-
113
- get_invalidate_btn_class: function (field) {
114
- return this.field_settings[field].validator.button_class;
115
- }
116
- }
117
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-fields/template.php DELETED
@@ -1,49 +0,0 @@
1
- <div class="wpuf-form-builder-form-fields">
2
- <template v-for="(section, index) in panel_sections">
3
- <div v-if="section.fields.length" class="panel-form-field-group clearfix">
4
- <h3 class="clearfix" @click="panel_toggle(index)">
5
- {{ section.title }} <i :class="[section.show ? 'fa fa-angle-down' : 'fa fa-angle-right']"></i>
6
- </h3>
7
-
8
- <transition name="slide-fade">
9
- <ul
10
- v-show="section.show"
11
- class="panel-form-field-buttons clearfix"
12
- :id="'panel-form-field-buttons-' + section.id"
13
- >
14
- <template v-for="field in section.fields">
15
- <li
16
- v-if="is_pro_feature(field)"
17
- class="button button-faded"
18
- :data-form-field="field"
19
- data-source="panel"
20
- @click="alert_pro_feature(field)"
21
- >
22
- <i v-if="field_settings[field].icon" :class="['fa fa-' + field_settings[field].icon]" aria-hidden="true"></i> {{ field_settings[field].title }}
23
- </li>
24
-
25
- <li
26
- v-if="is_failed_to_validate(field)"
27
- :class="['button', get_invalidate_btn_class(field)]"
28
- :data-form-field="field"
29
- data-source="panel"
30
- @click="alert_invalidate_msg(field)"
31
- >
32
- <i v-if="field_settings[field].icon" :class="['fa fa-' + field_settings[field].icon]" aria-hidden="true"></i> {{ field_settings[field].title }}
33
- </li>
34
-
35
- <li
36
- v-if="!is_pro_feature(field) && !is_failed_to_validate(field)"
37
- class="button"
38
- :data-form-field="field"
39
- data-source="panel"
40
- @click="add_form_field(field)"
41
- >
42
- <i v-if="field_settings[field].icon" :class="['fa fa-' + field_settings[field].icon]" aria-hidden="true"></i> {{ field_settings[field].title }}
43
- </li>
44
- </template>
45
- </ul>
46
- </transition>
47
- </div>
48
- </template>
49
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-image_upload/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Image Upload
3
- */
4
- Vue.component('form-image_upload', {
5
- template: '#tmpl-wpuf-form-image_upload',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-image_upload/template.php DELETED
@@ -1,11 +0,0 @@
1
- <div class="wpuf-fields">
2
- <div :id="'wpuf-img_label-' + field.id + '-upload-container'">
3
- <div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes">
4
- <a class="button file-selector wpuf_img_label_148" href="#">
5
- <?php _e( 'Select Image', 'wpuf' ); ?>
6
- </a>
7
- </div>
8
- </div>
9
-
10
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-multiple_select/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Multi-Select
3
- */
4
- Vue.component('form-multiple_select', {
5
- template: '#tmpl-wpuf-form-multiple_select',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-multiple_select/template.php DELETED
@@ -1,17 +0,0 @@
1
- <div class="wpuf-fields">
2
- <select
3
- :class="class_names('multi_label')"
4
- multiple
5
- >
6
- <option v-if="field.first" value="">{{ field.first }}</option>
7
-
8
- <option
9
- v-if="has_options"
10
- v-for="(label, val) in field.options"
11
- :value="label"
12
- :selected="is_selected(label)"
13
- >{{ label }}</option>
14
- </select>
15
-
16
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
17
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_content/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field Template: Post Content
3
- */
4
- Vue.component('form-post_content', {
5
- template: '#tmpl-wpuf-form-post_content',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_content/template.php DELETED
@@ -1,20 +0,0 @@
1
- <div class="wpuf-fields">
2
- <div class="wp-media-buttons" v-if="field.insert_image == 'yes'">
3
- <button type="button" class="button insert-media add_media" data-editor="content">
4
- <span class="dashicons dashicons-admin-media insert-photo-icon"></span> <?php _e( 'Insert Photo', 'wpuf' ); ?>
5
- </button>
6
- </div>
7
- <br v-if="field.insert_image == 'yes'" />
8
-
9
- <textarea
10
- v-if="'no' === field.rich"
11
- :class="class_names('textareafield')"
12
- :placeholder="field.placeholder"
13
- :rows="field.rows"
14
- :cols="field.cols"
15
- >{{ field.default }}</textarea>
16
-
17
- <text-editor v-if="'no' !== field.rich" :rich="field.rich"></text-editor>
18
-
19
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
20
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_excerpt/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field Template: Post Excerpt
3
- */
4
- Vue.component('form-post_excerpt', {
5
- template: '#tmpl-wpuf-form-post_excerpt',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_excerpt/template.php DELETED
@@ -1,9 +0,0 @@
1
- <div class="wpuf-fields">
2
- <textarea
3
- :class="class_names('textareafield')"
4
- :placeholder="field.placeholder"
5
- :rows="field.rows"
6
- :cols="field.cols"
7
- >{{ field.default }}</textarea>
8
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
9
- </div>
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_tags/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: post_tags
3
- */
4
- Vue.component('form-post_tags', {
5
- template: '#tmpl-wpuf-form-post_tags',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_tags/template.php DELETED
@@ -1,11 +0,0 @@
1
- <div class="wpuf-fields">
2
- <input
3
- type="text"
4
- :class="class_names('textfield')"
5
- :placeholder="field.placeholder"
6
- :value="field.default"
7
- :size="field.size"
8
- >
9
-
10
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_title/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Post Title
3
- */
4
- Vue.component('form-post_title', {
5
- template: '#tmpl-wpuf-form-post_title',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-post_title/template.php DELETED
@@ -1,10 +0,0 @@
1
- <div class="wpuf-fields">
2
- <input
3
- type="text"
4
- :class="class_names('textfield')"
5
- :placeholder="field.placeholder"
6
- :value="field.default"
7
- :size="field.size"
8
- >
9
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
10
- </div>
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-radio_field/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Radio
3
- */
4
- Vue.component('form-radio_field', {
5
- template: '#tmpl-wpuf-form-radio_field',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-radio_field/template.php DELETED
@@ -1,16 +0,0 @@
1
- <div class="wpuf-fields">
2
- <ul :class="['wpuf-fields-list', ('yes' === field.inline) ? 'wpuf-list-inline' : '']">
3
- <li v-if="has_options" v-for="(label, val) in field.options">
4
- <label>
5
- <input
6
- type="radio"
7
- :value="label"
8
- :checked="is_selected(label)"
9
- :class="class_names('radio_btns')"
10
- > {{ label }}
11
- </label>
12
- </li>
13
- </ul>
14
-
15
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
16
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-section_break/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Section Break
3
- */
4
- Vue.component('form-section_break', {
5
- template: '#tmpl-wpuf-form-section_break',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-section_break/template.php DELETED
@@ -1,4 +0,0 @@
1
- <div class="wpuf-section-wrap">
2
- <h2 class="wpuf-section-title">{{ field.label }}</h2>
3
- <div class="wpuf-section-details">{{ field.description }}</div>
4
- </div>
 
 
 
 
admin/form-builder/assets/js/components/form-taxonomy/index.js DELETED
@@ -1,163 +0,0 @@
1
- /**
2
- * Field template: taxonomy
3
- */
4
- Vue.component('form-taxonomy', {
5
- template: '#tmpl-wpuf-form-taxonomy',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ],
10
-
11
- computed: {
12
- terms: function () {
13
- var i;
14
-
15
- for (i in wpuf_form_builder.wp_post_types) {
16
- var taxonomies = wpuf_form_builder.wp_post_types[i];
17
-
18
- if (taxonomies.hasOwnProperty(this.field.name)) {
19
- var tax_field = taxonomies[this.field.name];
20
-
21
- if (tax_field.terms) {
22
- return tax_field.terms;
23
- }
24
- }
25
- }
26
-
27
- return [];
28
- },
29
-
30
- sorted_terms: function () {
31
- var self = this;
32
- var terms = $.extend(true, [], this.terms);
33
-
34
- // selection type and terms
35
- if (this.field.exclude_type && this.field.exclude) {
36
- var filter_ids = this.field.exclude.split(',').map(function (id) {
37
- id = id.trim();
38
- id = parseInt(id);
39
- return id;
40
- }).filter(function (id) {
41
- return isFinite(id);
42
- });
43
-
44
- terms = terms.filter(function (term) {
45
-
46
- switch(self.field.exclude_type) {
47
- case 'exclude':
48
- return _.indexOf(filter_ids, term.term_id) < 0;
49
-
50
- case 'include':
51
- return _.indexOf(filter_ids, term.term_id) >= 0;
52
-
53
- case 'child_of':
54
- return _.indexOf(filter_ids, parseInt(term.parent)) >= 0;
55
- }
56
- });
57
- }
58
-
59
- // order
60
- terms = _.sortBy(terms, function (term) {
61
- return term[self.field.orderby];
62
- });
63
-
64
- if ('DESC' === this.field.order) {
65
- terms = terms.reverse();
66
- }
67
-
68
- var parent_terms = terms.filter(function (term) {
69
- return !term.parent;
70
- });
71
-
72
- parent_terms.map(function (parent) {
73
- parent.children = self.get_child_terms(parent.term_id, terms);
74
- });
75
-
76
- return parent_terms.length ? parent_terms : terms;
77
- }
78
- },
79
-
80
- methods: {
81
- get_child_terms: function (parent_id, terms) {
82
- var self = this;
83
-
84
- var child_terms = terms.filter(function (term) {
85
- return parseInt(term.parent) === parseInt(parent_id);
86
- });
87
-
88
- child_terms.map(function (child) {
89
- child.children = self.get_child_terms(child.term_id, terms);
90
- });
91
-
92
- return child_terms;
93
- },
94
-
95
- get_term_dropdown_options: function () {
96
- var self = this,
97
- options = '';
98
-
99
- _.each(self.sorted_terms, function (term) {
100
- options += self.get_term_dropdown_options_children(term, 0);
101
- });
102
-
103
- return options;
104
- },
105
-
106
- get_term_dropdown_options_children: function (term, level) {
107
- var self = this,
108
- option = '';
109
-
110
- var indent = '',
111
- i = 0;
112
-
113
- for (i = 0; i < level; i++) {
114
- indent += '&nbsp;&nbsp;';
115
- }
116
-
117
- option += '<option value="' + term.id + '">' + indent + term.name + '</option>';
118
-
119
- if (term.children.length) {
120
- _.each(term.children, function (child_term) {
121
- option += self.get_term_dropdown_options_children(child_term, (level + 1));
122
- });
123
- }
124
-
125
- return option;
126
- },
127
-
128
- get_term_checklist: function () {
129
- var self = this,
130
- checklist = '';
131
-
132
-
133
- checklist += '<ul class="wpuf-category-checklist">';
134
-
135
- _.each(this.sorted_terms, function (term) {
136
- checklist += self.get_term_checklist_li(term);
137
- });
138
-
139
- checklist += '</ul>';
140
-
141
- return checklist;
142
- },
143
-
144
- get_term_checklist_li: function (term) {
145
- var self = this,
146
- li = '';
147
-
148
- li += '<li><label class="selectit"><input type="checkbox"> ' + term.name + '</label></li>';
149
-
150
- if (term.children.length) {
151
- li += '<ul class="children">';
152
-
153
- _.each(term.children, function (child_term) {
154
- li += self.get_term_checklist_li(child_term);
155
- });
156
-
157
- li += '</ul>';
158
- }
159
-
160
- return li;
161
- }
162
- }
163
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-taxonomy/template.php DELETED
@@ -1,41 +0,0 @@
1
- <div class="wpuf-fields">
2
- <select
3
- v-if="'select' === field.type"
4
- :class="field.name"
5
- v-html="get_term_dropdown_options()"
6
- >
7
- </select>
8
-
9
- <div v-if="'ajax' === field.type" class="category-wrap">
10
- <div>
11
- <select>
12
- <option><?php _e( '— Select —', 'wpuf' ); ?></option>
13
- <option v-for="term in sorted_terms" :value="term.id">{{ term.name }}</option>
14
- </select>
15
- </div>
16
- </div>
17
-
18
- <div v-if="'multiselect' === field.type" class="category-wrap">
19
- <select
20
- :class="field.name"
21
- v-html="get_term_dropdown_options()"
22
- multiple
23
- >
24
- </select>
25
- </div>
26
-
27
- <div v-if="'checkbox' === field.type" class="category-wrap">
28
- <div v-html="get_term_checklist()"></div>
29
- </div>
30
-
31
- <input
32
- v-if="'text' === field.type"
33
- class="textfield"
34
- type="text"
35
- value=""
36
- size="40"
37
- autocomplete="off"
38
- >
39
-
40
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
41
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-text_field/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Text
3
- */
4
- Vue.component('form-text_field', {
5
- template: '#tmpl-wpuf-form-text_field',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-text_field/template.php DELETED
@@ -1,10 +0,0 @@
1
- <div class="wpuf-fields">
2
- <input
3
- type="text"
4
- :class="class_names('textfield')"
5
- :placeholder="field.placeholder"
6
- :value="field.default"
7
- :size="field.size"
8
- >
9
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
10
- </div>
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-textarea_field/index.js DELETED
@@ -1,7 +0,0 @@
1
- Vue.component('form-textarea_field', {
2
- template: '#tmpl-wpuf-form-textarea_field',
3
-
4
- mixins: [
5
- wpuf_mixins.form_field_mixin
6
- ]
7
- });
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-textarea_field/template.php DELETED
@@ -1,13 +0,0 @@
1
- <div class="wpuf-fields">
2
- <textarea
3
- v-if="'no' === field.rich"
4
- :class="class_names('textareafield')"
5
- :placeholder="field.placeholder"
6
- :rows="field.rows"
7
- :cols="field.cols"
8
- >{{ field.default }}</textarea>
9
-
10
- <text-editor v-if="'no' !== field.rich" :rich="field.rich"></text-editor>
11
-
12
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
13
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-website_url/index.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Field template: Website URL
3
- */
4
- Vue.component('form-website_url', {
5
- template: '#tmpl-wpuf-form-website_url',
6
-
7
- mixins: [
8
- wpuf_mixins.form_field_mixin
9
- ]
10
- });
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/form-website_url/template.php DELETED
@@ -1,10 +0,0 @@
1
- <div class="wpuf-fields">
2
- <input
3
- type="url"
4
- :class="class_names('url')"
5
- :placeholder="field.placeholder"
6
- :value="field.default"
7
- :size="field.size"
8
- >
9
- <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
10
- </div>
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/help-text/index.js DELETED
@@ -1,14 +0,0 @@
1
- Vue.component('help-text', {
2
- template: '#tmpl-wpuf-help-text',
3
-
4
- props: {
5
- text: {
6
- type: String,
7
- default: ''
8
- }
9
- },
10
-
11
- mounted: function () {
12
- $(".wpuf-tooltip").tooltip();
13
- }
14
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/help-text/template.php DELETED
@@ -1 +0,0 @@
1
- <i class="fa fa-question-circle field-helper-text wpuf-tooltip" data-placement="top" :title="text"></i>
 
admin/form-builder/assets/js/components/text-editor/editor.less DELETED
@@ -1,63 +0,0 @@
1
- * {
2
- box-sizing: border-box;
3
- }
4
-
5
- body {
6
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
7
- font-size: 14px;
8
- line-height: 1.42857143;
9
- color: #333;
10
- background-color: #fff;
11
- -ms-word-wrap: break-word;
12
- word-wrap: break-word;
13
-
14
- &[contenteditable="false"] {
15
- opacity: .4;
16
- pointer-events: none;
17
- cursor: not-allowed;
18
- }
19
- }
20
-
21
-
22
- // TYPOGRAPHY
23
- h1, h2, h3, h4, h5, h6 {
24
- font-family: inherit;
25
- font-weight: normal;
26
- line-height: 1.1;
27
- color: inherit;
28
- padding: 0;
29
- }
30
-
31
- h1, h2, h3 {
32
- margin: 0 0 10px;
33
- }
34
-
35
- h1 {
36
- font-size: 36px;
37
- }
38
-
39
- h2 {
40
- font-size: 30px;
41
- }
42
-
43
- h3 {
44
- font-size: 24px;
45
- }
46
-
47
- h4 {
48
- font-size: 18px;
49
- }
50
-
51
- h5 {
52
- font-size: 14px;
53
- }
54
-
55
- h6 {
56
- font-size: 12px;
57
- }
58
-
59
- p {
60
- margin: 0 0 10px;
61
- font-size: inherit;
62
- line-height: inherit;
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/text-editor/index.js DELETED
@@ -1,15 +0,0 @@
1
- Vue.component('text-editor', {
2
- template: '#tmpl-wpuf-text-editor',
3
-
4
- props: ['rich'],
5
-
6
- computed: {
7
- site_url: function () {
8
- return wpuf_form_builder.site_url;
9
- },
10
-
11
- is_full: function () {
12
- return 'yes' === this.rich;
13
- }
14
- }
15
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/text-editor/style.less DELETED
@@ -1,53 +0,0 @@
1
- .mce-toolbar {
2
- .mce-btn button {
3
- padding: 2px;
4
- }
5
-
6
- .mce-ico {
7
- font-size: 18px;
8
- }
9
- }
10
-
11
- div.wp-link-input {
12
- max-width: 130px;
13
-
14
- input {
15
- width: 100%;
16
- }
17
- }
18
-
19
- div.wp-link-preview {
20
- max-width: 130px;
21
- }
22
-
23
- .mce-i-shortcode {
24
- background-image: url(../images/shortcode.png) !important;
25
-
26
- & + .mce-caret {
27
- display: none;
28
- }
29
- }
30
-
31
- .mce-menu-item.mce-menu-section-title {
32
- cursor: default;
33
- border-top: 1px solid #ccc;
34
-
35
- &:first-child {
36
- border-top: none;
37
- }
38
-
39
- &:hover {
40
- background-color: none;
41
- }
42
-
43
- span {
44
- font-weight: bold;
45
- }
46
- }
47
-
48
- // reset color cross button
49
- .mce-grid-cell.mce-colorbtn-trans {
50
- div[title="No color"] {
51
- line-height: .5;
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/components/text-editor/template.php DELETED
@@ -1,70 +0,0 @@
1
- <div class="wpuf-text-editor">
2
-
3
- <div class="wp-core-ui wp-editor-wrap tmce-active">
4
- <link rel="stylesheet" :href="site_url + 'wp-includes/css/editor.css'" type="text/css" media="all">
5
- <link rel="stylesheet" :href="site_url + 'wp-includes/js/tinymce/skins/lightgray/skin.min.css'" type="text/css" media="all">
6
-
7
- <div class="wp-editor-container">
8
- <div class="mce-tinymce mce-container mce-panel" style="visibility: hidden; border-width: 1px;">
9
- <div class="mce-container-body mce-stack-layout">
10
- <div class="mce-toolbar-grp mce-container mce-panel mce-stack-layout-item">
11
- <div class="mce-container-body mce-stack-layout">
12
- <div class="mce-container mce-toolbar mce-stack-layout-item">
13
- <div class="mce-container-body mce-flow-layout">
14
- <div class="mce-container mce-flow-layout-item mce-btn-group">
15
- <div>
16
- <div v-if="is_full" class="mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox mce-btn-has-text"><button type="button"><span class="mce-txt">Paragraph</span> <i class="mce-caret"></i></button></div>
17
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-bold"></i></button></div>
18
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-italic"></i></button></div>
19
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-bullist"></i></button></div>
20
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-numlist"></i></button></div>
21
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-blockquote"></i></button></div>
22
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-alignleft"></i></button></div>
23
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-aligncenter"></i></button></div>
24
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-alignright"></i></button></div>
25
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-link"></i></button></div>
26
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-unlink"></i></button></div>
27
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-wp_more"></i></button></div>
28
- <div class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-fullscreen"></i></button></div>
29
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-wp_adv"></i></button></div>
30
- </div>
31
- </div>
32
- </div>
33
- </div>
34
- <div class="mce-container mce-toolbar mce-stack-layout-item">
35
- <div class="mce-container-body mce-flow-layout">
36
- <div class="mce-container mce-flow-layout-item mce-btn-group">
37
- <div>
38
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-strikethrough"></i></button></div>
39
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-hr"></i></button></div>
40
- <div v-if="is_full" class="mce-widget mce-btn mce-colorbutton"><button type="button"><i class="mce-ico mce-i-forecolor"></i><span class="mce-preview"></span></button><button type="button" class="mce-open"> <i class="mce-caret"></i></button></div>
41
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-pastetext"></i></button></div>
42
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-removeformat"></i></button></div>
43
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-charmap"></i></button></div>
44
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-outdent"></i></button></div>
45
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-indent"></i></button></div>
46
- <div class="mce-widget mce-btn mce-disabled"><button type="button"><i class="mce-ico mce-i-undo"></i></button></div>
47
- <div class="mce-widget mce-btn mce-disabled"><button type="button"><i class="mce-ico mce-i-redo"></i></button></div>
48
- <div v-if="is_full" class="mce-widget mce-btn"><button type="button"><i class="mce-ico mce-i-wp_help"></i></button></div>
49
- </div>
50
- </div>
51
- </div>
52
- </div>
53
- </div>
54
- </div>
55
- <div class="mce-edit-area mce-container mce-panel mce-stack-layout-item" style="border-width: 1px 0px 0px;">
56
- <div style="width: 100%; height: 150px; display: block;"></div><!-- iframe replacement div -->
57
- </div>
58
- <div class="mce-statusbar mce-container mce-panel mce-stack-layout-item" style="border-width: 1px 0px 0px;">
59
- <div class="mce-container-body mce-flow-layout">
60
- <div class="mce-path mce-flow-layout-item">
61
- <div class="mce-path-item" data-index="0" aria-level="0">p</div>
62
- </div>
63
- <div class="mce-flow-layout-item mce-resizehandle"><i class="mce-ico mce-i-resize"></i></div>
64
- </div>
65
- </div>
66
- </div>
67
- </div>
68
- </div>
69
- </div>
70
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/form-builder-assets.js DELETED
@@ -1,46 +0,0 @@
1
- /**
2
- * Returns file paths of vue assets
3
- */
4
-
5
- /* global module, require */
6
- function assets() {
7
- 'use strict';
8
-
9
- const grunt = require('grunt');
10
- const fs = require('fs');
11
- let paths = {
12
- mixins: ['admin/form-builder/assets/js/jquery-siaf-start.js'],
13
- components: ['admin/form-builder/assets/js/jquery-siaf-start.js']
14
- };
15
-
16
- // mixins
17
- const mixinsPath = './admin/form-builder/assets/js/mixins/';
18
- let mixins = fs.readdirSync(mixinsPath);
19
-
20
- mixins.forEach((mixin) => {
21
- const path = `${mixinsPath}${mixin}`;
22
-
23
- if (grunt.file.isFile(path)) {
24
- paths.mixins.push(path);
25
- }
26
- });
27
-
28
- // components
29
- const componentPath = './admin/form-builder/assets/js/components/';
30
- let components = fs.readdirSync(componentPath);
31
-
32
- components.forEach((component) => {
33
- const path = `${componentPath}${component}`;
34
-
35
- if (grunt.file.isDir(path)) {
36
- paths.components.push(path + '/index.js');
37
- }
38
- });
39
-
40
- paths.mixins.push('admin/form-builder/assets/js/jquery-siaf-end.js');
41
- paths.components.push('admin/form-builder/assets/js/jquery-siaf-end.js');
42
-
43
- return paths;
44
- }
45
-
46
- module.exports = assets();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/form-builder.js DELETED
@@ -1,427 +0,0 @@
1
- ;(function($) {
2
- 'use strict';
3
-
4
- /**
5
- * Only proceed if current page is a form builder page
6
- */
7
- if (!$('#wpuf-form-builder').length) {
8
- return;
9
- }
10
-
11
- if (!Array.prototype.hasOwnProperty('swap')) {
12
- Array.prototype.swap = function (from, to) {
13
- this.splice(to, 0, this.splice(from, 1)[0]);
14
- };
15
- }
16
-
17
- // check if an element is visible in browser viewport
18
- function is_element_in_viewport (el) {
19
- if (typeof jQuery === "function" && el instanceof jQuery) {
20
- el = el[0];
21
- }
22
-
23
- var rect = el.getBoundingClientRect();
24
-
25
- return (
26
- rect.top >= 0 &&
27
- rect.left >= 0 &&
28
- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
29
- rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
30
- );
31
- }
32
-
33
- /**
34
- * Vuex Store data
35
- */
36
- var wpuf_form_builder_store = new Vuex.Store({
37
- state: {
38
- post: wpuf_form_builder.post,
39
- form_fields: wpuf_form_builder.form_fields,
40
- panel_sections: wpuf_form_builder.panel_sections,
41
- field_settings: wpuf_form_builder.field_settings,
42
- current_panel: 'form-fields',
43
- editing_field_id: 0, // editing form field id
44
- },
45
-
46
- mutations: {
47
- set_form_fields: function (state, form_fields) {
48
- Vue.set(state, 'form_fields', form_fields);
49
- },
50
-
51
- // set the current panel
52
- set_current_panel: function (state, panel) {
53
- if ('field-options' !== state.current_panel &&
54
- 'field-options' === panel &&
55
- state.form_fields.length
56
- ) {
57
- state.editing_field_id = state.form_fields[0].id;
58
- }
59
-
60
- state.current_panel = panel;
61
-
62
- // reset editing field id
63
- if ('form-fields' === panel) {
64
- state.editing_field_id = 0;
65
- }
66
- },
67
-
68
- // add show property to every panel section
69
- panel_add_show_prop: function (state) {
70
- state.panel_sections.map(function (section, index) {
71
- if (!section.hasOwnProperty('show')) {
72
- Vue.set(state.panel_sections[index], 'show', true);
73
- }
74
- });
75
- },
76
-
77
- // toggle panel sections
78
- panel_toggle: function (state, index) {
79
- state.panel_sections[index].show = !state.panel_sections[index].show;
80
- },
81
-
82
- // open field settings panel
83
- open_field_settings: function (state, field_id) {
84
- var field = state.form_fields.filter(function(item) {
85
- return parseInt(field_id) === parseInt(item.id);
86
- });
87
-
88
- if ('field-options' === state.current_panel && field[0].id === state.editing_field_id) {
89
- return;
90
- }
91
-
92
- if (field.length) {
93
- state.editing_field_id = 0;
94
- state.current_panel = 'field-options';
95
-
96
- setTimeout(function () {
97
- state.editing_field_id = field[0].id;
98
- }, 400);
99
- }
100
- },
101
-
102
- update_editing_form_field: function (state, payload) {
103
- var editing_field = _.find(state.form_fields, function (item) {
104
- return parseInt(item.id) === parseInt(payload.editing_field_id);
105
- });
106
-
107
- editing_field[payload.field_name] = payload.value;
108
- },
109
-
110
- // add new form field element
111
- add_form_field_element: function (state, payload) {
112
- state.form_fields.splice(payload.toIndex, 0, payload.field);
113
-
114
- // bring newly added element into viewport
115
- Vue.nextTick(function () {
116
- var el = $('#form-preview-stage .wpuf-form .field-items').eq(payload.toIndex);
117
-
118
- if (el && !is_element_in_viewport(el.get(0))) {
119
- $('#builder-stage section').scrollTo(el, 800, {offset: -50});
120
- }
121
- });
122
- },
123
-
124
- // sorting inside stage
125
- swap_form_field_elements: function (state, payload) {
126
- state.form_fields.swap(payload.fromIndex, payload.toIndex);
127
- },
128
-
129
- clone_form_field_element: function (state, payload) {
130
- var field = _.find(state.form_fields, function (item) {
131
- return parseInt(item.id) === parseInt(payload.field_id);
132
- });
133
-
134
- var clone = $.extend(true, {}, field),
135
- index = parseInt(payload.index) + 1;
136
-
137
- clone.id = payload.new_id;
138
- clone.name = clone.name + '_copy';
139
-
140
- state.form_fields.splice(index, 0, clone);
141
- },
142
-
143
- // delete a field
144
- delete_form_field_element: function (state, index) {
145
- state.current_panel = 'form-fields';
146
- state.form_fields.splice(index, 1);
147
- },
148
-
149
- // set fields for a panel section
150
- set_panel_section_fields: function (state, payload) {
151
- var section = _.find(state.panel_sections, function (item) {
152
- return item.id === payload.id;
153
- });
154
-
155
- section.fields = payload.fields;
156
- }
157
- }
158
- });
159
-
160
- /**
161
- * The main form builder vue instance
162
- */
163
- new Vue({
164
- el: '#wpuf-form-builder',
165
-
166
- mixins: wpuf_form_builder_mixins(wpuf_mixins.root),
167
-
168
- store: wpuf_form_builder_store,
169
-
170
- data: {
171
- is_form_saving: false,
172
- is_form_saved: false,
173
- is_form_switcher: false,
174
- post_title_editing: false,
175
- },
176
-
177
- computed: {
178
- current_panel: function () {
179
- return this.$store.state.current_panel;
180
- },
181
-
182
- post: function () {
183
- return this.$store.state.post;
184
- },
185
-
186
- form_fields_count: function () {
187
- return this.$store.state.form_fields.length;
188
- },
189
-
190
- form_fields: function () {
191
- return this.$store.state.form_fields;
192
- }
193
- },
194
-
195
- created: function () {
196
- this.$store.commit('panel_add_show_prop');
197
-
198
- /**
199
- * This is the event hub we'll use in every
200
- * component to communicate between them
201
- */
202
- wpuf_form_builder.event_hub = new Vue();
203
- },
204
-
205
- mounted: function () {
206
- // primary nav tabs and their contents
207
- this.bind_tab_on_click($('#wpuf-form-builder > fieldset > .nav-tab-wrapper > a'), '#wpuf-form-builder');
208
-
209
- // secondary settings tabs and their contents
210
- var settings_tabs = $('#wpuf-form-builder-settings .nav-tab'),
211
- settings_tab_contents = $('#wpuf-form-builder-settings .tab-contents .group');
212
-
213
- settings_tabs.first().addClass('nav-tab-active');
214
- settings_tab_contents.first().addClass('active');
215
-
216
- this.bind_tab_on_click(settings_tabs, '#wpuf-form-builder-settings');
217
-
218
- var clipboard = new window.Clipboard('.form-id');
219
- $(".form-id").tooltip();
220
-
221
- var self = this;
222
-
223
- clipboard.on('success', function(e) {
224
- // Show copied tooltip
225
- $(e.trigger)
226
- .attr('data-original-title', 'Copied!')
227
- .tooltip('show');
228
-
229
- // Reset the copied tooltip
230
- setTimeout(function() {
231
- $(e.trigger).tooltip('hide')
232
- .attr('data-original-title', self.i18n.copy_shortcode);
233
- }, 1000);
234
-
235
- e.clearSelection();
236
- });
237
-
238
- window.onbeforeunload = function () {
239
- if (!self.is_form_saved) {
240
- return self.i18n.unsaved_changes;
241
- }
242
- };
243
- },
244
-
245
- methods: {
246
- // tabs and their contents
247
- bind_tab_on_click: function (tabs, scope) {
248
- tabs.on('click', function (e) {
249
- e.preventDefault();
250
-
251
- var button = $(this),
252
- tab_contents = $(scope + ' > fieldset > .tab-contents'),
253
- group_id = button.attr('href');
254
-
255
- button.addClass('nav-tab-active').siblings('.nav-tab-active').removeClass('nav-tab-active');
256
-
257
- tab_contents.children().removeClass('active');
258
- $(group_id).addClass('active');
259
- });
260
- },
261
-
262
- // switch form
263
- switch_form: function () {
264
- this.is_form_switcher = (this.is_form_switcher) ? false : true;
265
- },
266
-
267
- // set current sidebar panel
268
- set_current_panel: function (panel) {
269
- this.$store.commit('set_current_panel', panel);
270
- },
271
-
272
- // save form builder data
273
- save_form_builder: function () {
274
- var self = this;
275
-
276
- if (_.isFunction(this.validate_form_before_submit) && !this.validate_form_before_submit()) {
277
-
278
- this.warn({
279
- text: this.validation_error_msg
280
- });
281
-
282
- return;
283
- }
284
-
285
- self.is_form_saving = true;
286
- self.set_current_panel('form-fields');
287
-
288
- wp.ajax.send('wpuf_form_builder_save_form', {
289
- data: {
290
- form_data: $('#wpuf-form-builder').serialize(),
291
- form_fields: JSON.stringify(self.form_fields)
292
- },
293
-
294
- success: function (response) {
295
- if (response.form_fields) {
296
- self.$store.commit('set_form_fields', response.form_fields);
297
- }
298
-
299
- self.is_form_saving = false;
300
- self.is_form_saved = true;
301
-
302
- toastr.success(self.i18n.saved_form_data);
303
- },
304
-
305
- error: function () {
306
- self.is_form_saving = false;
307
- }
308
- });
309
- }
310
- }
311
- });
312
-
313
- var SettingsTab = {
314
- init: function() {
315
- $(function() {
316
- $('.wpuf-ms-color').wpColorPicker();
317
- });
318
-
319
- $('#wpuf-metabox-settings').on('change', 'select[name="wpuf_settings[redirect_to]"]', this.settingsRedirect);
320
- $('#wpuf-metabox-settings-update').on('change', 'select[name="wpuf_settings[edit_redirect_to]"]', this.settingsRedirect);
321
- $('select[name="wpuf_settings[redirect_to]"]').change();
322
- $('select[name="wpuf_settings[edit_redirect_to]"]').change();
323
-
324
- // Form settings: Guest post
325
- $('#wpuf-metabox-settings').on('change', 'input[type=checkbox][name="wpuf_settings[guest_post]"]', this.settingsGuest);
326
- $('input[type=checkbox][name="wpuf_settings[guest_post]"]').trigger('change');
327
-
328
- // From settings: User details
329
- $('#wpuf-metabox-settings').on('change', 'input[type=checkbox][name="wpuf_settings[guest_details]"]', this.settingsGuestDetails);
330
-
331
- this.changeMultistepVisibility($('.wpuf_enable_multistep_section :input[type="checkbox"]'));
332
- var self = this;
333
- $('.wpuf_enable_multistep_section :input[type="checkbox"]').click(function() {
334
- self.changeMultistepVisibility($(this));
335
- });
336
- },
337
-
338
- settingsGuest: function (e) {
339
- e.preventDefault();
340
-
341
- var table = $(this).closest('table');
342
-
343
- if ( $(this).is(':checked') ) {
344
- table.find('tr.show-if-guest').show();
345
- table.find('tr.show-if-not-guest').hide();
346
-
347
- $('input[type=checkbox][name="wpuf_settings[guest_details]"]').trigger('change');
348
-
349
- } else {
350
- table.find('tr.show-if-guest').hide();
351
- table.find('tr.show-if-not-guest').show();
352
- }
353
- },
354
-
355
- settingsGuestDetails: function (e) {
356
- e.preventDefault();
357
-
358
- var table = $(this).closest('table');
359
-
360
- if ( $(this).is(':checked') ) {
361
- table.find('tr.show-if-details').show();
362
- } else {
363
- table.find('tr.show-if-details').hide();
364
- }
365
- },
366
-
367
- settingsRedirect: function(e) {
368
- e.preventDefault();
369
-
370
- var $self = $(this),
371
- $table = $self.closest('table'),
372
- value = $self.val();
373
-
374
- switch( value ) {
375
- case 'post':
376
- $table.find('tr.wpuf-page-id, tr.wpuf-url, tr.wpuf-same-page').hide();
377
- break;
378
-
379
- case 'page':
380
- $table.find('tr.wpuf-page-id').show();
381
- $table.find('tr.wpuf-same-page').hide();
382
- $table.find('tr.wpuf-url').hide();
383
- break;
384
-
385
- case 'url':
386
- $table.find('tr.wpuf-page-id').hide();
387
- $table.find('tr.wpuf-same-page').hide();
388
- $table.find('tr.wpuf-url').show();
389
- break;
390
-
391
- case 'same':
392
- $table.find('tr.wpuf-page-id').hide();
393
- $table.find('tr.wpuf-url').hide();
394
- $table.find('tr.wpuf-same-page').show();
395
- break;
396
- }
397
- },
398
-
399
- changeMultistepVisibility: function(target) {
400
- if (target.is(':checked')) {
401
- $('.wpuf_multistep_content').show();
402
- } else {
403
- $('.wpuf_multistep_content').hide();
404
- }
405
- }
406
- };
407
-
408
- // on DOM ready
409
- $(function() {
410
- resizeBuilderContainer();
411
-
412
- $("#collapse-menu").click(function () {
413
- resizeBuilderContainer();
414
- });
415
-
416
- function resizeBuilderContainer() {
417
- if ($(document.body).hasClass('folded')) {
418
- $("#wpuf-form-builder").css("width", "calc(100% - 80px)");
419
- } else {
420
- $("#wpuf-form-builder").css("width", "calc(100% - 200px)");
421
- }
422
- }
423
-
424
- SettingsTab.init();
425
- });
426
-
427
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/jquery-siaf-end.js DELETED
@@ -1 +0,0 @@
1
- })(jQuery);
 
admin/form-builder/assets/js/jquery-siaf-start.js DELETED
@@ -1,2 +0,0 @@
1
- ;(function($) {
2
- 'use strict';
 
 
admin/form-builder/assets/js/mixins/form-field.js DELETED
@@ -1,53 +0,0 @@
1
- /**
2
- * Mixin for form fields like
3
- * form-text_field, form-field_textarea etc
4
- */
5
- wpuf_mixins.form_field_mixin = {
6
- props: {
7
- field: {
8
- type: Object,
9
- default: {}
10
- }
11
- },
12
-
13
- computed: {
14
- form_id: function () {
15
- return this.$store.state.post.ID;
16
- },
17
-
18
- has_options: function () {
19
- if (!this.field.hasOwnProperty('options')) {
20
- return false;
21
- }
22
-
23
- return !!Object.keys(this.field.options).length;
24
- }
25
- },
26
-
27
- methods: {
28
- class_names: function(type_class) {
29
- return [
30
- type_class,
31
- this.required_class(),
32
- 'wpuf_' + this.field.name + '_' + this.form_id
33
- ];
34
- },
35
-
36
- required_class: function () {
37
- return ('yes' === this.required) ? 'required' : '';
38
- },
39
-
40
- is_selected: function (label) {
41
- if (_.isArray(this.field.selected)) {
42
- if (_.indexOf(this.field.selected, label) >= 0) {
43
- return true;
44
- }
45
-
46
- } else if (label === this.field.selected) {
47
- return true;
48
- }
49
-
50
- return false;
51
- }
52
- }
53
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/mixins/global.js DELETED
@@ -1,67 +0,0 @@
1
- /**
2
- * Global mixin
3
- */
4
- Vue.mixin({
5
- computed: {
6
- i18n: function () {
7
- return wpuf_form_builder.i18n;
8
- }
9
- },
10
-
11
- methods: {
12
- get_random_id: function() {
13
- var min = 999999,
14
- max = 9999999999;
15
-
16
- return Math.floor(Math.random() * (max - min + 1)) + min;
17
- },
18
-
19
- warn: function (settings, callback) {
20
- settings = $.extend(true, {
21
- title: '',
22
- text: '',
23
- type: 'warning',
24
- showCancelButton: true,
25
- confirmButtonColor: '#d54e21',
26
- confirmButtonText: this.i18n.ok,
27
- cancelButtonText: this.i18n.cancel,
28
- }, settings);
29
-
30
- swal(settings, callback);
31
- },
32
-
33
- is_failed_to_validate: function (template) {
34
- var validator = this.field_settings[template] ? this.field_settings[template].validator : false;
35
-
36
- if (validator && validator.callback && !this[validator.callback]()) {
37
- return true;
38
- }
39
-
40
- return false;
41
- },
42
-
43
- containsField: function(field_name) {
44
- var i = 0;
45
-
46
- for (i = 0; i < this.$store.state.form_fields.length; i++) {
47
- if (this.$store.state.form_fields[i].name === field_name) {
48
- return true;
49
- }
50
- }
51
-
52
- return false;
53
- },
54
-
55
- isSingleInstance: function(field_name) {
56
- var singleInstance = ['post_title', 'post_content', 'post_excerpt', 'featured_image',
57
- 'user_login', 'first_name', 'last_name', 'nickname', 'user_email', 'user_url',
58
- 'user_bio', 'password', 'user_avatar'];
59
-
60
- if ( $.inArray(field_name, singleInstance) >= 0 ) {
61
- return true;
62
- }
63
-
64
- return false;
65
- }
66
- }
67
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/js/mixins/option-field.js DELETED
@@ -1,57 +0,0 @@
1
- /**
2
- * Mixin for option fields like
3
- * field-text, field-text-meta, field-radio etc
4
- */
5
- wpuf_mixins.option_field_mixin = {
6
- props: {
7
- option_field: {
8
- type: Object,
9
- default: {}
10
- },
11
-
12
- editing_form_field: {
13
- type: Object,
14
- default: {}
15
- }
16
- },
17
-
18
- computed: {
19
- // show/hide on basis of depenedent settings
20
- met_dependencies: function () {
21
- // no 'dependencies' key
22
- if (!this.option_field.hasOwnProperty('dependencies')) {
23
- return true;
24
- }
25
-
26
- var deps = Object.keys(this.option_field.dependencies),
27
- i = 0;
28
-
29
- // has 'dependencies' key, but no property is set
30
- if (!deps.length) {
31
- return true;
32
- }
33
-
34
- // check if dependencies met
35
- for (i = 0; i < deps.length; i++) {
36
- var required_dep_value = this.option_field.dependencies[ deps[i] ],
37
- editing_field_value = this.editing_form_field[ deps[i] ];
38
-
39
- if (required_dep_value !== editing_field_value) {
40
- return false;
41
- }
42
- }
43
-
44
- return true;
45
- }
46
- },
47
-
48
- methods: {
49
- update_value: function(property, value) {
50
- this.$store.commit('update_editing_form_field', {
51
- editing_field_id: this.editing_form_field.id,
52
- field_name: property,
53
- value: value
54
- });
55
- },
56
- }
57
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/form-builder.less DELETED
@@ -1,947 +0,0 @@
1
- // Variables
2
- // --------------------------------------------------
3
- @import "variables.less";
4
-
5
- // Mixins
6
- // --------------------------------------------------
7
- @import "mixins/hide-text.less";
8
- @import "mixins/opacity.less";
9
- @import "mixins/size.less";
10
- @import "mixins/reset-text.less";
11
- @import "mixins/text-overflow.less";
12
- @import "mixins/vendor-prefixes.less";
13
- @import "mixins/clearfix.less";
14
- @import "mixins/center-block.less";
15
- @import "mixins/custom-mixins.less";
16
-
17
-
18
- // Hide initial vue instance template
19
- // --------------------------------------------------
20
- [v-cloak] {
21
- display: none;
22
- }
23
-
24
- // Style pro alerts
25
- // --------------------------------------------------
26
- .wpuf-pro-text-alert {
27
- font-style: italic;
28
- color: @borderColor;
29
-
30
- a {
31
- text-decoration: none;
32
- color: #aaa;
33
- }
34
- }
35
-
36
- #wpuf-pro-content {
37
- opacity: 0.7;
38
- }
39
-
40
- // Utilities
41
- // --------------------------------------------------
42
- .clearfix {
43
- .clearfix();
44
- }
45
-
46
- .pull-left {
47
- float: left !important;
48
- }
49
-
50
- .pull-right {
51
- float: right !important;
52
- }
53
-
54
- .text-center {
55
- text-align: center;
56
- }
57
-
58
- .text-right {
59
- text-align: right;
60
- }
61
-
62
- .margin-0 {
63
- margin: 0;
64
- }
65
-
66
- .margin-bottom-10 {
67
- margin-bottom: 10px;
68
- }
69
-
70
- .list-inline {
71
- padding-left: 0;
72
- list-style: none;
73
- margin-left: -5px;
74
-
75
- & > li {
76
- display: inline-block;
77
- padding-left: 5px;
78
- padding-right: 5px;
79
- }
80
- }
81
-
82
- .disabled {
83
- pointer-events: none;
84
- cursor: not-allowed;
85
- opacity: 0.7;
86
- }
87
-
88
- .label-hr {
89
- border-bottom: 1px solid #ccc;
90
- display: block;
91
- padding-bottom: 8px;
92
- }
93
-
94
- // Vue Transition effects
95
- // --------------------------------------------------
96
- .slide-fade-enter-active {
97
- .transition(all .6s);
98
- overflow: hidden;
99
- }
100
-
101
- .slide-fade-leave-active {
102
- .transition(all .4s);
103
- overflow: hidden;
104
- }
105
-
106
- .slide-fade-enter,
107
- .slide-fade-leave-active {
108
- opacity: .3 !important;
109
- max-height: 0 !important;
110
- margin: 0 !important;
111
- }
112
-
113
- // Sweet Alert
114
- // --------------------------------------------------
115
- .sweet-alert {
116
- border-radius: 0;
117
-
118
- h2 {
119
- font-size: 26px;
120
- line-height: 1.6;
121
- }
122
-
123
- p {
124
- font-size: 15px;
125
- font-weight: 400;
126
- color: #656565;
127
- line-height: 1.7;
128
-
129
- a {
130
- text-decoration: none;
131
- }
132
- }
133
-
134
- button {
135
- border-radius: 3px;
136
- padding: 10px 20px;
137
- min-width: 100px;
138
- }
139
- }
140
-
141
- // CSS3 loader animation
142
- // --------------------------------------------------
143
- .loader,
144
- .loader:after {
145
- border-radius: 50%;
146
- width: 25px;
147
- height: 25px;
148
- }
149
-
150
- .loader {
151
- display: inline-block;
152
- position: relative;
153
- text-indent: -9999em;
154
- border-top: 3px solid fade(@wpBlue, 20%);
155
- border-right: 3px solid fade(@wpBlue, 20%);
156
- border-bottom: 3px solid fade(@wpBlue, 20%);
157
- border-left: 3px solid @wpBlue;
158
- -webkit-transform: translateZ(0);
159
- -ms-transform: translateZ(0);
160
- transform: translateZ(0);
161
- -webkit-animation: wpuf_form_builder_loader 1.1s infinite linear;
162
- animation: wpuf_form_builder_loader 1.1s infinite linear;
163
- }
164
-
165
- .button.button-ajax-working {
166
-
167
- .loader {
168
- display: inline-block;
169
- width: 17px;
170
- height: 17px;
171
- top: 4px;
172
- margin-right: 3px;
173
- border-top: 1px solid rgb(102, 198, 228);
174
- border-right: 1px solid rgb(102, 198, 228);
175
- border-bottom: 1px solid rgb(102, 198, 228);
176
- border-left: 1px solid rgba(102, 198, 228, 0);
177
- }
178
- }
179
-
180
- @-webkit-keyframes wpuf_form_builder_loader {
181
- 0% {
182
- -webkit-transform: rotate(0deg);
183
- transform: rotate(0deg);
184
- }
185
- 100% {
186
- -webkit-transform: rotate(360deg);
187
- transform: rotate(360deg);
188
- }
189
- }
190
-
191
- @keyframes wpuf_form_builder_loader {
192
- 0% {
193
- -webkit-transform: rotate(0deg);
194
- transform: rotate(0deg);
195
- }
196
- 100% {
197
- -webkit-transform: rotate(360deg);
198
- transform: rotate(360deg);
199
- }
200
- }
201
-
202
- // toastr - notification
203
- // --------------------------------------------------
204
- #toast-container {
205
-
206
- &.toast-top-right {
207
- top: 40px;
208
- right: 18px;
209
- }
210
-
211
- & > div {
212
- opacity: 1;
213
- }
214
-
215
- & > :hover {
216
- opacity: .9;
217
- }
218
- }
219
-
220
- // Flex button group
221
- // --------------------------------------------------
222
- .wp-core-ui .button-group.wpuf-flex-button-group {
223
- position: relative;
224
- z-index: 1;
225
- display: flex;
226
- flex-flow: row nowrap;
227
- justify-content: flex-start;
228
- align-content: center;
229
- align-items: center;
230
-
231
- .button {
232
- flex-grow: 1;
233
- flex-shrink: 1;
234
- flex-basis: 0;
235
- align-self: auto;
236
- text-align: center;
237
- }
238
- }
239
-
240
- // Selectize
241
- // --------------------------------------------------
242
- .selectize-input {
243
- padding: 6px 5px;
244
- border: 1px solid #ddd;
245
- }
246
-
247
- .selectize-dropdown .active {
248
- background-color: @wpBlue;
249
- color: #fff;
250
- }
251
-
252
- .selectize-element-group {
253
- display: none;
254
-
255
- & + .selectize-control {
256
- display: none;
257
- }
258
-
259
- &.active + .selectize-control {
260
- display: block;
261
- margin-top: 10px;
262
- }
263
- }
264
-
265
- .selectize-control {
266
-
267
- &.multi {
268
-
269
- .selectize-input {
270
-
271
- [data-value] {
272
- text-shadow: 0 1px 0 rgba(0,51,83,0.3);
273
- -webkit-border-radius: 3px;
274
- -moz-border-radius: 3px;
275
- border-radius: 3px;
276
- .vertical-gradient(fade(@wpBlue, 40%), @wpBlue);
277
- .box-shadow(~"0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03)");
278
-
279
- &.active {
280
- .vertical-gradient(fade(@wpBlue, 40%), @wpBlue);
281
- }
282
- }
283
- }
284
- }
285
- }
286
-
287
-
288
- // Form Builder
289
- // --------------------------------------------------
290
- #wpuf-form-builder {
291
- width: ~"calc(100% - 200px)";
292
- padding-top: 10px;
293
- position: fixed;
294
- top: 25px;
295
-
296
- & * {
297
- box-sizing: border-box;
298
- }
299
-
300
- & > fieldset {
301
- & > .nav-tab-wrapper {
302
-
303
- .nav-tab:focus {
304
- outline: 0;
305
- .box-shadow(none);
306
- }
307
-
308
- .button {
309
- font-weight: 400;
310
- }
311
- }
312
-
313
- & > .tab-contents {
314
- .border(bottom);
315
-
316
- & > .group {
317
- display: none;
318
-
319
- &.active {
320
- display: block;
321
- }
322
-
323
- &:not(#wpuf-form-builder-container):not(#wpuf-form-builder-settings) {
324
- height: ~"calc(100vh - 125px)";
325
- overflow-y: auto;
326
- padding-top: 15px;
327
- }
328
- }
329
- }
330
- }
331
-
332
-
333
- .wpuf-settings-nav-tab-wrapper {
334
- width: 200px;
335
- }
336
-
337
- .wp-picker-holder * {
338
- box-sizing: content-box;
339
- }
340
- }
341
-
342
- #wpuf-form-builder-settings {
343
- position: relative;
344
- margin-top: 15px;
345
-
346
- .nav-tab-wrapper {
347
- position: absolute;
348
- top: 0;
349
- left: 0;
350
- width: 170px;
351
- border-bottom: 0;
352
-
353
- a {
354
- width: ~"calc(100% - -1px)";
355
- margin-left: 0;
356
- margin-bottom: .5em;
357
- .border(right);
358
- .border(bottom);
359
- font-weight: 400;
360
- font-size: 13px;
361
-
362
- &.nav-tab-active {
363
- border-right-color: @htmlBG;
364
- }
365
-
366
- &:focus {
367
- outline: 0;
368
- .box-shadow(none);
369
- }
370
- }
371
- }
372
-
373
- .tab-contents {
374
- margin-left: 170px;
375
- .border(left);
376
- padding-left: 20px;
377
-
378
- & > .group {
379
- display: none;
380
- height: ~"calc(100vh - 140px)";
381
- overflow-y: auto;
382
-
383
- &.active {
384
- display: block;
385
- }
386
- }
387
-
388
- .form-table {
389
- margin-top: 0;
390
- }
391
- }
392
- }
393
-
394
- #wpuf-form-builder-container {
395
- position: relative;
396
-
397
- header {
398
- height: 45px;
399
- .border(right);
400
-
401
- .form-title {
402
- cursor: pointer;
403
- font-size: 1.3em;
404
- font-weight: 600;
405
- float: left;
406
- margin-right: 10px;
407
- margin-top: 10px;
408
- line-height: 1.5;
409
- max-width: 300px;
410
- white-space: nowrap;
411
- overflow: hidden;
412
- text-overflow: ellipsis;
413
-
414
- &:hover {
415
- background-color: rgba(85, 85, 85, 0.2);
416
- }
417
- }
418
-
419
- .form-switcher-arrow {
420
- cursor: pointer;
421
- font-size: 24px;
422
- margin-top: 10px;
423
- line-height: 1;
424
- width: 20px;
425
- text-align: center;
426
-
427
- &:hover {
428
- background-color: rgba(85, 85, 85, 0.2);
429
- }
430
- }
431
-
432
- .form-id {
433
- color: #fff;
434
- background-color: #008ec2;
435
- line-height: 170%;
436
- padding: 0 8px;
437
- border-radius: 2px;
438
- font-size: 13px;
439
- display: inline-block;
440
- margin: 10px 0 0 15px;
441
- cursor: pointer;
442
- }
443
- }
444
-
445
- section {
446
- height: ~"calc(100vh - 170px)";
447
- overflow-y: auto;
448
- }
449
-
450
- #builder-form-fields {
451
- position: absolute;
452
- top: 0;
453
- right: 0;
454
- width: 360px;
455
-
456
- header {
457
- ul {
458
- margin: 0;
459
-
460
- li {
461
- width: 50%;
462
- text-align: center;
463
- float: left;
464
- line-height: 1;
465
- margin: 0;
466
-
467
- a {
468
- text-decoration: none;
469
- line-height: 44px;
470
- display: block;
471
- background-color: #e5e5e5;
472
- color: #777;
473
- .border(bottom);
474
- .transition(background-color .4s);
475
-
476
- &:hover {
477
- background-color: lighten(#e5e5e5, 5%);
478
- }
479
-
480
- &:focus {
481
- outline: 0;
482
- .box-shadow(none);
483
- }
484
- }
485
-
486
- &.active a {
487
- background-color: #fff;
488
- color: #444;
489
- .border(bottom, 1px, #fff);
490
- }
491
-
492
- &:first-child {
493
- .border(right);
494
- }
495
- }
496
- }
497
- }
498
-
499
- section {
500
- background-color: #fff;
501
- .border(right);
502
-
503
- .wpuf-form-builder-panel {
504
- padding: 10px;
505
- }
506
- }
507
- }
508
-
509
- #builder-stage {
510
- margin-right: 360px;
511
-
512
- section {
513
- background-color: #6b6b6b;
514
- padding: 30px;
515
-
516
- #form-preview {
517
- background-color: #fff;
518
- .box-shadow(0 0 10px rgba(0, 0, 0, 0.3));
519
- padding: 25px;
520
- max-width: 800px;
521
- margin: 0 auto;
522
- }
523
- }
524
- }
525
- }
526
-
527
- // Builder Stage
528
- // --------------------------------------------------
529
- #form-preview-stage {
530
-
531
- .field-items {
532
- position: relative;
533
- background-color: #fff;
534
-
535
- .control-buttons {
536
- position: absolute;
537
- top: 0;
538
- left: 0;
539
- z-index: 10;
540
- display: none;
541
- width: 100%;
542
- height: 100%;
543
- margin: 0;
544
- text-align: center;
545
- background: fade(@wpYellow, 8%);
546
- border: 1px dashed @wpYellow;
547
-
548
- p {
549
- position: absolute;
550
- top: 50%;
551
- left: 50%;
552
- margin: -14px 0 0 -61px;
553
- line-height: 1;
554
- color: #eee;
555
- background-color: @wpBlack;
556
- }
557
-
558
- i {
559
- cursor: pointer;
560
- padding: 8px;
561
-
562
- &.move {
563
- cursor: move;
564
- }
565
- }
566
-
567
- i:hover {
568
- background-color: @wpBlue;
569
- }
570
- }
571
-
572
- &:hover .control-buttons {
573
- display: block;
574
- }
575
-
576
- &.current-editing {
577
- background-color: fade(@wpYellow, 15%);
578
-
579
- &.ui-sortable-helper {
580
- background-color: #fff;
581
- }
582
- }
583
-
584
- &.ui-sortable-helper {
585
- .box-shadow(0 0 10px rgba(0, 0, 0, 0.3));
586
- }
587
- }
588
-
589
- .form-preview-stage-dropzone {
590
- background-color: fade(@wpYellow, 30%) !important;
591
- border: 1px solid @wpYellow;
592
- height: 50px;
593
- }
594
-
595
- .wpuf-submit + .button + .form-preview-stage-dropzone,
596
- .field-items.empty-list-item + .form-preview-stage-dropzone {
597
- display: none;
598
- }
599
-
600
- .field-items.empty-list-item {
601
- padding: 24px;
602
- margin: 0;
603
- border: 1px dashed fade(@wpBlack, 50%);
604
- }
605
-
606
- .form-preview-stage-dropzone + .field-items.empty-list-item {
607
- display: none;
608
- }
609
-
610
- .hidden-field-list {
611
- border-top: 1px dashed @borderColor;
612
-
613
- h4 {
614
- font-weight: 400;
615
- font-size: 16px;
616
- margin: 12px 0;
617
- }
618
-
619
- ul {
620
-
621
- li {
622
- background-color: @htmlBG;
623
- }
624
- }
625
- }
626
- }
627
-
628
- // Panel: Form Fields
629
- // --------------------------------------------------
630
- .panel-form-field-group {
631
- margin-bottom: 15px;
632
-
633
- h3 {
634
- margin: 0;
635
- font-size: 15px;
636
- border-bottom: 1px solid #eee;
637
- padding-bottom: 10px;
638
- cursor: pointer;
639
-
640
- i {
641
- float: right;
642
- }
643
- }
644
-
645
- .panel-form-field-buttons {
646
- opacity: 1;
647
- max-height: 100vh;
648
- overflow: hidden;
649
- margin: 15px 0 0;
650
- }
651
-
652
- .button {
653
- display: block;
654
- width: 48%;
655
- margin: 0 0 10px 0;
656
- float: left;
657
- text-align: left;
658
-
659
- &:nth-child(odd) {
660
- margin-right: 2%;
661
- }
662
-
663
- &.button-faded {
664
- opacity: .5;
665
- }
666
- }
667
- }
668
-
669
- // the dragging field button
670
- .button.ui-draggable-dragging {
671
- margin: 0;
672
- text-align: left;
673
- }
674
-
675
- // Panel: Field Options
676
- // --------------------------------------------------
677
- .wpuf-form-builder-field-options {
678
-
679
- .option-fields-section {
680
- margin-bottom: 15px;
681
- }
682
-
683
- .section-title {
684
- margin: 0;
685
- font-size: 15px;
686
- border-bottom: 1px solid #eee;
687
- padding-bottom: 10px;
688
- cursor: pointer;
689
-
690
- i {
691
- float: right;
692
- }
693
- }
694
-
695
- .option-field-section-fields {
696
- margin-top: 15px;
697
- max-height: 150vh;
698
- opacity: 1;
699
- }
700
-
701
- .panel-field-opt {
702
- margin-bottom: 15px;
703
-
704
- .field-helper-text {
705
- color: fadeout(@wpBlack, 50%);
706
- margin-left: 6px;
707
- }
708
-
709
- &.panel-field-opt-text {
710
-
711
- input[type="text"],
712
- input[type="number"] {
713
- display: block;
714
- width: 100%;
715
- margin: 5px 0 0;
716
- line-height: 1.75;
717
- }
718
- }
719
-
720
- &.panel-field-opt-radio {
721
-
722
- & > label {
723
- display: block;
724
- margin-bottom: 5px;
725
- }
726
-
727
- & > ul {
728
- margin-top: 0;
729
- margin-bottom: 0;
730
- }
731
- }
732
-
733
- &.panel-field-opt-select {
734
-
735
- select {
736
- width: 100%;
737
- height: 32px;
738
- margin: 4px 0 0;
739
- }
740
-
741
- }
742
-
743
- .chosen-select + .chosen-container {
744
- margin-top: 10px;
745
- }
746
-
747
- .label-title-block {
748
- display: block;
749
- margin-bottom: 3px;
750
- }
751
- }
752
- }
753
-
754
- .option-field-option-chooser {
755
- margin: 12px 0 0;
756
-
757
- &.margin-0 {
758
- margin: 0;
759
- }
760
-
761
- .selector,
762
- .sort-handler,
763
- .label,
764
- .value,
765
- .action-buttons {
766
- float: left;
767
- }
768
-
769
- .selector {
770
- width: 25px;
771
-
772
- input {
773
- margin-top: 14px;
774
- }
775
- }
776
-
777
- .sort-handler {
778
- width: 22px;
779
- cursor: ns-resize;
780
-
781
- i {
782
- margin-top: 14px;
783
- font-size: 15px;
784
- }
785
- }
786
-
787
- .label {
788
- width: 208px;
789
- margin-right: 8px;
790
- }
791
-
792
- &.show-value {
793
- .label,
794
- .value {
795
- width: 100px;
796
- margin-right: 8px;
797
- }
798
- }
799
-
800
- .header {
801
- .label, .value {
802
- color: #909090;
803
- }
804
- }
805
-
806
- .action-buttons {
807
- width: 36px;
808
-
809
- i {
810
- cursor: pointer;
811
- font-size: 16px;
812
- margin-top: 13px;
813
- }
814
- }
815
- }
816
-
817
- .panel-field-opt-repeater-columns {
818
-
819
- .repeater-columns {
820
-
821
- li > div {
822
- float: left;
823
- }
824
-
825
- .sorter {
826
- width: 30px;
827
-
828
- i {
829
- cursor: ns-resize;
830
- font-size: 16px;
831
- margin-top: 5px;
832
- }
833
- }
834
-
835
- .input-container {
836
- width: 195px;
837
- margin-right: 10px;
838
-
839
- input {
840
- width: 100%;
841
- }
842
- }
843
-
844
- .action-buttons {
845
- width: 50px;
846
-
847
- i {
848
- cursor: pointer;
849
- font-size: 16px;
850
- padding: 0 3px;
851
- margin-top: 4px;
852
- }
853
- }
854
- }
855
- }
856
-
857
- .panel-field-opt-textarea {
858
-
859
- textarea {
860
- display: block;
861
- width: 100%;
862
- margin: 5px 0 0;
863
- line-height: 1.75;
864
- }
865
- }
866
-
867
- .panel-field-html-help-text {
868
-
869
- pre {
870
- max-width: 100%;
871
- overflow-x: auto;
872
- }
873
- }
874
-
875
- .panel-field-opt-select {
876
-
877
- .opt-select-element {
878
- display: block;
879
- max-width: 100%;
880
- }
881
- }
882
-
883
- // Text Editor
884
- // --------------------------------------------------
885
- ul.wpuf-form li .wpuf-text-editor .wp-editor-wrap {
886
- border: 0;
887
- }
888
-
889
- .form-switcher-content {
890
- position: absolute;
891
- background-color: #f9f9f9;
892
- min-width: 160px;
893
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
894
- z-index: 9999;
895
- margin: 0;
896
-
897
- li {
898
- margin: 0;
899
- }
900
-
901
- a {
902
- color: black;
903
- padding: 12px;
904
- text-decoration: none;
905
- display: block;
906
- text-align: center;
907
- }
908
- a:hover {
909
- color: #fff;
910
- background-color: #008ec2;
911
- }
912
- a.active {
913
- font-weight: bold;
914
- color: #fff;
915
- background-color: #008ec2;
916
- }
917
- }
918
-
919
- .insert-photo-icon {
920
- vertical-align: text-top;
921
- color: #82878c;
922
- font-size: 18px;
923
- }
924
-
925
- .password-strength-meter {
926
- border-style: solid;
927
- border-width: 1px;
928
- float: left;
929
- margin: 0;
930
- padding: 3px 5px;
931
- text-align: center;
932
- width: 200px;
933
- display: block;
934
- background-color: #eee;
935
- border-color: #ddd;
936
- }
937
-
938
- ul.wpuf-form li .wpuf-password-field {
939
- width: 100%;
940
- margin-bottom: 10px;
941
- }
942
-
943
- ul.wpuf-form li .wpuf-password-field:after {
944
- clear: both;
945
- content: "";
946
- display: table;
947
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/center-block.less DELETED
@@ -1,7 +0,0 @@
1
- // Center-align a block level element
2
-
3
- .center-block() {
4
- display: block;
5
- margin-left: auto;
6
- margin-right: auto;
7
- }
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/clearfix.less DELETED
@@ -1,22 +0,0 @@
1
- // Clearfix
2
- //
3
- // For modern browsers
4
- // 1. The space content is one way to avoid an Opera bug when the
5
- // contenteditable attribute is included anywhere else in the document.
6
- // Otherwise it causes space to appear at the top and bottom of elements
7
- // that are clearfixed.
8
- // 2. The use of `table` rather than `block` is only necessary if using
9
- // `:before` to contain the top-margins of child elements.
10
- //
11
- // Source: http://nicolasgallagher.com/micro-clearfix-hack/
12
-
13
- .clearfix() {
14
- &:before,
15
- &:after {
16
- content: " "; // 1
17
- display: table; // 2
18
- }
19
- &:after {
20
- clear: both;
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/custom-mixins.less DELETED
@@ -1,70 +0,0 @@
1
- .border(@prop: '', @width: 1px, @bColor: @borderColor) {
2
- & when not (@prop = '') {
3
- border-@{prop}: @width solid @bColor;
4
- }
5
- & when (@prop = '') {
6
- border: @width solid @bColor;
7
- }
8
- }
9
-
10
- .button-colorized(@baseColor) {
11
- background: @baseColor;
12
- border-color: darken(@baseColor, 5%) darken(@baseColor, 9%) darken(@baseColor, 9%);
13
- -webkit-box-shadow: 0 1px 0 darken(@baseColor, 9%);
14
- box-shadow: 0 1px 0 darken(@baseColor, 9%);
15
- color: #fff;
16
- text-decoration: none;
17
- text-shadow: 0 -1px 1px darken(@baseColor, 9%), 1px 0 1px darken(@baseColor, 9%), 0 1px 1px darken(@baseColor, 9%), -1px 0 1px darken(@baseColor, 9%);
18
-
19
- &.hover,
20
- &:hover,
21
- &.focus,
22
- &:focus {
23
- background: lighten(@baseColor, 2%);
24
- border-color: darken(@baseColor, 9%);
25
- color: #fff;
26
- }
27
-
28
- &.focus,
29
- &:focus {
30
- -webkit-box-shadow: 0 1px 0 darken(@baseColor, 5%), 0 0 2px 1px darken(@baseColor, 17%);
31
- box-shadow: 0 1px 0 darken(@baseColor, 5%), 0 0 2px 1px darken(@baseColor, 17%);
32
- }
33
-
34
-
35
- &.active,
36
- &.active:hover,
37
- &.active:focus,
38
- &:active {
39
- background: darken(@baseColor, 5%);
40
- border-color: darken(@baseColor, 9%);
41
- -webkit-box-shadow: inset 0 2px 0 darken(@baseColor, 9%);
42
- box-shadow: inset 0 2px 0 darken(@baseColor, 9%);
43
- vertical-align: top;
44
- }
45
-
46
- &[disabled],
47
- &:disabled,
48
- &-disabled,
49
- &.disabled {
50
- color: lighten(@baseColor, 27%) !important;
51
- background: lighten(@baseColor, 2%) !important;
52
- border-color: lighten(@baseColor, 3%) !important;
53
- -webkit-box-shadow: none !important;
54
- box-shadow: none !important;
55
- text-shadow: 0 -1px 0 rgba( 0, 0, 0, 0.1 ) !important;
56
- cursor: default;
57
- }
58
- }
59
-
60
- // copied from selectize
61
- .vertical-gradient (@color-top, @color-bottom) {
62
- background-color: mix(@color-top, @color-bottom, 60%);
63
- background-image: -moz-linear-gradient(top, @color-top, @color-bottom); // FF 3.6+
64
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@color-top), to(@color-bottom)); // Safari 4+, Chrome 2+
65
- background-image: -webkit-linear-gradient(top, @color-top, @color-bottom); // Safari 5.1+, Chrome 10+
66
- background-image: -o-linear-gradient(top, @color-top, @color-bottom); // Opera 11.10
67
- background-image: linear-gradient(to bottom, @color-top, @color-bottom); // Standard, IE10
68
- background-repeat: repeat-x;
69
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@color-top),argb(@color-bottom))); // IE9 and down
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/hide-text.less DELETED
@@ -1,21 +0,0 @@
1
- // CSS image replacement
2
- //
3
- // Heads up! v3 launched with only `.hide-text()`, but per our pattern for
4
- // mixins being reused as classes with the same name, this doesn't hold up. As
5
- // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.
6
- //
7
- // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
8
-
9
- // Deprecated as of v3.0.1 (has been removed in v4)
10
- .hide-text() {
11
- font: ~"0/0" a;
12
- color: transparent;
13
- text-shadow: none;
14
- background-color: transparent;
15
- border: 0;
16
- }
17
-
18
- // New mixin to use as of v3.0.1
19
- .text-hide() {
20
- .hide-text();
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/opacity.less DELETED
@@ -1,8 +0,0 @@
1
- // Opacity
2
-
3
- .opacity(@opacity) {
4
- opacity: @opacity;
5
- // IE8 filter
6
- @opacity-ie: (@opacity * 100);
7
- filter: ~"alpha(opacity=@{opacity-ie})";
8
- }
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/reset-text.less DELETED
@@ -1,18 +0,0 @@
1
- .reset-text() {
2
- font-family: @font-family-base;
3
- // We deliberately do NOT reset font-size.
4
- font-style: normal;
5
- font-weight: normal;
6
- letter-spacing: normal;
7
- line-break: auto;
8
- line-height: @line-height-base;
9
- text-align: left; // Fallback for where `start` is not supported
10
- text-align: start;
11
- text-decoration: none;
12
- text-shadow: none;
13
- text-transform: none;
14
- white-space: normal;
15
- word-break: normal;
16
- word-spacing: normal;
17
- word-wrap: normal;
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/size.less DELETED
@@ -1,10 +0,0 @@
1
- // Sizing shortcuts
2
-
3
- .size(@width; @height) {
4
- width: @width;
5
- height: @height;
6
- }
7
-
8
- .square(@size) {
9
- .size(@size; @size);
10
- }
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/text-overflow.less DELETED
@@ -1,8 +0,0 @@
1
- // Text overflow
2
- // Requires inline-block or block for proper styling
3
-
4
- .text-overflow() {
5
- overflow: hidden;
6
- text-overflow: ellipsis;
7
- white-space: nowrap;
8
- }
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/mixins/vendor-prefixes.less DELETED
@@ -1,227 +0,0 @@
1
- // Vendor Prefixes
2
- //
3
- // All vendor mixins are deprecated as of v3.2.0 due to the introduction of
4
- // Autoprefixer in our Gruntfile. They have been removed in v4.
5
-
6
- // - Animations
7
- // - Backface visibility
8
- // - Box shadow
9
- // - Box sizing
10
- // - Content columns
11
- // - Hyphens
12
- // - Placeholder text
13
- // - Transformations
14
- // - Transitions
15
- // - User Select
16
-
17
-
18
- // Animations
19
- .animation(@animation) {
20
- -webkit-animation: @animation;
21
- -o-animation: @animation;
22
- animation: @animation;
23
- }
24
- .animation-name(@name) {
25
- -webkit-animation-name: @name;
26
- animation-name: @name;
27
- }
28
- .animation-duration(@duration) {
29
- -webkit-animation-duration: @duration;
30
- animation-duration: @duration;
31
- }
32
- .animation-timing-function(@timing-function) {
33
- -webkit-animation-timing-function: @timing-function;
34
- animation-timing-function: @timing-function;
35
- }
36
- .animation-delay(@delay) {
37
- -webkit-animation-delay: @delay;
38
- animation-delay: @delay;
39
- }
40
- .animation-iteration-count(@iteration-count) {
41
- -webkit-animation-iteration-count: @iteration-count;
42
- animation-iteration-count: @iteration-count;
43
- }
44
- .animation-direction(@direction) {
45
- -webkit-animation-direction: @direction;
46
- animation-direction: @direction;
47
- }
48
- .animation-fill-mode(@fill-mode) {
49
- -webkit-animation-fill-mode: @fill-mode;
50
- animation-fill-mode: @fill-mode;
51
- }
52
-
53
- // Backface visibility
54
- // Prevent browsers from flickering when using CSS 3D transforms.
55
- // Default value is `visible`, but can be changed to `hidden`
56
-
57
- .backface-visibility(@visibility) {
58
- -webkit-backface-visibility: @visibility;
59
- -moz-backface-visibility: @visibility;
60
- backface-visibility: @visibility;
61
- }
62
-
63
- // Drop shadows
64
- //
65
- // Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
66
- // supported browsers that have box shadow capabilities now support it.
67
-
68
- .box-shadow(@shadow) {
69
- -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
70
- box-shadow: @shadow;
71
- }
72
-
73
- // Box sizing
74
- .box-sizing(@boxmodel) {
75
- -webkit-box-sizing: @boxmodel;
76
- -moz-box-sizing: @boxmodel;
77
- box-sizing: @boxmodel;
78
- }
79
-
80
- // CSS3 Content Columns
81
- .content-columns(@column-count; @column-gap: @grid-gutter-width) {
82
- -webkit-column-count: @column-count;
83
- -moz-column-count: @column-count;
84
- column-count: @column-count;
85
- -webkit-column-gap: @column-gap;
86
- -moz-column-gap: @column-gap;
87
- column-gap: @column-gap;
88
- }
89
-
90
- // Optional hyphenation
91
- .hyphens(@mode: auto) {
92
- word-wrap: break-word;
93
- -webkit-hyphens: @mode;
94
- -moz-hyphens: @mode;
95
- -ms-hyphens: @mode; // IE10+
96
- -o-hyphens: @mode;
97
- hyphens: @mode;
98
- }
99
-
100
- // Placeholder text
101
- .placeholder(@color: @input-color-placeholder) {
102
- // Firefox
103
- &::-moz-placeholder {
104
- color: @color;
105
- opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
106
- }
107
- &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
108
- &::-webkit-input-placeholder { color: @color; } // Safari and Chrome
109
- }
110
-
111
- // Transformations
112
- .scale(@ratio) {
113
- -webkit-transform: scale(@ratio);
114
- -ms-transform: scale(@ratio); // IE9 only
115
- -o-transform: scale(@ratio);
116
- transform: scale(@ratio);
117
- }
118
- .scale(@ratioX; @ratioY) {
119
- -webkit-transform: scale(@ratioX, @ratioY);
120
- -ms-transform: scale(@ratioX, @ratioY); // IE9 only
121
- -o-transform: scale(@ratioX, @ratioY);
122
- transform: scale(@ratioX, @ratioY);
123
- }
124
- .scaleX(@ratio) {
125
- -webkit-transform: scaleX(@ratio);
126
- -ms-transform: scaleX(@ratio); // IE9 only
127
- -o-transform: scaleX(@ratio);
128
- transform: scaleX(@ratio);
129
- }
130
- .scaleY(@ratio) {
131
- -webkit-transform: scaleY(@ratio);
132
- -ms-transform: scaleY(@ratio); // IE9 only
133
- -o-transform: scaleY(@ratio);
134
- transform: scaleY(@ratio);
135
- }
136
- .skew(@x; @y) {
137
- -webkit-transform: skewX(@x) skewY(@y);
138
- -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
139
- -o-transform: skewX(@x) skewY(@y);
140
- transform: skewX(@x) skewY(@y);
141
- }
142
- .translate(@x; @y) {
143
- -webkit-transform: translate(@x, @y);
144
- -ms-transform: translate(@x, @y); // IE9 only
145
- -o-transform: translate(@x, @y);
146
- transform: translate(@x, @y);
147
- }
148
- .translate3d(@x; @y; @z) {
149
- -webkit-transform: translate3d(@x, @y, @z);
150
- transform: translate3d(@x, @y, @z);
151
- }
152
- .rotate(@degrees) {
153
- -webkit-transform: rotate(@degrees);
154
- -ms-transform: rotate(@degrees); // IE9 only
155
- -o-transform: rotate(@degrees);
156
- transform: rotate(@degrees);
157
- }
158
- .rotateX(@degrees) {
159
- -webkit-transform: rotateX(@degrees);
160
- -ms-transform: rotateX(@degrees); // IE9 only
161
- -o-transform: rotateX(@degrees);
162
- transform: rotateX(@degrees);
163
- }
164
- .rotateY(@degrees) {
165
- -webkit-transform: rotateY(@degrees);
166
- -ms-transform: rotateY(@degrees); // IE9 only
167
- -o-transform: rotateY(@degrees);
168
- transform: rotateY(@degrees);
169
- }
170
- .perspective(@perspective) {
171
- -webkit-perspective: @perspective;
172
- -moz-perspective: @perspective;
173
- perspective: @perspective;
174
- }
175
- .perspective-origin(@perspective) {
176
- -webkit-perspective-origin: @perspective;
177
- -moz-perspective-origin: @perspective;
178
- perspective-origin: @perspective;
179
- }
180
- .transform-origin(@origin) {
181
- -webkit-transform-origin: @origin;
182
- -moz-transform-origin: @origin;
183
- -ms-transform-origin: @origin; // IE9 only
184
- transform-origin: @origin;
185
- }
186
-
187
-
188
- // Transitions
189
-
190
- .transition(@transition) {
191
- -webkit-transition: @transition;
192
- -o-transition: @transition;
193
- transition: @transition;
194
- }
195
- .transition-property(@transition-property) {
196
- -webkit-transition-property: @transition-property;
197
- transition-property: @transition-property;
198
- }
199
- .transition-delay(@transition-delay) {
200
- -webkit-transition-delay: @transition-delay;
201
- transition-delay: @transition-delay;
202
- }
203
- .transition-duration(@transition-duration) {
204
- -webkit-transition-duration: @transition-duration;
205
- transition-duration: @transition-duration;
206
- }
207
- .transition-timing-function(@timing-function) {
208
- -webkit-transition-timing-function: @timing-function;
209
- transition-timing-function: @timing-function;
210
- }
211
- .transition-transform(@transition) {
212
- -webkit-transition: -webkit-transform @transition;
213
- -moz-transition: -moz-transform @transition;
214
- -o-transition: -o-transform @transition;
215
- transition: transform @transition;
216
- }
217
-
218
-
219
- // User select
220
- // For selecting text on the page
221
-
222
- .user-select(@select) {
223
- -webkit-user-select: @select;
224
- -moz-user-select: @select;
225
- -ms-user-select: @select; // IE10+
226
- user-select: @select;
227
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/assets/less/variables.less DELETED
@@ -1,8 +0,0 @@
1
- // WP Admin UI colors //
2
- @borderColor: #cccccc;
3
- @htmlBG: #f1f1f1;
4
- @wpBlue: #0073aa;
5
- @wpRed: #d54e21;
6
- @wpGreen: #46b450;
7
- @wpBlack: #23282d;
8
- @wpYellow: #ffb900;
 
 
 
 
 
 
 
 
admin/form-builder/class-wpuf-admin-form-builder-ajax.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- /**
3
- * Ajax handlers
4
- */
5
- class WPUF_Admin_Form_Builder_Ajax {
6
-
7
- /**
8
- * Class contructor
9
- *
10
- * @since 2.5
11
- *
12
- * @return void
13
- */
14
- public function __construct() {
15
- add_action( 'wp_ajax_wpuf_form_builder_save_form', array( $this, 'save_form' ) );
16
- }
17
-
18
- /**
19
- * Save form data
20
- *
21
- * @since 2.5
22
- *
23
- * @return void
24
- */
25
- public function save_form() {
26
- parse_str( $_POST['form_data'], $form_data );
27
-
28
- if ( ! wp_verify_nonce( $form_data['wpuf_form_builder_nonce'], 'wpuf_form_builder_save_form' ) ) {
29
- wp_send_json_error( __( 'Unauthorized operation', 'wpuf' ) );
30
- exit;
31
- }
32
-
33
- if ( empty( $form_data['wpuf_form_id'] ) ) {
34
- wp_send_json_error( __( 'Invalid form id', 'wpuf' ) );
35
- exit;
36
- }
37
-
38
- $form_fields = isset( $_POST['form_fields'] ) ? $_POST['form_fields'] : '';
39
- $form_fields = wp_unslash( $form_fields );
40
- $form_fields = json_decode( $form_fields, true );
41
-
42
- $data = array(
43
- 'form_id' => absint( $form_data['wpuf_form_id'] ),
44
- 'post_title' => sanitize_text_field( $form_data['post_title'] ),
45
- 'form_fields' => $form_fields,
46
- 'form_settings' => isset( $form_data['wpuf_settings'] ) ? $form_data['wpuf_settings'] : array(),
47
- 'form_settings_key' => isset( $form_data['form_settings_key'] ) ? $form_data['form_settings_key'] : ''
48
- );
49
-
50
- $form_fields = WPUF_Admin_Form_Builder::save_form( $data );
51
-
52
- wp_send_json_success( array( 'form_fields' => $form_fields ) );
53
- exit;
54
- }
55
-
56
- }
57
-
58
- new WPUF_Admin_Form_Builder_Ajax();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/class-wpuf-admin-form-builder.php DELETED
@@ -1,411 +0,0 @@
1
- <?php
2
- /**
3
- * Form Builder framework
4
- */
5
-
6
- class WPUF_Admin_Form_Builder {
7
-
8
- /**
9
- * Form Settings
10
- *
11
- * @since 2.5
12
- *
13
- * @var string
14
- */
15
- private $settings = array();
16
-
17
- /**
18
- * Class contructor
19
- *
20
- * @since 2.5
21
- *
22
- * @return void
23
- */
24
- public function __construct( $settings ) {
25
- global $post;
26
-
27
- $defaults = array(
28
- 'form_type' => '', // e.g 'post', 'profile' etc
29
- 'post_type' => '', // e.g 'wpuf_forms', 'wpuf_profile' etc,
30
- 'form_settings_key' => '',
31
- 'post_id' => 0,
32
- 'shortcodes' => array() // [ [ 'name' => 'wpuf_form', 'type' => 'profile' ], [ 'name' => 'wpuf_form', 'type' => 'registration' ] ]
33
- );
34
-
35
- $this->settings = wp_parse_args( $settings, $defaults );
36
-
37
- // set post data to global $post
38
- $post = get_post( $this->settings['post_id'] );
39
-
40
- // if we have an existing post, then let's start
41
- if ( ! empty( $post->ID ) ) {
42
- add_action( 'in_admin_header', array( $this, 'remove_admin_notices' ) );
43
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
44
- add_action( 'admin_print_scripts', array( $this, 'admin_print_scripts' ) );
45
- add_action( 'admin_footer', array( $this, 'admin_footer' ) );
46
- add_action( 'wpuf-admin-form-builder', array( $this, 'include_form_builder' ) );
47
- }
48
- }
49
-
50
- /**
51
- * Remove all kinds of admin notices
52
- *
53
- * Since we don't have much space left on top of the page,
54
- * we have to remove all kinds of admin notices
55
- *
56
- * @since 2.5
57
- *
58
- * @return void
59
- */
60
- public function remove_admin_notices() {
61
- remove_all_actions( 'network_admin_notices' );
62
- remove_all_actions( 'user_admin_notices' );
63
- remove_all_actions( 'admin_notices' );
64
- }
65
-
66
- /**
67
- * Enqueue admin scripts
68
- *
69
- * @since 2.5
70
- *
71
- * @return void
72
- */
73
- public function admin_enqueue_scripts() {
74
- global $post;
75
-
76
- /**
77
- * CSS
78
- */
79
- wp_enqueue_style( 'wpuf-css', WPUF_ASSET_URI . '/css/frontend-forms.css' );
80
- wp_enqueue_style( 'wpuf-font-awesome', WPUF_ASSET_URI . '/vendor/font-awesome/css/font-awesome.min.css', array(), WPUF_VERSION );
81
- wp_enqueue_style( 'wpuf-sweetalert', WPUF_ASSET_URI . '/vendor/sweetalert/sweetalert.css', array(), WPUF_VERSION );
82
- wp_enqueue_style( 'wpuf-selectize', WPUF_ASSET_URI . '/vendor/selectize/css/selectize.default.css', array(), WPUF_VERSION );
83
- wp_enqueue_style( 'wpuf-toastr', WPUF_ASSET_URI . '/vendor/toastr/toastr.min.css', array(), WPUF_VERSION );
84
- wp_enqueue_style( 'wpuf-tooltip', WPUF_ASSET_URI . '/vendor/tooltip/tooltip.css', array(), WPUF_VERSION );
85
-
86
- $form_builder_css_deps = apply_filters( 'wpuf-form-builder-css-deps', array(
87
- 'wpuf-css', 'wpuf-font-awesome', 'wpuf-sweetalert', 'wpuf-selectize', 'wpuf-toastr', 'wpuf-tooltip'
88
- ) );
89
-
90
- wp_enqueue_style( 'wpuf-form-builder', WPUF_ASSET_URI . '/css/wpuf-form-builder.css', $form_builder_css_deps, WPUF_VERSION );
91
-
92
- do_action( 'wpuf-form-builder-enqueue-style' );
93
-
94
- /**
95
- * JavaScript
96
- */
97
- $prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
98
-
99
- wp_enqueue_script( 'wpuf-vue', WPUF_ASSET_URI . '/vendor/vue/vue' . $prefix . '.js', array(), WPUF_VERSION, true );
100
- wp_enqueue_script( 'wpuf-vuex', WPUF_ASSET_URI . '/vendor/vuex/vuex' . $prefix . '.js', array( 'wpuf-vue' ), WPUF_VERSION, true );
101
- wp_enqueue_script( 'wpuf-sweetalert', WPUF_ASSET_URI . '/vendor/sweetalert/sweetalert-dev.js', array(), WPUF_VERSION, true );
102
- wp_enqueue_script( 'wpuf-jquery-scrollTo', WPUF_ASSET_URI . '/vendor/jquery.scrollTo/jquery.scrollTo' . $prefix . '.js', array( 'jquery' ), WPUF_VERSION, true );
103
- wp_enqueue_script( 'wpuf-selectize', WPUF_ASSET_URI . '/vendor/selectize/js/standalone/selectize' . $prefix . '.js', array( 'jquery' ), WPUF_VERSION, true );
104
- wp_enqueue_script( 'wpuf-toastr', WPUF_ASSET_URI . '/vendor/toastr/toastr' . $prefix . '.js', array(), WPUF_VERSION, true );
105
- wp_enqueue_script( 'wpuf-clipboard', WPUF_ASSET_URI . '/vendor/clipboard/clipboard' . $prefix . '.js', array(), WPUF_VERSION, true );
106
- wp_enqueue_script( 'wpuf-tooltip', WPUF_ASSET_URI . '/vendor/tooltip/tooltip' . $prefix . '.js', array(), WPUF_VERSION, true );
107
-
108
- $form_builder_js_deps = apply_filters( 'wpuf-form-builder-js-deps', array(
109
- 'jquery', 'jquery-ui-sortable', 'jquery-ui-draggable', 'underscore',
110
- 'wpuf-vue', 'wpuf-vuex', 'wpuf-sweetalert', 'wpuf-jquery-scrollTo',
111
- 'wpuf-selectize', 'wpuf-toastr', 'wpuf-clipboard', 'wpuf-tooltip'
112
- ) );
113
-
114
- wp_enqueue_script( 'wpuf-form-builder-mixins', WPUF_ASSET_URI . '/js/wpuf-form-builder-mixins.js', $form_builder_js_deps, WPUF_VERSION, true );
115
-
116
- do_action( 'wpuf-form-builder-enqueue-after-mixins' );
117
-
118
- wp_enqueue_script( 'wpuf-form-builder-components', WPUF_ASSET_URI . '/js/wpuf-form-builder-components.js', array( 'wpuf-form-builder-mixins' ), WPUF_VERSION, true );
119
-
120
- do_action( 'wpuf-form-builder-enqueue-after-components' );
121
-
122
- wp_enqueue_script( 'wpuf-form-builder', WPUF_ASSET_URI . '/js/wpuf-form-builder.js', array( 'wpuf-form-builder-components' ), WPUF_VERSION, true );
123
-
124
- do_action( 'wpuf-form-builder-enqueue-after-main-instance' );
125
-
126
- /*
127
- * Data required for building the form
128
- */
129
- require_once WPUF_ROOT . '/admin/form-builder/class-wpuf-form-builder-field-settings.php';
130
- require_once WPUF_ROOT . '/includes/free/prompt.php';
131
-
132
- $wpuf_form_builder = apply_filters( 'wpuf-form-builder-localize-script', array(
133
- 'i18n' => $this->i18n(),
134
- 'post' => $post,
135
- 'form_fields' => wpuf_get_form_fields( $post->ID ),
136
- 'panel_sections' => $this->get_panel_sections(),
137
- 'field_settings' => WPUF_Form_Builder_Field_Settings::get_field_settings(),
138
- 'pro_link' => WPUF_Pro_Prompt::get_pro_url(),
139
- 'site_url' => site_url('/')
140
- ) );
141
-
142
- wp_localize_script( 'wpuf-form-builder-mixins', 'wpuf_form_builder', $wpuf_form_builder );
143
-
144
- // mixins
145
- $wpuf_mixins = array(
146
- 'root' => apply_filters( 'wpuf-form-builder-js-root-mixins', array() ),
147
- 'builder_stage' => apply_filters( 'wpuf-form-builder-js-builder-stage-mixins', array() ),
148
- 'form_fields' => apply_filters( 'wpuf-form-builder-js-form-fields-mixins', array() ),
149
- 'field_options' => apply_filters( 'wpuf-form-builder-js-field-options-mixins', array() ),
150
- );
151
-
152
- wp_localize_script( 'wpuf-form-builder-mixins', 'wpuf_mixins', $wpuf_mixins );
153
- }
154
-
155
- /**
156
- * Print js scripts in admin head
157
- *
158
- * @since 2.5
159
- *
160
- * @return void
161
- */
162
- public function admin_print_scripts() {
163
- ?>
164
- <script>
165
- var wpuf_form_builder_mixins = function(mixins, mixin_parent) {
166
- if (!mixins || !mixins.length) {
167
- return [];
168
- }
169
-
170
- if (!mixin_parent) {
171
- mixin_parent = window;
172
- }
173
-
174
- return mixins.map(function (mixin) {
175
- return mixin_parent[mixin];
176
- });
177
- };
178
- </script>
179
- <?php
180
- }
181
-
182
- /**
183
- * Include vue component templates
184
- *
185
- * @since 2.5
186
- *
187
- * @return void
188
- */
189
- public function admin_footer() {
190
- // get all vue component names
191
- $path = WPUF_ROOT . '/admin/form-builder/assets/js/components';
192
-
193
- $components = array();
194
-
195
- // directory handle
196
- $dir = dir( $path );
197
-
198
- while ( $entry = $dir->read() ) {
199
- if ( $entry !== '.' && $entry !== '..' ) {
200
- if ( is_dir( $path . '/' . $entry ) ) {
201
- $components[] = $entry;
202
- }
203
- }
204
- }
205
-
206
- // html templates of vue components
207
- foreach ( $components as $component ) {
208
- self::include_js_template( $component );
209
- }
210
-
211
- do_action( 'wpuf-form-builder-add-js-templates' );
212
- }
213
-
214
- /**
215
- * Embed a Vue.js component template
216
- *
217
- * @since 2.5
218
- *
219
- * @param string $template
220
- * @param string $file_path
221
- *
222
- * @return void
223
- */
224
- public static function include_js_template( $template, $file_path = '' ) {
225
- $file_path = $file_path ? untrailingslashit( $file_path ) : WPUF_ROOT . '/admin/form-builder/assets/js/components';
226
-
227
- $file_path = $file_path . '/' . $template . '/template.php';
228
-
229
- if ( file_exists( $file_path ) ) {
230
- echo '<script type="text/x-template" id="tmpl-wpuf-' . $template . '">' . "\n";
231
- include apply_filters( 'wpuf-form-builder-js-template-path', $file_path, $template );
232
- echo "\n" . '</script>' . "\n";
233
- }
234
- }
235
-
236
- /**
237
- * Include form builder view template
238
- *
239
- * @since 2.5
240
- *
241
- * @return void
242
- */
243
- public function include_form_builder() {
244
- $form_id = $this->settings['post_id'];
245
- $form_type = $this->settings['form_type'];
246
- $post_type = $this->settings['post_type'];
247
- $form_settings_key = $this->settings['form_settings_key'];
248
- $shortcodes = $this->settings['shortcodes'];
249
-
250
- $forms = get_posts( array( 'post_type' => $post_type, 'post_status' => 'any' ) );
251
-
252
- include WPUF_ROOT . '/admin/form-builder/views/form-builder.php';
253
- }
254
-
255
- /**
256
- * Add Fields panel sections
257
- *
258
- * @since 2.5
259
- *
260
- * @return array
261
- */
262
- private function get_panel_sections() {
263
- $before_custom_fields = apply_filters( 'wpuf-form-builder-fields-section-before', array() );
264
-
265
- $sections = array_merge( $before_custom_fields, $this->get_custom_fields() );
266
- $sections = array_merge( $sections, $this->get_others_fields() );
267
-
268
- $after_custom_fields = apply_filters( 'wpuf-form-builder-fields-section-after', array() );
269
-
270
- $sections = array_merge( $sections, $after_custom_fields );
271
-
272
- return $sections;
273
- }
274
-
275
- /**
276
- * Custom field section
277
- *
278
- * @since 2.5
279
- *
280
- * @return array
281
- */
282
- private function get_custom_fields() {
283
- $fields = apply_filters( 'wpuf-form-builder-fields-custom-fields', array(
284
- 'text_field', 'textarea_field', 'dropdown_field', 'multiple_select',
285
- 'radio_field', 'checkbox_field', 'website_url', 'email_address',
286
- 'custom_hidden_field', 'image_upload'
287
- ) );
288
-
289
- return array(
290
- array(
291
- 'title' => __( 'Custom Fields', 'wpuf' ),
292
- 'id' => 'custom-fields',
293
- 'fields' => $fields
294
- )
295
- );
296
- }
297
-
298
- /**
299
- * Others field section
300
- *
301
- * @since 2.5
302
- *
303
- * @return array
304
- */
305
- private function get_others_fields() {
306
- $fields = apply_filters( 'wpuf-form-builder-fields-others-fields', array(
307
- 'section_break', 'custom_html'
308
- ) );
309
-
310
- return array(
311
- array(
312
- 'title' => __( 'Others', 'wpuf' ),
313
- 'id' => 'others',
314
- 'fields' => $fields
315
- )
316
- );
317
- }
318
-
319
- /**
320
- * i18n translatable strings
321
- *
322
- * @since 2.5
323
- *
324
- * @return array
325
- */
326
- private function i18n() {
327
- return apply_filters( 'wpuf-form-builder-i18n', array(
328
- 'advanced_options' => __( 'Advanced Options', 'wpuf' ),
329
- 'delete_field_warn_msg' => __( 'Are you sure you want to delete this field?', 'wpuf' ),
330
- 'yes_delete_it' => __( 'Yes, delete it', 'wpuf' ),
331
- 'no_cancel_it' => __( 'No, cancel it', 'wpuf' ),
332
- 'ok' => __( 'OK', 'wpuf' ),
333
- 'cancel' => __( 'Cancel', 'wpuf' ),
334
- 'close' => __( 'Close', 'wpuf' ),
335
- 'last_choice_warn_msg' => __( 'This field must contain at least one choice', 'wpuf' ),
336
- 'option' => __( 'Option', 'wpuf' ),
337
- 'column' => __( 'Column', 'wpuf' ),
338
- 'last_column_warn_msg' => __( 'This field must contain at least one column', 'wpuf' ),
339
- 'is_a_pro_feature' => __( 'is available in Pro version', 'wpuf' ),
340
- 'pro_feature_msg' => __( 'Please upgrade to the Pro version to unlock all these awesome features', 'wpuf' ),
341
- 'upgrade_to_pro' => __( 'Get the Pro version', 'wpuf' ),
342
- 'select' => __( 'Select', 'wpuf' ),
343
- 'saved_form_data' => __( 'Saved form data', 'wpuf' ),
344
- 'unsaved_changes' => __( 'You have unsaved changes.', 'wpuf' ),
345
- 'copy_shortcode' => __( 'Click to copy shortcode', 'wpuf' ),
346
- ) );
347
- }
348
-
349
- /**
350
- * Save form data
351
- *
352
- * @since 2.5
353
- *
354
- * @param array $data Contains form_fields, form_settings, form_settings_key data
355
- *
356
- * @return boolean
357
- */
358
- public static function save_form( $data ) {
359
- $saved_wpuf_inputs = array();
360
-
361
- wp_update_post( array( 'ID' => $data['form_id'], 'post_title' => $data['post_title'] ) );
362
-
363
- $existing_wpuf_input_ids = get_children( array(
364
- 'post_parent' => $data['form_id'],
365
- 'post_status' => 'publish',
366
- 'post_type' => 'wpuf_input',
367
- 'numberposts' => '-1',
368
- 'orderby' => 'menu_order',
369
- 'order' => 'ASC',
370
- 'fields' => 'ids'
371
- ) );
372
-
373
- $new_wpuf_input_ids = array();
374
-
375
- if ( ! empty( $data['form_fields'] ) ) {
376
-
377
- foreach ( $data['form_fields'] as $order => $field ) {
378
- if ( ! empty( $field['is_new'] ) ) {
379
- unset( $field['is_new'] );
380
- unset( $field['id'] );
381
-
382
- $field_id = 0;
383
-
384
- } else {
385
- $field_id = $field['id'];
386
- }
387
-
388
- $field_id = wpuf_insert_form_field( $data['form_id'], $field, $field_id, $order );
389
-
390
- $new_wpuf_input_ids[] = $field_id;
391
-
392
- $field['id'] = $field_id;
393
-
394
- $saved_wpuf_inputs[] = $field;
395
- }
396
-
397
- }
398
-
399
- $inputs_to_delete = array_diff( $existing_wpuf_input_ids, $new_wpuf_input_ids );
400
-
401
- if ( ! empty( $inputs_to_delete ) ) {
402
- foreach ( $inputs_to_delete as $delete_id ) {
403
- wp_delete_post( $delete_id , true );
404
- }
405
- }
406
-
407
- update_post_meta( $data['form_id'], $data['form_settings_key'], $data['form_settings'] );
408
-
409
- return $saved_wpuf_inputs;
410
- }
411
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/class-wpuf-form-builder-field-settings.php DELETED
@@ -1,771 +0,0 @@
1
- <?php
2
- /**
3
- * Field settings properties
4
- */
5
- class WPUF_Form_Builder_Field_Settings {
6
-
7
- /**
8
- * All field settings
9
- *
10
- * @since 2.5
11
- *
12
- * @return array
13
- */
14
- public static function get_field_settings() {
15
- return apply_filters( 'wpuf-form-builder-field-settings', array(
16
- 'text_field' => self::text_field(),
17
- 'textarea_field' => self::textarea_field(),
18
- 'dropdown_field' => self::dropdown_field(),
19
- 'multiple_select' => self::multiple_select(),
20
- 'radio_field' => self::radio_field(),
21
- 'checkbox_field' => self::checkbox_field(),
22
- 'website_url' => self::website_url(),
23
- 'email_address' => self::email_address(),
24
- 'custom_hidden_field' => self::custom_hidden_field(),
25
- 'image_upload' => self::image_upload(),
26
- 'section_break' => self::section_break(),
27
- 'custom_html' => self::custom_html()
28
- ) );
29
- }
30
-
31
- /**
32
- * Common properties for all kinds of fields
33
- *
34
- * @since 2.5
35
- *
36
- * @param boolean $is_meta
37
- *
38
- * @return array
39
- */
40
- public static function get_common_properties( $is_meta = true ) {
41
- $common_properties = array(
42
- array(
43
- 'name' => 'label',
44
- 'title' => __( 'Field Label', 'wpuf' ),
45
- 'type' => 'text',
46
- 'section' => 'basic',
47
- 'priority' => 10,
48
- 'help_text' => __( 'Enter a title of this field', 'wpuf' ),
49
- ),
50
-
51
- array(
52
- 'name' => 'help',
53
- 'title' => __( 'Help text', 'wpuf' ),
54
- 'type' => 'text',
55
- 'section' => 'basic',
56
- 'priority' => 20,
57
- 'help_text' => __( 'Give the user some information about this field', 'wpuf' ),
58
- ),
59
-
60
- array(
61
- 'name' => 'required',
62
- 'title' => __( 'Required', 'wpuf' ),
63
- 'type' => 'radio',
64
- 'options' => array(
65
- 'yes' => __( 'Yes', 'wpuf' ),
66
- 'no' => __( 'No', 'wpuf' ),
67
- ),
68
- 'section' => 'basic',
69
- 'priority' => 21,
70
- 'default' => 'no',
71
- 'inline' => true,
72
- 'help_text' => __( 'Check this option to mark the field required. A form will not submit unless all required fields are provided.', 'wpuf' ),
73
- ),
74
-
75
- array(
76
- 'name' => 'css',
77
- 'title' => __( 'CSS Class Name', 'wpuf' ),
78
- 'type' => 'text',
79
- 'section' => 'advanced',
80
- 'priority' => 22,
81
- 'help_text' => __( 'Give the user some information about this field', 'wpuf' ),
82
- ),
83
- );
84
-
85
- if ( $is_meta ) {
86
- $common_properties[] = array(
87
- 'name' => 'name',
88
- 'title' => __( 'Meta Key', 'wpuf' ),
89
- 'type' => 'text-meta',
90
- 'section' => 'basic',
91
- 'priority' => 11,
92
- 'help_text' => __( 'Name of the meta key this field will save to', 'wpuf' ),
93
- );
94
- }
95
-
96
- return apply_filters( 'wpuf-form-builder-fields-common-properties', $common_properties );
97
- }
98
-
99
- /**
100
- * Common properties of a text input field
101
- *
102
- * @since 2.5
103
- *
104
- * @return array
105
- */
106
- public static function get_common_text_properties() {
107
- return array(
108
- array(
109
- 'name' => 'placeholder',
110
- 'title' => __( 'Placeholder text', 'wpuf' ),
111
- 'type' => 'text',
112
- 'section' => 'advanced',
113
- 'priority' => 10,
114
- 'help_text' => __( 'Text for HTML5 placeholder attribute', 'wpuf' ),
115
- ),
116
-
117
- array(
118
- 'name' => 'default',
119
- 'title' => __( 'Default value', 'wpuf' ),
120
- 'type' => 'text',
121
- 'section' => 'advanced',
122
- 'priority' => 11,
123
- 'help_text' => __( 'The default value this field will have', 'wpuf' ),
124
- ),
125
-
126
- array(
127
- 'name' => 'size',
128
- 'title' => __( 'Size', 'wpuf' ),
129
- 'type' => 'text',
130
- 'variation' => 'number',
131
- 'section' => 'advanced',
132
- 'priority' => 20,
133
- 'help_text' => __( 'Size of this input field', 'wpuf' ),
134
- ),
135
- );
136
- }
137
-
138
- /**
139
- * Common properties of a textarea field
140
- *
141
- * @since 2.5
142
- *
143
- * @return array
144
- */
145
- public static function get_common_textarea_properties() {
146
- return array(
147
- array(
148
- 'name' => 'rows',
149
- 'title' => __( 'Rows', 'wpuf' ),
150
- 'type' => 'text',
151
- 'section' => 'advanced',
152
- 'priority' => 10,
153
- 'help_text' => __( 'Number of rows in textarea', 'wpuf' ),
154
- ),
155
-
156
- array(
157
- 'name' => 'cols',
158
- 'title' => __( 'Columns', 'wpuf' ),
159
- 'type' => 'text',
160
- 'section' => 'advanced',
161
- 'priority' => 11,
162
- 'help_text' => __( 'Number of columns in textarea', 'wpuf' ),
163
- ),
164
-
165
- array(
166
- 'name' => 'placeholder',
167
- 'title' => __( 'Placeholder text', 'wpuf' ),
168
- 'type' => 'text',
169
- 'section' => 'advanced',
170
- 'priority' => 12,
171
- 'help_text' => __( 'Text for HTML5 placeholder attribute', 'wpuf' ),
172
- 'dependencies' => array(
173
- 'rich' => 'no'
174
- )
175
- ),
176
-
177
- array(
178
- 'name' => 'default',
179
- 'title' => __( 'Default value', 'wpuf' ),
180
- 'type' => 'text',
181
- 'section' => 'advanced',
182
- 'priority' => 13,
183
- 'help_text' => __( 'The default value this field will have', 'wpuf' ),
184
- ),
185
-
186
- array(
187
- 'name' => 'rich',
188
- 'title' => __( 'Textarea', 'wpuf' ),
189
- 'type' => 'radio',
190
- 'options' => array(
191
- 'no' => __( 'Normal', 'wpuf' ),
192
- 'yes' => __( 'Rich textarea', 'wpuf' ),
193
- 'teeny' => __( 'Teeny Rich textarea', 'wpuf' ),
194
- ),
195
- 'section' => 'advanced',
196
- 'priority' => 14,
197
- 'default' => 'no',
198
- ),
199
-
200
- array(
201
- 'name' => 'word_restriction',
202
- 'title' => __( 'Word Restriction', 'wpuf' ),
203
- 'type' => 'text',
204
- 'section' => 'advanced',
205
- 'priority' => 15,
206
- 'help_text' => __( 'Numebr of words the author to be restricted in', 'wpuf' ),
207
- ),
208
- );
209
- }
210
-
211
- /**
212
- * wpuf_cond property for all fields
213
- *
214
- * @since 2.5
215
- *
216
- * @return array
217
- */
218
- public static function get_wpuf_cond_prop() {
219
- return array(
220
- 'condition_status' => 'no',
221
- 'cond_field' => array(),
222
- 'cond_operator' => array( '=' ),
223
- 'cond_option' => array( __( '- select -', 'wpuf' ) ),
224
- 'cond_logic' => 'all'
225
- );
226
- }
227
-
228
- /**
229
- * Text field settings
230
- *
231
- * @since 2.5
232
- *
233
- * @return array
234
- */
235
- public static function text_field() {
236
- $settings = self::get_common_properties();
237
- $settings = array_merge( $settings, self::get_common_text_properties() );
238
-
239
- return array(
240
- 'template' => 'text_field',
241
- 'title' => __( 'Text', 'wpuf' ),
242
- 'icon' => 'text-width',
243
- 'settings' => $settings,
244
- 'field_props' => array(
245
- 'input_type' => 'text',
246
- 'template' => 'text_field',
247
- 'required' => 'no',
248
- 'label' => __( 'Text', 'wpuf' ),
249
- 'name' => '',
250
- 'is_meta' => 'yes',
251
- 'help' => '',
252
- 'css' => '',
253
- 'placeholder' => '',
254
- 'default' => '',
255
- 'size' => 40,
256
- 'id' => 0,
257
- 'is_new' => true,
258
- 'wpuf_cond' => self::get_wpuf_cond_prop()
259
- )
260
- );
261
- }
262
-
263
- /**
264
- * Textarea field settings
265
- *
266
- * @since 2.5
267
- *
268
- * @return array
269
- */
270
- public static function textarea_field() {
271
- $settings = self::get_common_properties();
272
- $settings = array_merge( $settings, self::get_common_textarea_properties() );
273
-
274
- return array(
275
- 'template' => 'textarea_field',
276
- 'title' => __( 'Textarea', 'wpuf' ),
277
- 'icon' => 'paragraph',
278
- 'settings' => $settings,
279
- 'field_props' => array(
280
- 'input_type' => 'textarea',
281
- 'template' => 'textarea_field',
282
- 'required' => 'no',
283
- 'label' => __( 'Textarea', 'wpuf' ),
284
- 'name' => '',
285
- 'is_meta' => 'yes',
286
- 'help' => '',
287
- 'css' => '',
288
- 'rows' => 5,
289
- 'cols' => 25,
290
- 'placeholder' => '',
291
- 'default' => '',
292
- 'rich' => 'no',
293
- 'word_restriction' => '',
294
- 'id' => 0,
295
- 'is_new' => true,
296
- 'wpuf_cond' => self::get_wpuf_cond_prop()
297
- )
298
- );
299
- }
300
-
301
- /**
302
- * Option data for option based fields
303
- *
304
- * @since 2.5
305
- *
306
- * @param boolean $is_multiple
307
- *
308
- * @return array
309
- */
310
- public static function get_option_data_setting( $is_multiple = false ) {
311
- return array(
312
- 'name' => 'options',
313
- 'title' => __( 'Options', 'wpuf' ),
314
- 'type' => 'option-data',
315
- 'is_multiple' => $is_multiple,
316
- 'section' => 'basic',
317
- 'priority' => 12,
318
- 'help_text' => __( 'Add options for the form field', 'wpuf' ),
319
- );
320
- }
321
-
322
- /**
323
- * Dropdown/Select field settings
324
- *
325
- * @since 2.5
326
- *
327
- * @return array
328
- */
329
- public static function dropdown_field() {
330
- $settings = self::get_common_properties();
331
-
332
- $dropdown_settings = array(
333
- self::get_option_data_setting(),
334
-
335
- array(
336
- 'name' => 'first',
337
- 'title' => __( 'Select Text', 'wpuf' ),
338
- 'type' => 'text',
339
- 'section' => 'basic',
340
- 'priority' => 13,
341
- 'help_text' => __( "First element of the select dropdown. Leave this empty if you don't want to show this field", 'wpuf' ),
342
- ),
343
- );
344
-
345
- $settings = array_merge( $settings, $dropdown_settings );
346
-
347
- return array(
348
- 'template' => 'dropdown_field',
349
- 'title' => __( 'Dropdown', 'wpuf' ),
350
- 'icon' => 'caret-square-o-down',
351
- 'settings' => $settings,
352
- 'field_props' => array(
353
- 'input_type' => 'select',
354
- 'template' => 'dropdown_field',
355
- 'required' => 'no',
356
- 'label' => __( 'Dropdown', 'wpuf' ),
357
- 'name' => '',
358
- 'is_meta' => 'yes',
359
- 'help' => '',
360
- 'css' => '',
361
- 'selected' => '',
362
- 'options' => array( 'Option' => __( 'Option', 'wpuf' ) ),
363
- 'first' => __( '- select -', 'wpuf' ),
364
- 'id' => 0,
365
- 'is_new' => true,
366
- 'wpuf_cond' => self::get_wpuf_cond_prop()
367
- )
368
- );
369
- }
370
-
371
- /**
372
- * Multiselect field settings
373
- *
374
- * @since 2.5
375
- *
376
- * @return array
377
- */
378
- public static function multiple_select() {
379
- $settings = self::get_common_properties();
380
-
381
- $dropdown_settings = array(
382
- self::get_option_data_setting( true )
383
- );
384
-
385
- $settings = array_merge( $settings, $dropdown_settings );
386
-
387
- return array(
388
- 'template' => 'multiple_select',
389
- 'title' => __( 'Multi Select', 'wpuf' ),
390
- 'icon' => 'list-ul',
391
- 'settings' => $settings,
392
- 'field_props' => array(
393
- 'input_type' => 'multiselect',
394
- 'template' => 'multiple_select',
395
- 'required' => 'no',
396
- 'label' => __( 'Multi Select', 'wpuf' ),
397
- 'name' => '',
398
- 'is_meta' => 'yes',
399
- 'help' => '',
400
- 'css' => '',
401
- 'selected' => array(),
402
- 'options' => array( 'Option' => __( 'Option', 'wpuf' ) ),
403
- 'first' => __( '- select -', 'wpuf' ),
404
- 'id' => 0,
405
- 'is_new' => true,
406
- 'wpuf_cond' => self::get_wpuf_cond_prop()
407
- )
408
- );
409
- }
410
-
411
- /**
412
- * Radio field settings
413
- *
414
- * @since 2.5
415
- *
416
- * @return array
417
- */
418
- public static function radio_field() {
419
- $settings = self::get_common_properties();
420
-
421
- $dropdown_settings = array(
422
- self::get_option_data_setting(),
423
-
424
- array(
425
- 'name' => 'inline',
426
- 'title' => __( 'Show in inline list', 'wpuf' ),
427
- 'type' => 'radio',
428
- 'options' => array(
429
- 'yes' => __( 'Yes', 'wpuf' ),
430
- 'no' => __( 'No', 'wpuf' ),
431
- ),
432
- 'default' => 'no',
433
- 'inline' => true,
434
- 'section' => 'advanced',
435
- 'priority' => 23,
436
- 'help_text' => __( 'Show this option in an inline list', 'wpuf' ),
437
- )
438
- );
439
-
440
- $settings = array_merge( $settings, $dropdown_settings );
441
-
442
- return array(
443
- 'template' => 'radio_field',
444
- 'title' => __( 'Radio', 'wpuf' ),
445
- 'icon' => 'dot-circle-o',
446
- 'settings' => $settings,
447
- 'field_props' => array(
448
- 'input_type' => 'radio',
449
- 'template' => 'radio_field',
450
- 'required' => 'no',
451
- 'label' => __( 'Radio Field', 'wpuf' ),
452
- 'name' => '',
453
- 'is_meta' => 'yes',
454
- 'help' => '',
455
- 'css' => '',
456
- 'selected' => '',
457
- 'inline' => 'no',
458
- 'options' => array( 'Option' => __( 'Option', 'wpuf' ) ),
459
- 'id' => 0,
460
- 'is_new' => true,
461
- 'wpuf_cond' => self::get_wpuf_cond_prop()
462
- )
463
- );
464
- }
465
-
466
- /**
467
- * Checkbox field settings
468
- *
469
- * @since 2.5
470
- *
471
- * @return array
472
- */
473
- public static function checkbox_field() {
474
- $settings = self::get_common_properties();
475
-
476
- $dropdown_settings = array(
477
- self::get_option_data_setting( true ),
478
-
479
- array(
480
- 'name' => 'inline',
481
- 'title' => __( 'Show in inline list', 'wpuf' ),
482
- 'type' => 'radio',
483
- 'options' => array(
484
- 'yes' => __( 'Yes', 'wpuf' ),
485
- 'no' => __( 'No', 'wpuf' ),
486
- ),
487
- 'default' => 'no',
488
- 'inline' => true,
489
- 'section' => 'advanced',
490
- 'priority' => 23,
491
- 'help_text' => __( 'Show this option in an inline list', 'wpuf' ),
492
- )
493
- );
494
-
495
- $settings = array_merge( $settings, $dropdown_settings );
496
-
497
- return array(
498
- 'template' => 'checkbox_field',
499
- 'title' => __( 'Checkbox', 'wpuf' ),
500
- 'icon' => 'check-square-o',
501
- 'settings' => $settings,
502
- 'field_props' => array(
503
- 'input_type' => 'checkbox',
504
- 'template' => 'checkbox_field',
505
- 'required' => 'no',
506
- 'label' => __( 'Checkbox Field', 'wpuf' ),
507
- 'name' => '',
508
- 'is_meta' => 'yes',
509
- 'help' => '',
510
- 'css' => '',
511
- 'selected' => array(),
512
- 'inline' => 'no',
513
- 'options' => array( 'Option' => __( 'Option', 'wpuf' ) ),
514
- 'id' => 0,
515
- 'is_new' => true,
516
- 'wpuf_cond' => self::get_wpuf_cond_prop()
517
- )
518
- );
519
- }
520
-
521
- /**
522
- * Website URL field settings
523
- *
524
- * @since 2.5
525
- *
526
- * @return array
527
- */
528
- public static function website_url() {
529
- $settings = self::get_common_properties();
530
- $settings = array_merge( $settings, self::get_common_text_properties() );
531
-
532
- return array(
533
- 'template' => 'website_url',
534
- 'title' => __( 'URL', 'wpuf' ),
535
- 'icon' => 'link',
536
- 'settings' => $settings,
537
- 'field_props' => array(
538
- 'input_type' => 'text',
539
- 'template' => 'website_url',
540
- 'required' => 'no',
541
- 'label' => __( 'URL', 'wpuf' ),
542
- 'name' => '',
543
- 'is_meta' => 'yes',
544
- 'help' => '',
545
- 'css' => '',
546
- 'placeholder' => '',
547
- 'default' => '',
548
- 'size' => 40,
549
- 'id' => 0,
550
- 'is_new' => true,
551
- 'wpuf_cond' => self::get_wpuf_cond_prop()
552
- )
553
- );
554
- }
555
-
556
- /**
557
- * Email field settings
558
- *
559
- * @since 2.5
560
- *
561
- * @return array
562
- */
563
- public static function email_address() {
564
- $settings = self::get_common_properties();
565
- $settings = array_merge( $settings, self::get_common_text_properties() );
566
-
567
- return array(
568
- 'template' => 'email_address',
569
- 'title' => __( 'Email Address', 'wpuf' ),
570
- 'icon' => 'envelope-o',
571
- 'settings' => $settings,
572
- 'field_props' => array(
573
- 'input_type' => 'text',
574
- 'template' => 'email_address',
575
- 'required' => 'no',
576
- 'label' => __( 'Email', 'wpuf' ),
577
- 'name' => '',
578
- 'is_meta' => 'yes',
579
- 'help' => '',
580
- 'css' => '',
581
- 'placeholder' => '',
582
- 'default' => '',
583
- 'size' => 40,
584
- 'id' => 0,
585
- 'is_new' => true,
586
- 'wpuf_cond' => self::get_wpuf_cond_prop()
587
- )
588
- );
589
- }
590
-
591
- /**
592
- * Hidden field settings
593
- *
594
- * @since 2.5
595
- *
596
- * @return array
597
- */
598
- public static function custom_hidden_field() {
599
- $settings = array(
600
- array(
601
- 'name' => 'name',
602
- 'title' => __( 'Meta Key', 'wpuf' ),
603
- 'type' => 'text',
604
- 'section' => 'basic',
605
- 'priority' => 10,
606
- 'help_text' => __( 'Name of the meta key this field will save to', 'wpuf' ),
607
- ),
608
-
609
- array(
610
- 'name' => 'meta_value',
611
- 'title' => __( 'Meta Value', 'wpuf' ),
612
- 'type' => 'text',
613
- 'section' => 'basic',
614
- 'priority' => 11,
615
- 'help_text' => __( 'Enter the meta value', 'wpuf' ),
616
- ),
617
- );
618
-
619
- return array(
620
- 'template' => 'custom_hidden_field',
621
- 'title' => __( 'Hidden Field', 'wpuf' ),
622
- 'icon' => 'eye-slash',
623
- 'settings' => $settings,
624
- 'field_props' => array(
625
- 'input_type' => 'hidden',
626
- 'template' => 'custom_hidden_field',
627
- 'label' => '',
628
- 'name' => '',
629
- 'meta_value' => '',
630
- 'is_meta' => 'yes',
631
- 'id' => 0,
632
- 'is_new' => true,
633
- 'wpuf_cond' => null
634
- )
635
- );
636
- }
637
-
638
- /**
639
- * Image field settings
640
- *
641
- * @since 2.5
642
- *
643
- * @return array
644
- */
645
- public static function image_upload() {
646
- $settings = self::get_common_properties();
647
-
648
- $settings = array_merge( $settings, array(
649
- array(
650
- 'name' => 'max_size',
651
- 'title' => __( 'Max. file size', 'wpuf' ),
652
- 'type' => 'text',
653
- 'section' => 'advanced',
654
- 'priority' => 20,
655
- 'help_text' => __( 'Enter maximum upload size limit in KB', 'wpuf' ),
656
- ),
657
-
658
- array(
659
- 'name' => 'count',
660
- 'title' => __( 'Max. files', 'wpuf' ),
661
- 'type' => 'text',
662
- 'section' => 'advanced',
663
- 'priority' => 21,
664
- 'help_text' => __( 'Number of images can be uploaded', 'wpuf' ),
665
- ),
666
- ) );
667
-
668
- return array(
669
- 'template' => 'image_upload',
670
- 'title' => __( 'Image Upload', 'wpuf' ),
671
- 'icon' => 'file-image-o',
672
- 'settings' => $settings,
673
- 'field_props' => array(
674
- 'input_type' => 'image_upload',
675
- 'template' => 'image_upload',
676
- 'required' => 'no',
677
- 'label' => __( 'Image Upload', 'wpuf' ),
678
- 'name' => '',
679
- 'is_meta' => 'yes',
680
- 'help' => '',
681
- 'css' => '',
682
- 'max_size' => '1024',
683
- 'count' => '1',
684
- 'id' => 0,
685
- 'is_new' => true,
686
- 'wpuf_cond' => self::get_wpuf_cond_prop()
687
- )
688
- );
689
- }
690
-
691
- /**
692
- * Section break field settings
693
- *
694
- * @since 2.5
695
- *
696
- * @return array
697
- */
698
- public static function section_break() {
699
- $settings = array(
700
- array(
701
- 'name' => 'label',
702
- 'title' => __( 'Title', 'wpuf' ),
703
- 'type' => 'text',
704
- 'section' => 'basic',
705
- 'priority' => 10,
706
- 'help_text' => __( 'Title of the section', 'wpuf' ),
707
- ),
708
-
709
- array(
710
- 'name' => 'description',
711
- 'title' => __( 'Description', 'wpuf' ),
712
- 'type' => 'textarea',
713
- 'section' => 'basic',
714
- 'priority' => 11,
715
- 'help_text' => __( 'Some details text about the section', 'wpuf' ),
716
- ),
717
- );
718
-
719
- return array(
720
- 'template' => 'section_break',
721
- 'title' => __( 'Section Break', 'wpuf' ),
722
- 'is_full_width' => true,
723
- 'settings' => $settings,
724
- 'field_props' => array(
725
- 'input_type' => 'section_break',
726
- 'template' => 'section_break',
727
- 'label' => __( 'Section Break', 'wpuf' ),
728
- 'description' => __( 'Some description about this section', 'wpuf' ),
729
- 'id' => 0,
730
- 'is_new' => true,
731
- 'wpuf_cond' => self::get_wpuf_cond_prop()
732
- )
733
- );
734
- }
735
-
736
- /**
737
- * HTML field settings
738
- *
739
- * @since 2.5
740
- *
741
- * @return array
742
- */
743
- public static function custom_html() {
744
- $settings = array(
745
- array(
746
- 'name' => 'html',
747
- 'title' => __( 'HTML Codes', 'wpuf' ),
748
- 'type' => 'textarea',
749
- 'section' => 'basic',
750
- 'priority' => 11,
751
- 'help_text' => __( 'Paste your HTML codes, WordPress shortcodes will also work here', 'wpuf' ),
752
- ),
753
- );
754
-
755
- return array(
756
- 'template' => 'custom_html',
757
- 'title' => __( 'Custom HTML', 'wpuf' ),
758
- 'is_full_width' => true,
759
- 'settings' => $settings,
760
- 'field_props' => array(
761
- 'input_type' => 'html',
762
- 'template' => 'custom_html',
763
- 'label' => __( 'Custom HTML', 'wpuf' ),
764
- 'html' => sprintf( '<p>%s</p>', __( 'Some description about this section', 'wpuf' ) ),
765
- 'id' => 0,
766
- 'is_new' => true,
767
- 'wpuf_cond' => self::get_wpuf_cond_prop()
768
- )
769
- );
770
- }
771
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-builder/views/form-builder.php DELETED
@@ -1,115 +0,0 @@
1
- <form id="wpuf-form-builder" class="wpuf-form-builder-<?php echo $form_type; ?>" method="post" action="" @submit.prevent="save_form_builder" v-cloak>
2
- <fieldset :class="[is_form_saving ? 'disabled' : '']" :disabled="is_form_saving">
3
- <h2 class="nav-tab-wrapper">
4
- <a href="#wpuf-form-builder-container" class="nav-tab nav-tab-active">
5
- <?php _e( 'Form Editor', 'wpuf' ); ?>
6
- </a>
7
-
8
- <a href="#wpuf-form-builder-settings" class="nav-tab">
9
- <?php _e( 'Settings', 'wpuf' ); ?>
10
- </a>
11
-
12
- <?php do_action( "wpuf-form-builder-tabs-{$form_type}" ); ?>
13
-
14
- <span class="pull-right">
15
- <button v-if="!is_form_saving" type="button" class="button button-primary" @click="save_form_builder">
16
- <?php _e( 'Save Form', 'wpuf' ); ?>
17
- </button>
18
-
19
- <button v-else type="button" class="button button-primary button-ajax-working" disabled>
20
- <span class="loader"></span> <?php _e( 'Saving Form Data', 'wpuf' ); ?>
21
- </button>
22
- </span>
23
- </h2>
24
-
25
- <div class="tab-contents">
26
- <div id="wpuf-form-builder-container" class="group active">
27
- <div id="builder-stage">
28
- <header class="clearfix">
29
- <span v-if="!post_title_editing" class="form-title" @click.prevent="post_title_editing = true">{{ post.post_title }}</span>
30
-
31
- <span v-show="post_title_editing">
32
- <input type="text" v-model="post.post_title" name="post_title" />
33
- <button type="button" class="button button-small" style="margin-top: 13px;" @click.prevent="post_title_editing = false"><i class="fa fa-check"></i></button>
34
- </span>
35
-
36
- <i :class="(is_form_switcher ? 'fa fa-angle-up' : 'fa fa-angle-down') + ' form-switcher-arrow'" @click.prevent="switch_form"></i>
37
- <?php
38
- $form_id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;
39
-
40
- if ( count( $shortcodes ) > 1 && isset( $shortcodes[0]['type'] ) ) {
41
- foreach ( $shortcodes as $shortcode ) {
42
- printf( "<span class=\"form-id\" title=\"%s\" data-clipboard-text='%s'><i class=\"fa fa-clipboard\" aria-hidden=\"true\"></i> %s: #{{ post.ID }}</span>", sprintf( __( 'Click to copy %s shortcode', 'wpuf' ), $shortcode['type'] ), sprintf( '[%s type="%s" id="%s"]', $shortcode['name'], $shortcode['type'], $form_id ), ucwords( $shortcode['type'] ), $shortcode['type'] );
43
- }
44
- } else {
45
- printf( "<span class=\"form-id\" title=\"%s\" data-clipboard-text='%s'><i class=\"fa fa-clipboard\" aria-hidden=\"true\"></i> #{{ post.ID }}</span>", __( 'Click to copy shortcode', 'wpuf' ), '[' . $shortcodes[0]['name'] . ' id="' . $form_id . '"]' );
46
- }
47
- ?>
48
- </header>
49
-
50
- <ul v-if="is_form_switcher" class="form-switcher-content">
51
- <?php
52
- foreach ( $forms as $form ) {
53
- ?>
54
- <li><a class="<?php echo ( $form->ID == $_GET['id'] ) ? 'active' : ''; ?>" href="<?php echo admin_url( 'admin.php?page=wpuf-' . $form_type . '-forms&action=edit&id=' . $form->ID ); ?>"><?php echo $form->post_title; ?></a></li>
55
- <?php
56
- }
57
- ?>
58
- </ul>
59
-
60
- <section>
61
- <div id="form-preview">
62
- <builder-stage></builder-stage>
63
- </div>
64
- </section>
65
- </div><!-- #builder-stage -->
66
-
67
- <div id="builder-form-fields">
68
- <header>
69
- <ul class="clearfix">
70
- <li :class="['form-fields' === current_panel ? 'active' : '']">
71
- <a href="#add-fields" @click.prevent="set_current_panel('form-fields')">
72
- <?php _e( 'Add Fields', 'wpuf' ); ?>
73
- </a>
74
- </li>
75
-
76
- <li :class="['field-options' === current_panel ? 'active' : '', !form_fields_count ? 'disabled' : '']">
77
- <a href="#field-options" @click.prevent="set_current_panel('field-options')">
78
- <?php _e( 'Field Options', 'wpuf' ); ?>
79
- </a>
80
- </li>
81
- </ul>
82
- </header>
83
-
84
- <section>
85
- <div class="wpuf-form-builder-panel">
86
- <component :is="current_panel"></component>
87
- </div>
88
- </section>
89
- </div><!-- #builder-form-fields -->
90
- </div><!-- #wpuf-form-builder-container -->
91
-
92
- <div id="wpuf-form-builder-settings" class="group clearfix">
93
- <fieldset>
94
- <h2 id="wpuf-form-builder-settings-tabs" class="nav-tab-wrapper">
95
- <?php do_action( "wpuf-form-builder-settings-tabs-{$form_type}" ); ?>
96
- </h2><!-- #wpuf-form-builder-settings-tabs -->
97
-
98
- <div id="wpuf-form-builder-settings-contents" class="tab-contents">
99
- <?php do_action( "wpuf-form-builder-settings-tab-contents-{$form_type}" ); ?>
100
- </div><!-- #wpuf-form-builder-settings-contents -->
101
- </fieldset>
102
- </div><!-- #wpuf-form-builder-settings -->
103
-
104
- <?php do_action( "wpuf-form-builder-tab-contents-{$form_type}" ); ?>
105
- </div>
106
-
107
- <?php if ( ! empty( $form_settings_key ) ): ?>
108
- <input type="hidden" name="form_settings_key" value="<?php echo $form_settings_key; ?>">
109
- <?php endif; ?>
110
-
111
- <?php wp_nonce_field( 'wpuf_form_builder_save_form', 'wpuf_form_builder_nonce' ); ?>
112
-
113
- <input type="hidden" name="wpuf_form_id" value="<?php echo $form_id; ?>">
114
- </fieldset>
115
- </form><!-- #wpuf-form-builder -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-handler.php DELETED
@@ -1,372 +0,0 @@
1
- <?php
2
- class WPUF_Admin_Form_Handler {
3
-
4
- public function __construct() {
5
- $user_frontend = sanitize_title( __( 'User Frontend', 'wpuf' ) );
6
-
7
- // post forms list table
8
- add_action( "load-{$user_frontend}_page_wpuf-post-forms", array( $this, 'post_forms_actions' ) );
9
- add_action( "load-{$user_frontend}_page_wpuf-profile-forms", array( $this, 'profile_forms_actions' ) );
10
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
11
- add_action( 'removable_query_args', array( $this, 'removable_query_args' ) );
12
- }
13
-
14
- /**
15
- * Check current page actions
16
- *
17
- * @since 2.5
18
- *
19
- * @param integer $page_id
20
- * @param integer $bulk_action
21
- *
22
- * @return boolean
23
- */
24
- public function verify_current_page_screen( $page_id, $bulk_action ) {
25
-
26
- if ( ! isset( $_GET['_wpnonce'] ) || ! isset( $_GET['page'] ) ) {
27
- return false;
28
- }
29
-
30
- if ( $_GET['page'] != $page_id ) {
31
- return false;
32
- }
33
-
34
- if ( ! wp_verify_nonce( $_GET['_wpnonce'], $bulk_action ) ) {
35
- return false;
36
- }
37
-
38
- return true;
39
- }
40
-
41
- /**
42
- * Handle Post Forms list table action
43
- *
44
- * @since 2.5
45
- *
46
- * @return void
47
- */
48
- public function post_forms_actions() {
49
- // Nonce validation
50
- if ( ! $this->verify_current_page_screen( 'wpuf-post-forms', 'bulk-post-forms' ) ) {
51
- return;
52
- }
53
-
54
- // Check permission if not wpuf admin then go out from here
55
- if ( ! current_user_can( wpuf_admin_role() ) ) {
56
- wp_die( __( 'You do not have sufficient permissions to do this action', 'wpuf' ) );
57
- }
58
-
59
-
60
- $post_forms = new WPUF_Admin_Post_Forms_List_Table();
61
- $action = $post_forms->current_action();
62
-
63
- if ( $action ) {
64
-
65
- $remove_query_args = array(
66
- '_wp_http_referer', '_wpnonce', 'action', 'id', 'post', 'action2',
67
- );
68
-
69
- $add_query_args = array();
70
-
71
- switch ( $action ) {
72
- case 'post_form_search':
73
- $redirect = remove_query_arg( array( 'post_form_search' ), $redirect );
74
-
75
- break;
76
-
77
- case 'trash' :
78
-
79
- if ( ! empty( $_GET['id'] ) ) {
80
- delete_post_meta( $_GET['id'], '_wp_trash_meta_status' );
81
- delete_post_meta( $_GET['id'], '_wp_trash_meta_time' );
82
- delete_post_meta( $_GET['id'], '_wp_desired_post_slug' );
83
-
84
- wp_trash_post( $_GET['id'] );
85
-
86
- $add_query_args['trashed'] = 1;
87
-
88
- } else if ( ! empty( $_GET['post'] ) ) {
89
- foreach ( $_GET['post'] as $post_id ) {
90
- delete_post_meta( $post_id, '_wp_trash_meta_status' );
91
- delete_post_meta( $post_id, '_wp_trash_meta_time' );
92
- delete_post_meta( $post_id, '_wp_desired_post_slug' );
93
-
94
- wp_trash_post( $post_id );
95
- }
96
-
97
- $add_query_args['trashed'] = count( $_GET['post'] );
98
- }
99
-
100
- break;
101
-
102
- case 'restore' :
103
- if ( !empty( $_GET['id'] ) ) {
104
- $trash_meta_status = get_post_meta( $_GET['id'], '_wp_trash_meta_status', true );
105
-
106
- $args = array(
107
- 'ID' => $_GET['id'],
108
- 'post_status' => $trash_meta_status,
109
- );
110
-
111
- wp_update_post( $args );
112
-
113
- $add_query_args['untrashed'] = 1;
114
-
115
- } else if ( ! empty( $_GET['post'] ) ) {
116
- foreach ( $_GET['post'] as $post_id ) {
117
- $trash_meta_status = get_post_meta( $post_id, '_wp_trash_meta_status', true );
118
-
119
- $args = array(
120
- 'ID' => $post_id,
121
- 'post_status' => $trash_meta_status,
122
- );
123
-
124
- wp_update_post( $args );
125
-
126
- $add_query_args['untrashed'] = count( $_GET['post'] );
127
- }
128
- }
129
-
130
- break;
131
-
132
- case 'delete' :
133
-
134
- if ( ! empty( $_GET['id'] ) ) {
135
- wp_delete_post( $_GET['id'] );
136
-
137
- $add_query_args['deleted'] = 1;
138
-
139
- } else if ( ! empty( $_GET['post'] ) ) {
140
- foreach ( $_GET['post'] as $post_id ) {
141
- wp_delete_post( $post_id );
142
- }
143
-
144
- $add_query_args['deleted'] = count( $_GET['post'] );
145
- }
146
-
147
- $add_query_args['post_status'] = 'trash';
148
-
149
- break;
150
-
151
- case 'duplicate':
152
- if ( ! empty( $_GET['id'] ) ) {
153
- $add_query_args['duplicated'] = wpuf_duplicate_form( $_GET['id'] );
154
- }
155
-
156
- break;
157
- }
158
-
159
- $redirect = remove_query_arg( $remove_query_args, wp_unslash( $_SERVER['REQUEST_URI'] ) );
160
-
161
- $redirect = add_query_arg( $add_query_args, $redirect );
162
-
163
- wp_redirect( $redirect );
164
- exit();
165
- }
166
- }
167
-
168
- /**
169
- * Handle Profile Forms list table action
170
- *
171
- * @since 2.5
172
- *
173
- * @return void
174
- */
175
- public function profile_forms_actions() {
176
- // Nonce validation
177
- if ( ! $this->verify_current_page_screen( 'wpuf-profile-forms', 'bulk-profile-forms' ) ) {
178
- return;
179
- }
180
-
181
- // Check permission if not wpuf admin then go out from here
182
- if ( ! current_user_can( wpuf_admin_role() ) ) {
183
- wp_die( __( 'You do not have sufficient permissions to do this action', 'wpuf' ) );
184
- }
185
-
186
-
187
- $profile_forms = new WPUF_Admin_Profile_Forms_List_Table();
188
- $action = $profile_forms->current_action();
189
-
190
- if ( $action ) {
191
-
192
- $remove_query_args = array(
193
- '_wp_http_referer', '_wpnonce', 'action', 'id', 'post', 'action2',
194
- );
195
-
196
- $add_query_args = array();
197
-
198
- switch ( $action ) {
199
- case 'profile_form_search':
200
- $redirect = remove_query_arg( array( 'profile_form_search' ), $redirect );
201
-
202
- break;
203
-
204
- case 'trash' :
205
-
206
- if ( ! empty( $_GET['id'] ) ) {
207
- delete_post_meta( $_GET['id'], '_wp_trash_meta_status' );
208
- delete_post_meta( $_GET['id'], '_wp_trash_meta_time' );
209
- delete_post_meta( $_GET['id'], '_wp_desired_post_slug' );
210
-
211
- wp_trash_post( $_GET['id'] );
212
-
213
- $add_query_args['trashed'] = 1;
214
-
215
- } else if ( ! empty( $_GET['post'] ) ) {
216
- foreach ( $_GET['post'] as $post_id ) {
217
- delete_post_meta( $post_id, '_wp_trash_meta_status' );
218
- delete_post_meta( $post_id, '_wp_trash_meta_time' );
219
- delete_post_meta( $post_id, '_wp_desired_post_slug' );
220
-
221
- wp_trash_post( $post_id );
222
- }
223
-
224
- $add_query_args['trashed'] = count( $_GET['post'] );
225
- }
226
-
227
- break;
228
-
229
- case 'restore' :
230
- if ( !empty( $_GET['id'] ) ) {
231
- $trash_meta_status = get_post_meta( $_GET['id'], '_wp_trash_meta_status', true );
232
-
233
- $args = array(
234
- 'ID' => $_GET['id'],
235
- 'post_status' => $trash_meta_status,
236
- );
237
-
238
- wp_update_post( $args );
239
-
240
- $add_query_args['untrashed'] = 1;
241
-
242
- } else if ( ! empty( $_GET['post'] ) ) {
243
- foreach ( $_GET['post'] as $post_id ) {
244
- $trash_meta_status = get_post_meta( $post_id, '_wp_trash_meta_status', true );
245
-
246
- $args = array(
247
- 'ID' => $post_id,
248
- 'post_status' => $trash_meta_status,
249
- );
250
-
251
- wp_update_post( $args );
252
-
253
- $add_query_args['untrashed'] = count( $_GET['post'] );
254
- }
255
- }
256
-
257
- break;
258
-
259
- case 'delete' :
260
-
261
- if ( ! empty( $_GET['id'] ) ) {
262
- wp_delete_post( $_GET['id'] );
263
-
264
- $add_query_args['deleted'] = 1;
265
-
266
- } else if ( ! empty( $_GET['post'] ) ) {
267
- foreach ( $_GET['post'] as $post_id ) {
268
- wp_delete_post( $post_id );
269
- }
270
-
271
- $add_query_args['deleted'] = count( $_GET['post'] );
272
- }
273
-
274
- $add_query_args['post_status'] = 'trash';
275
-
276
- break;
277
-
278
- case 'duplicate':
279
- if ( ! empty( $_GET['id'] ) ) {
280
- $add_query_args['duplicated'] = wpuf_duplicate_form( $_GET['id'] );
281
- }
282
-
283
- break;
284
- }
285
-
286
- $redirect = remove_query_arg( $remove_query_args, wp_unslash( $_SERVER['REQUEST_URI'] ) );
287
-
288
- $redirect = add_query_arg( $add_query_args, $redirect );
289
-
290
- wp_redirect( $redirect );
291
- exit();
292
- }
293
- }
294
-
295
- /**
296
- * Print notices for WordPress
297
- *
298
- * @since 2.5
299
- *
300
- * @param string $text
301
- * @param string $type
302
- *
303
- * @return void
304
- */
305
- public function display_notice( $text, $type = 'updated' ) {
306
- printf( '<div class="%s"><p>%s</p></div>', esc_attr( $type ), $text );
307
- }
308
-
309
- /**
310
- * Admin notices
311
- *
312
- * @since 2.5
313
- *
314
- * @return void
315
- */
316
- public function admin_notices() {
317
- if ( !empty( $_GET['page'] ) && 'wpuf-post-forms' === $_GET['page'] ) {
318
- if ( !empty( $_GET['trashed'] ) ) {
319
- $notice = sprintf( _n( '%d form moved to the trash.', '%d forms moved to the trash.', $_GET['trashed'], 'wpuf' ), $_GET['trashed'] );
320
- $this->display_notice( $notice );
321
-
322
- } else if ( !empty( $_GET['untrashed'] ) ) {
323
- $notice = sprintf( _n( '%d form restored from the trash.', '%d forms restored from the trash.', $_GET['untrashed'], 'wpuf' ), $_GET['untrashed'] );
324
- $this->display_notice( $notice );
325
-
326
- } else if ( !empty( $_GET['deleted'] ) ) {
327
- $notice = sprintf( _n( '%d form permanently deleted.', '%d forms permanently deleted.', $_GET['deleted'], 'wpuf' ), $_GET['deleted'] );
328
- $this->display_notice( $notice );
329
-
330
- } else if ( !empty( $_GET['duplicated'] ) ) {
331
- $form_url = admin_url( 'admin.php?page=wpuf-post-forms&action=edit&id=' . $_GET['duplicated'] );
332
- $notice = sprintf( __( 'Form duplicated successfully. <a href="%s">View form.</a>', 'wpuf' ), $form_url );
333
- $this->display_notice( $notice );
334
- }
335
- }
336
-
337
- if ( !empty( $_GET['page'] ) && 'wpuf-profile-forms' === $_GET['page'] ) {
338
- if ( !empty( $_GET['trashed'] ) ) {
339
- $notice = sprintf( _n( '%d form moved to the trash.', '%d forms moved to the trash.', $_GET['trashed'], 'wpuf' ), $_GET['trashed'] );
340
- $this->display_notice( $notice );
341
-
342
- } else if ( !empty( $_GET['untrashed'] ) ) {
343
- $notice = sprintf( _n( '%d form restored from the trash.', '%d forms restored from the trash.', $_GET['untrashed'], 'wpuf' ), $_GET['untrashed'] );
344
- $this->display_notice( $notice );
345
-
346
- } else if ( !empty( $_GET['deleted'] ) ) {
347
- $notice = sprintf( _n( '%d form permanently deleted.', '%d forms permanently deleted.', $_GET['deleted'], 'wpuf' ), $_GET['deleted'] );
348
- $this->display_notice( $notice );
349
-
350
- } else if ( !empty( $_GET['duplicated'] ) ) {
351
- $form_url = admin_url( 'admin.php?page=wpuf-profile-forms&action=edit&id=' . $_GET['duplicated'] );
352
- $notice = sprintf( __( 'Form duplicated successfully. <a href="%s">View form.</a>', 'wpuf' ), $form_url );
353
- $this->display_notice( $notice );
354
- }
355
- }
356
- }
357
-
358
- /**
359
- * Add custom query args to the wp removable query args
360
- *
361
- * @since 2.5
362
- *
363
- * @param array $args
364
- *
365
- * @return array
366
- */
367
- public function removable_query_args() {
368
- $args[] = 'duplicated';
369
-
370
- return $args;
371
- }
372
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form-template.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Admin form template handler
5
- *
6
- * Create forms based on form templates
7
- *
8
- * @since 2.4
9
- */
10
- class WPUF_Admin_Form_Template {
11
-
12
- public function __construct() {
13
- add_action( 'admin_enqueue_scripts', array($this, 'enqueue_scripts') );
14
-
15
- // post form templates
16
- add_action( 'admin_footer', array( $this, 'render_post_form_templates' ) );
17
- add_filter( 'admin_action_wpuf_post_form_template', array( $this, 'create_post_form_from_template' ) );
18
-
19
- // form settings
20
- add_action( 'wpuf_form_setting', array( $this, 'post_form_settings' ), 8, 2 );
21
-
22
- // frontend insert/update
23
- add_action( 'wpuf_add_post_after_insert', array( $this, 'post_form_submission' ), 10, 3 );
24
- add_action( 'wpuf_edit_post_after_update', array( $this, 'post_form_submission' ), 10, 3 );
25
- }
26
-
27
- /**
28
- * Should a form displayed or sciprt enqueued?
29
- *
30
- * @return boolean
31
- */
32
- public function should_display() {
33
- $current_screen = get_current_screen();
34
-
35
- if ( in_array( $current_screen->id, array( 'user-frontend_page_wpuf-post-forms' ) ) ) {
36
- return true;
37
- }
38
-
39
- return false;
40
- }
41
-
42
- public function enqueue_scripts() {
43
- if ( ! $this->should_display() ) {
44
- return;
45
- }
46
-
47
- wp_enqueue_style( 'wpuf-formbuilder', WPUF_ASSET_URI . '/css/formbuilder.css' );
48
- }
49
-
50
- /**
51
- * Render the forms in the modal
52
- *
53
- * @return void
54
- */
55
- public function render_post_form_templates() {
56
- if ( ! $this->should_display() ) {
57
- return;
58
- }
59
-
60
- $registry = wpuf_get_post_form_templates();
61
-
62
- if ( ! $registry ) {
63
- return;
64
- }
65
-
66
- include dirname( __FILE__ ) . '/html/modal.php';
67
- }
68
-
69
- /**
70
- * Get a template object by name from the registry
71
- *
72
- * @param string $template
73
- *
74
- * @return boolean|WPUF_Post_Form_Template
75
- */
76
- public function get_template_object( $template ) {
77
- $registry = wpuf_get_post_form_templates();
78
-
79
- if ( ! array_key_exists( $template, $registry ) ) {
80
- return false;
81
- }
82
-
83
- $template_object = $registry[ $template ];
84
-
85
- if ( ! is_a( $template_object, 'WPUF_Post_Form_Template') ) {
86
- return false;
87
- }
88
-
89
- return $template_object;
90
- }
91
-
92
- /**
93
- * Create a posting form from a post template
94
- *
95
- * @since 2.4
96
- *
97
- * @return void
98
- */
99
- public function create_post_form_from_template() {
100
- check_admin_referer( 'wpuf_create_from_template' );
101
-
102
- $template_name = isset( $_GET['template'] ) ? sanitize_text_field( $_GET['template'] ) : '';
103
-
104
- if ( ! $template_name ) {
105
- return;
106
- }
107
-
108
- $template_object = $this->get_template_object( $template_name );
109
-
110
- if ( false === $template_object ) {
111
- return;
112
- }
113
-
114
- // var_dump( $template_object ); die();
115
- $current_user = get_current_user_id();
116
-
117
- $form_post_data = array(
118
- 'post_title' => $template_object->get_title(),
119
- 'post_type' => 'wpuf_forms',
120
- 'post_status' => 'publish',
121
- 'post_author' => $current_user
122
- );
123
-
124
- $form_id = wp_insert_post( $form_post_data );
125
-
126
- if ( is_wp_error( $form_id ) ) {
127
- return;
128
- }
129
-
130
- // form has been created, lets setup
131
- update_post_meta( $form_id, 'wpuf_form_settings', $template_object->get_form_settings() );
132
-
133
- $form_fields = $template_object->get_form_fields();
134
-
135
- if ( ! $form_fields ) {
136
- return;
137
- }
138
-
139
- foreach ($form_fields as $menu_order => $field) {
140
- wp_insert_post( array(
141
- 'post_type' => 'wpuf_input',
142
- 'post_status' => 'publish',
143
- 'post_content' => maybe_serialize( $field ),
144
- 'post_parent' => $form_id,
145
- 'menu_order' => $menu_order
146
- ) );
147
- }
148
-
149
- wp_redirect( admin_url( 'admin.php?page=wpuf-post-forms&action=edit&id=' . $form_id ) );
150
- exit;
151
- }
152
-
153
- /**
154
- * Add settings field to override a form template
155
- *
156
- * @param array $form_settings
157
- * @param object $post
158
- *
159
- * @return void
160
- */
161
- public function post_form_settings( $form_settings, $post ) {
162
- $registry = wpuf_get_post_form_templates();
163
- $selected = isset( $form_settings['form_template'] ) ? $form_settings['form_template'] : '';
164
- ?>
165
- <tr>
166
- <th><?php _e( 'Form Template', 'wpuf' ); ?></th>
167
- <td>
168
- <select name="wpuf_settings[form_template]">
169
- <option value=""><?php echo __( '&mdash; No Template &mdash;', 'wpuf' ); ?></option>
170
- <?php
171
- if ( $registry ) {
172
- foreach ($registry as $key => $template) {
173
- printf( '<option value="%s"%s>%s</option>' . "\n", $key, selected( $selected, $key, false ), $template->get_title() );
174
- }
175
- }
176
- ?>
177
- </select>
178
- <p class="description"><?php _e( 'If selected a form template, it will try to execute that integration options when new post created and updated.', 'wpuf' ); ?></p>
179
- </td>
180
- </tr>
181
- <?php
182
- }
183
-
184
- /**
185
- * Call the integration functions on form submission/update
186
- *
187
- * @param int $post_id
188
- * @param int $form_id
189
- * @param array $form_settings
190
- *
191
- * @return void
192
- */
193
- public function post_form_submission( $post_id, $form_id, $form_settings ) {
194
- $template = isset( $form_settings['form_template'] ) ? $form_settings['form_template'] : '';
195
-
196
- if ( !$template ) {
197
- return;
198
- }
199
-
200
- $template_object = $this->get_template_object( $template );
201
-
202
- if ( false === $template_object ) {
203
- return;
204
- }
205
-
206
- $current_action = current_action();
207
-
208
- if ( $current_action == 'wpuf_add_post_after_insert' ) {
209
- $template_object->after_insert( $post_id, $form_id, $form_settings );
210
- } elseif ( $current_action == 'wpuf_edit_post_after_update' ) {
211
- $template_object->after_update( $post_id, $form_id, $form_settings );
212
- }
213
- }
214
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/form.php DELETED
@@ -1,1243 +0,0 @@
1
- <?php
2
- /**
3
- * Post Forms or wpuf_forms form builder class
4
- *
5
- * @package WP User Frontend
6
- */
7
-
8
- class WPUF_Admin_Form {
9
- /**
10
- * Form type of which we're working on
11
- *
12
- * @var string
13
- */
14
- private $form_type = 'post';
15
-
16
- /**
17
- * Form settings key
18
- *
19
- * @var string
20
- */
21
- private $form_settings_key = 'wpuf_form_settings';
22
-
23
- /**
24
- * WP post types
25
- *
26
- * @var string
27
- */
28
- private $wp_post_types = array();
29
-
30
- /**
31
- * Add neccessary actions and filters
32
- *
33
- * @return void
34
- */
35
- public function __construct() {
36
- add_action( 'init', array($this, 'register_post_type') );
37
-
38
- $user_frontend = sanitize_title( __( 'User Frontend', 'wpuf' ) );
39
- add_action( "load-{$user_frontend}_page_wpuf-post-forms", array( $this, 'post_forms_builder_init' ) );
40
- }
41
-
42
- /**
43
- * Register form post types
44
- *
45
- * @return void
46
- */
47
- public function register_post_type() {
48
- $capability = wpuf_admin_role();
49
-
50
- register_post_type( 'wpuf_forms', array(
51
- 'label' => __( 'Forms', 'wpuf' ),
52
- 'public' => false,
53
- 'show_ui' => false,
54
- 'show_in_menu' => false, //false,
55
- 'capability_type' => 'post',
56
- 'hierarchical' => false,
57
- 'query_var' => false,
58
- 'supports' => array('title'),
59
- 'capabilities' => array(
60
- 'publish_posts' => $capability,
61
- 'edit_posts' => $capability,
62
- 'edit_others_posts' => $capability,
63
- 'delete_posts' => $capability,
64
- 'delete_others_posts' => $capability,
65
- 'read_private_posts' => $capability,
66
- 'edit_post' => $capability,
67
- 'delete_post' => $capability,
68
- 'read_post' => $capability,
69
- ),
70
- 'labels' => array(
71
- 'name' => __( 'Forms', 'wpuf' ),
72
- 'singular_name' => __( 'Form', 'wpuf' ),
73
- 'menu_name' => __( 'Forms', 'wpuf' ),
74
- 'add_new' => __( 'Add Form', 'wpuf' ),
75
- 'add_new_item' => __( 'Add New Form', 'wpuf' ),
76
- 'edit' => __( 'Edit', 'wpuf' ),
77
- 'edit_item' => __( 'Edit Form', 'wpuf' ),
78
- 'new_item' => __( 'New Form', 'wpuf' ),
79
- 'view' => __( 'View Form', 'wpuf' ),
80
- 'view_item' => __( 'View Form', 'wpuf' ),
81
- 'search_items' => __( 'Search Form', 'wpuf' ),
82
- 'not_found' => __( 'No Form Found', 'wpuf' ),
83
- 'not_found_in_trash' => __( 'No Form Found in Trash', 'wpuf' ),
84
- 'parent' => __( 'Parent Form', 'wpuf' ),
85
- ),
86
- ) );
87
-
88
- register_post_type( 'wpuf_profile', array(
89
- 'label' => __( 'Registraton Forms', 'wpuf' ),
90
- 'public' => false,
91
- 'show_ui' => false,
92
- 'show_in_menu' => false,
93
- 'capability_type' => 'post',
94
- 'hierarchical' => false,
95
- 'query_var' => false,
96
- 'supports' => array('title'),
97
- 'capabilities' => array(
98
- 'publish_posts' => $capability,
99
- 'edit_posts' => $capability,
100
- 'edit_others_posts' => $capability,
101
- 'delete_posts' => $capability,
102
- 'delete_others_posts' => $capability,
103
- 'read_private_posts' => $capability,
104
- 'edit_post' => $capability,
105
- 'delete_post' => $capability,
106
- 'read_post' => $capability,
107
- ),
108
- 'labels' => array(
109
- 'name' => __( 'Forms', 'wpuf' ),
110
- 'singular_name' => __( 'Form', 'wpuf' ),
111
- 'menu_name' => __( 'Registration Forms', 'wpuf' ),
112
- 'add_new' => __( 'Add Form', 'wpuf' ),
113
- 'add_new_item' => __( 'Add New Form', 'wpuf' ),
114
- 'edit' => __( 'Edit', 'wpuf' ),
115
- 'edit_item' => __( 'Edit Form', 'wpuf' ),
116
- 'new_item' => __( 'New Form', 'wpuf' ),
117
- 'view' => __( 'View Form', 'wpuf' ),
118
- 'view_item' => __( 'View Form', 'wpuf' ),
119
- 'search_items' => __( 'Search Form', 'wpuf' ),
120
- 'not_found' => __( 'No Form Found', 'wpuf' ),
121
- 'not_found_in_trash' => __( 'No Form Found in Trash', 'wpuf' ),
122
- 'parent' => __( 'Parent Form', 'wpuf' ),
123
- ),
124
- ) );
125
-
126
- register_post_type( 'wpuf_input', array(
127
- 'public' => false,
128
- 'show_ui' => false,
129
- 'show_in_menu' => false,
130
- ) );
131
- }
132
-
133
- /**
134
- * Initiate form builder for wpuf_forms post type
135
- *
136
- * @since 2.5
137
- *
138
- * @return void
139
- */
140
- public function post_forms_builder_init() {
141
-
142
- if ( ! isset( $_GET['action'] ) ) {
143
- return;
144
- }
145
-
146
- if ( 'add-new' === $_GET['action'] && empty( $_GET['id'] ) ) {
147
- $form_id = wpuf_create_sample_form( 'Sample Form', 'wpuf_forms', true );
148
- $add_new_page_url = add_query_arg( array( 'id' => $form_id ), admin_url( 'admin.php?page=wpuf-post-forms&action=edit' ) );
149
- wp_redirect( $add_new_page_url );
150
- }
151
-
152
- if ( ( 'edit' === $_GET['action'] ) && ! empty( $_GET['id'] ) ) {
153
-
154
- add_action( 'wpuf-form-builder-tabs-post', array( $this, 'add_primary_tabs' ) );
155
- add_action( 'wpuf-form-builder-tab-contents-post', array( $this, 'add_primary_tab_contents' ) );
156
- add_action( 'wpuf-form-builder-settings-tabs-post', array( $this, 'add_settings_tabs' ) );
157
- add_action( 'wpuf-form-builder-settings-tab-contents-post', array( $this, 'add_settings_tab_contents' ) );
158
- add_filter( 'wpuf-form-builder-fields-section-before', array( $this, 'add_post_field_section' ) );
159
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
160
- add_action( 'wpuf-form-builder-js-deps', array( $this, 'js_dependencies' ) );
161
- add_filter( 'wpuf-form-builder-js-root-mixins', array( $this, 'js_root_mixins' ) );
162
- add_filter( 'wpuf-form-builder-js-builder-stage-mixins', array( $this, 'js_builder_stage_mixins' ) );
163
- add_filter( 'wpuf-form-builder-js-field-options-mixins', array( $this, 'js_field_options_mixins' ) );
164
- add_action( 'wpuf-form-builder-template-builder-stage-submit-area', array( $this, 'add_form_submit_area' ) );
165
- add_action( 'wpuf-form-builder-localize-script', array( $this, 'add_to_localize_script' ) );
166
- add_filter( 'wpuf-form-builder-field-settings', array( $this, 'add_field_settings' ) );
167
- add_filter( 'wpuf-form-builder-i18n', array( $this, 'i18n' ) );
168
-
169
- do_action( 'wpuf-form-builder-init-type-wpuf_forms' );
170
-
171
- $this->set_wp_post_types();
172
-
173
- $settings = array(
174
- 'form_type' => 'post',
175
- 'post_type' => 'wpuf_forms',
176
- 'post_id' => $_GET['id'],
177
- 'form_settings_key' => $this->form_settings_key,
178
- 'shortcodes' => array( array( 'name' => 'wpuf_form' ) )
179
- );
180
-
181
- new WPUF_Admin_Form_Builder( $settings );
182
- }
183
- }
184
-
185
- /**
186
- * Additional primary tabs
187
- *
188
- * @since 2.5
189
- *
190
- * @return void
191
- */
192
- public function add_primary_tabs() {
193
- ?>
194
-
195
- <a href="#wpuf-form-builder-notification" class="nav-tab">
196
- <?php _e( 'Notification', 'wpuf' ); ?>
197
- </a>
198
-
199
- <?php
200
- }
201
-
202
- /**
203
- * Add primary tab contents
204
- *
205
- * @since 2.5
206
- *
207
- * @return void
208
- */
209
- public function add_primary_tab_contents() {
210
- ?>
211
-
212
- <div id="wpuf-form-builder-notification" class="group">
213
- <?php do_action('wpuf_form_settings_post_notification'); ?>
214
- </div><!-- #wpuf-form-builder-notification -->
215
-
216
- <?php
217
- }
218
-
219
- /**
220
- * Add settings tabs
221
- *
222
- * @since 2.5
223
- *
224
- * @return void
225
- */
226
- public function add_settings_tabs() {
227
- ?>
228
-
229
- <a href="#wpuf-metabox-settings" class="nav-tab"><?php _e( 'Post Settings', 'wpuf' ); ?></a>
230
- <a href="#wpuf-metabox-settings-update" class="nav-tab"><?php _e( 'Edit Settings', 'wpuf' ); ?></a>
231
- <a href="#wpuf-metabox-post_expiration" class="nav-tab"><?php _e( 'Post Expiration', 'wpuf' ); ?></a>
232
-
233
- <?php
234
- }
235
-
236
- /**
237
- * Add settings tabs
238
- *
239
- * @since 2.5
240
- *
241
- * @return void
242
- */
243
- public function add_settings_tab_contents() {
244
- ?>
245
-
246
- <div id="wpuf-metabox-settings" class="group">
247
- <?php $this->form_settings_posts(); ?>
248
- </div>
249
-
250
- <div id="wpuf-metabox-settings-update" class="group">
251
- <?php $this->form_settings_posts_edit(); ?>
252
- </div>
253
-
254
- <div id="wpuf-metabox-post_expiration" class="group wpuf-metabox-post_expiration">
255
- <?php $this->form_post_expiration(); ?>
256
- </div>
257
-
258
- <?php do_action( 'wpuf_post_form_tab_content' ); ?>
259
-
260
- <?php
261
- }
262
-
263
- /**
264
- * Displays settings on post form builder
265
- *
266
- * @since 2.3.2
267
- *
268
- * @return void
269
- */
270
- public function form_settings_posts() {
271
- global $post;
272
-
273
- $form_settings = wpuf_get_form_settings( $post->ID );
274
-
275
- $post_status_selected = isset( $form_settings['post_status'] ) ? $form_settings['post_status'] : 'publish';
276
- $restrict_message = __( "This page is restricted. Please Log in / Register to view this page.", 'wpuf' );
277
-
278
- $post_type_selected = isset( $form_settings['post_type'] ) ? $form_settings['post_type'] : 'post';
279
-
280
- $post_format_selected = isset( $form_settings['post_format'] ) ? $form_settings['post_format'] : 0;
281
- $default_cat = isset( $form_settings['default_cat'] ) ? $form_settings['default_cat'] : -1;
282
-
283
- $guest_post = isset( $form_settings['guest_post'] ) ? $form_settings['guest_post'] : 'false';
284
- $guest_details = isset( $form_settings['guest_details'] ) ? $form_settings['guest_details'] : 'true';
285
- $name_label = isset( $form_settings['name_label'] ) ? $form_settings['name_label'] : __( 'Name' );
286
- $email_label = isset( $form_settings['email_label'] ) ? $form_settings['email_label'] : __( 'Email' );
287
- $message_restrict = isset( $form_settings['message_restrict'] ) ? $form_settings['message_restrict'] : $restrict_message;
288
-
289
- $redirect_to = isset( $form_settings['redirect_to'] ) ? $form_settings['redirect_to'] : 'post';
290
- $message = isset( $form_settings['message'] ) ? $form_settings['message'] : __( 'Post saved', 'wpuf' );
291
- $update_message = isset( $form_settings['update_message'] ) ? $form_settings['update_message'] : __( 'Post updated successfully', 'wpuf' );
292
- $page_id = isset( $form_settings['page_id'] ) ? $form_settings['page_id'] : 0;
293
- $url = isset( $form_settings['url'] ) ? $form_settings['url'] : '';
294
- $comment_status = isset( $form_settings['comment_status'] ) ? $form_settings['comment_status'] : 'open';
295
-
296
- $submit_text = isset( $form_settings['submit_text'] ) ? $form_settings['submit_text'] : __( 'Submit', 'wpuf' );
297
- $draft_text = isset( $form_settings['draft_text'] ) ? $form_settings['draft_text'] : __( 'Save Draft', 'wpuf' );
298
- $preview_text = isset( $form_settings['preview_text'] ) ? $form_settings['preview_text'] : __( 'Preview', 'wpuf' );
299
- $draft_post = isset( $form_settings['draft_post'] ) ? $form_settings['draft_post'] : 'false';
300
- $subscription_disabled = isset( $form_settings['subscription_disabled'] ) ? $form_settings['subscription_disabled'] : '';
301
-
302
- ?>
303
- <table class="form-table">
304
-
305
- <tr class="">
306
- <th><?php _e( 'Disable Subscription', 'wpuf' ); ?></th>
307
- <td>
308
- <label>
309
- <input type="checkbox" name="wpuf_settings[subscription_disabled]" value="yes" <?php checked( $subscription_disabled, 'yes' ); ?> />
310
- <?php _e( 'Disable Subscription', 'wpuf' ); ?>
311
- </label>
312
-
313
- <p class="description"><?php echo __( 'If checked, any subscription and pay-per-post will be disabled on the form and will take no effect.', 'wpuf' ); ?></p>
314
- </td>
315
- </tr>
316
-
317
- <tr class="wpuf-post-type">
318
- <th><?php _e( 'Post Type', 'wpuf' ); ?></th>
319
- <td>
320
- <select name="wpuf_settings[post_type]">
321
- <?php
322
- $post_types = get_post_types();
323
- unset($post_types['attachment']);
324
- unset($post_types['revision']);
325
- unset($post_types['nav_menu_item']);
326
- unset($post_types['wpuf_forms']);
327
- unset($post_types['wpuf_profile']);
328
-
329
- foreach ($post_types as $post_type) {
330
- printf('<option value="%s"%s>%s</option>', $post_type, selected( $post_type_selected, $post_type, false ), $post_type );
331
- }
332
- ?>
333
- </select>
334
- </td>
335
- </tr>
336
-
337
- <tr class="wpuf-post-status">
338
- <th><?php _e( 'Post Status', 'wpuf' ); ?></th>
339
- <td>
340
- <select name="wpuf_settings[post_status]">
341
- <?php
342
- $statuses = get_post_statuses();
343
- foreach ($statuses as $status => $label) {
344
- printf('<option value="%s"%s>%s</option>', $status, selected( $post_status_selected, $status, false ), $label );
345
- }
346
- ?>
347
- </select>
348
- </td>
349
- </tr>
350
-
351
- <tr class="wpuf-post-fromat">
352
- <th><?php _e( 'Post Format', 'wpuf' ); ?></th>
353
- <td>
354
- <select name="wpuf_settings[post_format]">
355
- <option value="0"><?php _e( '- None -', 'wpuf' ); ?></option>
356
- <?php
357
- $post_formats = get_theme_support( 'post-formats' );
358
-
359
- if ( isset($post_formats[0]) && is_array( $post_formats[0] ) ) {
360
- foreach ($post_formats[0] as $format) {
361
- printf('<option value="%s"%s>%s</option>', $format, selected( $post_format_selected, $format, false ), $format );
362
- }
363
- }
364
- ?>
365
- </select>
366
- </td>
367
- </tr>
368
-
369
- <tr class="wpuf-default-cat">
370
- <th><?php _e( 'Default Post Category', 'wpuf' ); ?></th>
371
- <td>
372
- <?php
373
- wp_dropdown_categories( array(
374
- 'hide_empty' => false,
375
- 'hierarchical' => true,
376
- 'selected' => $default_cat,
377
- 'name' => 'wpuf_settings[default_cat]',
378
- 'show_option_none' => __( '- None -', 'wpuf' ),
379
- 'taxonomy' => ( $post_type_selected == 'product' ) ? 'product_cat' : 'category'
380
- ) );
381
- ?>
382
- <p class="description"><?php echo __( 'If users are not allowed to choose any category, this category will be used instead (if post type supports)', 'wpuf' ); ?></p>
383
- </td>
384
- </tr>
385
-
386
- <tr>
387
- <th><?php _e( 'Guest Post', 'wpuf' ); ?></th>
388
- <td>
389
- <label>
390
- <input type="hidden" name="wpuf_settings[guest_post]" value="false">
391
- <input type="checkbox" name="wpuf_settings[guest_post]" value="true"<?php checked( $guest_post, 'true' ); ?> />
392
- <?php _e( 'Enable Guest Post', 'wpuf' ) ?>
393
- </label>
394
- <p class="description"><?php _e( 'Unregistered users will be able to submit posts', 'wpuf' ); ?></p>
395
- </td>
396
- </tr>
397
-
398
- <tr class="show-if-guest">
399
- <th><?php _e( 'User Details', 'wpuf' ); ?></th>
400
- <td>
401
- <label>
402
- <input type="hidden" name="wpuf_settings[guest_details]" value="false">
403
- <input type="checkbox" name="wpuf_settings[guest_details]" value="true"<?php checked( $guest_details, 'true' ); ?> />
404
- <?php _e( 'Require Name and Email address', 'wpuf' ) ?>
405
- </label>
406
- <p class="description"><?php _e( 'If requires, users will be automatically registered to the site using the name and email address', 'wpuf' ); ?></p>
407
- </td>
408
- </tr>
409
-
410
- <tr class="show-if-guest show-if-details">
411
- <th><?php _e( 'Name Label', 'wpuf' ); ?></th>
412
- <td>
413
- <label>
414
- <input type="text" name="wpuf_settings[name_label]" value="<?php echo esc_attr( $name_label ); ?>" />
415
- </label>
416
- <p class="description"><?php _e( 'Label text for name field', 'wpuf' ); ?></p>
417
- </td>
418
- </tr>
419
-
420
- <tr class="show-if-guest show-if-details">
421
- <th><?php _e( 'E-Mail Label', 'wpuf' ); ?></th>
422
- <td>
423
- <label>
424
- <input type="text" name="wpuf_settings[email_label]" value="<?php echo esc_attr( $email_label ); ?>" />
425
- </label>
426
- <p class="description"><?php _e( 'Label text for email field', 'wpuf' ); ?></p>
427
- </td>
428
- </tr>
429
-
430
- <tr class="show-if-not-guest">
431
- <th><?php _e( 'Unauthorized Message', 'wpuf' ); ?></th>
432
- <td>
433
- <textarea rows="3" cols="40" name="wpuf_settings[message_restrict]"><?php echo esc_textarea( $message_restrict ); ?></textarea>
434
- <p class="description"><?php _e( 'Not logged in users will see this message', 'wpuf' ); ?></p>
435
- </td>
436
- </tr>
437
-
438
- <tr class="wpuf-redirect-to">
439
- <th><?php _e( 'Redirect To', 'wpuf' ); ?></th>
440
- <td>
441
- <select name="wpuf_settings[redirect_to]">
442
- <?php
443
- $redirect_options = array(
444
- 'post' => __( 'Newly created post', 'wpuf' ),
445
- 'same' => __( 'Same Page', 'wpuf' ),
446
- 'page' => __( 'To a page', 'wpuf' ),
447
- 'url' => __( 'To a custom URL', 'wpuf' )
448
- );
449
-
450
- foreach ($redirect_options as $to => $label) {
451
- printf('<option value="%s"%s>%s</option>', $to, selected( $redirect_to, $to, false ), $label );
452
- }
453
- ?>
454
- </select>
455
- <p class="description">
456
- <?php _e( 'After successfull submit, where the page will redirect to', $domain = 'default' ) ?>
457
- </p>
458
- </td>
459
- </tr>
460
-
461
- <tr class="wpuf-same-page">
462
- <th><?php _e( 'Message to show', 'wpuf' ); ?></th>
463
- <td>
464
- <textarea rows="3" cols="40" name="wpuf_settings[message]"><?php echo esc_textarea( $message ); ?></textarea>
465
- </td>
466
- </tr>
467
-
468
- <tr class="wpuf-page-id">
469
- <th><?php _e( 'Page', 'wpuf' ); ?></th>
470
- <td>
471
- <select name="wpuf_settings[page_id]">
472
- <?php
473
- $pages = get_posts( array( 'numberposts' => -1, 'post_type' => 'page') );
474
-
475
- foreach ($pages as $page) {
476
- printf('<option value="%s"%s>%s</option>', $page->ID, selected( $page_id, $page->ID, false ), esc_attr( $page->post_title ) );
477
- }
478
- ?>
479
- </select>
480
- </td>
481
- </tr>
482
-
483
- <tr class="wpuf-url">
484
- <th><?php _e( 'Custom URL', 'wpuf' ); ?></th>
485
- <td>
486
- <input type="url" name="wpuf_settings[url]" value="<?php echo esc_attr( $url ); ?>">
487
- </td>
488
- </tr>
489
-
490
- <tr class="wpuf-comment">
491
- <th><?php _e( 'Comment Status', 'wpuf' ); ?></th>
492
- <td>
493
- <select name="wpuf_settings[comment_status]">
494
- <option value="open" <?php selected( $comment_status, 'open'); ?>><?php _e('Open'); ?></option>
495
- <option value="closed" <?php selected( $comment_status, 'closed'); ?>><?php _e('Closed'); ?></option>
496
- </select>
497
- </td>
498
- </tr>
499
-
500
- <tr class="wpuf-submit-text">
501
- <th><?php _e( 'Submit Post Button text', 'wpuf' ); ?></th>
502
- <td>
503
- <input type="text" name="wpuf_settings[submit_text]" value="<?php echo esc_attr( $submit_text ); ?>">
504
- </td>
505
- </tr>
506
-
507
- <tr>
508
- <th><?php _e( 'Post Draft', 'wpuf' ); ?></th>
509
- <td>
510
- <label>
511
- <input type="hidden" name="wpuf_settings[draft_post]" value="false">
512
- <input type="checkbox" name="wpuf_settings[draft_post]" value="true"<?php checked( $draft_post, 'true' ); ?> />
513
- <?php _e( 'Enable Saving as draft', 'wpuf' ) ?>
514
- </label>
515
- <p class="description"><?php _e( 'It will show a button to save as draft', 'wpuf' ); ?></p>
516
- </td>
517
- </tr>
518
-
519
- <?php do_action( 'wpuf_form_setting', $form_settings, $post ); ?>
520
- </table>
521
- <?php
522
- }
523
-
524
- /**
525
- * Displays settings on post form builder
526
- *
527
- * @global object $post
528
- */
529
- public function form_settings_posts_edit() {
530
- global $post;
531
-
532
- $form_settings = wpuf_get_form_settings( $post->ID );
533
-
534
- $post_status_selected = isset( $form_settings['edit_post_status'] ) ? $form_settings['edit_post_status'] : 'publish';
535
- $redirect_to = isset( $form_settings['edit_redirect_to'] ) ? $form_settings['edit_redirect_to'] : 'same';
536
- $update_message = isset( $form_settings['update_message'] ) ? $form_settings['update_message'] : __( 'Post updated successfully', 'wpuf' );
537
- $page_id = isset( $form_settings['edit_page_id'] ) ? $form_settings['edit_page_id'] : 0;
538
- $url = isset( $form_settings['edit_url'] ) ? $form_settings['edit_url'] : '';
539
- $update_text = isset( $form_settings['update_text'] ) ? $form_settings['update_text'] : __( 'Update', 'wpuf' );
540
- $subscription = isset( $form_settings['subscription'] ) ? $form_settings['subscription'] : null;
541
- ?>
542
- <table class="form-table">
543
-
544
- <tr class="wpuf-post-status">
545
- <th><?php _e( 'Set Post Status to', 'wpuf' ); ?></th>
546
- <td>
547
- <select name="wpuf_settings[edit_post_status]">
548
- <?php
549
- $statuses = get_post_statuses();
550
-
551
- foreach ($statuses as $status => $label) {
552
- printf('<option value="%s"%s>%s</option>', $status, selected( $post_status_selected, $status, false ), $label );
553
- }
554
-
555
- printf( '<option value="_nochange"%s>%s</option>', selected( $post_status_selected, '_nochange', false ), __( 'No Change', 'wpuf' ) );
556
- ?>
557
- </select>
558
- </td>
559
- </tr>
560
-
561
- <tr class="wpuf-redirect-to">
562
- <th><?php _e( 'Redirect To', 'wpuf' ); ?></th>
563
- <td>
564
- <select name="wpuf_settings[edit_redirect_to]">
565
- <?php
566
- $redirect_options = array(
567
- 'post' => __( 'Newly created post', 'wpuf' ),
568
- 'same' => __( 'Same Page', 'wpuf' ),
569
- 'page' => __( 'To a page', 'wpuf' ),
570
- 'url' => __( 'To a custom URL', 'wpuf' )
571
- );
572
-
573
- foreach ($redirect_options as $to => $label) {
574
- printf('<option value="%s"%s>%s</option>', $to, selected( $redirect_to, $to, false ), $label );
575
- }
576
- ?>
577
- </select>
578
- <p class="description">
579
- <?php _e( 'After successfull submit, where the page will redirect to', $domain = 'default' ) ?>
580
- </p>
581
- </td>
582
- </tr>
583
-
584
- <tr class="wpuf-same-page">
585
- <th><?php _e( 'Post Update Message', 'wpuf' ); ?></th>
586
- <td>
587
- <textarea rows="3" cols="40" name="wpuf_settings[update_message]"><?php echo esc_textarea( $update_message ); ?></textarea>
588
- </td>
589
- </tr>
590
-
591
- <tr class="wpuf-page-id">
592
- <th><?php _e( 'Page', 'wpuf' ); ?></th>
593
- <td>
594
- <select name="wpuf_settings[edit_page_id]">
595
- <?php
596
- $pages = get_posts( array( 'numberposts' => -1, 'post_type' => 'page') );
597
-
598
- foreach ($pages as $page) {
599
- printf('<option value="%s"%s>%s</option>', $page->ID, selected( $page_id, $page->ID, false ), esc_attr( $page->post_title ) );
600
- }
601
- ?>
602
- </select>
603
- </td>
604
- </tr>
605
-
606
- <tr class="wpuf-url">
607
- <th><?php _e( 'Custom URL', 'wpuf' ); ?></th>
608
- <td>
609
- <input type="url" name="wpuf_settings[edit_url]" value="<?php echo esc_attr( $url ); ?>">
610
- </td>
611
- </tr>
612
-
613
- <tr class="wpuf-subscription-pack" style="display: none;">
614
- <th><?php _e( 'Subscription Title'); ?></th>
615
- <td>
616
- <select id="wpuf-subscription-list" name="wpuf_settings[subscription]">
617
- <?php $this->subscription_dropdown( $subscription ); ?>
618
- </select>
619
- </td>
620
- </tr>
621
-
622
- <tr class="wpuf-update-text">
623
- <th><?php _e( 'Update Post Button text', 'wpuf' ); ?></th>
624
- <td>
625
- <input type="text" name="wpuf_settings[update_text]" value="<?php echo esc_attr( $update_text ); ?>">
626
- </td>
627
- </tr>
628
- </table>
629
- <?php
630
- }
631
-
632
- /**
633
- * Subscription dropdown
634
- *
635
- * @since 2.5
636
- *
637
- * @param string $selected
638
- *
639
- * @return void
640
- */
641
- public function subscription_dropdown( $selected = null ) {
642
- $subscriptions = WPUF_Subscription::init()->get_subscriptions();
643
-
644
- if ( ! $subscriptions ) {
645
- printf( '<option>%s</option>', __( '- Select -' ), 'wpuf' );
646
- return;
647
- }
648
-
649
- printf( '<option>%s</option>', __( '- Select -', 'wpuf' ) );
650
-
651
- foreach ( $subscriptions as $key => $subscription ) {
652
- ?>
653
- <option value="<?php echo esc_attr( $subscription->ID ); ?>" <?php selected( $selected, $subscription->ID ); ?> ><?php echo $subscription->post_title; ?></option>
654
- <?php
655
- }
656
- }
657
-
658
- /**
659
- * Settings for post expiration
660
- *
661
- * @since 2.2.7
662
- *
663
- * @global $post
664
- */
665
- public function form_post_expiration(){
666
- do_action('wpuf_form_post_expiration');
667
- }
668
-
669
- /**
670
- * Add post fields in form builder
671
- *
672
- * @since 2.5
673
- *
674
- * @return array
675
- */
676
- public function add_post_field_section() {
677
- $post_fields = apply_filters( 'wpuf-form-builder-wp_forms-fields-section-post-fields', array(
678
- 'post_title', 'post_content', 'post_excerpt', 'featured_image'
679
- ) );
680
-
681
- return array(
682
- array(
683
- 'title' => __( 'Post Fields', 'wpuf' ),
684
- 'id' => 'post-fields',
685
- 'fields' => $post_fields
686
- ),
687
-
688
- array(
689
- 'title' => __( 'Taxonomies', 'wpuf' ),
690
- 'id' => 'taxonomies',
691
- 'fields' => array()
692
- )
693
- );
694
- }
695
-
696
- /**
697
- * Admin script form wpuf_forms form builder
698
- *
699
- * @since 2.5
700
- *
701
- * @return void
702
- */
703
- public function admin_enqueue_scripts() {
704
- wp_register_script(
705
- 'wpuf-form-builder-wpuf-forms',
706
- WPUF_ASSET_URI . '/js/wpuf-form-builder-wpuf-forms.js',
707
- array( 'jquery', 'underscore', 'wpuf-vue', 'wpuf-vuex' ),
708
- WPUF_VERSION,
709
- true
710
- );
711
- }
712
-
713
- /**
714
- * Add dependencies to form builder script
715
- *
716
- * @since 2.5
717
- *
718
- * @param array $deps
719
- *
720
- * @return array
721
- */
722
- public function js_dependencies( $deps ) {
723
- array_push( $deps, 'wpuf-form-builder-wpuf-forms' );
724
-
725
- return $deps;
726
- }
727
-
728
- /**
729
- * Add mixins to root instance
730
- *
731
- * @since 2.5
732
- *
733
- * @param array $mixins
734
- *
735
- * @return array
736
- */
737
- public function js_root_mixins( $mixins ) {
738
- array_push( $mixins , 'wpuf_forms_mixin_root' );
739
-
740
- return $mixins;
741
- }
742
-
743
- /**
744
- * Add mixins to form builder builder stage component
745
- *
746
- * @since 2.5
747
- *
748
- * @param array $mixins
749
- *
750
- * @return array
751
- */
752
- public function js_builder_stage_mixins( $mixins ) {
753
- array_push( $mixins , 'wpuf_forms_mixin_builder_stage' );
754
-
755
- return $mixins;
756
- }
757
-
758
- /**
759
- * Add mixins to form builder field options component
760
- *
761
- * @since 2.5
762
- *
763
- * @param array $mixins
764
- *
765
- * @return array
766
- */
767
- public function js_field_options_mixins( $mixins ) {
768
- array_push( $mixins , 'wpuf_forms_mixin_field_options' );
769
-
770
- return $mixins;
771
- }
772
-
773
- /**
774
- * Add buttons in form submit area
775
- *
776
- * @since 2.5
777
- *
778
- * @return void
779
- */
780
- public function add_form_submit_area() {
781
- ?>
782
- <input @click.prevent="" type="submit" name="submit" :value="post_form_settings.submit_text">
783
-
784
- <a
785
- v-if="post_form_settings.draft_post"
786
- @click.prevent=""
787
- href="#"
788
- class="btn"
789
- id="wpuf-post-draft"
790
- >
791
- <?php _e( 'Save Draft', 'wpuf' ); ?>
792
- </a>
793
- <?php
794
- }
795
-
796
- /**
797
- * Populate available wp post types
798
- *
799
- * @since 2.5
800
- *
801
- * @return void
802
- */
803
- public function set_wp_post_types() {
804
- $args = array( '_builtin' => true );
805
-
806
- $wpuf_post_types = wpuf_get_post_types( $args );
807
-
808
- $ignore_taxonomies = apply_filters( 'wpuf-ignore-taxonomies', array(
809
- 'post_format'
810
- ) );
811
-
812
- foreach ( $wpuf_post_types as $post_type ) {
813
- $this->wp_post_types[ $post_type ] = array();
814
-
815
- $taxonomies = get_object_taxonomies( $post_type, 'object' );
816
-
817
- foreach ( $taxonomies as $tax_name => $taxonomy ) {
818
- if ( ! in_array( $tax_name, $ignore_taxonomies ) ) {
819
- $this->wp_post_types[ $post_type ][ $tax_name ] = array(
820
- 'title' => $taxonomy->label,
821
- 'hierarchical' => $taxonomy->hierarchical
822
- );
823
-
824
- $this->wp_post_types[ $post_type ][ $tax_name ]['terms'] = get_terms( array(
825
- 'taxonomy' => $tax_name,
826
- 'hide_empty' => false
827
- ) );
828
- }
829
- }
830
- }
831
- }
832
-
833
- /**
834
- * Add data to localize_script
835
- *
836
- * @since 2.5
837
- *
838
- * @param array $data
839
- *
840
- * @return array
841
- */
842
- public function add_to_localize_script( $data ) {
843
- return array_merge( $data, array(
844
- 'wp_post_types' => $this->wp_post_types
845
- ) );
846
- }
847
-
848
- /**
849
- * Add field settings
850
- *
851
- * @since 2.5
852
- *
853
- * @param array $field_settings
854
- *
855
- * @return array
856
- */
857
- public function add_field_settings( $field_settings ) {
858
- $field_settings = array_merge( $field_settings, array(
859
- 'post_title' => self::post_title(),
860
- 'post_content' => self::post_content(),
861
- 'post_excerpt' => self::post_excerpt(),
862
- 'featured_image' => self::featured_image()
863
- ) );
864
-
865
- $taxonomy_templates = array();
866
-
867
- foreach ( $this->wp_post_types as $post_type => $taxonomies ) {
868
-
869
- if ( ! empty( $taxonomies ) ) {
870
-
871
- foreach ( $taxonomies as $tax_name => $taxonomy ) {
872
- if ( 'post_tag' === $tax_name ) {
873
- $taxonomy_templates['post_tag'] = self::post_tags();
874
- } else {
875
- $taxonomy_templates[ $tax_name ] = self::taxonomy_template( $tax_name, $taxonomy );
876
- }
877
- }
878
-
879
- }
880
-
881
- }
882
-
883
- $field_settings = array_merge( $field_settings, $taxonomy_templates );
884
-
885
- return $field_settings;
886
- }
887
-
888
- /**
889
- * Post Title field settings
890
- *
891
- * @since 2.5
892
- *
893
- * @return array
894
- */
895
- public static function post_title() {
896
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
897
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_text_properties() );
898
-
899
- return array(
900
- 'template' => 'post_title',
901
- 'title' => __( 'Post Title', 'wpuf' ),
902
- 'icon' => 'header',
903
- 'settings' => $settings,
904
- 'field_props' => array(
905
- 'input_type' => 'text',
906
- 'template' => 'post_title',
907
- 'required' => 'no',
908
- 'label' => __( 'Post Title', 'wpuf' ),
909
- 'name' => 'post_title',
910
- 'is_meta' => 'no',
911
- 'help' => '',
912
- 'css' => '',
913
- 'placeholder' => '',
914
- 'default' => '',
915
- 'size' => 40,
916
- 'id' => 0,
917
- 'is_new' => true,
918
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
919
- )
920
- );
921
- }
922
-
923
- /**
924
- * Post Content field settings
925
- *
926
- * @since 2.5
927
- *
928
- * @return array
929
- */
930
- public static function post_content() {
931
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
932
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_textarea_properties() );
933
-
934
- $settings = array_merge( $settings, array(
935
- array(
936
- 'name' => 'insert_image',
937
- 'title' => __( 'Enable Image Insertion', 'wpuf-pro' ),
938
- 'type' => 'checkbox',
939
- 'options' => array( 'yes' => __( 'Enable image upload in post area', 'wpuf-pro' ) ),
940
- 'is_single_opt' => true,
941
- 'section' => 'advanced',
942
- 'priority' => 14,
943
- ),
944
- ) );
945
-
946
- return array(
947
- 'template' => 'post_content',
948
- 'title' => __( 'Post Body', 'wpuf' ),
949
- 'icon' => 'file-text',
950
- 'settings' => $settings,
951
- 'field_props' => array(
952
- 'input_type' => 'textarea',
953
- 'template' => 'post_content',
954
- 'required' => 'no',
955
- 'label' => __( 'Post Body', 'wpuf' ),
956
- 'name' => 'post_content',
957
- 'is_meta' => 'no',
958
- 'help' => '',
959
- 'css' => '',
960
- 'rows' => 5,
961
- 'cols' => 25,
962
- 'placeholder' => '',
963
- 'default' => '',
964
- 'rich' => 'yes',
965
- 'word_restriction' => '',
966
- 'id' => 0,
967
- 'is_new' => true,
968
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
969
- )
970
- );
971
- }
972
-
973
- /**
974
- * Post Excerpt field settings
975
- *
976
- * @since 2.5
977
- *
978
- * @return array
979
- */
980
- public static function post_excerpt() {
981
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
982
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_textarea_properties() );
983
-
984
- $index = array_search( 'rich', array_column( $settings, 'name' ) );
985
- if ( ! empty( $index ) ) {
986
- unset( $settings[ $index ] );
987
- }
988
-
989
-
990
- return array(
991
- 'template' => 'post_excerpt',
992
- 'title' => __( 'Excerpt', 'wpuf' ),
993
- 'icon' => 'compress',
994
- 'settings' => $settings,
995
- 'field_props' => array(
996
- 'input_type' => 'textarea',
997
- 'template' => 'post_excerpt',
998
- 'required' => 'no',
999
- 'label' => __( 'Excerpt', 'wpuf' ),
1000
- 'name' => 'post_excerpt',
1001
- 'is_meta' => 'no',
1002
- 'help' => '',
1003
- 'css' => '',
1004
- 'rows' => 5,
1005
- 'cols' => 25,
1006
- 'placeholder' => '',
1007
- 'default' => '',
1008
- 'rich' => 'no',
1009
- 'word_restriction' => '',
1010
- 'id' => 0,
1011
- 'is_new' => true,
1012
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
1013
- )
1014
- );
1015
- }
1016
-
1017
- /**
1018
- * Featured Image
1019
- *
1020
- * @since 2.5
1021
- *
1022
- * @return array
1023
- */
1024
- public static function featured_image() {
1025
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
1026
-
1027
- $settings = array_merge( $settings, array(
1028
- array(
1029
- 'name' => 'max_size',
1030
- 'title' => __( 'Max. file size', 'wpuf' ),
1031
- 'type' => 'text',
1032
- 'section' => 'advanced',
1033
- 'priority' => 20,
1034
- 'help_text' => __( 'Enter maximum upload size limit in KB', 'wpuf' ),
1035
- )
1036
- ) );
1037
-
1038
- return array(
1039
- 'template' => 'featured_image',
1040
- 'title' => __( 'Featured Image', 'wpuf' ),
1041
- 'icon' => 'picture-o',
1042
- 'settings' => $settings,
1043
- 'field_props' => array(
1044
- 'input_type' => 'image_upload',
1045
- 'template' => 'featured_image',
1046
- 'required' => 'no',
1047
- 'label' => __( 'Featured Image', 'wpuf' ),
1048
- 'name' => 'featured_image',
1049
- 'is_meta' => 'no',
1050
- 'help' => '',
1051
- 'css' => '',
1052
- 'max_size' => '1024',
1053
- 'count' => '1',
1054
- 'id' => 0,
1055
- 'is_new' => true,
1056
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
1057
- )
1058
- );
1059
- }
1060
-
1061
- /**
1062
- * Post Tag
1063
- *
1064
- * @since 2.5
1065
- *
1066
- * @return array
1067
- */
1068
- public static function post_tags() {
1069
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
1070
- $settings = array_merge( $settings, WPUF_Form_Builder_Field_Settings::get_common_text_properties() );
1071
-
1072
- return array(
1073
- 'template' => 'post_tags',
1074
- 'title' => __( 'Tags', 'wpuf' ),
1075
- 'settings' => $settings,
1076
- 'field_props' => array(
1077
- 'input_type' => 'text',
1078
- 'template' => 'post_tags',
1079
- 'required' => 'no',
1080
- 'label' => __( 'Tags', 'wpuf' ),
1081
- 'name' => 'tags',
1082
- 'is_meta' => 'no',
1083
- 'help' => '',
1084
- 'css' => '',
1085
- 'placeholder' => '',
1086
- 'default' => '',
1087
- 'size' => 40,
1088
- 'id' => 0,
1089
- 'is_new' => true,
1090
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
1091
- )
1092
- );
1093
- }
1094
-
1095
- /**
1096
- * Common settings for taxonomy fields
1097
- *
1098
- * @since 2.5
1099
- *
1100
- * @return array
1101
- */
1102
- public static function taxonomy_template( $tax_name, $taxonomy ) {
1103
- $settings = WPUF_Form_Builder_Field_Settings::get_common_properties( false );
1104
-
1105
- $settings = array_merge( $settings, array(
1106
- array(
1107
- 'name' => 'type',
1108
- 'title' => __( 'Type', 'wpuf' ),
1109
- 'type' => 'select',
1110
- 'options' => array(
1111
- 'select' => __( 'Select', 'wpuf' ),
1112
- 'multiselect' => __( 'Multi Select', 'wpuf' ),
1113
- 'checkbox' => __( 'Checkbox', 'wpuf' ),
1114
- 'text' => __( 'Text Input', 'wpuf' ),
1115
- 'ajax' => __( 'Ajax', 'wpuf' ),
1116
- ),
1117
- 'section' => 'advanced',
1118
- 'priority' => 23,
1119
- 'default' => 'select',
1120
- ),
1121
-
1122
- array(
1123
- 'name' => 'orderby',
1124
- 'title' => __( 'Order By', 'wpuf' ),
1125
- 'type' => 'select',
1126
- 'options' => array(
1127
- 'name' => __( 'Name', 'wpuf' ),
1128
- 'term_id' => __( 'Term ID', 'wpuf' ), // NOTE: before 2.5 the key was 'id' not 'term_id'
1129
- 'slug' => __( 'Slug', 'wpuf' ),
1130
- 'count' => __( 'Count', 'wpuf' ),
1131
- 'term_group' => __( 'Term Group', 'wpuf' ),
1132
- ),
1133
- 'section' => 'advanced',
1134
- 'priority' => 24,
1135
- 'default' => 'name',
1136
- ),
1137
-
1138
- array(
1139
- 'name' => 'order',
1140
- 'title' => __( 'Order', 'wpuf' ),
1141
- 'type' => 'radio',
1142
- 'inline' => true,
1143
- 'options' => array(
1144
- 'ASC' => __( 'ASC', 'wpuf' ),
1145
- 'DESC' => __( 'DESC', 'wpuf' ),
1146
- ),
1147
- 'section' => 'advanced',
1148
- 'priority' => 25,
1149
- 'default' => 'ASC',
1150
- ),
1151
-
1152
- array(
1153
- 'name' => 'exclude_type',
1154
- 'title' => __( 'Selection Type', 'wpuf' ),
1155
- 'type' => 'select',
1156
- 'options' => array(
1157
- 'exclude' => __( 'Exclude', 'wpuf' ),
1158
- 'include' => __( 'Include', 'wpuf' ),
1159
- 'child_of' => __( 'Child of', 'wpuf' ),
1160
- ),
1161
- 'section' => 'advanced',
1162
- 'priority' => 26,
1163
- 'default' => '',
1164
- ),
1165
-
1166
- array(
1167
- 'name' => 'exclude',
1168
- 'title' => __( 'Selection Terms', 'wpuf' ),
1169
- 'type' => 'text',
1170
- 'section' => 'advanced',
1171
- 'priority' => 27,
1172
- 'help_text' => __( 'Enter the term IDs as comma separated (without space) to exclude/include in the form.', 'wpuf' ),
1173
- ),
1174
-
1175
- array(
1176
- 'name' => 'woo_attr',
1177
- 'type' => 'checkbox',
1178
- 'is_single_opt' => true,
1179
- 'options' => array(
1180
- 'yes' => __( 'This taxonomy is a WooCommerce attribute', 'wpuf' )
1181
- ),
1182
- 'section' => 'advanced',
1183
- 'priority' => 28,
1184
- ),
1185
-
1186
- array(
1187
- 'name' => 'woo_attr_vis',
1188
- 'type' => 'checkbox',
1189
- 'is_single_opt' => true,
1190
- 'options' => array(
1191
- 'yes' => __( 'Visible on product page', 'wpuf' )
1192
- ),
1193
- 'section' => 'advanced',
1194
- 'priority' => 29,
1195
- 'dependencies' => array(
1196
- 'woo_attr' => 'yes'
1197
- )
1198
- ),
1199
- ) );
1200
-
1201
- return array(
1202
- 'template' => 'taxonomy',
1203
- 'title' => $taxonomy['title'],
1204
- 'settings' => $settings,
1205
- 'field_props' => array(
1206
- 'input_type' => 'taxonomy',
1207
- 'template' => 'taxonomy',
1208
- 'required' => 'no',
1209
- 'label' => $taxonomy['title'],
1210
- 'name' => $tax_name,
1211
- 'is_meta' => 'no',
1212
- 'help' => '',
1213
- 'css' => '',
1214
- 'type' => 'select',
1215
- 'orderby' => 'name',
1216
- 'order' => 'ASC',
1217
- 'exclude_type' => '',
1218
- 'exclude' => '',
1219
- 'woo_attr' => '',
1220
- 'woo_attr_vis' => '',
1221
- 'id' => 0,
1222
- 'is_new' => true,
1223
- 'wpuf_cond' => WPUF_Form_Builder_Field_Settings::get_wpuf_cond_prop()
1224
- )
1225
- );
1226
- }
1227
-
1228
- /**
1229
- * i18n strings specially for Post Forms
1230
- *
1231
- * @since 2.5
1232
- *
1233
- * @param array $i18n
1234
- *
1235
- * @return array
1236
- */
1237
- public function i18n( $i18n ) {
1238
- return array_merge( $i18n, array(
1239
- 'any_of_three_needed' => __( 'Post Forms must have either Post Title, Post Body or Excerpt field', 'wpuf' )
1240
- ) );
1241
- }
1242
-
1243
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/html/modal.php DELETED
@@ -1,105 +0,0 @@
1
- <div id="wpuf-form-template-modal">
2
- <div class="wpuf-form-template-modal">
3
-
4
- <span id="modal-label" class="screen-reader-text"><?php _e( 'Modal window. Press escape to close.', 'wpuf' ); ?></span>
5
- <a href="#" class="close">× <span class="screen-reader-text"><?php _e( 'Close modal window', 'wpuf' ); ?></span></a>
6
-
7
- <header class="modal-header">
8
- <h2>
9
- <?php _e( 'Select a Template', 'wpuf' ); ?>
10
- <small><?php
11
- printf(
12
- __( 'Select from a pre-defined template or from a <a href="%s">blank form</a>', 'wpuf' ),
13
- admin_url( 'admin.php?page=wpuf-post-forms&action=add-new' )
14
- ); ?></small>
15
- </h2>
16
- </header>
17
-
18
- <div class="content-container modal-footer">
19
- <div class="content">
20
-
21
- <ul>
22
- <li class="blank-form">
23
- <a href="<?php echo admin_url( 'admin.php?page=wpuf-post-forms&action=add-new' ); ?>">
24
- <span class="dashicons dashicons-plus"></span>
25
- <div class="title"><?php _e( 'Blank Form', 'wpuf' ); ?></div>
26
- </a>
27
- </li>
28
-
29
- <?php
30
- foreach ($registry as $key => $template ) {
31
- $class = 'template-active';
32
- $title = '';
33
- $url = esc_url( add_query_arg( array(
34
- 'action' => 'wpuf_post_form_template',
35
- 'template' => $key,
36
- '_wpnonce' => wp_create_nonce( 'wpuf_create_from_template' )
37
- ), admin_url( 'admin.php' ) ) );
38
-
39
- if ( ! $template->is_enabled() ) {
40
- $url = '#';
41
- $class = 'template-inactive';
42
- $title = __( 'This integration is not installed.', 'wpuf' );
43
- }
44
- ?>
45
-
46
- <li class="<?php echo $class; ?>">
47
- <a href="<?php echo $url; ?>" title="<?php echo esc_attr( $title ); ?>">
48
- <div class="title"><?php echo $template->get_title(); ?></div>
49
- <div class="description"><?php echo $template->get_description(); ?></div>
50
- </a>
51
- </li>
52
-
53
- <?php } ?>
54
- </ul>
55
- </div>
56
- </div>
57
-
58
- <footer>
59
- <?php printf( __( 'List of available templates can be found <a href="%s" target="_blank">here</a>.', 'wpuf' ), 'http://docs.wedevs.com/?p=4390' ); ?>
60
- <?php printf( __( 'Want a new integration? <a href="%s" target="_blank">Let us know</a>.', 'wpuf'), 'mailto:support@wedevs.com?subject=WPUF Custom Post Template Integration Request' ); ?>
61
- </footer>
62
- </div>
63
- <div class="wpuf-form-template-modal-backdrop"></div>
64
- </div>
65
-
66
-
67
- <script type="text/javascript">
68
- (function($) {
69
- var popup = {
70
- init: function() {
71
- $('a.page-title-action').on('click', this.openModal);
72
- $('.wpuf-form-template-modal-backdrop, .wpuf-form-template-modal .close').on('click', $.proxy(this.closeModal, this) );
73
-
74
- $('body').on( 'keydown', $.proxy(this.onEscapeKey, this) );
75
- },
76
-
77
- openModal: function(e) {
78
- e.preventDefault();
79
-
80
- $('.wpuf-form-template-modal').show();
81
- $('.wpuf-form-template-modal-backdrop').show();
82
- },
83
-
84
- onEscapeKey: function(e) {
85
- if ( 27 === e.keyCode ) {
86
- this.closeModal(e);
87
- }
88
- },
89
-
90
- closeModal: function(e) {
91
- if ( typeof e !== 'undefined' ) {
92
- e.preventDefault();
93
- }
94
-
95
- $('.wpuf-form-template-modal').hide();
96
- $('.wpuf-form-template-modal-backdrop').hide();
97
- }
98
- };
99
-
100
- $(function() {
101
- popup.init();
102
- });
103
-
104
- })(jQuery);
105
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/installer.php DELETED
@@ -1,177 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Page installer
5
- *
6
- * @since 2.3
7
- */
8
- class WPUF_Admin_Installer {
9
-
10
- function __construct() {
11
- add_action( 'admin_notices', array($this, 'admin_notice') );
12
- add_action( 'admin_init', array($this, 'handle_request') );
13
- }
14
-
15
- /**
16
- * Print admin notices
17
- *
18
- * @return void
19
- */
20
- function admin_notice() {
21
- $page_created = get_option( '_wpuf_page_created' );
22
-
23
- if ( $page_created != '1' ) {
24
- ?>
25
- <div class="updated error">
26
- <p>
27
- <?php _e( 'If you have not created <strong>WP User Frontend Pro</strong> pages yet, you can do this by one click.', 'wpuf' ); ?>
28
- </p>
29
- <p class="submit">
30
- <a class="button button-primary" href="<?php echo add_query_arg( array( 'install_wpuf_pages' => true ), admin_url( 'admin.php?page=wpuf-settings' ) ); ?>"><?php _e( 'Install WPUF Pages', 'wpuf' ); ?></a>
31
- or
32
- <a class="button" href="<?php echo add_query_arg( array( 'wpuf_hide_page_nag' => true ) ); ?>"><?php _e( 'Skip Setup', 'wpuf' ); ?></a>
33
- </p>
34
- </div>
35
- <?php
36
- }
37
-
38
- if ( isset( $_GET['wpuf_page_installed'] ) && $_GET['wpuf_page_installed'] == '1' ) {
39
- ?>
40
- <div class="updated">
41
- <p>
42
- <strong><?php _e( 'Congratulations!', 'wpuf' ); ?></strong> <?php _e( 'Pages for <strong>WP User Frontend Pro</strong> has been successfully installed and saved!', 'wpuf' ); ?>
43
- </p>
44
- </div>
45
- <?php
46
- }
47
- }
48
-
49
- /**
50
- * Handle the page creation button requests
51
- *
52
- * @return void
53
- */
54
- function handle_request() {
55
- if ( isset( $_GET['install_wpuf_pages'] ) && $_GET['install_wpuf_pages'] == '1' ) {
56
- $this->init_pages();
57
- }
58
-
59
- if ( isset( $_GET['wpuf_hide_page_nag'] ) && $_GET['wpuf_hide_page_nag'] == '1' ) {
60
- update_option( '_wpuf_page_created', '1' );
61
- }
62
- }
63
-
64
- /**
65
- * Initialize the plugin with some default page/settings
66
- *
67
- * @since 2.2
68
- * @return void
69
- */
70
- function init_pages() {
71
-
72
- // create a dashboard page
73
- $dashboard_page = $this->create_page( __( 'Dashboard', 'wpuf' ), '[wpuf_dashboard]' );
74
- $account_page = $this->create_page( __( 'Account', 'wpuf' ), '[wpuf_account]' );
75
- $edit_page = $this->create_page( __( 'Edit', 'wpuf' ), '[wpuf_edit]' );
76
-
77
- // login page
78
- $login_page = $this->create_page( __( 'Login', 'wpuf' ), '[wpuf-login]' );
79
-
80
- $post_form = $this->create_form();
81
-
82
- // payment page
83
- $subscr_page = $this->create_page( __( 'Subscription', 'wpuf' ), __( '[wpuf_sub_pack]') );
84
- $payment_page = $this->create_page( __( 'Payment', 'wpuf' ), __( 'Please select a gateway for payment') );
85
- $thank_page = $this->create_page( __( 'Thank You', 'wpuf' ), __( '<h1>Payment is complete</h1><p>Congratulations, your payment has been completed!</p>') );
86
- $bank_page = $this->create_page( __( 'Order Received', 'wpuf' ), __( 'Hi, we have received your order. We will validate the order and will take necessary steps to move forward.') );
87
-
88
- // save the settings
89
- if ( $edit_page ) {
90
- update_option( 'wpuf_general', array(
91
- 'edit_page_id' => $edit_page,
92
- 'default_post_form' => $post_form
93
- ) );
94
- }
95
-
96
- // profile pages
97
- $profile_options = array();
98
- $reg_page = false;
99
-
100
- if ( $login_page ) {
101
- $profile_options['login_page'] = $login_page;
102
- }
103
-
104
- $data = apply_filters( 'wpuf_pro_page_install', $profile_options );
105
-
106
- if ( is_array( $data ) ) {
107
-
108
- if ( isset ( $data['profile_options'] ) ) {
109
- $profile_options = $data['profile_options'];
110
- }
111
- if ( isset ( $data['reg_page'] ) ) {
112
- $reg_page = $data['reg_page'];
113
- }
114
- }
115
-
116
- if ( $login_page && $reg_page ) {
117
- $profile_options['register_link_override'] = 'on';
118
- }
119
-
120
- update_option( 'wpuf_profile', $profile_options );
121
-
122
- // payment pages
123
- update_option( 'wpuf_payment', array(
124
- 'subscription_page' => $subscr_page,
125
- 'payment_page' => $payment_page,
126
- 'payment_success' => $thank_page,
127
- 'bank_success' => $bank_page
128
- ) );
129
-
130
- update_option( '_wpuf_page_created', '1' );
131
-
132
- wp_redirect( admin_url( 'admin.php?page=wpuf-settings&wpuf_page_installed=1' ) );
133
- exit;
134
- }
135
-
136
- /**
137
- * Create a page with title and content
138
- *
139
- * @param string $page_title
140
- * @param string $post_content
141
- * @return false|int
142
- */
143
- function create_page( $page_title, $post_content = '', $post_type = 'page' ) {
144
- $page_id = wp_insert_post( array(
145
- 'post_title' => $page_title,
146
- 'post_type' => $post_type,
147
- 'post_status' => 'publish',
148
- 'comment_status' => 'closed',
149
- 'post_content' => $post_content
150
- ) );
151
-
152
- if ( $page_id && ! is_wp_error( $page_id ) ) {
153
- return $page_id;
154
- }
155
-
156
- return false;
157
- }
158
-
159
- /**
160
- * Create a basic registration form by default
161
- *
162
- * @return int|boolean
163
- */
164
- function create_reg_form() {
165
- return wpuf_create_sample_form( __( 'Registration', 'wpuf' ), 'wpuf_profile' );
166
- }
167
-
168
- /**
169
- * Create a post form
170
- *
171
- * @return void
172
- */
173
- function create_form() {
174
- return wpuf_create_sample_form( __( 'Sample Form', 'wpuf' ), 'wpuf_forms' );
175
- }
176
-
177
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/post-forms-list-table-view.php DELETED
@@ -1,36 +0,0 @@
1
- <div class="wrap">
2
- <h2>
3
- <?php
4
- _e( 'Post Forms', 'wpuf' );
5
-
6
- if ( current_user_can( wpuf_admin_role() ) ):
7
- ?>
8
- <a href="<?php echo $add_new_page_url; ?>" id="new-wpuf-post-form" class="page-title-action"><?php _e( 'Add Form', 'wpuf' ); ?></a>
9
- <?php
10
- endif;
11
- ?>
12
- </h2>
13
-
14
-
15
- <div class="list-table-wrap wpuf-post-form-wrap">
16
- <div class="list-table-inner wpuf-post-form-wrap-inner">
17
-
18
- <form method="get">
19
- <input type="hidden" name="page" value="wpuf-post-forms">
20
- <?php
21
- $wpuf_post_form = new WPUF_Admin_Post_Forms_List_Table();
22
- $wpuf_post_form->prepare_items();
23
- $wpuf_post_form->search_box( __( 'Search Forms', 'wpuf' ), 'wpuf-post-form-search' );
24
-
25
- if ( current_user_can( wpuf_admin_role() ) ) {
26
- $wpuf_post_form->views();
27
- }
28
-
29
- $wpuf_post_form->display();
30
- ?>
31
- </form>
32
-
33
- </div><!-- .list-table-inner -->
34
- </div><!-- .list-table-wrap -->
35
-
36
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/post-forms-list-table.php DELETED
@@ -1,418 +0,0 @@
1
- <?php
2
- /**
3
- * Post Forms list table class
4
- *
5
- * @since 2.5
6
- */
7
- class WPUF_Admin_Post_Forms_List_Table extends WP_List_Table {
8
-
9
- /**
10
- * Class constructor
11
- *
12
- * @since 2.5
13
- *
14
- * @return void
15
- */
16
- public function __construct() {
17
- global $status, $page, $page_status;
18
-
19
- parent::__construct( array(
20
- 'singular' => 'post-form',
21
- 'plural' => 'post-forms',
22
- 'ajax' => false
23
- ) );
24
- }
25
-
26
- /**
27
- * Top filters like All, Published, Trash etc
28
- *
29
- * @since 2.5
30
- *
31
- * @return array
32
- */
33
- public function get_views() {
34
- $status_links = array();
35
- $base_link = admin_url( 'admin.php?page=wpuf-post-forms' );
36
-
37
- $post_statuses = apply_filters( 'wpuf_post_forms_list_table_post_statuses', array(
38
- 'all' => __( 'All', 'wpuf' ),
39
- 'publish' => __( 'Published', 'wpuf' ),
40
- 'trash' => __( 'Trash', 'wpuf' )
41
- ) );
42
-
43
- $current_status = isset( $_GET['post_status'] ) ? $_GET['post_status'] : 'all';
44
-
45
- $post_counts = (array) wp_count_posts( 'wpuf_forms' );
46
-
47
- if ( isset( $post_counts['auto-draft'] ) ) {
48
- unset( $post_counts['auto-draft'] );
49
- }
50
-
51
- foreach ( $post_statuses as $status => $status_title ) {
52
- $link = ( 'all' === $status ) ? $base_link : admin_url( 'admin.php?page=wpuf-post-forms&post_status=' . $status );
53
-
54
- if ( $status === $current_status ) {
55
- $class = 'current';
56
- } else {
57
- $class = '';
58
- }
59
-
60
- switch ( $status ) {
61
- case 'all':
62
- $without_trash = $post_counts;
63
- unset( $without_trash['trash'] );
64
-
65
- $count = array_sum( $without_trash );
66
- break;
67
-
68
- default:
69
- $count = $post_counts[ $status ];
70
- break;
71
- }
72
-
73
- $status_links[ $status ] = sprintf(
74
- '<a class="%s" href="%s">%s <span class="count">(%s)</span></a>',
75
- $class, $link, $status_title, $count
76
- );
77
- }
78
-
79
- return apply_filters( 'wpuf_post_forms_list_table_get_views', $status_links, $post_statuses, $current_status );
80
- }
81
-
82
- /**
83
- * Message to show if no item found
84
- *
85
- * @since 2.5
86
- *
87
- * @return void
88
- */
89
- public function no_items() {
90
- _e( 'No form found.', 'wpuf' );
91
- }
92
-
93
- /**
94
- * Bulk actions dropdown
95
- *
96
- * @since 2.5
97
- *
98
- * @return array
99
- */
100
- public function get_bulk_actions() {
101
- $actions = array();
102
-
103
- if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
104
- $actions['trash'] = __( 'Move to Trash', 'wpuf' );
105
- }
106
-
107
- if ( isset( $_GET['post_status'] ) && 'trash' === $_GET['post_status'] ) {
108
- $actions['restore'] = __( 'Restore', 'wpuf' );
109
- $actions['delete'] = __( 'Delete Permanently', 'wpuf' );
110
- }
111
-
112
- return apply_filters( 'wpuf_post_forms_list_table_get_bulk_actions', $actions );
113
- }
114
-
115
- /**
116
- * List table search box
117
- *
118
- * @since 2.5
119
- *
120
- * @param string $text
121
- * @param string $input_id
122
- *
123
- * @return void
124
- */
125
- public function search_box( $text, $input_id ) {
126
- if ( empty( $_GET['s'] ) && ! $this->has_items() ) {
127
- return;
128
- }
129
-
130
- if ( ! empty( $_GET['orderby'] ) ) {
131
- echo '<input type="hidden" name="orderby" value="' . esc_attr( $_GET['orderby'] ) . '" />';
132
- }
133
-
134
- if ( ! empty( $_GET['order'] ) ) {
135
- echo '<input type="hidden" name="order" value="' . esc_attr( $_GET['order'] ) . '" />';
136
- }
137
-
138
- if ( ! empty( $_GET['post_status'] ) ) {
139
- echo '<input type="hidden" name="post_status" value="' . esc_attr( $_GET['post_status'] ) . '" />';
140
- }
141
-
142
- do_action( 'wpuf_post_forms_list_table_search_box', $text, $input_id );
143
-
144
- $input_id = $input_id . '-search-input';
145
-
146
- ?>
147
- <p class="search-box">
148
- <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
149
- <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
150
- <?php submit_button( $text, 'button', 'post_form_search', false, array( 'id' => 'search-submit' ) ); ?>
151
- </p>
152
- <?php
153
- }
154
-
155
- /**
156
- * Decide which action is currently performing
157
- *
158
- * @since 2.5
159
- *
160
- * @return string
161
- */
162
- public function current_action() {
163
-
164
- if ( isset( $_GET['post_form_search'] ) ) {
165
- return 'post_form_search';
166
- }
167
-
168
- return parent::current_action();
169
- }
170
-
171
- /**
172
- * Prepare table data
173
- *
174
- * @since 2.5
175
- *
176
- * @return void
177
- */
178
- public function prepare_items() {
179
- $columns = $this->get_columns();
180
- $hidden = array();
181
- $sortable = $this->get_sortable_columns();
182
- $this->_column_headers = array( $columns, $hidden, $sortable );
183
-
184
- $per_page = get_option( 'posts_per_page', 20 );
185
- $current_page = $this->get_pagenum();
186
- $offset = ( $current_page - 1 ) * $per_page;
187
-
188
- $args = array(
189
- 'offset' => $offset,
190
- 'posts_per_page' => $per_page,
191
- );
192
-
193
- if ( isset( $_GET['s'] ) && !empty( $_GET['s'] ) ) {
194
- $args['s'] = $_GET['s'];
195
- }
196
-
197
- if ( isset( $_GET['post_status'] ) && !empty( $_GET['post_status'] ) ) {
198
- $args['post_status'] = $_GET['post_status'];
199
- }
200
-
201
- if ( isset( $_GET['orderby'] ) && !empty( $_GET['orderby'] ) ) {
202
- $args['orderby'] = $_GET['orderby'];
203
- }
204
-
205
- if ( isset( $_GET['order'] ) && !empty( $_GET['order'] ) ) {
206
- $args['order'] = $_GET['order'];
207
- }
208
-
209
-
210
- $items = $this->item_query( $args );
211
-
212
- $this->counts = count( $items['count'] );
213
- $this->items = $items['forms'];
214
-
215
- $this->set_pagination_args( array(
216
- 'total_items' => $items['count'],
217
- 'per_page' => $per_page
218
- ) );
219
- }
220
-
221
- /**
222
- * WP_Query for post forms
223
- *
224
- * @since 2.5
225
- *
226
- * @param array $args
227
- *
228
- * @return array
229
- */
230
- public function item_query( $args ) {
231
- $defauls = array(
232
- 'post_status' => 'any',
233
- 'orderby' => 'DESC',
234
- 'order' => 'ID',
235
- );
236
-
237
- $args = wp_parse_args( $args, $defauls );
238
-
239
- $args['post_type'] = 'wpuf_forms';
240
-
241
- $query = new WP_Query( $args );
242
-
243
- $forms = array();
244
-
245
- if ( $query->have_posts() ) {
246
-
247
- $i = 0;
248
-
249
- while ( $query->have_posts() ) {
250
- $query->the_post();
251
-
252
- $form = $query->posts[ $i ];
253
-
254
- $settings = get_post_meta( get_the_ID(), 'wpuf_form_settings', true );
255
-
256
- $forms[ $i ] = [
257
- 'ID' => $form->ID,
258
- 'post_title' => $form->post_title,
259
- 'post_status' => $form->post_status,
260
- 'settings_post_type' => $settings['post_type'],
261
- 'settings_post_status' => $settings['post_status'],
262
- 'settings_guest_post' => $settings['guest_post']
263
- ];
264
-
265
-
266
- $i++;
267
- }
268
- }
269
-
270
- $forms = apply_filters( 'wpuf_post_forms_list_table_query_results', $forms, $query, $args );
271
- $count = $query->found_posts;
272
-
273
- wp_reset_postdata();
274
-
275
- return array(
276
- 'forms' => $forms,
277
- 'count' => $count
278
- );
279
- }
280
-
281
- /**
282
- * Get the column names
283
- *
284
- * @since 2.5
285
- *
286
- * @return array
287
- */
288
- public function get_columns() {
289
- $columns = array(
290
- 'cb' => '<input type="checkbox" />',
291
- 'form_name' => __( 'Form Name', 'wpuf' ),
292
- 'post_type' => __( 'Post Type', 'wpuf' ),
293
- 'post_status' => __( 'Post Status', 'wpuf' ),
294
- 'guest_post' => __( 'Guest Post', 'wpuf' ),
295
- 'shortcode' => __( 'Shortcode', 'wpuf' ),
296
- );
297
-
298
- return apply_filters( 'wpuf_post_forms_list_table_cols', $columns );
299
- }
300
-
301
- /**
302
- * Get sortable columns
303
- *
304
- * @since 2.5
305
- *
306
- * @return array
307
- */
308
- public function get_sortable_columns() {
309
- $sortable_columns = array(
310
- 'form_name' => array( 'form_name', false ),
311
- );
312
-
313
- return apply_filters( 'wpuf_post_forms_list_table_sortable_columns', $sortable_columns );
314
- }
315
-
316
- /**
317
- * Column values
318
- *
319
- * @since 2.5
320
- *
321
- * @param array $item
322
- * @param string $column_name
323
- *
324
- * @return string
325
- */
326
- public function column_default( $item, $column_name ) {
327
- switch ( $column_name ) {
328
- case 'post_type':
329
- return $item['settings_post_type'];
330
-
331
- case 'post_status':
332
- return wpuf_admin_post_status( $item['settings_post_status'] );
333
-
334
- case 'guest_post':
335
- $is_guest_post = $item['settings_guest_post'];
336
- $url = WPUF_ASSET_URI . '/images/';
337
- $image = '<img src="%s" alt="%s">';
338
-
339
- return filter_var( $is_guest_post, FILTER_VALIDATE_BOOLEAN ) ?
340
- sprintf( $image, $url . 'tick.png', __( 'Yes', 'wpuf' ) ) :
341
- sprintf( $image, $url . 'cross.png', __( 'No', 'wpuf' ) );
342
-
343
- case 'shortcode':
344
- return '<code>[wpuf_form id="' . $item['ID'] . '"]</code>';
345
-
346
- default:
347
- return apply_filter( 'wpuf_post_forms_list_table_column_default', $item, $column_name );
348
- }
349
- }
350
-
351
- /**
352
- * Checkbox column value
353
- *
354
- * @since 2.5
355
- *
356
- * @param array $item
357
- *
358
- * @return string
359
- */
360
- public function column_cb( $item ) {
361
- return sprintf( '<input type="checkbox" name="post[]" value="%d" />', $item['ID'] );
362
- }
363
-
364
- /**
365
- * Form name column value
366
- *
367
- * @since 2.5
368
- *
369
- * @param array $item
370
- *
371
- * @return string
372
- */
373
- public function column_form_name( $item ) {
374
- $actions = array();
375
-
376
- $edit_url = admin_url( 'admin.php?page=wpuf-post-forms&action=edit&id=' . $item['ID'] );
377
-
378
- $wpnonce = wp_create_nonce( 'bulk-post-forms' );
379
- $admin_url = admin_url( 'admin.php?page=wpuf-post-forms&id=' . $item['ID'] . '&_wpnonce=' . $wpnonce );
380
-
381
- $duplicate_url = $admin_url . '&action=duplicate';
382
- $trash_url = $admin_url . '&action=trash';
383
- $restore_url = $admin_url . '&action=restore';
384
- $delete_url = $admin_url . '&action=delete';
385
-
386
- if ( ( !isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) && current_user_can( wpuf_admin_role() ) ) {
387
- $actions['edit'] = sprintf( '<a href="%s">%s</a>', $edit_url, __( 'Edit', 'wpuf' ) );
388
- $actions['trash'] = sprintf( '<a href="%s" class="submitdelete">%s</a>', $trash_url, __( 'Trash', 'wpuf' ) );
389
- $actions['duplicate'] = sprintf( '<a href="%s">%s</a>', $duplicate_url, __( 'Duplicate', 'wpuf' ) );
390
-
391
- $title = sprintf(
392
- '<a class="row-title" href="%1s" aria-label="%2s">%3s</a>',
393
- $edit_url,
394
- '"' . $item['post_title'] . '" (Edit)',
395
- $item['post_title']
396
- );
397
- }
398
-
399
- if ( ( isset( $_GET['post_status'] ) && 'trash' === $_GET['post_status'] ) && current_user_can( wpuf_admin_role() ) ) {
400
- $actions['restore'] = sprintf( '<a href="%s">%s</a>', $restore_url, __( 'Restore', 'wpuf' ) );
401
- $actions['delete'] = sprintf( '<a href="%s" class="submitdelete">%s</a>', $delete_url, __( 'Delete Permanently', 'wpuf' ) );
402
-
403
- $title = sprintf(
404
- '<strong>%1s</strong>',
405
- $item['post_title']
406
- );
407
- }
408
-
409
- $draft_marker = ( 'draft' === $item['post_status'] ) ?
410
- '<strong> — <span class="post-state">' . __( 'Draft', 'wpuf' ) . '</span></strong>' :
411
- '';
412
-
413
- $form_name = sprintf( '%1s %2s %3s', $title, $draft_marker, $this->row_actions( $actions ) );
414
-
415
- return apply_filters( 'wpuf_post_forms_list_table_column_form_name', $form_name, $item );
416
- }
417
-
418
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/posting.php DELETED
@@ -1,303 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Admin side posting handler
5
- *
6
- * Builds custom fields UI for post add/edit screen
7
- * and handles value saving.
8
- *
9
- * @package WP User Frontend
10
- */
11
- class WPUF_Admin_Posting extends WPUF_Render_Form {
12
-
13
- function __construct() {
14
- add_action( 'add_meta_boxes', array($this, 'add_meta_boxes') );
15
- add_action( 'admin_enqueue_scripts', array($this, 'enqueue_script') );
16
-
17
- add_action( 'save_post', array($this, 'save_meta'), 1, 2 ); // save the custom fields
18
- }
19
-
20
- function enqueue_script() {
21
- global $pagenow;
22
-
23
- if ( !in_array( $pagenow, array('profile.php', 'post-new.php', 'post.php', 'user-edit.php') ) ) {
24
- return;
25
- }
26
-
27
- $scheme = is_ssl() ? 'https' : 'http';
28
- $api_key = wpuf_get_option( 'gmap_api_key', 'wpuf_general' );
29
-
30
- wp_enqueue_style( 'jquery-ui', WPUF_ASSET_URI . '/css/jquery-ui-1.9.1.custom.css' );
31
-
32
- wp_enqueue_script( 'jquery-ui-datepicker' );
33
- wp_enqueue_script( 'jquery-ui-slider' );
34
- wp_enqueue_script( 'jquery-ui-timepicker', WPUF_ASSET_URI . '/js/jquery-ui-timepicker-addon.js', array('jquery-ui-datepicker') );
35
-
36
- if ( !empty( $api_key ) ) {
37
- wp_enqueue_script( 'google-maps', $scheme . '://maps.google.com/maps/api/js?libraries=places&key='.$api_key, array(), null );
38
- } else {
39
- add_action('admin_head', 'wpuf_hide_google_map_button');
40
-
41
- function wpuf_hide_google_map_button() {
42
- echo "<style>
43
- button.button[data-name='custom_map'] {
44
- display: none;
45
- }
46
- </style>";
47
- }
48
- }
49
-
50
- wp_enqueue_script( 'wpuf-upload', WPUF_ASSET_URI . '/js/upload.js', array('jquery', 'plupload-handlers') );
51
- wp_localize_script( 'wpuf-upload', 'wpuf_frontend_upload', array(
52
- 'confirmMsg' => __( 'Are you sure?', 'wpuf' ),
53
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
54
- 'nonce' => wp_create_nonce( 'wpuf_nonce' ),
55
- 'plupload' => array(
56
- 'url' => admin_url( 'admin-ajax.php' ) . '?nonce=' . wp_create_nonce( 'wpuf-upload-nonce' ),
57
- 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
58
- 'filters' => array(array('title' => __( 'Allowed Files', 'wpuf' ), 'extensions' => '*')),
59
- 'multipart' => true,
60
- 'urlstream_upload' => true,
61
- 'warning' => __( 'Maximum number of files reached!', 'wpuf' ),
62
- 'size_error' => __( 'The file you have uploaded exceeds the file size limit. Please try again.', 'wpuf' ),
63
- 'type_error' => __( 'You have uploaded an incorrect file type. Please try again.', 'wpuf' )
64
- )
65
- ) );
66
- }
67
-
68
- function add_meta_boxes() {
69
- $post_types = get_post_types( array('public' => true) );
70
-
71
- foreach ($post_types as $post_type) {
72
- add_meta_box( 'wpuf-custom-fields', __( 'WPUF Custom Fields', 'wpuf' ), array($this, 'render_form'), $post_type, 'normal', 'high' );
73
- }
74
- }
75
-
76
- function hide_form() {
77
- ?>
78
- <style type="text/css">
79
- #wpuf-custom-fields { display: none; }
80
- </style>
81
- <?php
82
- }
83
-
84
- function render_form( $form_id, $post_id = null, $preview = false) {
85
- global $post;
86
-
87
- $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );
88
- $form_settings = wpuf_get_form_settings( $form_id );
89
-
90
-
91
- // hide the metabox itself if no form ID is set
92
- if ( !$form_id ) {
93
- $this->hide_form();
94
- return;
95
- }
96
-
97
- list($post_fields, $taxonomy_fields, $custom_fields) = $this->get_input_fields( $form_id );
98
-
99
- if ( empty( $custom_fields ) ) {
100
- _e( 'No custom fields found.', 'wpuf' );
101
- return;
102
- }
103
- ?>
104
-
105
- <input type="hidden" name="wpuf_cf_update" value="<?php echo wp_create_nonce( plugin_basename( __FILE__ ) ); ?>" />
106
- <input type="hidden" name="wpuf_cf_form_id" value="<?php echo $form_id; ?>" />
107
-
108
- <table class="form-table wpuf-cf-table">
109
- <tbody>
110
- <?php
111
- $this->render_items( $custom_fields, $post->ID, 'post', $form_id, $form_settings );
112
- ?>
113
- </tbody>
114
- </table>
115
- <?php
116
- $this->scripts_styles();
117
- }
118
-
119
- /**
120
- * Prints form input label
121
- *
122
- * @param string $attr
123
- */
124
- function label( $attr, $post_id = 0 ) {
125
- ?>
126
- <?php echo $attr['label'] . $this->required_mark( $attr ); ?>
127
- <?php
128
- }
129
-
130
- function render_item_before( $form_field, $post_id = 0 ) {
131
- echo '<tr>';
132
- echo '<th><strong>';
133
- $this->label( $form_field );
134
- echo '</strong></th>';
135
- echo '<td>';
136
- }
137
-
138
- function render_item_after( $form_field ) {
139
- echo '</td>';
140
- echo '</tr>';
141
- }
142
-
143
- function scripts_styles() {
144
- ?>
145
- <script type="text/javascript">
146
- jQuery(function($){
147
- var wpuf = {
148
- init: function() {
149
- $('.wpuf-cf-table').on('click', 'img.wpuf-clone-field', this.cloneField);
150
- $('.wpuf-cf-table').on('click', 'img.wpuf-remove-field', this.removeField);
151
- $('.wpuf-cf-table').on('click', 'a.wpuf-delete-avatar', this.deleteAvatar);
152
- },
153
- cloneField: function(e) {
154
- e.preventDefault();
155
-
156
- var $div = $(this).closest('tr');
157
- var $clone = $div.clone();
158
- // console.log($clone);
159
-
160
- //clear the inputs
161
- $clone.find('input').val('');
162
- $clone.find(':checked').attr('checked', '');
163
- $div.after($clone);
164
- },
165
-
166
- removeField: function() {
167
- //check if it's the only item
168
- var $parent = $(this).closest('tr');
169
- var items = $parent.siblings().andSelf().length;
170
-
171
- if( items > 1 ) {
172
- $parent.remove();
173
- }
174
- },
175
-
176
- deleteAvatar: function(e) {
177
- e.preventDefault();
178
-
179
- var data = {
180
- action: 'wpuf_delete_avatar',
181
- user_id : $('#profile-page').find('#user_id').val(),
182
- _wpnonce: '<?php echo wp_create_nonce( 'wpuf_nonce' ); ?>'
183
- };
184
-
185
- if ( confirm( $(this).data('confirm') ) ) {
186
- $.post(ajaxurl, data, function() {
187
- window.location.reload();
188
- });
189
- }
190
- }
191
- };
192
-
193
- wpuf.init();
194
- });
195
-
196
- </script>
197
- <style type="text/css">
198
- ul.wpuf-attachment-list li {
199
- display: inline-block;
200
- border: 1px solid #dfdfdf;
201
- padding: 5px;
202
- -webkit-border-radius: 5px;
203
- -moz-border-radius: 5px;
204
- border-radius: 5px;
205
- margin-right: 5px;
206
- }
207
- ul.wpuf-attachment-list li a.attachment-delete {
208
- text-decoration: none;
209
- padding: 3px 12px;
210
- border: 1px solid #C47272;
211
- color: #ffffff;
212
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
213
- -webkit-border-radius: 3px;
214
- -moz-border-radius: 3px;
215
- border-radius: 3px;
216
- background-color: #da4f49;
217
- background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
218
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
219
- background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
220
- background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
221
- background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
222
- background-repeat: repeat-x;
223
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
224
- border-color: #bd362f #bd362f #802420;
225
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
226
- *background-color: #bd362f;
227
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
228
- }
229
- ul.wpuf-attachment-list li a.attachment-delete:hover,
230
- ul.wpuf-attachment-list li a.attachment-delete:active {
231
- color: #ffffff;
232
- background-color: #bd362f;
233
- *background-color: #a9302a;
234
- }
235
-
236
- .wpuf-cf-table table th,
237
- .wpuf-cf-table table td{
238
- padding-left: 0 !important;
239
- }
240
-
241
- .wpuf-cf-table .required { color: red;}
242
- .wpuf-cf-table textarea { width: 400px; }
243
-
244
- .wpuf-field-google-map {
245
- height: 300px;
246
- width: 100%;
247
- }
248
- .wpuf-form-google-map {
249
- height: 300px;
250
- width: 100%;
251
- }
252
- input[type="text"].wpuf-google-map-search {
253
- margin-top: 10px !important;
254
- border: 1px solid transparent !important;
255
- border-radius: 2px 0 0 2px !important;
256
- box-sizing: border-box !important;
257
- -moz-box-sizing: border-box !important;
258
- height: 32px !important;
259
- outline: none !important;
260
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
261
- background-color: #fff !important;
262
- text-overflow: ellipsis !important;
263
- width: 170px !important;
264
- font-family: Roboto !important;
265
- font-size: 15px !important;
266
- font-weight: 300 !important;
267
- padding: 0 11px 0 13px !important;
268
- display: none;
269
- }
270
- .gm-style input[type="text"].wpuf-google-map-search {
271
- display: block;
272
- }
273
- .wpuf-form-google-map-container input[type="text"].wpuf-google-map-search {
274
- width: 230px !important;
275
- }
276
- .wpuf-form-google-map-container.hide-search-box .gm-style input[type="text"].wpuf-google-map-search {
277
- display: none;
278
- }
279
-
280
- </style>
281
- <?php
282
- }
283
-
284
- // Save the Metabox Data
285
- function save_meta( $post_id, $post ) {
286
- if ( !isset( $_POST['wpuf_cf_update'] ) ) {
287
- return $post->ID;
288
- }
289
-
290
- if ( !wp_verify_nonce( $_POST['wpuf_cf_update'], plugin_basename( __FILE__ ) ) ) {
291
- return $post->ID;
292
- }
293
-
294
- // Is the user allowed to edit the post or page?
295
- if ( !current_user_can( 'edit_post', $post->ID ) )
296
- return $post->ID;
297
-
298
- list( $post_vars, $tax_vars, $meta_vars ) = self::get_input_fields( $_POST['wpuf_cf_form_id'] );
299
-
300
- WPUF_Frontend_Form_Post::update_post_meta( $meta_vars, $post->ID );
301
- }
302
-
303
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/promotion.php DELETED
@@ -1,174 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Promotional offer class
5
- */
6
- class WPUF_Admin_Promotion {
7
-
8
- public function __construct() {
9
- add_action( 'admin_notices', array( $this, 'promotional_offer' ) );
10
- add_action( 'wp_ajax_wpuf-dismiss-promotional-offer-notice', array( $this, 'dismiss_promotional_offer' ) );
11
- }
12
-
13
- /**
14
- * Promotional offer notice
15
- *
16
- * @since 1.1.15
17
- *
18
- * @return void
19
- */
20
- public function promotional_offer() {
21
- // Show only to Admins
22
- if ( ! current_user_can( 'manage_options' ) ) {
23
- return;
24
- }
25
-
26
- // 2017-03-22 23:59:00
27
- if ( time() > 1490227140 ) {
28
- return;
29
- }
30
-
31
- // check if it has already been dismissed
32
- $hide_notice = get_option( 'wpuf_promotional_offer_notice', 'no' );
33
-
34
- if ( 'hide' == $hide_notice ) {
35
- return;
36
- }
37
-
38
- $product_text = ( ! wpuf()->is_pro() ) ? __( 'Pro upgrade and all extensions, ', 'wpuf' ) : __( 'all extensions, ', 'wpuf' );
39
-
40
- $offer_msg = __( '<h2><span class="dashicons dashicons-awards"></span> weDevs 4th Year Anniversary Offer</h2>', 'erp' );
41
- $offer_msg .= sprintf( __( '<p>Get <strong class="highlight-text">44&#37; discount</strong> on %2$s also <a target="_blank" href="%1$s"><strong>WIN any product</strong></a> from our 4th year anniversary giveaway. Offer ending soon!</p>', 'wpuf' ), 'https://wedevs.com/in/4years/?utm_source=freeplugin&utm_medium=prompt&utm_term=wpuf_plugin&utm_content=textlink&utm_campaign=wedevs_4_years', $product_text );
42
- ?>
43
- <div class="notice is-dismissible" id="wpuf-promotional-offer-notice">
44
- <table>
45
- <tbody>
46
- <tr>
47
- <td class="image-container">
48
- <img src="https://ps.w.org/wp-user-frontend/assets/icon-256x256.png" alt="">
49
- </td>
50
- <td class="message-container">
51
- <?php echo $offer_msg; ?>
52
- </td>
53
- </tr>
54
- </tbody>
55
- </table>
56
-
57
- <span class="dashicons dashicons-megaphone"></span>
58
- </div><!-- #wpuf-promotional-offer-notice -->
59
-
60
- <style>
61
- #wpuf-promotional-offer-notice {
62
- background-color: #4caf50;
63
- border: 0px;
64
- padding: 0;
65
- opacity: 0;
66
- }
67
-
68
- .wrap > #wpuf-promotional-offer-notice {
69
- opacity: 1;
70
- }
71
-
72
- #wpuf-promotional-offer-notice table {
73
- border-collapse: collapse;
74
- width: 100%;
75
- }
76
-
77
- #wpuf-promotional-offer-notice table td {
78
- padding: 0;
79
- }
80
-
81
- #wpuf-promotional-offer-notice table td.image-container {
82
- background-color: #fff;
83
- vertical-align: middle;
84
- width: 95px;
85
- }
86
-
87
-
88
- #wpuf-promotional-offer-notice img {
89
- max-width: 100%;
90
- max-height: 100px;
91
- vertical-align: middle;
92
- }
93
-
94
- #wpuf-promotional-offer-notice table td.message-container {
95
- padding: 0 10px;
96
- }
97
-
98
- #wpuf-promotional-offer-notice h2{
99
- color: rgba(250, 250, 250, 0.77);
100
- margin-bottom: 10px;
101
- font-weight: normal;
102
- margin: 16px 0 14px;
103
- -webkit-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
104
- -moz-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
105
- -o-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
106
- text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
107
- }
108
-
109
-
110
- #wpuf-promotional-offer-notice h2 span {
111
- position: relative;
112
- top: 0;
113
- }
114
-
115
- #wpuf-promotional-offer-notice p{
116
- color: rgba(250, 250, 250, 0.77);
117
- font-size: 14px;
118
- margin-bottom: 10px;
119
- -webkit-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
120
- -moz-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
121
- -o-text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
122
- text-shadow: 0.1px 0.1px 0px rgba(250, 250, 250, 0.24);
123
- }
124
-
125
- #wpuf-promotional-offer-notice p strong.highlight-text{
126
- color: #fff;
127
- }
128
-
129
- #wpuf-promotional-offer-notice p a {
130
- color: #fafafa;
131
- }
132
-
133
- #wpuf-promotional-offer-notice .notice-dismiss:before {
134
- color: #fff;
135
- }
136
-
137
- #wpuf-promotional-offer-notice span.dashicons-megaphone {
138
- position: absolute;
139
- bottom: 46px;
140
- right: 119px;
141
- color: rgba(253, 253, 253, 0.29);
142
- font-size: 96px;
143
- transform: rotate(-21deg);
144
- }
145
-
146
- </style>
147
-
148
- <script type='text/javascript'>
149
- jQuery('body').on('click', '#wpuf-promotional-offer-notice .notice-dismiss', function(e) {
150
- e.preventDefault();
151
-
152
- wp.ajax.post('wpuf-dismiss-promotional-offer-notice', {
153
- dismissed: true
154
- });
155
- });
156
- </script>
157
- <?php
158
- }
159
-
160
-
161
- /**
162
- * Dismiss promotion notice
163
- *
164
- * @since 2.5
165
- *
166
- * @return void
167
- */
168
- public function dismiss_promotional_offer() {
169
- if ( ! empty( $_POST['dismissed'] ) ) {
170
- $offer_key = 'wpuf_promotional_offer_notice';
171
- update_option( $offer_key, 'hide' );
172
- }
173
- }
174
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/settings-options.php DELETED
@@ -1,445 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Settings Sections
5
- *
6
- * @since 1.0
7
- * @return array
8
- */
9
- function wpuf_settings_sections() {
10
- $sections = array(
11
- array(
12
- 'id' => 'wpuf_general',
13
- 'title' => __( 'General Options', 'wpuf' )
14
- ),
15
- array(
16
- 'id' => 'wpuf_dashboard',
17
- 'title' => __( 'Dashboard', 'wpuf' )
18
- ),
19
- array(
20
- 'id' => 'wpuf_profile',
21
- 'title' => __( 'Login / Registration', 'wpuf' )
22
- ),
23
- array(
24
- 'id' => 'wpuf_payment',
25
- 'title' => __( 'Payments', 'wpuf' )
26
- ),
27
- array(
28
- 'id' => 'wpuf_support',
29
- 'title' => __( 'Support', 'wpuf' )
30
- ),
31
- );
32
-
33
- return apply_filters( 'wpuf_settings_sections', $sections );
34
- }
35
-
36
- function wpuf_settings_fields() {
37
- $pages = wpuf_get_pages();
38
- $users = wpuf_list_users();
39
-
40
- $all_currencies = wpuf_get_currencies();
41
-
42
- $currencies = array();
43
- foreach ( $all_currencies as $currency ) {
44
- $currencies[ $currency['currency'] ] = $currency['label'] . ' (' . $currency['symbol'] . ')';
45
- }
46
-
47
- $default_currency_symbol = wpuf_get_currency( 'symbol' );
48
-
49
- $settings_fields = array(
50
- 'wpuf_general' => apply_filters( 'wpuf_options_others', array(
51
- array(
52
- 'name' => 'fixed_form_element',
53
- 'label' => __( 'Fixed Form Elements ', 'wpuf' ),
54
- 'desc' => __( 'Show fixed form elements sidebar in form editor', 'wpuf' ),
55
- 'type' => 'checkbox',
56
- 'default' => 'on'
57
- ),
58
- array(
59
- 'name' => 'edit_page_id',
60
- 'label' => __( 'Edit Page', 'wpuf' ),
61
- 'desc' => __( 'Select the page where [wpuf_edit] is located', 'wpuf' ),
62
- 'type' => 'select',
63
- 'options' => $pages
64
- ),
65
- array(
66
- 'name' => 'default_post_owner',
67
- 'label' => __( 'Default Post Owner', 'wpuf' ),
68
- 'desc' => __( 'If guest post is enabled and user details are OFF, the posts are assigned to this user', 'wpuf' ),
69
- 'type' => 'select',
70
- 'options' => $users,
71
- 'default' => '1'
72
- ),
73
- array(
74
- 'name' => 'admin_access',
75
- 'label' => __( 'Admin area access', 'wpuf' ),
76
- 'desc' => __( 'Allow you to block specific user role to WordPress admin area.', 'wpuf' ),
77
- 'type' => 'select',
78
- 'default' => 'read',
79
- 'options' => array(
80
- 'manage_options' => __( 'Admin Only', 'wpuf' ),
81
- 'edit_others_posts' => __( 'Admins, Editors', 'wpuf' ),
82
- 'publish_posts' => __( 'Admins, Editors, Authors', 'wpuf' ),
83
- 'edit_posts' => __( 'Admins, Editors, Authors, Contributors', 'wpuf' ),
84
- 'read' => __( 'Default', 'wpuf' )
85
- )
86
- ),
87
- array(
88
- 'name' => 'override_editlink',
89
- 'label' => __( 'Override the post edit link', 'wpuf' ),
90
- 'desc' => __( 'Users see the edit link in post if s/he is capable to edit the post/page. Selecting <strong>Yes</strong> will override the default WordPress edit post link in frontend', 'wpuf' ),
91
- 'type' => 'select',
92
- 'default' => 'yes',
93
- 'options' => array(
94
- 'yes' => __( 'Yes', 'wpuf' ),
95
- 'no' => __( 'No', 'wpuf' )
96
- )
97
- ),
98
- array(
99
- 'name' => 'cf_show_front',
100
- 'label' => __( 'Custom Fields in post', 'wpuf' ),
101
- 'desc' => __( 'Show custom fields on post content area', 'wpuf' ),
102
- 'type' => 'checkbox',
103
- 'default' => 'off'
104
- ),
105
- array(
106
- 'name' => 'load_script',
107
- 'label' => __( 'Load Scripts', 'wpuf' ),
108
- 'desc' => __( 'Load scripts/styles in all pages', 'wpuf' ),
109
- 'type' => 'checkbox',
110
- 'default' => 'on'
111
- ),
112
- array(
113
- 'name' => 'insert_photo_size',
114
- 'label' => __( 'Insert Photo image size', 'wpuf' ),
115
- 'desc' => __( 'Default image size of "<strong>Insert Photo</strong>" button in post content area', 'wpuf' ),
116
- 'type' => 'select',
117
- 'options' => wpuf_get_image_sizes(),
118
- 'default' => 'thumbnail'
119
- ),
120
- array(
121
- 'name' => 'insert_photo_type',
122
- 'label' => __( 'Insert Photo image type', 'wpuf' ),
123
- 'desc' => __( 'Default image type of "<strong>Insert Photo</strong>" button in post content area', 'wpuf' ),
124
- 'type' => 'select',
125
- 'options' => array(
126
- 'image' => __( 'Image only', 'wpuf' ),
127
- 'link' => __( 'Image with link', 'wpuf' )
128
- ),
129
- 'default' => 'link'
130
- ),
131
- array(
132
- 'name' => 'image_caption',
133
- 'label' => __( 'Enable Image Caption', 'wpuf' ),
134
- 'desc' => __( 'Allow users to update image/video title, caption and description', 'wpuf' ),
135
- 'type' => 'checkbox',
136
- 'default' => 'off'
137
- ),
138
- array(
139
- 'name' => 'default_post_form',
140
- 'label' => __( 'Default Post Form', 'wpuf' ),
141
- 'desc' => __( 'Fallback form for post editing if no associated form found', 'wpuf' ),
142
- 'type' => 'select',
143
- 'options' => wpuf_get_pages( 'wpuf_forms' )
144
- ),
145
- array(
146
- 'name' => 'recaptcha_public',
147
- 'label' => __( 'reCAPTCHA Site Key', 'wpuf' ),
148
- ),
149
- array(
150
- 'name' => 'recaptcha_private',
151
- 'label' => __( 'reCAPTCHA Secret Key', 'wpuf' ),
152
- 'desc' => __( '<a target="_blank" href="https://www.google.com/recaptcha/">Register here</a> to get reCaptcha Site and Secret keys.', 'wpuf' ),
153
- ),
154
- array(
155
- 'name' => 'gmap_api_key',
156
- 'label' => __( 'Google Map API', 'wpuf' ),
157
- 'desc' => __( '<a target="_blank" href="https://developers.google.com/maps/documentation/javascript">API</a> key is needed to render Google Maps', 'wpuf' ),
158
- ),
159
- array(
160
- 'name' => 'custom_css',
161
- 'label' => __( 'Custom CSS codes', 'wpuf' ),
162
- 'desc' => __( 'If you want to add your custom CSS code, it will be added on page header wrapped with style tag', 'wpuf' ),
163
- 'type' => 'textarea'
164
- ),
165
- ) ),
166
- 'wpuf_dashboard' => apply_filters( 'wpuf_options_dashboard', array(
167
- array(
168
- 'name' => 'enable_post_edit',
169
- 'label' => __( 'Users can edit post?', 'wpuf' ),
170
- 'desc' => __( 'Users will be able to edit their own posts', 'wpuf' ),
171
- 'type' => 'select',
172
- 'default' => 'yes',
173
- 'options' => array(
174
- 'yes' => __( 'Yes', 'wpuf' ),
175
- 'no' => __( 'No', 'wpuf' )
176
- )
177
- ),
178
- array(
179
- 'name' => 'enable_post_del',
180
- 'label' => __( 'User can delete post?', 'wpuf' ),
181
- 'desc' => __( 'Users will be able to delete their own posts', 'wpuf' ),
182
- 'type' => 'select',
183
- 'default' => 'yes',
184
- 'options' => array(
185
- 'yes' => __( 'Yes', 'wpuf' ),
186
- 'no' => __( 'No', 'wpuf' )
187
- )
188
- ),
189
- array(
190
- 'name' => 'disable_pending_edit',
191
- 'label' => __( 'Pending Post Edit', 'wpuf' ),
192
- 'desc' => __( 'Disable post editing while post in "pending" status', 'wpuf' ),
193
- 'type' => 'checkbox',
194
- 'default' => 'on'
195
- ),
196
- array(
197
- 'name' => 'per_page',
198
- 'label' => __( 'Posts per page', 'wpuf' ),
199
- 'desc' => __( 'How many posts will be listed in a page', 'wpuf' ),
200
- 'type' => 'text',
201
- 'default' => '10'
202
- ),
203
- array(
204
- 'name' => 'show_user_bio',
205
- 'label' => __( 'Show user bio', 'wpuf' ),
206
- 'desc' => __( 'Users biographical info will be shown', 'wpuf' ),
207
- 'type' => 'checkbox',
208
- 'default' => 'on'
209
- ),
210
- array(
211
- 'name' => 'show_post_count',
212
- 'label' => __( 'Show post count', 'wpuf' ),
213
- 'desc' => __( 'Show how many posts are created by the user', 'wpuf' ),
214
- 'type' => 'checkbox',
215
- 'default' => 'on'
216
- ),
217
- array(
218
- 'name' => 'show_ft_image',
219
- 'label' => __( 'Show Featured Image', 'wpuf' ),
220
- 'desc' => __( 'Show featured image of the post', 'wpuf' ),
221
- 'type' => 'checkbox'
222
- ),
223
- array(
224
- 'name' => 'ft_img_size',
225
- 'label' => __( 'Featured Image size', 'wpuf' ),
226
- 'type' => 'select',
227
- 'options' => wpuf_get_image_sizes()
228
- ),
229
- array(
230
- 'name' => 'un_auth_msg',
231
- 'label' => __( 'Unauthorized Message', 'wpuf' ),
232
- 'desc' => __( 'Not logged in users will see this message', 'wpuf' ),
233
- 'type' => 'textarea'
234
- ),
235
- ) ),
236
- 'wpuf_profile' => array(
237
- array(
238
- 'name' => 'autologin_after_registration',
239
- 'label' => __( 'Auto Login After Registration', 'wpuf' ),
240
- 'desc' => __( 'If enabled, users after registration will be logged in to the system', 'wpuf' ),
241
- 'type' => 'checkbox',
242
- 'default' => 'off'
243
- ),
244
- array(
245
- 'name' => 'register_link_override',
246
- 'label' => __( 'Login/Registration override', 'wpuf' ),
247
- 'desc' => __( 'If enabled, default login and registration forms will be overridden by WPUF with pages below', 'wpuf' ),
248
- 'type' => 'checkbox',
249
- 'default' => 'off'
250
- ),
251
- array(
252
- 'name' => 'reg_override_page',
253
- 'label' => __( 'Registration Page', 'wpuf' ),
254
- 'desc' => __( 'Select the page you want to use as registration page override <em>(should have shortcode)</em>', 'wpuf' ),
255
- 'type' => 'select',
256
- 'options' => $pages
257
- ),
258
- array(
259
- 'name' => 'login_page',
260
- 'label' => __( 'Login Page', 'wpuf' ),
261
- 'desc' => __( 'Select the page which contains <code>[wpuf-login]</code> shortcode', 'wpuf' ),
262
- 'type' => 'select',
263
- 'options' => $pages
264
- ),
265
- ),
266
- 'wpuf_payment' => apply_filters( 'wpuf_options_payment', array(
267
- array(
268
- 'name' => 'charge_posting',
269
- 'label' => __( 'Charge for posting', 'wpuf' ),
270
- 'desc' => __( 'Charge user for submitting a post', 'wpuf' ),
271
- 'type' => 'select',
272
- 'default' => 'no',
273
- 'options' => array(
274
- 'yes' => __( 'Yes', 'wpuf' ),
275
- 'no' => __( 'No', 'wpuf' )
276
- )
277
- ),
278
- array(
279
- 'name' => 'force_pack',
280
- 'label' => __( 'Force pack purchase', 'wpuf' ),
281
- 'desc' => __( 'When active, users must have to buy a pack for posting', 'wpuf' ),
282
- 'type' => 'select',
283
- 'default' => 'no',
284
- 'options' => array(
285
- 'no' => __( 'Disable', 'wpuf' ),
286
- 'yes' => __( 'Enable', 'wpuf' )
287
- )
288
- ),
289
- array(
290
- 'name' => 'subscription_page',
291
- 'label' => __( 'Subscription Pack Page', 'wpuf' ),
292
- 'desc' => __( 'Select the page where <code>[wpuf_sub_pack]</code> located.', 'wpuf' ),
293
- 'type' => 'select',
294
- 'options' => $pages
295
- ),
296
- array(
297
- 'name' => 'register_subscription',
298
- 'label' => __( 'Subscription at registration', 'wpuf' ),
299
- 'desc' => __( 'Registration time redirect to subscription page', 'wpuf' ),
300
- 'type' => 'checkbox',
301
- ),
302
- array(
303
- 'name' => 'currency',
304
- 'label' => __( 'Currency', 'wpuf' ),
305
- 'type' => 'select',
306
- 'default' => 'USD',
307
- 'options' => $currencies
308
- ),
309
- array(
310
- 'name' => 'currency_position',
311
- 'label' => __( 'Currency Position', 'wpuf' ),
312
- 'type' => 'select',
313
- 'default' => 'left',
314
- 'options' => array(
315
- 'left' => sprintf( '%1$s (%2$s99.99)', __( 'Left', 'wpuf' ), $default_currency_symbol ),
316
- 'right' => sprintf( '%1$s (99.99%2$s)', __( 'Right', 'wpuf' ), $default_currency_symbol ),
317
- 'left_space' => sprintf( '%1$s (%2$s 99.99)', __( 'Left with space', 'wpuf' ), $default_currency_symbol ),
318
- 'right_space' => sprintf( '%1$s (99.99 %2$s)', __( 'Right with space', 'wpuf' ), $default_currency_symbol ),
319
- )
320
- ),
321
- array(
322
- 'name' => 'wpuf_price_thousand_sep',
323
- 'label' => __( 'Thousand Separator', 'wpuf' ),
324
- 'desc' => __( 'This sets the thousand separator of displayed prices.', 'wpuf' ),
325
- 'css' => 'width:50px;',
326
- 'default' => ',',
327
- 'type' => 'text',
328
- 'desc_tip' => true,
329
- ),
330
- array(
331
- 'name' => 'wpuf_price_decimal_sep',
332
- 'label' => __( 'Decimal Separator', 'wpuf' ),
333
- 'desc' => __( 'This sets the decimal separator of displayed prices.', 'wpuf' ),
334
- 'default' => '.',
335
- 'type' => 'text',
336
- ),
337
-
338
- array(
339
- 'name' => 'wpuf_price_num_decimals',
340
- 'label' => __( 'Number of Decimals', 'wpuf' ),
341
- 'desc' => __( 'This sets the number of decimal points shown in displayed prices.', 'wpuf' ),
342
- 'default' => '2',
343
- 'type' => 'number',
344
- 'custom_attributes' => array(
345
- 'min' => 0,
346
- 'step' => 1
347
- )
348
- ),
349
- array(
350
- 'name' => 'cost_per_post',
351
- 'label' => __( 'Cost', 'wpuf' ),
352
- 'desc' => __( 'Cost per post in - <span>' . wpuf_get_currency( 'code' ) . ' ( ' . wpuf_get_currency( 'symbol' ) . '</span> )', 'wpuf' ),
353
- 'type' => 'text',
354
- 'default' => '2'
355
- ),
356
- array(
357
- 'name' => 'sandbox_mode',
358
- 'label' => __( 'Enable demo/sandbox mode', 'wpuf' ),
359
- 'desc' => __( 'When sandbox mode is active, all payment gateway will be used in demo mode', 'wpuf' ),
360
- 'type' => 'checkbox',
361
- 'default' => 'on'
362
- ),
363
- array(
364
- 'name' => 'payment_page',
365
- 'label' => __( 'Payment Page', 'wpuf' ),
366
- 'desc' => __( 'This page will be used to process payment options', 'wpuf' ),
367
- 'type' => 'select',
368
- 'options' => $pages
369
- ),
370
- array(
371
- 'name' => 'payment_success',
372
- 'label' => __( 'Payment Success Page', 'wpuf' ),
373
- 'desc' => __( 'After payment users will be redirected here', 'wpuf' ),
374
- 'type' => 'select',
375
- 'options' => $pages
376
- ),
377
- array(
378
- 'name' => 'active_gateways',
379
- 'label' => __( 'Payment Gateways', 'wpuf' ),
380
- 'desc' => __( 'Active payment gateways', 'wpuf' ),
381
- 'type' => 'multicheck',
382
- 'options' => wpuf_get_gateways()
383
- )
384
- ) ),
385
- 'wpuf_support' => apply_filters( 'wpuf_options_support', array(
386
- array(
387
- 'name' => 'support',
388
- 'label' => __( 'Need Help?', 'wpuf' ),
389
- 'type' => 'html',
390
- 'desc' => '
391
- <ul>
392
- <li>
393
- <strong>Step 1: <a target="_blank" href="http://docs.wedevs.com/">Read Documentation and FAQ</a></strong>
394
- <p>We have created detailed step by step documentation for all the features (including docs for developers). We have also answered all possible FAQ queries based on user request. We hope you will find what you are looking for. If not, please continue to Step 2.</p>
395
- </li>
396
- <br/>
397
- <li>
398
- <strong>Step 2: <a href="https://wedevs.com/account/ticket" target="_blank">Create a Support Ticket</a></strong>
399
- <p>We reply from <code>10am to 6pm (GMT+6)</code> except <code><strong>Friday</strong></code>. Our responses are usually under 12 hours to as quick as 1 hour depending on channel pressure.</p>
400
- <p>When you are creating a ticket, please care to include a screenshot of the issue if possible and write the problem as specificly as you can. This will help us track and solve your trouble quickly.
401
- </p>
402
- </li>
403
- </ul>'
404
- )
405
- ) ),
406
- );
407
-
408
- return apply_filters( 'wpuf_settings_fields', $settings_fields );
409
- }
410
-
411
- function wpuf_settings_field_profile( $form ) {
412
- $user_roles = wpuf_get_user_roles();
413
- $forms = get_posts( array(
414
- 'numberposts' => -1,
415
- 'post_type' => 'wpuf_profile'
416
- ) );
417
-
418
- $val = get_option( 'wpuf_profile', array() );
419
- ?>
420
-
421
- <p style="padding-left: 10px; font-style: italic; font-size: 13px;">
422
- <strong><?php _e( 'Select profile/registration forms for user roles. These forms will be used to populate extra edit profile fields in backend.', 'wpuf' ); ?></strong>
423
- </p>
424
- <table class="form-table">
425
- <?php
426
- foreach ($user_roles as $role => $name) {
427
- $current = isset( $val['roles'][$role] ) ? $val['roles'][$role] : '';
428
- ?>
429
- <tr valign="top">
430
- <th scrope="row"><?php echo $name; ?></th>
431
- <td>
432
- <select name="wpuf_profile[roles][<?php echo $role; ?>]">
433
- <option value=""><?php _e( ' - select - ', 'wpuf' ); ?></option>
434
- <?php foreach ($forms as $form) { ?>
435
- <option value="<?php echo $form->ID; ?>"<?php selected( $current, $form->ID ); ?>><?php echo $form->post_title; ?></option>
436
- <?php } ?>
437
- </select>
438
- </td>
439
- </tr>
440
- <?php } ?>
441
- </table>
442
- <?php
443
- }
444
-
445
- add_action( 'wsa_form_bottom_wpuf_profile', 'wpuf_settings_field_profile' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/settings.php DELETED
@@ -1,287 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * WordPress settings API demo class
5
- *
6
- * @author Tareq Hasan
7
- */
8
- class WPUF_Admin_Settings {
9
-
10
- private $settings_api;
11
- private static $_instance;
12
-
13
- function __construct() {
14
-
15
- if ( ! class_exists( 'WeDevs_Settings_API' ) ) {
16
- require_once dirname( dirname( __FILE__ ) ) . '/lib/class.settings-api.php';
17
- }
18
-
19
- $this->settings_api = new WeDevs_Settings_API();
20
-
21
- add_action( 'admin_init', array($this, 'admin_init') );
22
- add_action( 'admin_menu', array($this, 'admin_menu') );
23
-
24
- add_filter( 'parent_file', array($this, 'fix_parent_menu' ) );
25
-
26
- add_action( 'admin_init', array($this, 'handle_tools_action') );
27
- }
28
-
29
- public static function init() {
30
- if ( !self::$_instance ) {
31
- self::$_instance = new self();
32
- }
33
-
34
- return self::$_instance;
35
- }
36
-
37
- function admin_init() {
38
-
39
- //set the settings
40
- $this->settings_api->set_sections( $this->get_settings_sections() );
41
- $this->settings_api->set_fields( $this->get_settings_fields() );
42
-
43
- //initialize settings
44
- $this->settings_api->admin_init();
45
- }
46
-
47
- /**
48
- * Register the admin menu
49
- *
50
- * @since 1.0
51
- */
52
- function admin_menu() {
53
- $capability = wpuf_admin_role();
54
-
55
- add_menu_page( __( 'WP User Frontend', 'wpuf' ), __( 'User Frontend', 'wpuf' ), $capability, 'wp-user-frontend', array($this, 'wpuf_post_forms_page'), 'dashicons-exerpt-view', 55 );
56
-
57
- add_submenu_page( 'wp-user-frontend', __( 'Post Forms', 'wpuf' ), __( 'Post Forms' ), $capability, 'wpuf-post-forms', array( $this, 'wpuf_post_forms_page' ) );
58
- remove_submenu_page( 'wp-user-frontend', 'wp-user-frontend' );
59
-
60
- /**
61
- * @since 2.3
62
- */
63
- do_action( 'wpuf_admin_menu_top' );
64
-
65
- add_submenu_page( 'wp-user-frontend', __( 'Subscriptions', 'wpuf' ), __( 'Subscriptions', 'wpuf' ), $capability, 'edit.php?post_type=wpuf_subscription' );
66
-
67
- do_action( 'wpuf_admin_menu' );
68
-
69
- $transactions_page = add_submenu_page( 'wp-user-frontend', __( 'Transactions', 'wpuf' ), __( 'Transactions', 'wpuf' ), $capability, 'wpuf_transaction', array($this, 'transactions_page') );
70
- add_submenu_page( 'wp-user-frontend', __( 'Add-ons', 'wpuf' ), __( 'Add-ons', 'wpuf' ), $capability, 'wpuf_addons', array($this, 'addons_page') );
71
- add_submenu_page( 'wp-user-frontend', __( 'Tools', 'wpuf' ), __( 'Tools', 'wpuf' ), $capability, 'wpuf_tools', array($this, 'tools_page') );
72
- add_submenu_page( 'wp-user-frontend', __( 'Settings', 'wpuf' ), __( 'Settings', 'wpuf' ), $capability, 'wpuf-settings', array($this, 'plugin_page') );
73
-
74
- add_action( "load-$transactions_page", array( $this, 'transactions_screen_option' ) );
75
- add_action( "load-$transactions_page", array( $this, 'enqueue_styles' ) );
76
- }
77
-
78
- /**
79
- * WPUF Settings sections
80
- *
81
- * @since 1.0
82
- * @return array
83
- */
84
- function get_settings_sections() {
85
- return wpuf_settings_sections();
86
- }
87
-
88
- /**
89
- * Returns all the settings fields
90
- *
91
- * @return array settings fields
92
- */
93
- function get_settings_fields() {
94
- return wpuf_settings_fields();
95
- }
96
-
97
- function plugin_page() {
98
- ?>
99
- <div class="wrap">
100
-
101
- <?php screen_icon( 'options-general' ); ?>
102
-
103
- <?php
104
- settings_errors();
105
-
106
- $this->settings_api->show_navigation();
107
- $this->settings_api->show_forms();
108
- ?>
109
-
110
- </div>
111
- <?php
112
- }
113
-
114
- function transactions_page() {
115
- require_once dirname( dirname( __FILE__ ) ) . '/admin/transactions.php';
116
- }
117
-
118
- /**
119
- * Callback method for Post Forms submenu
120
- *
121
- * @since 2.5
122
- *
123
- * @return void
124
- */
125
- function wpuf_post_forms_page() {
126
- $action = isset( $_GET['action'] ) ? $_GET['action'] : null;
127
- $add_new_page_url = admin_url( 'admin.php?page=wpuf-post-forms&action=add-new' );
128
-
129
- switch ( $action ) {
130
- case 'edit':
131
- require_once WPUF_ROOT . '/views/post-form.php';
132
- break;
133
-
134
- case 'add-new':
135
- require_once WPUF_ROOT . '/views/post-form.php';
136
- break;
137
-
138
- default:
139
- require_once WPUF_ROOT . '/admin/post-forms-list-table-view.php';
140
- break;
141
- }
142
- }
143
-
144
- function subscription_page() {
145
- require_once dirname( dirname( __FILE__ ) ) . '/admin/subscription.php';
146
- }
147
-
148
- function addons_page() {
149
- require_once dirname( dirname( __FILE__ ) ) . '/admin/add-ons.php';
150
- }
151
-
152
- function tools_page() {
153
- require_once dirname( dirname( __FILE__ ) ) . '/admin/tools.php';
154
- }
155
-
156
- /**
157
- * highlight the proper top level menu
158
- *
159
- * @link http://wordpress.org/support/topic/moving-taxonomy-ui-to-another-main-menu?replies=5#post-2432769
160
- * @global obj $current_screen
161
- * @param string $parent_file
162
- * @return string
163
- */
164
- function fix_parent_menu( $parent_file ) {
165
- global $current_screen;
166
-
167
- $post_types = array( 'wpuf_forms', 'wpuf_profile', 'wpuf_subscription', 'wpuf_coupon');
168
-
169
- if ( in_array( $current_screen->post_type, $post_types ) ) {
170
- $parent_file = 'wp-user-frontend';
171
- }
172
-
173
- return $parent_file;
174
- }
175
-
176
- /**
177
- * Hanlde tools page action
178
- *
179
- * @return void
180
- */
181
- function handle_tools_action() {
182
- if ( ! isset( $_GET['wpuf_action'] ) ) {
183
- return;
184
- }
185
-
186
- check_admin_referer( 'wpuf-tools-action' );
187
-
188
- if ( ! current_user_can( 'manage_options' ) ) {
189
- return;
190
- }
191
-
192
- global $wpdb;
193
-
194
- $action = $_GET['wpuf_action'];
195
- $message = 'del_forms';
196
-
197
- switch ($action) {
198
- case 'clear_settings':
199
- delete_option( 'wpuf_general' );
200
- delete_option( 'wpuf_dashboard' );
201
- delete_option( 'wpuf_profile' );
202
- delete_option( 'wpuf_payment' );
203
- delete_option( '_wpuf_page_created' );
204
-
205
- $message = 'settings_cleared';
206
- break;
207
-
208
- case 'del_post_forms':
209
- $this->delete_post_type( 'wpuf_forms' );
210
- break;
211
-
212
- case 'del_pro_forms':
213
- $this->delete_post_type( 'wpuf_profile' );
214
- break;
215
-
216
- case 'del_subs':
217
- $this->delete_post_type( 'wpuf_subscription' );
218
- break;
219
-
220
- case 'del_coupon':
221
- $this->delete_post_type( 'wpuf_coupon' );
222
- break;
223
-
224
- case 'clear_transaction':
225
- $wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}wpuf_transaction");
226
-
227
- $message = 'del_trans';
228
- break;
229
-
230
- default:
231
- # code...
232
- break;
233
- }
234
-
235
- wp_redirect( add_query_arg( array( 'msg' => $message ), admin_url( 'admin.php?page=wpuf_tools&action=tools' ) ) );
236
- exit;
237
- }
238
-
239
- /**
240
- * Delete all posts by a post type
241
- *
242
- * @param string $post_type
243
- * @return void
244
- */
245
- function delete_post_type( $post_type ) {
246
- $query = new WP_Query( array(
247
- 'post_type' => $post_type,
248
- 'posts_per_page' => -1,
249
- 'post_status' => array( 'publish', 'draft', 'pending', 'trash' )
250
- ) );
251
-
252
- $posts = $query->get_posts();
253
-
254
- if ( $posts ) {
255
- foreach ($posts as $item) {
256
- wp_delete_post( $item->ID, true );
257
- }
258
- }
259
- }
260
-
261
- /**
262
- * Screen options.
263
- *
264
- * @return void
265
- */
266
- public function transactions_screen_option() {
267
- $option = 'per_page';
268
- $args = array(
269
- 'label' => __( 'Number of items per page:', 'wpuf' ),
270
- 'default' => 20,
271
- 'option' => 'transactions_per_page'
272
- );
273
-
274
- add_screen_option( $option, $args );
275
-
276
- $this->transactions_list_table_obj = new WPUF_Transactions_List_Table();
277
- }
278
-
279
- /**
280
- * Enqueue styles
281
- *
282
- * @return void
283
- */
284
- public function enqueue_styles() {
285
- wp_enqueue_style( 'wpuf-admin', WPUF_ASSET_URI . '/css/admin.css' );
286
- }
287
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/subscription.php DELETED
@@ -1,609 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Manage Subscription packs
5
- *
6
- * @package WP User Frontend
7
- */
8
- class WPUF_Admin_Subscription {
9
-
10
- private $table;
11
- private $db;
12
- public $baseurl;
13
- private static $_instance;
14
-
15
- public static function getInstance() {
16
- if ( !self::$_instance ) {
17
- self::$_instance = new WPUF_Admin_Subscription();
18
- }
19
-
20
- return self::$_instance;
21
- }
22
-
23
- function __construct() {
24
- global $wpdb;
25
-
26
- $this->db = $wpdb;
27
- $this->table = $this->db->prefix . 'wpuf_subscription';
28
- $this->baseurl = admin_url( 'admin.php?page=wpuf_subscription' );
29
-
30
- add_filter( 'post_updated_messages', array($this, 'form_updated_message') );
31
-
32
- add_action( 'show_user_profile', array($this, 'profile_subscription_details'), 30 );
33
- add_action( 'edit_user_profile', array($this, 'profile_subscription_details'), 30 );
34
- add_action( 'personal_options_update', array($this, 'profile_subscription_update') );
35
- add_action( 'edit_user_profile_update', array($this, 'profile_subscription_update') );
36
- add_action( 'wp_ajax_wpuf_delete_user_package', array($this, 'delete_user_package') );
37
-
38
- add_filter('manage_wpuf_subscription_posts_columns', array( $this, 'subscription_columns_head') );
39
-
40
- add_action('manage_wpuf_subscription_posts_custom_column', array( $this, 'subscription_columns_content' ),10, 2 );
41
- }
42
-
43
- /**
44
- * Custom post update message
45
- *
46
- * @param array $messages
47
- * @return array
48
- */
49
- function form_updated_message( $messages ) {
50
- $message = array(
51
- 0 => '',
52
- 1 => __( 'Subscription pack updated.', 'wpuf' ),
53
- 2 => __( 'Custom field updated.', 'wpuf' ),
54
- 3 => __( 'Custom field deleted.', 'wpuf' ),
55
- 4 => __( 'Subscription pack updated.', 'wpuf' ),
56
- 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Subscription pack restored to revision from %s', 'wpuf' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
57
- 6 => __( 'Subscription pack published.', 'wpuf' ),
58
- 7 => __( 'Subscription pack saved.', 'wpuf' ),
59
- 8 => __( 'Subscription pack submitted.', 'wpuf' ),
60
- 9 => '',
61
- 10 => __( 'Subscription pack draft updated.', 'wpuf' ),
62
- );
63
-
64
- $messages['wpuf_subscription'] = $message;
65
-
66
- return $messages;
67
- }
68
-
69
- /**
70
- * Update user profile lock
71
- *
72
- * @param int $user_id
73
- */
74
- function profile_subscription_update( $user_id ) {
75
- if ( !is_admin() && !current_user_can( 'edit_users' ) ) {
76
- return;
77
- }
78
-
79
- if ( !isset( $_POST['pack_id'] ) ) {
80
- return;
81
- }
82
-
83
- $pack_id = $_POST['pack_id'];
84
- $user_pack = WPUF_Subscription::get_user_pack( $_POST['user_id'] );
85
- if ( isset ( $user_pack['pack_id'] ) && $pack_id == $user_pack['pack_id'] ) {
86
- //updating number of posts
87
-
88
- if( isset( $user_pack['posts'] ) ) {
89
-
90
- foreach( $user_pack['posts'] as $post_type => $post_num ) {
91
- $user_pack['posts'][$post_type] = $_POST[$post_type];
92
- }
93
-
94
- }
95
-
96
- //post expiration enable or disable
97
-
98
- if( isset( $_POST['is_post_expiration_enabled'] ) ) {
99
- $user_pack['_enable_post_expiration'] = $_POST['is_post_expiration_enabled'];
100
- } else {
101
- unset($user_pack['_enable_post_expiration']);
102
- }
103
-
104
- //updating post time
105
-
106
- if( isset( $_POST['post_expiration_settings'] ) ) {
107
- echo $user_pack['_post_expiration_time'] = $_POST['post_expiration_settings']['expiration_time_value'].' '.$_POST['post_expiration_settings']['expiration_time_type'];
108
- }
109
- if ( isset( $user_pack['recurring'] ) && $user_pack['recurring'] == 'yes' ) {
110
- foreach ( $user_pack['posts'] as $type => $value ) {
111
- $user_pack['posts'][$type] = isset( $_POST[$type] ) ? $_POST[$type] : 0;
112
- }
113
- } else {
114
- foreach ( $user_pack['posts'] as $type => $value ) {
115
- $user_pack['posts'][$type] = isset( $_POST[$type] ) ? $_POST[$type] : 0;
116
- }
117
- $user_pack['expire'] = isset( $_POST['expire'] ) ? wpuf_date2mysql( $_POST['expire'] ) : $user_pack['expire'];
118
- }
119
- WPUF_Subscription::update_user_subscription_meta( $user_id, $user_pack );
120
- } else {
121
- if ( $pack_id == '-1' ) {
122
- return;
123
- }
124
- WPUF_Subscription::init()->new_subscription( $user_id, $pack_id, null, false, $status = null );
125
- }
126
- }
127
-
128
- function subscription_columns_content( $column_name, $post_ID ) {
129
- switch ( $column_name ) {
130
- case 'amount':
131
-
132
- $amount = get_post_meta( $post_ID, '_billing_amount', true );
133
- if ( intval($amount) == 0 ) {
134
- $amount = __( 'Free', 'wpuf' );
135
- } else {
136
- $amount = wpuf_format_price( $amount );
137
- }
138
- echo $amount;
139
- break;
140
-
141
- case 'recurring':
142
-
143
- $recurring = get_post_meta( $post_ID, '_recurring_pay', true );
144
- if ( $recurring == 'yes' ) {
145
- _e( 'Yes', 'wpuf' );
146
- } else {
147
- _e( 'No', 'wpuf' );
148
- }
149
- break;
150
-
151
- case 'duration':
152
-
153
- $recurring_pay = get_post_meta( $post_ID, '_recurring_pay', true );
154
- $billing_cycle_number = get_post_meta( $post_ID, '_billing_cycle_number', true );
155
- $cycle_period = get_post_meta( $post_ID, '_cycle_period', true );
156
- if ( $recurring_pay == 'yes' ) {
157
- echo $billing_cycle_number .' '. $cycle_period . '\'s (cycle)';
158
- } else {
159
- $expiration_number = get_post_meta( $post_ID, '_expiration_number', true );
160
- $expiration_period = get_post_meta( $post_ID, '_expiration_period', true );
161
- echo $expiration_number .' '. $expiration_period . '\'s';
162
- }
163
- break;
164
- }
165
-
166
- }
167
-
168
- function subscription_columns_head( $head ) {
169
- unset($head['date']);
170
- $head['title'] = __('Pack Name', 'wpuf' );
171
- $head['amount'] = __( 'Amount', 'wpuf' );
172
- $head['recurring'] = __( 'Recurring', 'wpuf' );
173
- $head['duration'] = __( 'Duration', 'wpuf' );
174
-
175
- return $head;
176
- }
177
-
178
- function get_packs() {
179
- return $this->db->get_results( "SELECT * FROM {$this->table} ORDER BY created DESC" );
180
- }
181
-
182
- function get_pack( $pack_id ) {
183
- return $this->db->get_row( $this->db->prepare( "SELECT * FROM {$this->table} WHERE id = %d", $pack_id ) );
184
- }
185
-
186
- function delete_pack( $pack_id ) {
187
- $this->db->query( $this->db->prepare( "DELETE FROM {$this->table} WHERE id= %d", $pack_id ) );
188
- }
189
-
190
- function list_packs() {
191
-
192
- //delete packs
193
- if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == "del" ) {
194
- check_admin_referer( 'wpuf_pack_del' );
195
- $this->delete_pack( $_GET['id'] );
196
- echo '<div class="updated fade" id="message"><p><strong>' . __( 'Pack Deleted', 'wpuf' ) . '</strong></p></div>';
197
-
198
- echo '<script type="text/javascript">window.location.href = "' . $this->baseurl . '";</script>';
199
- }
200
- ?>
201
-
202
- <table class="widefat meta" style="margin-top: 20px;">
203
- <thead>
204
- <tr>
205
- <th scope="col"><?php _e( 'Name', 'wpuf' ); ?></th>
206
- <th scope="col"><?php _e( 'Description', 'wpuf' ); ?></th>
207
- <th scope="col"><?php _e( 'Cost', 'wpuf' ); ?></th>
208
- <th scope="col"><?php _e( 'Validity', 'wpuf' ); ?></th>
209
- <th scope="col"><?php _e( 'Post Count', 'wpuf' ); ?></th>
210
- <th scope="col"><?php _e( 'Action', 'wpuf' ); ?></th>
211
- </tr>
212
- </thead>
213
- <?php
214
- $packs = $this->get_packs();
215
- if ( $packs ) {
216
- $count = 0;
217
- foreach ($packs as $row) {
218
- ?>
219
- <tr valign="top" <?php echo ( ($count % 2) == 0) ? 'class="alternate"' : ''; ?>>
220
- <td><?php echo stripslashes( htmlspecialchars( $row->name ) ); ?></td>
221
- <td><?php echo stripslashes( htmlspecialchars( $row->description ) ); ?></td>
222
- <td><?php echo wpuf_format_price( $row->cost ); ?></td>
223
- <td><?php echo ( $row->pack_length == 0 ) ? 'Unlimited' : $row->pack_length . ' days'; ?></td>
224
- <td><?php echo ( $row->count == 0 ) ? 'Unlimited' : $row->count; ?></td>
225
- <td>
226
- <a href="<?php echo wp_nonce_url( add_query_arg( array('action' => 'edit', 'pack_id' => $row->id), $this->baseurl, 'wpuf_pack_edit' ) ); ?>">
227
- <?php _e( 'Edit', 'wpuf' ); ?>
228
- </a>
229
- <span class="sep">|</span>
230
- <a href="<?php echo wp_nonce_url( add_query_arg( array('action' => 'del', 'id' => $row->id), $this->baseurl ), 'wpuf_pack_del' ); ?>" onclick="return confirm('<?php _e( 'Are you sure to delete this pack?', 'wpuf' ); ?>');">
231
- <?php _e( 'Delete', 'wpuf' ); ?>
232
- </a>
233
- </td>
234
-
235
- </tr>
236
- <?php
237
- $count++;
238
- }
239
- ?>
240
- <?php } else { ?>
241
- <tr>
242
- <td colspan="6"><?php _e( 'No subscription pack found', 'wpuf' ); ?></td>
243
- </tr>
244
- <?php } ?>
245
-
246
- </table>
247
- <?php
248
- }
249
-
250
- function get_post_types( $post_types = null ) {
251
-
252
- if ( ! $post_types ) {
253
- $post_types = WPUF_Subscription::init()->get_all_post_type();
254
- }
255
-
256
- ob_start();
257
-
258
- foreach ( $post_types as $key => $name ) {
259
- $name = ( $post_types !== null ) ? $name : '';
260
- ?>
261
- <tr>
262
- <th><label for="wpuf-<?php echo esc_attr( $key ); ?>"><?php printf( 'Number of %ss', $key ); ?></label></th>
263
- <td>
264
- <input type="text" size="20" style="" id="wpuf-<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( (int)$name ); ?>" name="post_type_name[<?php echo esc_attr( $key ); ?>]" />
265
- <div><span class="description"><span><?php printf( 'How many %s the user can list with this pack? Enter <strong>-1</strong> for unlimited.', $key ); ?></span></span></div>
266
- </td>
267
- </tr>
268
- <?php
269
- }
270
-
271
- return ob_get_clean();
272
- }
273
-
274
- function form( $pack_id = null ) {
275
- global $post;
276
-
277
- $sub_meta = WPUF_Subscription::init()->get_subscription_meta( $post->ID, $post );
278
-
279
- $hidden_recurring_class = ( $sub_meta['recurring_pay'] != 'yes' ) ? 'none' : '';
280
- $hidden_trial_class = ( $sub_meta['trial_status'] != 'yes' ) ? 'none' : '';
281
- $hidden_expire = ( $sub_meta['recurring_pay'] == 'yes' ) ? 'none' : '';
282
-
283
- ?>
284
-
285
- <table class="form-table" style="width: 100%">
286
- <tbody>
287
- <input type="hidden" name="wpuf_subscription" id="wpuf_subscription_editor" value="<?php echo wp_create_nonce( 'wpuf_subscription_editor' ); ?>" />
288
- <tr>
289
- <th><label><?php _e( 'Pack Description', 'wpuf' ); ?></label></th>
290
- <td>
291
- <?php wp_editor( $sub_meta['post_content'], 'post_content', array('editor_height' => 100, 'quicktags' => false, 'media_buttons' => false) ); ?>
292
- </td>
293
- </tr>
294
- <tr>
295
- <th><label for="wpuf-billing-amount">
296
- <span class="wpuf-biling-amount wpuf-subcription-expire" style="display: <?php echo $hidden_expire; ?>;"><?php _e( 'Billing amount:', 'wpuf' ); ?></span>
297
- <span class="wpuf-billing-cycle wpuf-recurring-child" style="display: <?php echo $hidden_recurring_class; ?>;"><?php _e( 'Billing amount each cycle:', 'wpuf' ); ?></span></label></th>
298
- <td>
299
- <?php echo wpuf_get_currency( 'symbol' ); ?>
300
- <input type="text" size="20" style="" id="wpuf-billing-amount" value="<?php echo esc_attr( $sub_meta['billing_amount'] ); ?>" name="billing_amount" />
301
- <div><span class="description"></span></div>
302
- </td>
303
- </tr>
304
-
305
- <tr class="wpuf-subcription-expire" style="display: <?php echo $hidden_expire; ?>;">
306
- <th><label for="wpuf-expiration-number"><?php _e( 'Expires In:', 'wpuf' ); ?></label></th>
307
- <td>
308
- <input type="text" size="20" style="" id="wpuf-expiration-number" value="<?php echo esc_attr( $sub_meta['expiration_number'] ); ?>" name="expiration_number" />
309
-
310
- <select id="expiration-period" name="expiration_period">
311
- <?php echo $this->option_field( $sub_meta['expiration_period'] ); ?>
312
- </select>
313
- <div><span class="description"></span></div>
314
- </td>
315
- </tr>
316
-
317
- <?php
318
- $is_post_exp_selected = isset($sub_meta['_enable_post_expiration']) && $sub_meta['_enable_post_expiration'] == 'on'?'checked':'';
319
- $_post_expiration_time = explode(' ',isset($sub_meta['_post_expiration_time'])?$sub_meta['_post_expiration_time']:' ');
320
- $time_value = isset($_post_expiration_time[0])?$_post_expiration_time[0]:1;
321
- $time_type = isset($_post_expiration_time[1])?$_post_expiration_time[1]:'day';
322
-
323
- $expired_post_status = isset($sub_meta['_expired_post_status'])?$sub_meta['_expired_post_status']:'';
324
- $is_enable_mail_after_expired = isset($sub_meta['_enable_mail_after_expired']) && $sub_meta['_enable_mail_after_expired'] == 'on'?'checked':'';
325
- $post_expiration_message = isset($sub_meta['_post_expiration_message'])?$sub_meta['_post_expiration_message']:'';;
326
- ?>
327
- <tr class="wpuf-metabox-post_expiration">
328
- <th><?php _e( 'Enable Post Expiration', 'wpuf' ); ?></th>
329
- <td>
330
- <input type="checkbox" id="wpuf-enable_post_expiration" name="post_expiration_settings[enable_post_expiration]" value="on" <?php echo $is_post_exp_selected;?> />
331
- </td>
332
- </tr>
333
- <tr class="wpuf-metabox-post_expiration wpuf_expiration_field">
334
- <?php
335
- $timeType_array = array(
336
- 'year' => 100,
337
- 'month' => 12,
338
- 'day' => 30
339
- );
340
- ?>
341
- <th><?php _e( 'Post Expiration Time', 'wpuf' ); ?></th>
342
- <td>
343
- <select name="post_expiration_settings[expiration_time_value]" id="wpuf-expiration_time_value">
344
- <?php
345
- for($i = 1;$i <= $timeType_array[$time_type];$i++){
346
- ?>
347
- <option value="<?php echo $i; ?>" <?php echo $i == $time_value?'selected':''; ?>><?php echo $i;?></option>
348
- <?php
349
- }
350
- ?>
351
- </select>
352
- <select name="post_expiration_settings[expiration_time_type]" id="wpuf-expiration_time_type">
353
- <?php
354
- foreach($timeType_array as $each_time_type=>$each_time_type_val){
355
- ?>
356
- <option value="<?php echo $each_time_type;?>" <?php echo $each_time_type==$time_type?'selected':''; ?>><?php echo ucfirst($each_time_type);?></option>
357
- <?php
358
- }
359
- ?>
360
- </select>
361
- </td>
362
-
363
- </tr>
364
- <tr class="wpuf_expiration_field">
365
- <th>
366
- Post Status :
367
- </th>
368
- <td>
369
- <?php $post_statuses = get_post_statuses();
370
- ?>
371
- <select name="post_expiration_settings[expired_post_status]" id="wpuf-expired_post_status">
372
- <?php
373
- foreach($post_statuses as $post_status => $text){
374
- ?>
375
- <option value="<?php echo $post_status ?>" <?php echo ( $expired_post_status == $post_status )?'selected':''; ?>><?php echo $text;?></option>
376
- <?php
377
- }
378
- ?>
379
- </select>
380
- <p class="description"><?php echo _('Status of post after post expiration time is over ');?></p>
381
- </td>
382
- </tr>
383
- <tr class="wpuf_expiration_field">
384
- <th>
385
- Send Mail :
386
- </th>
387
- <td>
388
- <input type="checkbox" name="post_expiration_settings[enable_mail_after_expired]" value="on" <?php echo $is_enable_mail_after_expired;?> />
389
- Send Mail to Author After Exceeding Post Expiration Time
390
- </td>
391
- </tr>
392
- <tr class="wpuf_expiration_field">
393
- <th>Post Expiration Message</th>
394
- <td>
395
- <textarea name="post_expiration_settings[post_expiration_message]" id="wpuf-post_expiration_message" cols="50" rows="5"><?php echo $post_expiration_message;?></textarea>
396
- </td>
397
- </tr>
398
- <?php echo $this->get_post_types( $sub_meta['post_type_name'] ); ?>
399
- <?php
400
- do_action( 'wpuf_admin_subscription_detail', $sub_meta, $hidden_recurring_class, $hidden_trial_class, $this );
401
- ?>
402
- </tbody>
403
- </table>
404
-
405
- <?php
406
-
407
- }
408
-
409
- function option_field( $selected ) {
410
- ?>
411
- <option value="day" <?php selected( $selected, 'day' ); ?> ><?php _e( 'Day(s)', 'wpuf' ); ?></option>
412
- <option value="week" <?php selected( $selected, 'week' ); ?> ><?php _e( 'Week(s)', 'wpuf' ); ?></option>
413
- <option value="month" <?php selected( $selected, 'month' ); ?> ><?php _e( 'Month(s)', 'wpur'); ?></option>
414
- <option value="year" <?php selected( $selected, 'year' ); ?> ><?php _e( 'Year(s)', 'wpuf' ); ?></option>
415
- <?php
416
- }
417
-
418
- function packdropdown_without_recurring( $packs, $selected = '' ) {
419
- $packs = isset( $packs ) ? $packs : array();
420
- foreach( $packs as $key => $pack ) {
421
- $recurring = isset( $pack->meta_value['recurring_pay'] ) ? $pack->meta_value['recurring_pay'] : '';
422
- if( $recurring == 'yes' ) {
423
- continue;
424
- }
425
- ?>
426
- <option value="<?php echo $pack->ID; ?>" <?php selected( $selected, $pack->ID ); ?>><?php echo $pack->post_title; ?></option>
427
- <?php
428
- }
429
- }
430
-
431
- /**
432
- * Adds the postlock form in users profile
433
- *
434
- * @param object $profileuser
435
- */
436
- function profile_subscription_details( $profileuser ) {
437
-
438
- if ( ! current_user_can( 'edit_users' ) ) {
439
- return;
440
- }
441
- if ( wpuf_get_option( 'charge_posting', 'wpuf_payment' ) != 'yes' ) {
442
- return;
443
- }
444
- $userdata = get_userdata( $profileuser->ID ); //wp 3.3 fix
445
-
446
- $packs = WPUF_Subscription::init()->get_subscriptions();
447
- $user_sub = WPUF_Subscription::get_user_pack( $userdata->ID );
448
- $pack_id = isset( $user_sub['pack_id'] ) ? $user_sub['pack_id'] : '';
449
- ?>
450
- <div class="wpuf-user-subscription">
451
- <h3><?php _e( 'WPUF Subscription', 'wpuf' ); ?></h3>
452
- <?php
453
-
454
- if ( isset( $user_sub['pack_id'] ) ) :
455
-
456
- $pack = WPUF_Subscription::get_subscription( $user_sub['pack_id'] );
457
- $details_meta = WPUF_Subscription::init()->get_details_meta_value();
458
-
459
- $billing_amount = ( isset( $pack->meta_value['billing_amount'] ) && intval( $pack->meta_value['billing_amount'] ) > 0 ) ? $details_meta['symbol'] . $pack->meta_value['billing_amount'] : __( 'Free', 'wpuf' );
460
- $recurring_pay = ( isset( $pack->meta_value['recurring_pay'] ) && $pack->meta_value['recurring_pay'] == 'yes' ) ? true : false;
461
- if ( $billing_amount && $recurring_pay ) {
462
- $recurring_des = sprintf( 'For each %s %s', $pack->meta_value['billing_cycle_number'], $pack->meta_value['cycle_period'], $pack->meta_value['trial_duration_type'] );
463
- $recurring_des .= !empty( $pack->meta_value['billing_limit'] ) ? sprintf( ', for %s installments', $pack->meta_value['billing_limit'] ) : '';
464
- $recurring_des = $recurring_des;
465
- } else {
466
- $recurring_des = '';
467
- }
468
-
469
- ?>
470
- <div class="wpuf-user-sub-info">
471
- <h3><?php _e( 'Subscription Details', 'wpuf' ); ?></h3>
472
- <?php if(isset($user_sub['recurring']) && $user_sub['recurring'] == 'yes' ){
473
- ?>
474
- <div class="updated">
475
- <p><?php _e( 'This user is using recurring subscription pack', 'wpuf' ); ?></p>
476
- </div>
477
- <?php
478
- } ?>
479
- <div class="wpuf-text">
480
- <div><strong><?php _e( 'Subcription Name: ','wpuf' ); ?></strong><?php echo isset( $pack->post_title ) ? $pack->post_title : ''; ?></div>
481
- <div>
482
- <strong><?php _e( 'Package billing details: ', 'wpuf'); ?></strong>
483
- <div class="wpuf-pricing-wrap">
484
- <div class="wpuf-sub-amount">
485
- <?php echo $billing_amount; ?>
486
- <?php echo $recurring_des; ?>
487
- </div
488
- </div>
489
- </div>
490
-
491
- <strong><?php _e( 'Remaining post: ','wpuf'); ?></strong>
492
- <table class="form-table">
493
-
494
- <?php
495
-
496
- foreach ($user_sub['posts'] as $key => $value) {
497
- ?>
498
- <tr>
499
- <th><label><?php echo $key; ?></label></th>
500
- <td><input type="text" value="<?php echo $value; ?>" name="<?php echo $key; ?>" ></td>
501
- </tr>
502
- <?php
503
- }
504
- ?>
505
- <?php
506
- if ( $user_sub['recurring'] != 'yes' ) {
507
- if ( !empty( $user_sub['expire'] ) ) {
508
-
509
- $expire = ( $user_sub['expire'] == 'unlimited' ) ? ucfirst( 'unlimited' ) : wpuf_date2mysql( $user_sub['expire'] );
510
-
511
- ?>
512
- <tr>
513
- <th><label><?php echo _e('Expire date:' , 'wpuf'); ?></label></th>
514
- <td><input type="text" class="wpuf-date-picker" name="expire" value="<?php echo wpuf_get_date( $expire ); ?>"></td>
515
- </tr>
516
- <?php
517
- }
518
-
519
- } ?>
520
- <?php
521
- $is_post_exp_selected = isset($user_sub['_enable_post_expiration'])?'checked':'';
522
- $_post_expiration_time = explode(' ',isset($user_sub['_post_expiration_time'])?$user_sub['_post_expiration_time']:' ');
523
- $time_value = isset($_post_expiration_time[0]) && !empty($_post_expiration_time[0])?$_post_expiration_time[0]:'1';
524
- $time_type = isset($_post_expiration_time[1]) && !empty($_post_expiration_time[1])?$_post_expiration_time[1]:'day';
525
- ?>
526
- <tr>
527
- <th><label><?php echo _e('Post Expiration Enabled', 'wpuf'); ?></label></th>
528
- <td><input type="checkbox" name="is_post_expiration_enabled" value="on" <?php echo $is_post_exp_selected;?>></td>
529
- </tr>
530
- <tr>
531
- <?php
532
- $timeType_array = array(
533
- 'year' => 100,
534
- 'month' => 12,
535
- 'day' => 30
536
- );
537
- ?>
538
- <th><?php _e( 'Post Expiration Time', 'wpuf' ); ?></th>
539
- <td>
540
- <select name="post_expiration_settings[expiration_time_value]" id="wpuf-expiration_time_value">
541
- <?php
542
- for($i = 1;$i <= $timeType_array[$time_type];$i++){
543
- ?>
544
- <option value="<?php echo $i; ?>" <?php echo $i == $time_value?'selected':''; ?>><?php echo $i;?></option>
545
- <?php
546
- }
547
- ?>
548
- </select>
549
- <select name="post_expiration_settings[expiration_time_type]" id="wpuf-expiration_time_type">
550
- <?php
551
- foreach($timeType_array as $each_time_type=>$each_time_type_val){
552
- ?>
553
- <option value="<?php echo $each_time_type;?>" <?php echo $each_time_type==$time_type?'selected':''; ?>><?php echo ucfirst($each_time_type);?></option>
554
- <?php
555
- }
556
- ?>
557
- </select>
558
- </td>
559
- </tr>
560
- </table>
561
- </div>
562
- </div>
563
- <?php endif;?>
564
- <?php if(!isset($user_sub['recurring']) || $user_sub['recurring'] != 'yes' ): ?>
565
- <a class="btn button-primary wpuf-assing-pack-btn wpuf-add-pack" href="#"><?php _e( 'Assign Package', 'wpuf' ); ?></a>
566
- <a class="btn button-primary wpuf-assing-pack-btn wpuf-cancel-pack" style="display:none;" href="#"><?php _e( 'Show Package', 'wpuf' ); ?></a>
567
- <table class="form-table wpuf-pack-dropdown" disabled="disabled" style="display: none;">
568
- <tr>
569
- <th><label for="wpuf_sub_pack"><?php _e( 'Pack:', 'wpuf' ); ?> </label></th>
570
- <td>
571
- <select name="pack_id" id="wpuf_sub_pack">
572
- <option value="-1"><?php _e( '--Select--', 'wpuf' ); ?></option>
573
- <?php $this->packdropdown_without_recurring( $packs, $pack_id );//WPUF_Subscription::init()->packdropdown( $packs, $selected = '' ); ?>
574
- </select>
575
- </td>
576
- </tr>
577
- </table>
578
- <?php endif;?>
579
- <?php if( !empty($user_sub) ):?>
580
- <a class="btn button-primary wpuf-delete-pack-btn" href="javascript:" data-userid = "<?php echo $userdata->ID; ?>"><?php _e( 'Delete Package', 'wpuf' ); ?></a>
581
- <?php endif; ?>
582
- </div>
583
- <?php
584
-
585
- }
586
-
587
- function lenght_type_option( $selected ) {
588
-
589
- for ($i = 1; $i <= 30; $i++) {
590
- ?>
591
- <option value="<?php echo $i; ?>" <?php selected( $i, $selected ); ?>><?php echo $i; ?></option>
592
- <?php
593
- }
594
-
595
- }
596
-
597
- /**
598
- * Ajax function. Delete user package
599
- * @since 2.2.7
600
- */
601
- function delete_user_package(){
602
- echo delete_user_meta($_POST['userid'],'_wpuf_subscription_pack');
603
- $wpuf_paypal = new WPUF_Paypal();
604
- $wpuf_paypal->recurring_change_status( $_POST['userid'], 'Cancel' );
605
- exit;
606
- }
607
- }
608
-
609
- //$subscription = new WPUF_Admin_Subscription();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/template-post.php DELETED
@@ -1,306 +0,0 @@
1
- <?php
2
- /**
3
- * Post related form templates
4
- *
5
- * @package WP User Frontend
6
- */
7
- class WPUF_Admin_Template_Post extends WPUF_Admin_Template {
8
-
9
- public static function post_title( $field_id, $label, $values = array() ) {
10
-
11
- ?>
12
- <li class="post_title">
13
- <?php self::legend( $label, $values, $field_id ); ?>
14
- <?php self::hidden_field( "[$field_id][input_type]", 'text' ); ?>
15
- <?php self::hidden_field( "[$field_id][template]", 'post_title' ); ?>
16
-
17
- <div class="wpuf-form-holder">
18
- <?php self::common( $field_id, 'post_title', false, $values ); ?>
19
- <?php self::common_text( $field_id, $values ); ?>
20
- <?php self::conditional_field( $field_id, $values ); ?>
21
- </div> <!-- .wpuf-form-holder -->
22
- </li>
23
- <?php
24
- }
25
-
26
- public static function post_content( $field_id, $label, $values = array() ) {
27
-
28
- $image_insert_name = sprintf( '%s[%d][insert_image]', self::$input_name, $field_id );
29
- $image_insert_value = isset( $values['insert_image'] ) ? $values['insert_image'] : 'yes';
30
- $word_restriction_name = sprintf( '%s[%d][word_restriction]', self::$input_name, $field_id );
31
- $word_restriction_value = isset( $values['word_restriction'] ) && is_numeric( $values['word_restriction'] ) ? $values['word_restriction'] : '';
32
- ?>
33
- <li class="post_content">
34
- <?php self::legend( $label, $values, $field_id ); ?>
35
- <?php self::hidden_field( "[$field_id][input_type]", 'textarea' ); ?>
36
- <?php self::hidden_field( "[$field_id][template]", 'post_content' ); ?>
37
-
38
- <div class="wpuf-form-holder">
39
- <?php self::common( $field_id, 'post_content', false, $values ); ?>
40
- <?php self::common_textarea( $field_id, $values ); ?>
41
-
42
- <div class="wpuf-form-rows">
43
- <label><?php _e( 'Enable Image Insertion', 'wpuf' ); ?></label>
44
-
45
- <div class="wpuf-form-sub-fields">
46
- <label>
47
- <?php self::hidden_field( "[$field_id][insert_image]", 'no' ); ?>
48
- <input type="checkbox" name="<?php echo $image_insert_name ?>" value="yes"<?php checked( $image_insert_value, 'yes' ); ?> />
49
- <?php _e( 'Enable image upload in post area', 'wpuf' ); ?>
50
- </label>
51
- </div>
52
-
53
- <label><?php _e( 'Word Restriction', 'wpuf' ); ?></label>
54
-
55
- <div class="wpuf-form-sub-fields">
56
- <label>
57
- <input type="text" class="smallipopInput" name="<?php echo $word_restriction_name ?>" value="<?php echo $word_restriction_value; ?>" title="<?php esc_attr_e( 'Numebr of words the author to be restricted in', 'wpuf' ); ?>" />
58
- </label>
59
- </div>
60
- </div> <!-- .wpuf-form-rows -->
61
-
62
- <?php self::conditional_field( $field_id, $values ); ?>
63
- </div> <!-- .wpuf-form-holder -->
64
- </li>
65
- <?php
66
- }
67
-
68
- public static function post_excerpt( $field_id, $label, $values = array() ) {
69
- ?>
70
- <li class="post_excerpt">
71
- <?php self::legend( $label, $values, $field_id ); ?>
72
- <?php self::hidden_field( "[$field_id][input_type]", 'textarea' ); ?>
73
- <?php self::hidden_field( "[$field_id][template]", 'post_excerpt' ); ?>
74
-
75
- <div class="wpuf-form-holder">
76
- <?php self::common( $field_id, 'post_excerpt', false, $values ); ?>
77
- <?php self::common_textarea( $field_id, $values ); ?>
78
- <?php self::conditional_field( $field_id, $values ); ?>
79
- </div> <!-- .wpuf-form-holder -->
80
- </li>
81
- <?php
82
- }
83
-
84
- public static function post_tags( $field_id, $label, $values = array() ) {
85
- ?>
86
- <li class="post_tags">
87
- <?php self::legend( $label, $values, $field_id ); ?>
88
- <?php self::hidden_field( "[$field_id][input_type]", 'text' ); ?>
89
- <?php self::hidden_field( "[$field_id][template]", 'post_tags' ); ?>
90
-
91
- <div class="wpuf-form-holder">
92
- <?php self::common( $field_id, 'tags', false, $values ); ?>
93
- <?php self::common_text( $field_id, $values ); ?>
94
- <?php self::conditional_field( $field_id, $values ); ?>
95
- </div> <!-- .wpuf-form-holder -->
96
- </li>
97
- <?php
98
- }
99
-
100
- public static function featured_image( $field_id, $label, $values = array() ) {
101
- $max_file_name = sprintf( '%s[%d][max_size]', self::$input_name, $field_id );
102
- $max_file_value = $values ? $values['max_size'] : '1024';
103
- $help = esc_attr( __( 'Enter maximum upload size limit in KB', 'wpuf' ) );
104
- ?>
105
- <li class="featured_image">
106
- <?php self::legend( $label, $values, $field_id ); ?>
107
- <?php self::hidden_field( "[$field_id][input_type]", 'image_upload' ); ?>
108
- <?php self::hidden_field( "[$field_id][template]", 'featured_image' ); ?>
109
- <?php self::hidden_field( "[$field_id][count]", '1' ); ?>
110
-
111
- <div class="wpuf-form-holder">
112
- <?php self::common( $field_id, 'featured_image', false, $values ); ?>
113
-
114
- <div class="wpuf-form-rows">
115
- <label><?php _e( 'Max. file size', 'wpuf' ); ?></label>
116
- <input type="text" class="smallipopInput" name="<?php echo $max_file_name; ?>" value="<?php echo $max_file_value; ?>" title="<?php echo $help; ?>">
117
- </div> <!-- .wpuf-form-rows -->
118
- <?php self::conditional_field( $field_id, $values ); ?>
119
- </div> <!-- .wpuf-form-holder -->
120
- </li>
121
- <?php
122
- }
123
-
124
- public static function post_category( $field_id, $label, $values = array() ) {
125
- ?>
126
- <li class="post_category">
127
- <?php self::legend( $label, $values, $field_id ); ?>
128
- <?php self::hidden_field( "[$field_id][template]", 'post_category' ); ?>
129
-
130
- <div class="wpuf-form-holder">
131
- <?php self::common( $field_id, 'category', false, $values ); ?>
132
- <?php self::conditional_field( $field_id, $values ); ?>
133
- </div> <!-- .wpuf-form-holder -->
134
- </li>
135
- <?php
136
- }
137
-
138
- public static function taxonomy( $field_id, $label, $taxonomy = '', $values = array() ) {
139
- $type_name = sprintf( '%s[%d][type]', self::$input_name, $field_id );
140
- $order_name = sprintf( '%s[%d][order]', self::$input_name, $field_id );
141
- $orderby_name = sprintf( '%s[%d][orderby]', self::$input_name, $field_id );
142
- $exclude_type_name = sprintf( '%s[%d][exclude_type]', self::$input_name, $field_id );
143
- $exclude_name = sprintf( '%s[%d][exclude]', self::$input_name, $field_id );
144
- $woo_attr_name = sprintf( '%s[%d][woo_attr]', self::$input_name, $field_id );
145
- $woo_attr_vis_name = sprintf( '%s[%d][woo_attr_vis]', self::$input_name, $field_id );
146
-
147
- $type_value = $values ? esc_attr( $values['type'] ) : 'select';
148
- $order_value = $values ? esc_attr( $values['order'] ) : 'ASC';
149
- $orderby_value = $values ? esc_attr( $values['orderby'] ) : 'name';
150
- $exclude_type_value = $values ? esc_attr( $values['exclude_type'] ) : 'exclude';
151
- $exclude_value = $values ? esc_attr( $values['exclude'] ) : '';
152
- $woo_attr_value = $values ? esc_attr( $values['woo_attr'] ) : 'no';
153
- $woo_attr_vis_value = $values ? esc_attr( $values['woo_attr_vis'] ) : 'no';
154
- ?>
155
- <li class="taxonomy <?php echo $taxonomy; ?> wpuf-conditional">
156
- <?php self::legend( $label, $values, $field_id ); ?>
157
- <?php self::hidden_field( "[$field_id][input_type]", 'taxonomy' ); ?>
158
- <?php self::hidden_field( "[$field_id][template]", 'taxonomy' ); ?>
159
-
160
- <div class="wpuf-form-holder">
161
- <?php self::common( $field_id, $taxonomy, false, $values ); ?>
162
-
163
- <div class="wpuf-form-rows">
164
- <label><?php _e( 'Type', 'wpuf' ); ?></label>
165
- <select name="<?php echo $type_name ?>">
166
- <option value="select"<?php selected( $type_value, 'select' ); ?>><?php _e( 'Dropdown', 'wpuf' ); ?></option>
167
- <option value="multiselect"<?php selected( $type_value, 'multiselect' ); ?>><?php _e( 'Multi Select', 'wpuf' ); ?></option>
168
- <option value="checkbox"<?php selected( $type_value, 'checkbox' ); ?>><?php _e( 'Checkbox', 'wpuf' ); ?></option>
169
- <option value="text"<?php selected( $type_value, 'text' ); ?>><?php _e( 'Text Input', 'wpuf' ); ?></option>
170
- <option value="ajax"<?php selected( $type_value, 'ajax' ); ?>><?php _e( 'Ajax', 'wpuf' ); ?></option>
171
- </select>
172
- </div> <!-- .wpuf-form-rows -->
173
-
174
- <div class="wpuf-form-rows">
175
- <label><?php _e( 'Order By', 'wpuf' ); ?></label>
176
- <select name="<?php echo $orderby_name ?>">
177
- <option value="name"<?php selected( $orderby_value, 'name' ); ?>><?php _e( 'Name', 'wpuf' ); ?></option>
178
- <option value="id"<?php selected( $orderby_value, 'id' ); ?>><?php _e( 'Term ID', 'wpuf' ); ?></option>
179
- <option value="slug"<?php selected( $orderby_value, 'slug' ); ?>><?php _e( 'Slug', 'wpuf' ); ?></option>
180
- <option value="count"<?php selected( $orderby_value, 'count' ); ?>><?php _e( 'Count', 'wpuf' ); ?></option>
181
- <option value="term_group"<?php selected( $orderby_value, 'term_group' ); ?>><?php _e( 'Term Group', 'wpuf' ); ?></option>
182
- </select>
183
- </div> <!-- .wpuf-form-rows -->
184
-
185
- <div class="wpuf-form-rows">
186
- <label><?php _e( 'Order', 'wpuf' ); ?></label>
187
- <select name="<?php echo $order_name ?>">
188
- <option value="ASC"<?php selected( $order_value, 'ASC' ); ?>><?php _e( 'ASC', 'wpuf' ); ?></option>
189
- <option value="DESC"<?php selected( $order_value, 'DESC' ); ?>><?php _e( 'DESC', 'wpuf' ); ?></option>
190
- </select>
191
- </div> <!-- .wpuf-form-rows -->
192
-
193
- <div class="wpuf-form-rows">
194
- <label><?php _e( 'Selection Type', 'wpuf' ); ?></label>
195
- <select name="<?php echo $exclude_type_name ?>">
196
- <option value="exclude"<?php selected( $exclude_type_value, 'exclude' ); ?>><?php _e( 'Exclude', 'wpuf' ); ?></option>
197
- <option value="include"<?php selected( $exclude_type_value, 'include' ); ?>><?php _e( 'Include', 'wpuf' ); ?></option>
198
- <option value="child_of"<?php selected( $exclude_type_value, 'child_of' ); ?>><?php _e( 'Child of', 'wpuf' ); ?></option>
199
- </select>
200
- </div> <!-- .wpuf-form-rows -->
201
-
202
- <div class="wpuf-form-rows">
203
- <label><?php _e( 'Selection terms', 'wpuf' ); ?></label>
204
- <input type="text" class="smallipopInput" name="<?php echo $exclude_name; ?>" title="<?php _e( 'Enter the term IDs as comma separated (without space) to exclude/include in the form.', 'wpuf' ); ?>" value="<?php echo $exclude_value; ?>" />
205
- </div> <!-- .wpuf-form-rows -->
206
-
207
- <div class="wpuf-form-rows">
208
- <label><?php _e( 'WooCommerce Attribute', 'wpuf' ); ?></label>
209
-
210
- <div class="wpuf-form-sub-fields">
211
- <label>
212
- <?php self::hidden_field( "[$field_id][woo_attr]", 'no' ); ?>
213
- <input type="checkbox" class="woo_attr" name="<?php echo $woo_attr_name ?>" value="yes"<?php checked( $woo_attr_value, 'yes' ); ?> />
214
- <?php _e( 'This taxonomy is a WooCommerce attribute', 'wpuf' ); ?>
215
- </label>
216
- </div>
217
- </div> <!-- .wpuf-form-rows -->
218
-
219
- <div class="wpuf-form-rows<?php echo $woo_attr_value == 'no' ? ' wpuf-hide' : ''; ?>">
220
- <label><?php _e( 'Visibility', 'wpuf' ); ?></label>
221
-
222
- <div class="wpuf-form-sub-fields">
223
- <label>
224
- <?php self::hidden_field( "[$field_id][woo_attr_vis]", 'no' ); ?>
225
- <input type="checkbox" name="<?php echo $woo_attr_vis_name ?>" value="yes"<?php checked( $woo_attr_vis_value, 'yes' ); ?> />
226
- <?php _e( 'Visible on product page', 'wpuf' ); ?>
227
- </label>
228
- </div>
229
- </div> <!-- .wpuf-form-rows -->
230
-
231
- <?php self::conditional_field( $field_id, $values ); ?>
232
- <div class="wpuf-options">
233
- <?php
234
-
235
- $tax = get_terms( $taxonomy, array(
236
- 'orderby' => 'count',
237
- 'hide_empty' => 0
238
- ) );
239
-
240
- $tax = is_array( $tax ) ? $tax : array();
241
-
242
- foreach($tax as $tax_obj) {
243
- ?>
244
- <div>
245
- <input type="hidden" value="<?php echo $tax_obj->name;?>" data-taxonomy="yes" data-term-id="<?php echo $tax_obj->term_id;?>" data-type="option">
246
- <input type="hidden" value="<?php echo $tax_obj->term_id;?>" data-taxonomy="yes" data-term-id="<?php echo $tax_obj->term_id;?>" data-type="option_value">
247
- </div>
248
- <?php
249
- }
250
- ?>
251
- </div>
252
- </div> <!-- .wpuf-form-holder -->
253
- </li>
254
- <?php
255
- }
256
-
257
-
258
- /**
259
- * Drop Down portion
260
- * @param array $param
261
- */
262
- public static function render_drop_down_portion( $param = array( 'names_to_hide' => array( 'name' => '', 'value' => '' ),'names_to_show' => array( 'name' => '', 'value' => '' ),'option_to_chose' => array('name' => '', 'value' => '' ) ) ) {
263
- empty( $param['option_to_chose']['value'] ) ? ( $param['option_to_chose']['value'] = 'all' ) : '';
264
-
265
- ?>
266
- <div class="wpuf-form-rows">
267
- <label><input type="radio" name="<?php echo $param['option_to_chose']['name'] ?>" value="<?php echo _e('all','wpuf'); ?>" <?php echo ( ( $param['option_to_chose']['value'] == 'all' )?'checked':'' ); ?> /><?php _e( 'Show All', 'wpuf' ); ?></label>
268
- </div>
269
- <div class="wpuf-form-rows">
270
- <label><input type="radio" name="<?php echo $param['option_to_chose']['name'] ?>" value="<?php echo _e('hide','wpuf'); ?>" <?php echo ( ( $param['option_to_chose']['value'] == 'hide' )?'checked':'' ); ?> /><?php _e( 'Hide These Countries', 'wpuf' ); ?></label>
271
- <select name="<?php echo $param['names_to_hide']['name'];?>" class="wpuf-country_to_hide" multiple data-placeholder="<?php esc_attr_e( 'Chose Country to hide from List', 'wpuf' ); ?>"></select>
272
- </div>
273
-
274
- <div class="wpuf-form-rows">
275
- <label><input type="radio" name="<?php echo $param['option_to_chose']['name'] ?>" value="<?php echo _e('show','wpuf'); ?>" <?php echo ( ( $param['option_to_chose']['value'] == 'show' )?'checked':'' ); ?> /><?php _e( 'Show These Countries', 'wpuf' ); ?></label>
276
- <select name="<?php echo $param['names_to_show']['name'];?>" class="wpuf-country_to_hide" multiple data-placeholder="<?php esc_attr_e( 'Add Country to List', 'wpuf' ); ?>"></select>
277
- </div>
278
-
279
- <script>
280
- (function($){
281
- $(document).ready(function(){
282
- var hide_field_name = '<?php echo $param['names_to_hide']['name'];?>';
283
- var hide_field_value = JSON.parse('<?php echo json_encode($param['names_to_hide']['value']);?>');
284
- var show_field_name = '<?php echo $param['names_to_show']['name'];?>';
285
- var show_field_value = JSON.parse('<?php echo json_encode($param['names_to_show']['value']);?>');
286
- var countries = <?php echo wpuf_get_countries( 'json' ); ?>;
287
- var hide_field_option_string = '';
288
- var show_field_option_string = '';
289
-
290
- for(country in countries){
291
- hide_field_option_string = hide_field_option_string + '<option value="'+ countries[country].code +'" '+ (( $.inArray(countries[country].code,hide_field_value) != -1 )?'selected':'') +'>'+ countries[country].name +'</option>';
292
- show_field_option_string = show_field_option_string + '<option value="'+ countries[country].code +'" '+ (( $.inArray(countries[country].code,show_field_value) != -1 )?'selected':'') +'>'+ countries[country].name +'</option>';
293
- }
294
-
295
- jQuery('select[name="'+ hide_field_name +'"]').html(hide_field_option_string);
296
- jQuery('select[name="'+ show_field_name +'"]').html(show_field_option_string);
297
- jQuery('select[name="'+ hide_field_name +'"],select[name="'+ show_field_name +'"]').chosen({allow_single_deselect:true});
298
- })
299
-
300
- }(jQuery))
301
-
302
- </script>
303
- <?php
304
- }
305
-
306
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/template.php DELETED
@@ -1,651 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * WPUF Form builder template
5
- *
6
- * @package WP User Frontend
7
- * @author Tareq Hasan <tareq@wedevs.com>
8
- */
9
- class WPUF_Admin_Template {
10
-
11
- static $input_name = 'wpuf_input';
12
- static $cond_name = 'wpuf_cond';
13
-
14
- /**
15
- * Legend of a form item
16
- *
17
- * @param string $title
18
- * @param array $values
19
- */
20
- public static function legend( $title = 'Field Name', $values = array(), $field_id = 0 ) {
21
-
22
- $field_label = $values ? ': <strong>' . $values['label'] . '</strong>' : '';
23
- $id = isset( $values['id'] ) ? $values['id'] : '';
24
- ?>
25
- <div class="wpuf-legend" title="<?php _e( 'Click and Drag to rearrange', 'wpuf' ); ?>">
26
- <input type="hidden" value="<?php echo $id; ?>" name="wpuf_input[<?php echo $field_id; ?>][id]">
27
- <div class="wpuf-label"><?php echo $title . $field_label; ?></div>
28
- <div class="wpuf-actions">
29
- <a href="#" class="wpuf-remove"><?php _e( 'Remove', 'wpuf' ); ?></a>
30
- <a href="#" class="wpuf-toggle"><?php _e( 'Toggle', 'wpuf' ); ?></a>
31
- </div>
32
- </div> <!-- .wpuf-legend -->
33
- <?php
34
- }
35
-
36
- /**
37
- * Common Fields for a input field
38
- *
39
- * Contains required, label, meta_key, help text, css class name
40
- *
41
- * @param int $id field order
42
- * @param mixed $field_name_value
43
- * @param bool $custom_field if it a custom field or not
44
- * @param array $values saved value
45
- */
46
- public static function common( $id, $field_name_value = '', $custom_field = true, $values = array() ) {
47
-
48
- $tpl = '%s[%d][%s]';
49
- $required_name = sprintf( $tpl, self::$input_name, $id, 'required' );
50
- $field_name = sprintf( $tpl, self::$input_name, $id, 'name' );
51
- $label_name = sprintf( $tpl, self::$input_name, $id, 'label' );
52
- $is_meta_name = sprintf( $tpl, self::$input_name, $id, 'is_meta' );
53
- $help_name = sprintf( $tpl, self::$input_name, $id, 'help' );
54
- $css_name = sprintf( $tpl, self::$input_name, $id, 'css' );
55
-
56
- // $field_name_value = $field_name_value ?
57
- $required = $values ? esc_attr( $values['required'] ) : 'yes';
58
- $label_value = $values ? esc_attr( $values['label'] ) : '';
59
- $help_value = $values ? stripslashes( $values['help'] ) : '';
60
- $css_value = $values ? esc_attr( $values['css'] ) : '';
61
-
62
- if ( $custom_field && $values ) {
63
- $field_name_value = $values['name'];
64
- }
65
-
66
- // var_dump($values);
67
- // var_dump($required, $label_value, $help_value);
68
- ?>
69
- <div class="wpuf-form-rows required-field">
70
- <label><?php _e( 'Required', 'wpuf' ); ?></label>
71
-
72
- <div class="wpuf-form-sub-fields">
73
- <label><input type="radio" name="<?php echo $required_name; ?>" value="yes"<?php checked( $required, 'yes' ); ?>> <?php _e( 'Yes', 'wpuf' ); ?> </label>
74
- <label><input type="radio" name="<?php echo $required_name; ?>" value="no"<?php checked( $required, 'no' ); ?>> <?php _e( 'No', 'wpuf' ); ?> </label>
75
- </div>
76
- </div> <!-- .wpuf-form-rows -->
77
-
78
- <div class="wpuf-form-rows">
79
- <label><?php _e( 'Field Label', 'wpuf' ); ?></label>
80
- <input type="text" data-type="label" name="<?php echo $label_name; ?>" value="<?php echo $label_value; ?>" class="smallipopInput" title="<?php _e( 'Enter a title of this field', 'wpuf' ); ?>">
81
- </div> <!-- .wpuf-form-rows -->
82
-
83
- <?php if ( $custom_field ) { ?>
84
- <div class="wpuf-form-rows">
85
- <label><?php _e( 'Meta Key', 'wpuf' ); ?></label>
86
- <input type="text" data-type="name" name="<?php echo $field_name; ?>" value="<?php echo $field_name_value; ?>" class="smallipopInput" title="<?php _e( 'Name of the meta key this field will save to', 'wpuf' ); ?>">
87
- <input type="hidden" name="<?php echo $is_meta_name; ?>" value="yes">
88
- </div> <!-- .wpuf-form-rows -->
89
- <?php } else { ?>
90
-
91
- <input type="hidden" data-type="name" name="<?php echo $field_name; ?>" value="<?php echo $field_name_value; ?>">
92
- <input type="hidden" name="<?php echo $is_meta_name; ?>" value="no">
93
-
94
- <?php } ?>
95
-
96
- <div class="wpuf-form-rows">
97
- <label><?php _e( 'Help text', 'wpuf' ); ?></label>
98
- <textarea name="<?php echo $help_name; ?>" class="smallipopInput" title="<?php _e( 'Give the user some information about this field', 'wpuf' ); ?>"><?php echo $help_value; ?></textarea>
99
- </div> <!-- .wpuf-form-rows -->
100
-
101
- <div class="wpuf-form-rows">
102
- <label><?php _e( 'CSS Class Name', 'wpuf' ); ?></label>
103
- <input type="text" name="<?php echo $css_name; ?>" value="<?php echo $css_value; ?>" class="smallipopInput" title="<?php _e( 'Add a CSS class name for this field', 'wpuf' ); ?>">
104
- </div> <!-- .wpuf-form-rows -->
105
-
106
- <?php
107
- }
108
-
109
- /**
110
- * Common fields for a text area
111
- *
112
- * @param int $id
113
- * @param array $values
114
- */
115
- public static function common_text( $id, $values = array() ) {
116
- $tpl = '%s[%d][%s]';
117
- $placeholder_name = sprintf( $tpl, self::$input_name, $id, 'placeholder' );
118
- $default_name = sprintf( $tpl, self::$input_name, $id, 'default' );
119
- $size_name = sprintf( $tpl, self::$input_name, $id, 'size' );
120
-
121
- $placeholder_value = $values ? esc_attr( $values['placeholder'] ) : '';
122
- $default_value = $values ? esc_attr( $values['default'] ) : '';
123
- $size_value = $values ? esc_attr( $values['size'] ) : '40';
124
-
125
- ?>
126
- <div class="wpuf-form-rows">
127
- <label><?php _e( 'Placeholder text', 'wpuf' ); ?></label>
128
- <input type="text" class="smallipopInput" name="<?php echo $placeholder_name; ?>" title="<?php esc_attr_e( 'Text for HTML5 placeholder attribute', 'wpuf' ); ?>" value="<?php echo $placeholder_value; ?>" />
129
- </div> <!-- .wpuf-form-rows -->
130
-
131
- <div class="wpuf-form-rows">
132
- <label><?php _e( 'Default value', 'wpuf' ); ?></label>
133
- <input type="text" class="smallipopInput" name="<?php echo $default_name; ?>" title="<?php esc_attr_e( 'The default value this field will have', 'wpuf' ); ?>" value="<?php echo $default_value; ?>" />
134
- </div> <!-- .wpuf-form-rows -->
135
-
136
- <div class="wpuf-form-rows">
137
- <label><?php _e( 'Size', 'wpuf' ); ?></label>
138
- <input type="text" class="smallipopInput" name="<?php echo $size_name; ?>" title="<?php esc_attr_e( 'Size of this input field', 'wpuf' ); ?>" value="<?php echo $size_value; ?>" />
139
- </div> <!-- .wpuf-form-rows -->
140
- <?php
141
- }
142
-
143
- /**
144
- * Common fields for a textarea
145
- *
146
- * @param int $id
147
- * @param array $values
148
- */
149
- public static function common_textarea( $id, $values = array() ) {
150
- $tpl = '%s[%d][%s]';
151
- $rows_name = sprintf( $tpl, self::$input_name, $id, 'rows' );
152
- $cols_name = sprintf( $tpl, self::$input_name, $id, 'cols' );
153
- $rich_name = sprintf( $tpl, self::$input_name, $id, 'rich' );
154
- $placeholder_name = sprintf( $tpl, self::$input_name, $id, 'placeholder' );
155
- $default_name = sprintf( $tpl, self::$input_name, $id, 'default' );
156
-
157
- $rows_value = $values ? esc_attr( $values['rows'] ) : '5';
158
- $cols_value = $values ? esc_attr( $values['cols'] ) : '25';
159
- $rich_value = $values ? esc_attr( $values['rich'] ) : 'no';
160
- $placeholder_value = $values ? esc_attr( $values['placeholder'] ) : '';
161
- $default_value = $values ? esc_attr( $values['default'] ) : '';
162
-
163
- ?>
164
- <div class="wpuf-form-rows">
165
- <label><?php _e( 'Rows', 'wpuf' ); ?></label>
166
- <input type="text" class="smallipopInput" name="<?php echo $rows_name; ?>" title="Number of rows in textarea" value="<?php echo $rows_value; ?>" />
167
- </div> <!-- .wpuf-form-rows -->
168
-
169
- <div class="wpuf-form-rows">
170
- <label><?php _e( 'Columns', 'wpuf' ); ?></label>
171
- <input type="text" class="smallipopInput" name="<?php echo $cols_name; ?>" title="Number of columns in textarea" value="<?php echo $cols_value; ?>" />
172
- </div> <!-- .wpuf-form-rows -->
173
-
174
- <div class="wpuf-form-rows">
175
- <label><?php _e( 'Placeholder text', 'wpuf' ); ?></label>
176
- <input type="text" class="smallipopInput" name="<?php echo $placeholder_name; ?>" title="text for HTML5 placeholder attribute" value="<?php echo $placeholder_value; ?>" />
177
- </div> <!-- .wpuf-form-rows -->
178
-
179
- <div class="wpuf-form-rows">
180
- <label><?php _e( 'Default value', 'wpuf' ); ?></label>
181
- <input type="text" class="smallipopInput" name="<?php echo $default_name; ?>" title="the default value this field will have" value="<?php echo $default_value; ?>" />
182
- </div> <!-- .wpuf-form-rows -->
183
-
184
- <div class="wpuf-form-rows">
185
- <label><?php _e( 'Textarea', 'wpuf' ); ?></label>
186
-
187
- <div class="wpuf-form-sub-fields">
188
- <label><input type="radio" name="<?php echo $rich_name; ?>" value="no"<?php checked( $rich_value, 'no' ); ?>> <?php _e( 'Normal', 'wpuf' ); ?></label>
189
- <label><input type="radio" name="<?php echo $rich_name; ?>" value="yes"<?php checked( $rich_value, 'yes' ); ?>> <?php _e( 'Rich textarea', 'wpuf' ); ?></label>
190
- <label><input type="radio" name="<?php echo $rich_name; ?>" value="teeny"<?php checked( $rich_value, 'teeny' ); ?>> <?php _e( 'Teeny Rich textarea', 'wpuf' ); ?></label>
191
- </div>
192
- </div> <!-- .wpuf-form-rows -->
193
- <?php
194
- }
195
-
196
- /**
197
- * Hidden field helper function
198
- *
199
- * @param string $name
200
- * @param string $value
201
- */
202
- public static function hidden_field( $name, $value = '' ) {
203
- printf( '<input type="hidden" name="%s" value="%s" />', self::$input_name . $name, $value );
204
- }
205
-
206
- /**
207
- * Displays a radio custom field
208
- *
209
- * @param int $field_id
210
- * @param string $name
211
- * @param array $values
212
- */
213
- public static function radio_fields( $field_id, $name, $values = array() ) {
214
-
215
- $selected_name = sprintf( '%s[%d][selected]', self::$input_name, $field_id );
216
- $input_name = sprintf( '%s[%d][%s]', self::$input_name, $field_id, $name );
217
- $input_value_name = sprintf( '%s[%d][%s]', self::$input_name, $field_id, $name.'_values' );
218
-
219
- $selected_value = ( $values && isset( $values['selected'] ) ) ? $values['selected'] : '';
220
- ?>
221
-
222
- <label for="wpuf-<?php echo $name.'_'.$field_id; ?>" class="wpuf-show-field-value">
223
- <input type="checkbox" class="wpuf-value-handelar" id="wpuf-<?php echo $name . '_' . $field_id; ?>"><?php _e( 'Show values', 'wpuf' ); ?>
224
- </label>
225
-
226
- <div class="wpuf-option-label-value"><span><?php _e( 'Label', 'wpuf' ); ?></span><span class="wpuf-option-value" style="display: none;"><?php _e( 'Value', 'wpuf' ); ?></span></div>
227
- <?php
228
- if ( $values && $values['options'] > 0 ) {
229
- foreach ($values['options'] as $key => $value) {
230
- ?>
231
- <div class="wpuf-clone-field">
232
- <input type="radio" name="<?php echo $selected_name ?>" value="<?php echo $value; ?>" <?php checked( $selected_value, $value ); ?>>
233
- <input type="text" data-type="option" name="<?php echo $input_name; ?>[]" value="<?php echo $value; ?>">
234
- <input type="text" data-type="option_value" name="<?php echo $input_value_name; ?>[]" value="<?php echo $key; ?>" style="display:none;">
235
-
236
- <?php self::remove_button(); ?>
237
- </div>
238
- <?php
239
- }
240
-
241
- } else {
242
- ?>
243
- <div class="wpuf-clone-field">
244
- <input type="radio" name="<?php echo $selected_name ?>">
245
- <input type="text" data-type="option" name="<?php echo $input_name; ?>[]" value="">
246
- <input type="text" data-type="option_value" name="<?php echo $input_value_name; ?>[]" value="" style="display:none;">
247
-
248
- <?php self::remove_button(); ?>
249
- </div>
250
- <?php
251
- }
252
- }
253
-
254
- public static function conditional_field( $field_id, $con_fields = array() ) {
255
-
256
- do_action( 'wpuf_conditional_field_render_hook',$field_id, $con_fields, 'WPUF_Admin_Template' );
257
-
258
- }
259
-
260
- /**
261
- * Displays a checkbox custom field
262
- *
263
- * @param int $field_id
264
- * @param string $name
265
- * @param array $values
266
- */
267
- public static function common_checkbox( $field_id, $name, $values = array() ) {
268
-
269
- $selected_name = sprintf( '%s[%d][selected]', self::$input_name, $field_id );
270
- $input_name = sprintf( '%s[%d][%s]', self::$input_name, $field_id, $name );
271
- $input_value_name = sprintf( '%s[%d][%s]', self::$input_name, $field_id, $name.'_values' );
272
-
273
- $selected_value = ( $values && isset( $values['selected'] ) ) ? $values['selected'] : array();
274
-
275
- ?>
276
- <style>
277
- .wpuf-option-label-value span {
278
- font-weight: bold;
279
- margin-left: 5%;
280
- margin-right: 27%;
281
- }
282
- </style>
283
- <input type="checkbox" class="wpuf-value-handelar" id="<?php echo $name.'_'.$field_id; ?>"><label for="<?php echo $name.'_'.$field_id; ?>"><?php _e('show values', 'wpuf'); ?></label>
284
- <div class="wpuf-option-label-value"><span><?php _e( 'Label', 'wpuf' ); ?></span><span class="wpuf-option-value" style="display: none;"><?php _e( 'Value', 'wpuf' ); ?></span></div>
285
- <?php
286
- if ( $values && $values['options'] > 0 ) {
287
- foreach ($values['options'] as $key => $value) {
288
- ?>
289
- <div class="wpuf-clone-field">
290
-
291
- <input type="checkbox" name="<?php echo $selected_name ?>[]" value="<?php echo $value; ?>"<?php echo in_array( $value, $selected_value ) ? ' checked="checked"' : ''; ?> />
292
- <input type="text" data-type="option" name="<?php echo $input_name; ?>[]" value="<?php echo $value; ?>">
293
- <input type="text" data-type="option_value" name="<?php echo $input_value_name; ?>[]" value="<?php echo $key; ?>" style="display:none;">
294
- <?php self::remove_button(); ?>
295
- </div>
296
- <?php
297
- }
298
- } else {
299
- ?>
300
- <div class="wpuf-clone-field">
301
- <input type="checkbox" name="<?php echo $selected_name ?>[]">
302
- <input type="text" data-type="option" name="<?php echo $input_name; ?>[]" value="">
303
- <input type="text" data-type="option_value" name="<?php echo $input_value_name; ?>[]" value="" style="display:none;">
304
-
305
- <?php self::remove_button(); ?>
306
- </div>
307
- <?php
308
- }
309
- }
310
-
311
- /**
312
- * Add/remove buttons for repeatable fields
313
- *
314
- * @return void
315
- */
316
- public static function remove_button() {
317
- $add = plugins_url( 'assets/images/add.png', dirname( __FILE__ ) );
318
- $remove = plugins_url( 'assets/images/remove.png', dirname( __FILE__ ) );
319
- ?>
320
- <img style="cursor:pointer; margin:0 3px;" alt="add another choice" title="add another choice" class="wpuf-clone-field" src="<?php echo $add; ?>">
321
- <img style="cursor:pointer;" class="wpuf-remove-field" alt="remove this choice" title="remove this choice" src="<?php echo $remove; ?>">
322
- <?php
323
- }
324
-
325
- public static function get_buffered( $func, $field_id, $label ) {
326
- ob_start();
327
-
328
- self::$func( $field_id, $label );
329
-
330
- return ob_get_clean();
331
- }
332
-
333
- public static function text_field( $field_id, $label, $values = array() ) {
334
-
335
- ?>
336
- <li class="custom-field text_field">
337
- <?php self::legend( $label, $values, $field_id ); ?>
338
- <?php self::hidden_field( "[$field_id][input_type]", 'text' ); ?>
339
- <?php self::hidden_field( "[$field_id][template]", 'text_field' ); ?>
340
-
341
- <div class="wpuf-form-holder">
342
- <?php self::common( $field_id, '', true, $values ); ?>
343
- <?php self::common_text( $field_id, $values ); ?>
344
- <?php self::conditional_field( $field_id, $values ); ?>
345
- </div> <!-- .wpuf-form-holder -->
346
- </li>
347
- <?php
348
- }
349
-
350
- public static function textarea_field( $field_id, $label, $values = array() ) {
351
- $word_restriction_name = sprintf( '%s[%d][word_restriction]', self::$input_name, $field_id );
352
- $word_restriction_value = isset( $values['word_restriction'] ) && is_numeric( $values['word_restriction'] ) ? $values['word_restriction'] : '';
353
- ?>
354
- <li class="custom-field textarea_field">
355
- <?php self::legend( $label, $values, $field_id ); ?>
356
- <?php self::hidden_field( "[$field_id][input_type]", 'textarea' ); ?>
357
- <?php self::hidden_field( "[$field_id][template]", 'textarea_field' ); ?>
358
-
359
- <div class="wpuf-form-holder">
360
- <?php self::common( $field_id, '', true, $values ); ?>
361
- <?php self::common_textarea( $field_id, $values ); ?>
362
- <div class="wpuf-form-rows">
363
- <label><?php _e( 'Word Restriction', 'wpuf' ); ?></label>
364
-
365
- <div class="wpuf-form-sub-fields">
366
- <label>
367
- <input type="text" class="smallipopInput" name="<?php echo $word_restriction_name ?>" value="<?php echo $word_restriction_value; ?>" title="<?php esc_attr_e( 'Numebr of words the author to be restricted in', 'wpuf' ); ?>" />
368
- </label>
369
- </div>
370
- </div>
371
- <?php self::conditional_field( $field_id, $values ); ?>
372
- </div> <!-- .wpuf-form-holder -->
373
- </li>
374
- <?php
375
- }
376
-
377
- public static function radio_field( $field_id, $label, $values = array() ) {
378
- ?>
379
- <li class="custom-field radio_field wpuf-conditional">
380
- <?php self::legend( $label, $values, $field_id ); ?>
381
- <?php self::hidden_field( "[$field_id][input_type]", 'radio' ); ?>
382
- <?php self::hidden_field( "[$field_id][template]", 'radio_field' ); ?>
383
-
384
- <div class="wpuf-form-holder">
385
- <?php self::common( $field_id, '', true, $values ); ?>
386
-
387
- <div class="wpuf-form-rows">
388
- <label><?php _e( 'Options', 'wpuf' ); ?></label>
389
-
390
- <div class="wpuf-form-sub-fields wpuf-options">
391
- <?php self::radio_fields( $field_id, 'options', $values ); ?>
392
-
393
- </div> <!-- .wpuf-form-sub-fields -->
394
- <?php self::conditional_field( $field_id, $values ); ?>
395
- </div> <!-- .wpuf-form-rows -->
396
- </div> <!-- .wpuf-form-holder -->
397
- </li>
398
- <?php
399
- }
400
-
401
- public static function checkbox_field( $field_id, $label, $values = array() ) {
402
- ?>
403
- <li class="custom-field checkbox_field wpuf-conditional">
404
- <?php self::legend( $label, $values, $field_id ); ?>
405
- <?php self::hidden_field( "[$field_id][input_type]", 'checkbox' ); ?>
406
- <?php self::hidden_field( "[$field_id][template]", 'checkbox_field' ); ?>
407
-
408
- <div class="wpuf-form-holder">
409
- <?php self::common( $field_id, '', true, $values ); ?>
410
-
411
- <div class="wpuf-form-rows">
412
- <label><?php _e( 'Options', 'wpuf' ); ?></label>
413
-
414
- <div class="wpuf-form-sub-fields wpuf-options">
415
- <?php self::common_checkbox( $field_id, 'options', $values ); ?>
416
-
417
- </div> <!-- .wpuf-form-sub-fields -->
418
- <?php self::conditional_field( $field_id, $values ); ?>
419
- </div> <!-- .wpuf-form-rows -->
420
- </div> <!-- .wpuf-form-holder -->
421
- </li>
422
- <?php
423
- }
424
-
425
- public static function dropdown_field( $field_id, $label, $values = array() ) {
426
- $first_name = sprintf( '%s[%d][first]', self::$input_name, $field_id );
427
- $first_value = $values ? $values['first'] : ' - select -';
428
- $help = esc_attr( __( 'First element of the select dropdown. Leave this empty if you don\'t want to show this field', 'wpuf' ) );
429
- ?>
430
- <li class="custom-field dropdown_field wpuf-conditional">
431
- <?php self::legend( $label, $values, $field_id ); ?>
432
- <?php self::hidden_field( "[$field_id][input_type]", 'select' ); ?>
433
- <?php self::hidden_field( "[$field_id][template]", 'dropdown_field' ); ?>
434
-
435
- <div class="wpuf-form-holder">
436
- <?php self::common( $field_id, '', true, $values ); ?>
437
-
438
- <div class="wpuf-form-rows">
439
- <label><?php _e( 'Select Text', 'wpuf' ); ?></label>
440
- <input type="text" class="smallipopInput" name="<?php echo $first_name; ?>" value="<?php echo $first_value; ?>" title="<?php echo $help; ?>">
441
- </div> <!-- .wpuf-form-rows -->
442
-
443
- <div class="wpuf-form-rows">
444
- <label><?php _e( 'Options', 'wpuf' ); ?></label>
445
-
446
- <div class="wpuf-form-sub-fields wpuf-options">
447
- <?php self::radio_fields( $field_id, 'options', $values ); ?>
448
- </div> <!-- .wpuf-form-sub-fields -->
449
-
450
- <?php self::conditional_field( $field_id, $values ); ?>
451
- </div> <!-- .wpuf-form-rows -->
452
- </div> <!-- .wpuf-form-holder -->
453
- </li>
454
- <?php
455
- }
456
-
457
- public static function multiple_select( $field_id, $label, $values = array() ) {
458
- $first_name = sprintf( '%s[%d][first]', self::$input_name, $field_id );
459
- $first_value = $values ? $values['first'] : ' - select -';
460
- $help = esc_attr( __( 'First element of the select dropdown. Leave this empty if you don\'t want to show this field', 'wpuf' ) );
461
- ?>
462
- <li class="custom-field multiple_select">
463
- <?php self::legend( $label, $values, $field_id ); ?>
464
- <?php self::hidden_field( "[$field_id][input_type]", 'multiselect' ); ?>
465
- <?php self::hidden_field( "[$field_id][template]", 'multiple_select' ); ?>
466
-
467
- <div class="wpuf-form-holder">
468
- <?php self::common( $field_id, '', true, $values ); ?>
469
-
470
- <div class="wpuf-form-rows">
471
- <label><?php _e( 'Select Text', 'wpuf' ); ?></label>
472
- <input type="text" class="smallipopInput" name="<?php echo $first_name; ?>" value="<?php echo $first_value; ?>" title="<?php echo $help; ?>">
473
- </div> <!-- .wpuf-form-rows -->
474
-
475
- <div class="wpuf-form-rows">
476
- <label><?php _e( 'Options', 'wpuf' ); ?></label>
477
-
478
- <div class="wpuf-form-sub-fields wpuf-options">
479
- <?php self::radio_fields( $field_id, 'options', $values ); ?>
480
- </div> <!-- .wpuf-form-sub-fields -->
481
-
482
- <?php self::conditional_field( $field_id, $values ); ?>
483
- </div> <!-- .wpuf-form-rows -->
484
- </div> <!-- .wpuf-form-holder -->
485
- </li>
486
- <?php
487
- }
488
-
489
- public static function website_url( $field_id, $label, $values = array() ) {
490
- ?>
491
- <li class="custom-field website_url">
492
- <?php self::legend( $label, $values, $field_id ); ?>
493
- <?php self::hidden_field( "[$field_id][input_type]", 'url' ); ?>
494
- <?php self::hidden_field( "[$field_id][template]", 'website_url' ); ?>
495
-
496
- <div class="wpuf-form-holder">
497
- <?php self::common( $field_id, '', true, $values ); ?>
498
- <?php self::common_text( $field_id, $values ); ?>
499
- <?php self::conditional_field( $field_id, $values ); ?>
500
- </div> <!-- .wpuf-form-holder -->
501
- </li>
502
- <?php
503
- }
504
-
505
- public static function email_address( $field_id, $label, $values = array() ) {
506
- ?>
507
- <li class="custom-field eamil_address">
508
- <?php self::legend( $label, $values, $field_id ); ?>
509
- <?php self::hidden_field( "[$field_id][input_type]", 'email' ); ?>
510
- <?php self::hidden_field( "[$field_id][template]", 'email_address' ); ?>
511
-
512
- <div class="wpuf-form-holder">
513
- <?php self::common( $field_id, '', true, $values ); ?>
514
- <?php self::common_text( $field_id, $values ); ?>
515
- <?php self::conditional_field( $field_id, $values ); ?>
516
- </div> <!-- .wpuf-form-holder -->
517
- </li>
518
- <?php
519
- }
520
-
521
- public static function custom_html( $field_id, $label, $values = array() ) {
522
- $title_name = sprintf( '%s[%d][label]', self::$input_name, $field_id );
523
- $html_name = sprintf( '%s[%d][html]', self::$input_name, $field_id );
524
- $title_value = $values ? esc_attr( $values['label'] ) : '';
525
- $html_value = $values ? esc_attr( $values['html'] ) : '';
526
- ?>
527
- <li class="custom-field custom_html">
528
- <?php self::legend( $label, $values, $field_id ); ?>
529
- <?php self::hidden_field( "[$field_id][input_type]", 'html' ); ?>
530
- <?php self::hidden_field( "[$field_id][template]", 'custom_html' ); ?>
531
-
532
- <div class="wpuf-form-holder">
533
- <div class="wpuf-form-rows">
534
- <label><?php _e( 'Title', 'wpuf' ); ?></label>
535
- <input type="text" class="smallipopInput" title="Title of the section" name="<?php echo $title_name; ?>" value="<?php echo esc_attr( $title_value ); ?>" />
536
- </div> <!-- .wpuf-form-rows -->
537
-
538
- <div class="wpuf-form-rows">
539
- <label><?php _e( 'HTML Codes', 'wpuf' ); ?></label>
540
- <textarea class="smallipopInput" title="Paste your HTML codes, WordPress shortcodes will also work here" name="<?php echo $html_name; ?>" rows="10"><?php echo esc_html( $html_value ); ?></textarea>
541
- </div>
542
-
543
- <?php self::conditional_field( $field_id, $values ); ?>
544
- </div> <!-- .wpuf-form-holder -->
545
- </li>
546
- <?php
547
- }
548
-
549
- public static function custom_hidden_field( $field_id, $label, $values = array() ) {
550
- $meta_name = sprintf( '%s[%d][name]', self::$input_name, $field_id );
551
- $value_name = sprintf( '%s[%d][meta_value]', self::$input_name, $field_id );
552
- $is_meta_name = sprintf( '%s[%d][is_meta]', self::$input_name, $field_id );
553
- $label_name = sprintf( '%s[%d][label]', self::$input_name, $field_id );
554
-
555
- $meta_value = $values ? esc_attr( $values['name'] ) : '';
556
- $value_value = $values ? esc_attr( $values['meta_value'] ) : '';
557
- ?>
558
- <li class="custom-field custom_hidden_field">
559
- <?php self::legend( $label, $values, $field_id ); ?>
560
- <?php self::hidden_field( "[$field_id][input_type]", 'hidden' ); ?>
561
- <?php self::hidden_field( "[$field_id][template]", 'custom_hidden_field' ); ?>
562
-
563
- <div class="wpuf-form-holder">
564
- <div class="wpuf-form-rows">
565
- <label><?php _e( 'Meta Key', 'wpuf' ); ?></label>
566
- <input type="text" name="<?php echo $meta_name; ?>" value="<?php echo $meta_value; ?>" class="smallipopInput" title="<?php _e( 'Name of the meta key this field will save to', 'wpuf' ); ?>">
567
- <input type="hidden" name="<?php echo $is_meta_name; ?>" value="yes">
568
- <input type="hidden" name="<?php echo $label_name; ?>" value="">
569
- </div> <!-- .wpuf-form-rows -->
570
-
571
- <div class="wpuf-form-rows">
572
- <label><?php _e( 'Meta Value', 'wpuf' ); ?></label>
573
- <input type="text" class="smallipopInput" title="<?php esc_attr_e( 'Enter the meta value', 'wpuf' ); ?>" name="<?php echo $value_name; ?>" value="<?php echo $value_value; ?>">
574
- </div>
575
- </div> <!-- .wpuf-form-holder -->
576
- </li>
577
- <?php
578
- }
579
-
580
- public static function section_break( $field_id, $label, $values = array() ) {
581
- $title_name = sprintf( '%s[%d][label]', self::$input_name, $field_id );
582
- $description_name = sprintf( '%s[%d][description]', self::$input_name, $field_id );
583
-
584
- $title_value = $values ? esc_attr( $values['label'] ) : '';
585
- $description_value = $values ? esc_attr( $values['description'] ) : '';
586
- ?>
587
- <li class="custom-field custom_html">
588
- <?php self::legend( $label, $values, $field_id ); ?>
589
- <?php self::hidden_field( "[$field_id][input_type]", 'section_break' ); ?>
590
- <?php self::hidden_field( "[$field_id][template]", 'section_break' ); ?>
591
-
592
- <div class="wpuf-form-holder">
593
- <div class="wpuf-form-rows">
594
- <label><?php _e( 'Title', 'wpuf' ); ?></label>
595
- <input type="text" class="smallipopInput" title="Title of the section" name="<?php echo $title_name; ?>" value="<?php echo esc_attr( $title_value ); ?>" />
596
- </div> <!-- .wpuf-form-rows -->
597
-
598
- <div class="wpuf-form-rows">
599
- <label><?php _e( 'Description', 'wpuf' ); ?></label>
600
- <textarea class="smallipopInput" title="Some details text about the section" name="<?php echo $description_name; ?>" rows="3"><?php echo esc_html( $description_value ); ?></textarea>
601
- </div> <!-- .wpuf-form-rows -->
602
-
603
- <?php self::conditional_field( $field_id, $values ); ?>
604
- </div> <!-- .wpuf-form-holder -->
605
- </li>
606
- <?php
607
- }
608
-
609
- /**
610
- * Render image upload
611
- *
612
- * @param $field_id
613
- * @param $label
614
- * @param self
615
- * @param array $values
616
- */
617
- public static function image_upload( $field_id, $label, $values = array() ) {
618
- $max_size_name = sprintf( '%s[%d][max_size]', self::$input_name, $field_id );
619
- $max_files_name = sprintf( '%s[%d][count]', self::$input_name, $field_id );
620
-
621
- $max_size_value = $values ? $values['max_size'] : '1024';
622
- $max_files_value = $values ? $values['count'] : '1';
623
-
624
- $help = esc_attr( __( 'Enter maximum upload size limit in KB', 'wpuf' ) );
625
- $count = esc_attr( __( 'Number of images can be uploaded', 'wpuf' ) );
626
- ?>
627
- <li class="custom-field image_upload">
628
- <?php self::legend( $label, $values, $field_id ); ?>
629
- <?php self::hidden_field( "[$field_id][input_type]", 'image_upload' ); ?>
630
- <?php self::hidden_field( "[$field_id][template]", 'image_upload' ); ?>
631
-
632
- <div class="wpuf-form-holder">
633
- <?php self::common( $field_id, '', true, $values ); ?>
634
-
635
- <div class="wpuf-form-rows">
636
- <label><?php _e( 'Max. file size', 'wpuf' ); ?></label>
637
- <input type="text" class="smallipopInput" name="<?php echo $max_size_name; ?>" value="<?php echo $max_size_value; ?>" title="<?php echo $help; ?>">
638
- </div> <!-- .wpuf-form-rows -->
639
-
640
- <div class="wpuf-form-rows">
641
- <label><?php _e( 'Max. files', 'wpuf' ); ?></label>
642
- <input type="text" class="smallipopInput" name="<?php echo $max_files_name; ?>" value="<?php echo $max_files_value; ?>" title="<?php echo $count; ?>">
643
- </div> <!-- .wpuf-form-rows -->
644
-
645
- <?php self::conditional_field( $field_id, $values ); ?>
646
- </div> <!-- .wpuf-form-holder -->
647
- </li>
648
- <?php
649
- }
650
-
651
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/tools.php DELETED
@@ -1,445 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Manage Import Export
5
- *
6
- * @since 2.2
7
- * @package WP User Frontend
8
- */
9
- class WPUF_Admin_Tools {
10
-
11
- /**
12
- * List of All the post forms
13
- *
14
- * @return void
15
- */
16
- function list_forms() {
17
-
18
- if ( isset( $_POST['export'] ) ) {
19
- $this->export_data( $_POST['export_content'], $_POST['formlist'] );
20
- }
21
-
22
- $args = array(
23
- 'post_type' => 'wpuf_forms',
24
- 'posts_per_page' => -1,
25
- 'post_status' => 'publish'
26
- );
27
- $forms = get_posts( $args );
28
-
29
- if ( $forms ) {
30
- ?>
31
- <div class="postbox" style="margin-top: 15px;">
32
- <h3 style="padding:10px 15px"><?php _e( 'Form Export', 'wpuf' ); ?></h3>
33
- <div class="inside">
34
- <div class="main">
35
- <form action="" method="post" style="margin-top: 20px;">
36
- <p>
37
- <input class="export_type" type="radio" name="export_content" value="all" id="wpuf-all_export" checked>
38
- <label for="wpuf-all_export"><?php _e( 'All', 'wpuf' ); ?></label>
39
- </p>
40
-
41
- <p>
42
- <input class="export_type" type="radio" name="export_content" value="selected" id="wpuf-selected_export">
43
- <label for="wpuf-selected_export"><?php _e( 'Select individual', 'wpuf' ); ?></label></p>
44
- <p>
45
- <select class="formlist" name="formlist[]" multiple="multiple">
46
- <?php foreach ( $forms as $form ) { ?>
47
- <option value="<?php echo esc_attr( $form->ID ) ?>"><?php echo esc_attr( $form->post_title ); ?></option>
48
- <?php } ?>
49
- </select>
50
- </p>
51
-
52
- <?php wp_nonce_field( 'wpuf-export-form' ); ?>
53
- <input type="submit" class="button button-primary" name="export" value="<?php _e( 'Export', 'wpuf' ) ?>">
54
- </form>
55
- </div>
56
- </div>
57
- </div>
58
-
59
- <?php
60
- } else {
61
- sprintf( '<p>%s</p>', __( 'Sorry you have no form to export', 'wpuf' ) );
62
- }
63
- }
64
-
65
- /**
66
- * List of All Registration forms
67
- *
68
- * @return void
69
- */
70
- function list_regis_forms() {
71
-
72
- if ( isset( $_POST['export_regis_form'] ) ) {
73
- $this->export_regis_data( $_POST['export_regis_content'], $_POST['formlist'] );
74
- }
75
-
76
- $args = array(
77
- 'post_type' => 'wpuf_profile',
78
- 'posts_per_page' => -1,
79
- 'post_status' => 'publish'
80
- );
81
-
82
- $forms = get_posts( $args );
83
- if ( $forms ) {
84
- ?>
85
- <div class="postbox">
86
- <h3 style="padding:10px 15px"><?php _e( 'Registration Form Export', 'wpuf' ); ?></h3>
87
- <div class="inside">
88
- <div class="main">
89
-
90
- <form action="" method="post" style="margin-top: 20px;">
91
-
92
- <p>
93
- <input class="export_type" type="radio" name="export_regis_content" value="all" id="wpuf-all_regis_export" checked>
94
- <label for="wpuf-all_regis_export"><?php _e( 'All', 'wpuf' ); ?></label>
95
- </p>
96
-
97
- <p>
98
- <input class="export_type" type="radio" name="export_regis_content" value="selected" id="wpuf-selected_regis_export">
99
- <label for="wpuf-selected_regis_export"><?php _e( 'Select individual', 'wpuf' ); ?></label>
100
- </p>
101
-
102
- <p>
103
- <select class="formlist" name="formlist[]" multiple="multiple">
104
- <?php foreach ( $forms as $form ) { ?>
105
- <option value="<?php echo esc_attr( $form->ID ); ?>"><?php echo esc_attr( $form->post_title ); ?></option>";
106
- <?php } ?>
107
- </select>
108
- </p>
109
-
110
- <?php wp_nonce_field( 'wpuf-export-regs-form' ); ?>
111
-
112
- <input type="submit" class="button button-primary" name="export_regis_form" value="<?php _e( 'Export', 'wpuf' ) ?>">
113
- </form>
114
- </div>
115
- </div>
116
- </div>
117
- <?php
118
- } else {
119
- sprintf( '<p>%s</p>', __( 'Sorry you have no form to export', 'wpuf' ) );
120
- }
121
- }
122
-
123
- /**
124
- * Import functionality
125
- */
126
- function import_data() {
127
-
128
- if ( isset( $_FILES['import'] ) && check_admin_referer( 'wpuf-import' ) ) {
129
-
130
- if ( $_FILES['import']['error'] > 0 ) {
131
-
132
- printf( '<div class="error"><p>%s</p></div>', __( 'Somthing went wrong. Please choose a file again', 'wpuf' ) );
133
- } else {
134
-
135
- $file_name = $_FILES['import']['name'];
136
- $file_ext = pathinfo( $file_name, PATHINFO_EXTENSION );
137
- $file_size = $_FILES['import']['size'];
138
-
139
- if ( ($file_ext == "json") && ($file_size < 500000) ) {
140
-
141
- $data = $this->import_json_file( $_FILES['import']['tmp_name'] );
142
-
143
- if ( $data ) {
144
- printf( '<div class="updated"><p>%s</p></div>', __( 'Import successful. Have fun!', 'wpuf' ) );
145
- }
146
- } else {
147
- printf( '<div class="error"><p>%s</p></div>', __( 'Invalid file or file size too big.', 'wpuf' ) );
148
- }
149
- }
150
- }
151
- ?>
152
-
153
- <h3><?php _e( 'Import forms', 'wpuf' ); ?></h3>
154
-
155
- <p><?php _e( 'Click Browse button and choose a json file that you backup before.', 'wpuf' ); ?></p>
156
- <p><?php _e( 'Press Restore button, WordPress does the rest for you.', 'wpuf' ); ?></p>
157
-
158
- <form action="" method="post" enctype='multipart/form-data' style="margin-top: 20px;">
159
- <?php wp_nonce_field( 'wpuf-import' ); ?>
160
- <input type='file' name='import' />
161
- <input type="submit" class="button button-primary" name="import_data" value="<?php _e( 'Import', 'wpuf' ); ?>">
162
- </form>
163
- <?php
164
- }
165
-
166
- /**
167
- * Import json file into database
168
- * @param array $file
169
- * @return boolean
170
- */
171
- function import_json_file( $file ) {
172
-
173
- $encode_data = file_get_contents( $file );
174
- $options = json_decode( $encode_data, true );
175
-
176
- foreach ( $options as $key => $value ) {
177
-
178
- $generate_post = array(
179
- 'post_title' => $value['post_data']['post_title'],
180
- 'post_status' => $value['post_data']['post_status'],
181
- 'post_type' => $value['post_data']['post_type'],
182
- 'ping_status' => $value['post_data']['ping_status'],
183
- 'comment_status' => $value['post_data']['comment_status']
184
- );
185
-
186
- $post_id = wp_insert_post( $generate_post, true );
187
-
188
- if ( $post_id && !is_wp_error( $post_id ) ) {
189
-
190
- foreach ( $value['meta_data']['fields'] as $order => $field ) {
191
- wpuf_insert_form_field( $post_id, $field, false, $order );
192
- }
193
-
194
- update_post_meta( $post_id, 'wpuf_form_settings', $value['meta_data']['settings'] );
195
- }
196
- }
197
-
198
- return true;
199
- }
200
-
201
- /**
202
- * Export Registration form
203
- * @param string $export_type
204
- * @param integer $post_ids
205
- */
206
- function export_regis_data( $export_type, $post_ids ) {
207
-
208
- if ( $export_type == 'all' && check_admin_referer( 'wpuf-export-regs-form' ) ) {
209
-
210
- $this->export_to_json( 'wpuf_profile' );
211
-
212
- } elseif ( $export_type == 'selected' && check_admin_referer( 'wpuf-export-regs-form' ) ) {
213
-
214
- if ( $_POST['formlist'] == NULL ) {
215
- printf( '<div class="error"><p>%s</p></div>', __( 'Please select some form for exporting', 'wpuf' ) );
216
- } else {
217
- $this->export_to_json( 'wpuf_profile', $post_ids );
218
- }
219
- }
220
- }
221
-
222
- /**
223
- * Export normal form data
224
- * @param string $export_type
225
- * @param integer $post_ids
226
- */
227
- function export_data( $export_type, $post_ids ) {
228
- if ( $export_type == 'all' && check_admin_referer( 'wpuf-export-form' ) ) {
229
-
230
- $this->export_to_json( 'wpuf_forms' );
231
-
232
- } elseif ( $export_type == 'selected' && check_admin_referer( 'wpuf-export-form' ) ) {
233
-
234
- if ( $_POST['formlist'] == NULL ) {
235
- printf( '<div class="error"><p>%s</p></div>', __( 'Please select some form for exporting', 'wpuf' ) );
236
- } else {
237
- $this->export_to_json( 'wpuf_forms', $post_ids );
238
- }
239
- }
240
- }
241
-
242
- /**
243
- * Export into json file
244
- *
245
- * @param string $post_type
246
- * @param array $post_ids
247
- */
248
- function export_to_json( $post_type, $post_ids = array( ) ) {
249
-
250
- $formatted_data = array( );
251
- $ids = array( );
252
- $blogname = str_replace( " ", "", get_option( 'blogname' ) );
253
- $date = date( "Y-m-d" );
254
- $json_name = $blogname . "-wpuf-" . $date; // Namming the filename will be generated.
255
-
256
- if ( ! empty( $post_ids ) ) {
257
- foreach ( $post_ids as $key => $value ) {
258
- array_push( $ids, $value );
259
- }
260
- }
261
-
262
- $args = array(
263
- 'post_status' => 'publish',
264
- 'post_type' => $post_type,
265
- 'post__in' => (!empty( $ids ) ) ? $ids : ''
266
- );
267
-
268
- $query = new WP_Query( $args );
269
-
270
- foreach ( $query->posts as $post ) {
271
- $postdata = get_object_vars( $post );
272
- unset( $postdata['ID'] );
273
-
274
- $data = array(
275
- 'post_data' => $postdata,
276
- 'meta_data' => array(
277
- 'fields' => wpuf_get_form_fields( $post->ID ),
278
- 'settings' => get_post_meta( $post->ID, 'wpuf_form_settings', true )
279
- )
280
- );
281
-
282
- array_push( $formatted_data, $data );
283
- }
284
-
285
- $json_file = json_encode( $formatted_data ); // Encode data into json data
286
-
287
- ob_clean();
288
-
289
- echo $json_file;
290
-
291
- header( "Content-Type: text/json; charset=" . get_option( 'blog_charset' ) );
292
- header( "Content-Disposition: attachment; filename=$json_name.json" );
293
-
294
- exit();
295
- }
296
-
297
- /**
298
- * Formetted meta key value
299
- *
300
- * @param array $array
301
- * @return array
302
- */
303
- function formetted_meta_key_value( $array ) {
304
- $result = array( );
305
-
306
- foreach ( $array as $key => $val ) {
307
- $result[$key] = $val[0];
308
- }
309
-
310
- return $result;
311
- }
312
-
313
- function tool_page() {
314
- $msg = isset( $_GET['msg'] ) ? $_GET['msg'] : '';
315
- $text = '';
316
-
317
- switch ($msg) {
318
- case 'del_forms':
319
- $text = __( 'All forms has been deleted', 'wpuf' );
320
- break;
321
-
322
- case 'settings_cleared':
323
- $text = __( 'Settings has been cleared!', 'wpuf' );
324
- break;
325
-
326
- case 'del_trans':
327
- $text = __( 'All transactions has been deleted!', 'wpuf' );
328
- break;
329
- }
330
-
331
- if ( $text ) {
332
- ?>
333
- <div class="updated">
334
- <p>
335
- <?php echo $text; ?>
336
- </p>
337
- </div>
338
-
339
- <?php } ?>
340
-
341
-
342
- <div class="metabox-holder">
343
- <div class="postbox">
344
- <h3><?php _e( 'Page Installation', 'wpuf' ); ?></h3>
345
-
346
- <div class="inside">
347
- <p><?php _e( 'Clicking this button will create required pages for the plugin. Note: It\'ll not delete/replace existing pages.', 'wpuf' ); ?></p>
348
- <a class="button button-primary" href="<?php echo add_query_arg( array( 'install_wpuf_pages' => true ) ); ?>"><?php _e( 'Install WPUF Pages', 'wpuf' ); ?></a>
349
- </div>
350
- </div>
351
-
352
- <div class="postbox">
353
- <h3><?php _e( 'Reset Settings', 'wpuf' ); ?></h3>
354
-
355
- <div class="inside">
356
- <p><?php _e( '<strong>Caution:</strong> This tool will delete all the plugin settings of WP User Frontend Pro', 'wpuf' ); ?></p>
357
- <a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'wpuf_action' => 'clear_settings' ), 'admin.php?page=wpuf_tools&action=tools' ), 'wpuf-tools-action' ); ?>" onclick="return confirm('Are you sure?');"><?php _e( 'Reset Settings', 'wpuf' ); ?></a>
358
- </div>
359
- </div>
360
-
361
- <div class="postbox">
362
- <h3><?php _e( 'Delete Forms', 'wpuf' ); ?></h3>
363
-
364
- <div class="inside">
365
- <p><?php _e( '<strong>Caution:</strong> This tool will delete all the post and registration/profile forms.', 'wpuf' ); ?></p>
366
-
367
- <a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'wpuf_action' => 'del_post_forms' ), 'admin.php?page=wpuf_tools&action=tools' ), 'wpuf-tools-action' ); ?>" onclick="return confirm('Are you sure?');"><?php _e( 'Delete Post Forms', 'wpuf' ); ?></a>
368
- <a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'wpuf_action' => 'del_pro_forms' ), 'admin.php?page=wpuf_tools&action=tools' ), 'wpuf-tools-action' ); ?>" onclick="return confirm('Are you sure?');"><?php _e( 'Delete Registration Forms', 'wpuf' ); ?></a>
369
- <a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'wpuf_action' => 'del_subs' ), 'admin.php?page=wpuf_tools&action=tools' ), 'wpuf-tools-action' ); ?>" onclick="return confirm('Are you sure?');"><?php _e( 'Delete Subscriptions', 'wpuf' ); ?></a>
370
- <a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'wpuf_action' => 'del_coupon' ), 'admin.php?page=wpuf_tools&action=tools' ), 'wpuf-tools-action' ); ?>" onclick="return confirm('Are you sure?');"><?php _e( 'Delete Coupons', 'wpuf' ); ?></a>
371
- </div>
372
- </div>
373
-
374
- <div class="postbox">
375
- <h3><?php _e( 'Transactions', 'wpuf' ); ?></h3>
376
-
377
- <div class="inside">
378
- <p><?php _e( 'This tool will delete all the transactions from the transaction table.', 'wpuf' ); ?></p>
379
-
380
- <a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'wpuf_action' => 'clear_transaction' ), 'admin.php?page=wpuf_tools&action=tools' ), 'wpuf-tools-action' ); ?>" onclick="return confirm('Are you sure?');"><?php _e( 'Delete Transactions', 'wpuf' ); ?></a>
381
- </div>
382
- </div>
383
- </div>
384
- <?php
385
- }
386
-
387
- }
388
-
389
- $tools = new WPUF_Admin_Tools();
390
- ?>
391
-
392
- <div class="wrap">
393
- <div id="icon-options-general" class="icon32"><br></div>
394
-
395
- <h2 class="nav-tab-wrapper">
396
- <a class="nav-tab <?php echo (!isset( $_GET['action'] ) ) ? 'nav-tab-active' : ''; ?>" href="<?php echo add_query_arg( array( 'page' => 'wpuf_tools' ), admin_url( 'admin.php' ) ); ?>"><?php _e( 'Import', 'wpuf' ); ?></a>
397
- <a class="nav-tab <?php echo ( isset( $_GET['action'] ) && $_GET['action'] == 'export' ) ? 'nav-tab-active' : ''; ?>" href="<?php echo add_query_arg( array( 'page' => 'wpuf_tools', 'action' => 'export' ), admin_url( 'admin.php' ) ); ?>"><?php _e( 'Export', 'wpuf' ); ?></a>
398
- <a class="nav-tab <?php echo ( isset( $_GET['action'] ) && $_GET['action'] == 'tools' ) ? 'nav-tab-active' : ''; ?>" href="<?php echo add_query_arg( array( 'page' => 'wpuf_tools', 'action' => 'tools' ), admin_url( 'admin.php' ) ); ?>"><?php _e( 'Tools', 'wpuf' ); ?></a>
399
- </h2>
400
-
401
- <?php
402
- $action = isset( $_GET['action'] ) ? $_GET['action'] : '';
403
-
404
- switch ( $action ) {
405
- case 'export':
406
- $tools->list_forms();
407
- $tools->list_regis_forms();
408
- break;
409
-
410
- case 'tools':
411
- $tools->tool_page();
412
- break;
413
-
414
- default:
415
- $tools->import_data();
416
- break;
417
- }
418
- ?>
419
- </div>
420
-
421
- <style>
422
- select.formlist{
423
- display: block;
424
- width: 300px;
425
- }
426
-
427
- </style>
428
-
429
- <script>
430
- (function($){
431
-
432
- $('.formlist').hide();
433
- $('input.export_type').on('change',function(){
434
- $(this).closest('form').find('.formlist').slideUp(200);
435
-
436
- if( $(this).attr('value') == 'selected' ) {
437
- $(this).closest('form').find('.formlist').slideDown(200);
438
- }
439
- });
440
-
441
-
442
- })(jQuery);
443
-
444
- </script>
445
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/transactions.php DELETED
@@ -1,27 +0,0 @@
1
- <div class="wrap">
2
- <h2><?php _e( 'Transactions', 'wpuf' ); ?></h2>
3
-
4
- <?php
5
- global $wpdb;
6
- $total_income = $wpdb->get_var( "SELECT SUM(cost) FROM {$wpdb->prefix}wpuf_transaction WHERE status = 'completed'" );
7
- $month_income = $wpdb->get_var( "SELECT SUM(cost) FROM {$wpdb->prefix}wpuf_transaction WHERE YEAR(`created`) = YEAR(NOW()) AND MONTH(`created`) = MONTH(NOW()) AND status = 'completed'" );
8
- ?>
9
-
10
- <ul>
11
- <li>
12
- <strong><?php _e( 'Total Income:', 'wpuf' ); ?></strong> <?php echo wpuf_format_price( $total_income ); ?><br />
13
- </li>
14
- <li>
15
- <strong><?php _e( 'This Month:', 'wpuf' ); ?></strong> <?php echo wpuf_format_price( $month_income ); ?>
16
- </li>
17
- </ul>
18
-
19
- <form method="post">
20
- <input type="hidden" name="page" value="transactions">
21
- <?php
22
- $this->transactions_list_table_obj->prepare_items();
23
- $this->transactions_list_table_obj->views();
24
- $this->transactions_list_table_obj->display();
25
- ?>
26
- </form>
27
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin.css DELETED
@@ -1,168 +0,0 @@
1
- .wpuf-admin fieldset{
2
- border: 1px solid #E3E3E3;
3
- margin: 20px 0 0px 0;
4
- padding-bottom: 20px;
5
- -moz-border-radius: 5px;
6
- -webkit-border-radius: 5px;
7
- background: #fff;
8
- -moz-box-shadow:inset 0 0 5px #ccc;
9
- -webkit-box-shadow:inset 0 0 5px #ccc;
10
- box-shadow:inset 0 0 5px #ccc;
11
- }
12
-
13
- .wpuf-admin legend{
14
- -moz-border-radius: 5px 5px 5px 5px;
15
- -webkit-border-radius: 5px;
16
- background: #FFFFFF;
17
- border: 1px solid #E3E3E3;
18
- color: #2481C6;
19
- font-size: 15px;
20
- font-weight: bold;
21
- margin-left: 20px;
22
- padding: 5px 10px;
23
- text-transform: capitalize;
24
- -moz-box-shadow:inset 0 0 5px #ccc;
25
- -webkit-box-shadow:inset 0 0 5px #ccc;
26
- box-shadow:inset 0 0 5px #ccc;
27
- }
28
-
29
- .wpuf-admin .widefat td{
30
- padding: 7px 12px;
31
- vertical-align: top;
32
- }
33
-
34
- .wpuf-admin .meta td.label{
35
- width: 140px;
36
- font-size: 12px;
37
- }
38
-
39
- .wpuf-admin td.label{
40
- font-size: 12px;
41
- }
42
-
43
- .wpuf-admin .options td:nth-child(odd){
44
- background-color: F9F9F9;
45
- }
46
-
47
- .wpuf-admin .meta .description {
48
- font-size: 11px;
49
- }
50
-
51
- .wpuf_admin ul {
52
- margin: 10px;
53
- }
54
-
55
- .wpuf_admin li {
56
- padding: 0 0 10px;
57
- margin: 0 0 10px;
58
- border-bottom: 1px solid #E7E7E7;
59
- line-height: 20px;
60
- }
61
-
62
- .wpuf_admin li:last-child {
63
- border-bottom: none;
64
- }
65
-
66
- .wpuf_admin span.label {
67
- float: left;
68
- height: 20px;
69
- line-height: 20px;
70
- width: 200px;
71
- }
72
-
73
- .wpuf-admin .nav-tab {
74
- font-size: 15px;
75
- margin: 0 0px -1px 0;
76
- }
77
-
78
- .tooltip {
79
- position:absolute;
80
- z-index:9999;
81
- color: #fff;
82
- font-size:11px;
83
- width: 250px;
84
- background: #333;
85
- -moz-border-radius: 5px;
86
- -webkit-border-radius: 5px;
87
- margin: 20px;
88
- opacity: .8;
89
- }
90
-
91
- .tooltip:after {
92
- border-color: transparent transparent #333;
93
- border-style: solid;
94
- border-width: 8px;
95
- content: "";
96
- display: block;
97
- height: 0;
98
- left: 20px;
99
- position: absolute;
100
- top: -16px;
101
- width: 0;
102
- }
103
-
104
-
105
- .tooltip .tipBody {
106
- padding: 5px 10px;
107
- text-indent: 0;
108
- color: #fff;
109
- text-shadow: 1px 1px 1px #333;
110
- font-size: 12px;
111
- }
112
-
113
- .tooltip .buble {
114
- border-right: 60px solid white;
115
- border-top: 50px solid #CCCCCC;
116
- height: 0;
117
- line-height: 0;
118
- position: absolute;
119
- right: -60px;
120
- top: 30px;
121
- width: 0;
122
- }
123
-
124
- span.wpuf_help{
125
- height: 16px;
126
- width: 16px;
127
- background: url('../images/help.png') no-repeat;
128
- cursor: pointer;
129
- float: right;
130
- display: none;
131
- }
132
-
133
- #option-saved{
134
- -moz-border-radius: 5px 5px 5px 5px;
135
- background: none repeat scroll 0 0 orange;
136
- border: 1px solid #CCCCCC;
137
- color: #FFFFFF;
138
- display: none;
139
- font-size: 30px;
140
- padding: 50px;
141
- position: absolute;
142
- left: 50%;
143
- z-index: 99;
144
- -moz-box-shadow:0 0 8px rgba(82,168,236,.5);
145
- -webkit-box-shadow:0 0 8px rgba(82,168,236,.5);
146
- }
147
-
148
- .wpuf_loading {
149
- height: 16px;
150
- width: 16px;
151
- background: url('../images/wpspin_light.gif') no-repeat;
152
- padding: 0 0 0 20px;
153
- margin-bottom: 10px;
154
- }
155
- .wpuf-status-completed {
156
- background: url(../images/completed.png);
157
- background-size: cover;
158
- width: 18px;
159
- height: 18px;
160
- display: block;
161
- }
162
- .wpuf-status-processing {
163
- background: url(../images/processing.png);
164
- background-size: cover;
165
- width: 18px;
166
- height: 18px;
167
- display: block;
168
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/chosen/chosen-sprite.png DELETED
Binary file
assets/css/chosen/chosen-sprite@2x.png DELETED
Binary file
assets/css/chosen/chosen.css DELETED
@@ -1,436 +0,0 @@
1
- /*!
2
- Chosen, a Select Box Enhancer for jQuery and Prototype
3
- by Patrick Filler for Harvest, http://getharvest.com
4
-
5
- Version 1.1.0
6
- Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011 Harvest http://getharvest.com
8
-
9
- MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
- This file is generated by `grunt build`, do not edit it by hand.
11
- */
12
-
13
- /* @group Base */
14
- .chosen-container {
15
- position: relative;
16
- display: inline-block;
17
- vertical-align: middle;
18
- font-size: 13px;
19
- zoom: 1;
20
- *display: inline;
21
- -webkit-user-select: none;
22
- -moz-user-select: none;
23
- user-select: none;
24
- min-width: 200px;
25
- }
26
- .chosen-container .chosen-drop {
27
- position: absolute;
28
- top: 100%;
29
- left: -9999px;
30
- z-index: 1010;
31
- -webkit-box-sizing: border-box;
32
- -moz-box-sizing: border-box;
33
- box-sizing: border-box;
34
- width: 100%;
35
- border: 1px solid #ddd;
36
- border-top: 0;
37
- background: #fff;
38
- box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
39
- }
40
- .chosen-container.chosen-with-drop .chosen-drop {
41
- left: 0;
42
- }
43
- .chosen-container a {
44
- cursor: pointer;
45
- }
46
-
47
- /* @end */
48
- /* @group Single Chosen */
49
- .chosen-container-single .chosen-single {
50
- position: relative;
51
- display: block;
52
- overflow: hidden;
53
- padding: 0 0 0 8px;
54
- height: 23px;
55
- border: 1px solid #aaa;
56
- border-radius: 5px;
57
- background-color: #fff;
58
- background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
59
- background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
60
- background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
61
- background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
62
- background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
63
- background-clip: padding-box;
64
- box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
65
- color: #444;
66
- text-decoration: none;
67
- white-space: nowrap;
68
- line-height: 24px;
69
- }
70
- .chosen-container-single .chosen-default {
71
- color: #999;
72
- }
73
- .chosen-container-single .chosen-single span {
74
- display: block;
75
- overflow: hidden;
76
- margin-right: 26px;
77
- text-overflow: ellipsis;
78
- white-space: nowrap;
79
- }
80
- .chosen-container-single .chosen-single-with-deselect span {
81
- margin-right: 38px;
82
- }
83
- .chosen-container-single .chosen-single abbr {
84
- position: absolute;
85
- top: 6px;
86
- right: 26px;
87
- display: block;
88
- width: 12px;
89
- height: 12px;
90
- background: url('chosen-sprite.png') -42px 1px no-repeat;
91
- font-size: 1px;
92
- }
93
- .chosen-container-single .chosen-single abbr:hover {
94
- background-position: -42px -10px;
95
- }
96
- .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
97
- background-position: -42px -10px;
98
- }
99
- .chosen-container-single .chosen-single div {
100
- position: absolute;
101
- top: 0;
102
- right: 0;
103
- display: block;
104
- width: 18px;
105
- height: 100%;
106
- }
107
- .chosen-container-single .chosen-single div b {
108
- display: block;
109
- width: 100%;
110
- height: 100%;
111
- background: url('chosen-sprite.png') no-repeat 0px 2px;
112
- }
113
- .chosen-container-single .chosen-search {
114
- position: relative;
115
- z-index: 1010;
116
- margin: 0;
117
- padding: 3px 4px;
118
- white-space: nowrap;
119
- }
120
- .chosen-container-single .chosen-search input[type="text"] {
121
- -webkit-box-sizing: border-box;
122
- -moz-box-sizing: border-box;
123
- box-sizing: border-box;
124
- margin: 1px 0;
125
- padding: 4px 20px 4px 5px;
126
- width: 100%;
127
- height: auto;
128
- outline: 0;
129
- border: 1px solid #aaa;
130
- background: white url('chosen-sprite.png') no-repeat 100% -20px;
131
- background: url('chosen-sprite.png') no-repeat 100% -20px;
132
- font-size: 1em;
133
- font-family: sans-serif;
134
- line-height: normal;
135
- border-radius: 0;
136
- }
137
- .chosen-container-single .chosen-drop {
138
- margin-top: -1px;
139
- border-radius: 0 0 4px 4px;
140
- background-clip: padding-box;
141
- }
142
- .chosen-container-single.chosen-container-single-nosearch .chosen-search {
143
- position: absolute;
144
- left: -9999px;
145
- }
146
-
147
- /* @end */
148
- /* @group Results */
149
- .chosen-container .chosen-results {
150
- position: relative;
151
- overflow-x: hidden;
152
- overflow-y: auto;
153
- margin: 0 4px 4px 0;
154
- padding: 0 0 0 4px;
155
- max-height: 240px;
156
- -webkit-overflow-scrolling: touch;
157
- }
158
- .chosen-container .chosen-results li {
159
- display: none;
160
- margin: 0;
161
- padding: 5px 6px;
162
- list-style: none;
163
- line-height: 15px;
164
- -webkit-touch-callout: none;
165
- }
166
- .chosen-container .chosen-results li.active-result {
167
- display: list-item;
168
- cursor: pointer;
169
- }
170
- .chosen-container .chosen-results li.disabled-result {
171
- display: list-item;
172
- color: #ccc;
173
- cursor: default;
174
- }
175
- .chosen-container .chosen-results li.highlighted {
176
- background-color: #3875d7;
177
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
178
- background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
179
- background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
180
- background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
181
- background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
182
- color: #fff;
183
- }
184
- .chosen-container .chosen-results li.no-results {
185
- display: list-item;
186
- background: #f4f4f4;
187
- }
188
- .chosen-container .chosen-results li.group-result {
189
- display: list-item;
190
- font-weight: bold;
191
- cursor: default;
192
- }
193
- .chosen-container .chosen-results li.group-option {
194
- padding-left: 15px;
195
- }
196
- .chosen-container .chosen-results li em {
197
- font-style: normal;
198
- text-decoration: underline;
199
- }
200
-
201
- /* @end */
202
- /* @group Multi Chosen */
203
- .chosen-container-multi .chosen-choices {
204
- position: relative;
205
- overflow: hidden;
206
- -webkit-box-sizing: border-box;
207
- -moz-box-sizing: border-box;
208
- box-sizing: border-box;
209
- margin: 0;
210
- padding: 0;
211
- width: 100%;
212
- height: auto !important;
213
- height: 1%;
214
- border: 1px solid #aaa;
215
- background-color: #fff;
216
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
217
- background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
218
- background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
219
- background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
220
- background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
221
- cursor: text;
222
- }
223
- .chosen-container-multi .chosen-choices li {
224
- float: left;
225
- list-style: none;
226
- }
227
- .chosen-container-multi .chosen-choices li.search-field {
228
- margin: 0;
229
- padding: 0;
230
- white-space: nowrap;
231
- }
232
- .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
233
- margin: 1px 0;
234
- padding: 5px;
235
- height: 15px;
236
- outline: 0;
237
- border: 0 !important;
238
- background: transparent !important;
239
- box-shadow: none;
240
- color: #666;
241
- font-size: 100%;
242
- font-family: sans-serif;
243
- line-height: normal;
244
- border-radius: 0;
245
- }
246
- .chosen-container-multi .chosen-choices li.search-field .default {
247
- color: #999;
248
- }
249
- .chosen-container-multi .chosen-choices li.search-choice {
250
- position: relative;
251
- margin: 3px 0 3px 5px;
252
- padding: 3px 20px 3px 5px;
253
- border: 1px solid #aaa;
254
- border-radius: 3px;
255
- background-color: #e4e4e4;
256
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
257
- background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
258
- background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
259
- background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
260
- background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
261
- background-clip: padding-box;
262
- box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
263
- color: #333;
264
- line-height: 13px;
265
- cursor: default;
266
- }
267
- .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
268
- position: absolute;
269
- top: 4px;
270
- right: 3px;
271
- display: block;
272
- width: 12px;
273
- height: 12px;
274
- background: url('chosen-sprite.png') -42px 1px no-repeat;
275
- font-size: 1px;
276
- }
277
- .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
278
- background-position: -42px -10px;
279
- }
280
- .chosen-container-multi .chosen-choices li.search-choice-disabled {
281
- padding-right: 5px;
282
- border: 1px solid #ccc;
283
- background-color: #e4e4e4;
284
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
285
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
286
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
287
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
288
- background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
289
- color: #666;
290
- }
291
- .chosen-container-multi .chosen-choices li.search-choice-focus {
292
- background: #d4d4d4;
293
- }
294
- .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
295
- background-position: -42px -10px;
296
- }
297
- .chosen-container-multi .chosen-results {
298
- margin: 0;
299
- padding: 0;
300
- }
301
- .chosen-container-multi .chosen-drop .result-selected {
302
- display: list-item;
303
- color: #ccc;
304
- cursor: default;
305
- }
306
-
307
- /* @end */
308
- /* @group Active */
309
- .chosen-container-active .chosen-single {
310
- border: 1px solid #5897fb;
311
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
312
- }
313
- .chosen-container-active.chosen-with-drop .chosen-single {
314
- border: 1px solid #aaa;
315
- -moz-border-radius-bottomright: 0;
316
- border-bottom-right-radius: 0;
317
- -moz-border-radius-bottomleft: 0;
318
- border-bottom-left-radius: 0;
319
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
320
- background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
321
- background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
322
- background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
323
- background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
324
- box-shadow: 0 1px 0 #fff inset;
325
- }
326
- .chosen-container-active.chosen-with-drop .chosen-single div {
327
- border-left: none;
328
- background: transparent;
329
- }
330
- .chosen-container-active.chosen-with-drop .chosen-single div b {
331
- background-position: -18px 2px;
332
- }
333
- .chosen-container-active .chosen-choices {
334
- border: 1px solid #5897fb;
335
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
336
- }
337
- .chosen-container-active .chosen-choices li.search-field input[type="text"] {
338
- color: #111 !important;
339
- }
340
-
341
- /* @end */
342
- /* @group Disabled Support */
343
- .chosen-disabled {
344
- opacity: 0.5 !important;
345
- cursor: default;
346
- }
347
- .chosen-disabled .chosen-single {
348
- cursor: default;
349
- }
350
- .chosen-disabled .chosen-choices .search-choice .search-choice-close {
351
- cursor: default;
352
- }
353
-
354
- /* @end */
355
- /* @group Right to Left */
356
- .chosen-rtl {
357
- text-align: right;
358
- }
359
- .chosen-rtl .chosen-single {
360
- overflow: visible;
361
- padding: 0 8px 0 0;
362
- }
363
- .chosen-rtl .chosen-single span {
364
- margin-right: 0;
365
- margin-left: 26px;
366
- direction: rtl;
367
- }
368
- .chosen-rtl .chosen-single-with-deselect span {
369
- margin-left: 38px;
370
- }
371
- .chosen-rtl .chosen-single div {
372
- right: auto;
373
- left: 3px;
374
- }
375
- .chosen-rtl .chosen-single abbr {
376
- right: auto;
377
- left: 26px;
378
- }
379
- .chosen-rtl .chosen-choices li {
380
- float: right;
381
- }
382
- .chosen-rtl .chosen-choices li.search-field input[type="text"] {
383
- direction: rtl;
384
- }
385
- .chosen-rtl .chosen-choices li.search-choice {
386
- margin: 3px 5px 3px 0;
387
- padding: 3px 5px 3px 19px;
388
- }
389
- .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
390
- right: auto;
391
- left: 4px;
392
- }
393
- .chosen-rtl.chosen-container-single-nosearch .chosen-search,
394
- .chosen-rtl .chosen-drop {
395
- left: 9999px;
396
- }
397
- .chosen-rtl.chosen-container-single .chosen-results {
398
- margin: 0 0 4px 4px;
399
- padding: 0 4px 0 0;
400
- }
401
- .chosen-rtl .chosen-results li.group-option {
402
- padding-right: 15px;
403
- padding-left: 0;
404
- }
405
- .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
406
- border-right: none;
407
- }
408
- .chosen-rtl .chosen-search input[type="text"] {
409
- padding: 4px 5px 4px 20px;
410
- background: white url('chosen-sprite.png') no-repeat -30px -20px;
411
- background: url('chosen-sprite.png') no-repeat -30px -20px;
412
- direction: rtl;
413
- }
414
- .chosen-rtl.chosen-container-single .chosen-single div b {
415
- background-position: 6px 2px;
416
- }
417
- .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
418
- background-position: -12px 2px;
419
- }
420
-
421
- /* @end */
422
- /* @group Retina compatibility */
423
- @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
424
- .chosen-rtl .chosen-search input[type="text"],
425
- .chosen-container-single .chosen-single abbr,
426
- .chosen-container-single .chosen-single div b,
427
- .chosen-container-single .chosen-search input[type="text"],
428
- .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
429
- .chosen-container .chosen-results-scroll-down span,
430
- .chosen-container .chosen-results-scroll-up span {
431
- background-image: url('chosen-sprite@2x.png') !important;
432
- background-size: 52px 37px !important;
433
- background-repeat: no-repeat !important;
434
- }
435
- }
436
- /* @end */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/formbuilder.css DELETED
@@ -1,343 +0,0 @@
1
- .wpuf-hide {
2
- display: none;
3
- }
4
- .wpuf-pro-text-alert {
5
- font-style: italic;
6
- color: #ccc;
7
- }
8
- .wpuf-pro-text-alert a {
9
- text-decoration: none;
10
- color: #aaa;
11
- }
12
- #wpuf-pro-content {
13
- opacity: 0.7;
14
- }
15
- .wpuf-pro-content {
16
- opacity: 0.7;
17
- }
18
- #wpuf-metabox-editor {
19
- background: transparent;
20
- border: none;
21
- box-shadow: none;
22
- }
23
- #wpuf-metabox-editor .handlediv {
24
- display: none;
25
- }
26
- #wpuf-metabox-editor .hndle {
27
- display: none;
28
- }
29
- #wpuf-metabox-editor .wpuf-updated {
30
- background-color: #ffffe0;
31
- border: 1px solid #e6db55;
32
- border-radius: 5px;
33
- padding: 0 10px;
34
- margin: 5px 0 15px;
35
- font-weight: bold;
36
- }
37
- #wpuf-metabox-editor h2.nav-tab-wrapper {
38
- padding: 0;
39
- }
40
- #wpuf-metabox-editor h2.nav-tab-wrapper a:first-child {
41
- margin-left: 10px;
42
- }
43
- #wpuf-metabox-editor .inside {
44
- margin: 0;
45
- padding: 0;
46
- }
47
- #wpuf-metabox-editor .inside h3 {
48
- border-bottom: 1px solid #E6E6E6;
49
- cursor: pointer;
50
- padding-left: 0;
51
- padding-bottom: 10px;
52
- }
53
- #wpuf-metabox-fields h2 {
54
- margin: 0;
55
- }
56
- #wpuf-metabox-fields .wpuf-form-buttons {
57
- margin-bottom: 10px;
58
- }
59
- #wpuf-metabox-fields button {
60
- margin-bottom: 5px;
61
- }
62
- #wpuf-metabox-fields .wpuf-loading {
63
- width: 16px;
64
- height: 16px;
65
- background: url('../images/wpspin_light.gif') no-repeat;
66
- }
67
- #wpuf-metabox-fields .wpuf-loading.hide {
68
- display: none;
69
- }
70
- .wpuf-form-editor {
71
- font-size: 12px;
72
- margin: 0;
73
- }
74
- .wpuf-form-editor li {
75
- background: #FFF;
76
- margin-bottom: 10px;
77
- border: 1px solid #dfdfdf;
78
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
79
- }
80
- .wpuf-form-editor li.ui-state-highlight {
81
- border: 1px dashed #DDD;
82
- min-height: 50px;
83
- background: #eee;
84
- }
85
- .wpuf-form-editor li.password .required-field,
86
- .wpuf-form-editor li.user_email .required-field {
87
- display: none;
88
- }
89
- .wpuf-form-editor li .wpuf-legend {
90
- background: #fff;
91
- color: #464646;
92
- border-bottom: 1px solid #eee;
93
- padding-bottom: 5px;
94
- padding: 7px 10px;
95
- }
96
- .wpuf-form-editor li .wpuf-legend:after {
97
- clear: both;
98
- content: "";
99
- display: table;
100
- }
101
- .wpuf-form-editor li .wpuf-legend:hover {
102
- cursor: move;
103
- }
104
- .wpuf-form-editor li .wpuf-legend .wpuf-label {
105
- float: left;
106
- width: 70%;
107
- }
108
- .wpuf-form-editor li .wpuf-legend .wpuf-actions {
109
- float: right;
110
- }
111
- .wpuf-form-editor li .wpuf-legend .wpuf-actions a {
112
- font-size: 11px;
113
- padding: 2px 5px;
114
- }
115
- .wpuf-form-editor li .wpuf-legend .wpuf-actions a.wpuf-remove {
116
- background: transparent url(../images/delete.png) no-repeat 70% 50%;
117
- color: #f00;
118
- width: 16px;
119
- text-indent: -9999px;
120
- display: inline-block;
121
- }
122
- .wpuf-form-editor li .wpuf-legend .wpuf-actions a.wpuf-toggle {
123
- background: transparent url(../images/arrows.png) no-repeat 0 2px;
124
- width: 10px;
125
- text-indent: -9999px;
126
- display: inline-block;
127
- }
128
- .wpuf-form-editor li .wpuf-form-holder {
129
- padding: 10px;
130
- }
131
- .wpuf-form-editor li .wpuf-form-rows {
132
- padding-bottom: 3px;
133
- }
134
- .wpuf-form-editor li .wpuf-form-rows:after {
135
- clear: both;
136
- content: "";
137
- display: table;
138
- }
139
- .wpuf-form-editor li .wpuf-form-rows label {
140
- float: left;
141
- width: 20%;
142
- font-size: 12px;
143
- }
144
- .wpuf-form-editor li .wpuf-form-rows textarea {
145
- width: 60%;
146
- }
147
- .wpuf-form-editor li .wpuf-form-rows .wpuf-form-sub-fields {
148
- width: 77%;
149
- float: left;
150
- }
151
- .wpuf-form-editor li .wpuf-form-rows .wpuf-form-sub-fields label {
152
- float: none;
153
- display: inline-block;
154
- width: auto;
155
- }
156
- .wpuf-form-editor li .wpuf-form-rows .wpuf-form-sub-fields .wpuf-show-field-value {
157
- margin: 7px 0 7px 0;
158
- }
159
- .wpuf-form-editor li .wpuf-form-rows .wpuf-form-sub-fields .wpuf-option-label-value {
160
- margin: 0;
161
- }
162
- .wpuf-form-editor li .wpuf-form-rows .wpuf-form-sub-fields .wpuf-option-label-value span {
163
- font-weight: bold;
164
- margin-left: 5%;
165
- margin-right: 27%;
166
- }
167
- .wpuf-form-editor li .wpuf-form-rows .wpuf-form-sub-fields.wpuf-options {
168
- margin-bottom: 10px;
169
- }
170
- .wpuf-form-editor li .wpuf-form-rows table.address-table {
171
- width: 100%;
172
- margin-bottom: 15px;
173
- }
174
- .wpuf-form-editor li .wpuf-form-rows table.address-table label {
175
- float: none;
176
- width: 100%;
177
- }
178
- .ui-state-highlight {
179
- height: 1.5em;
180
- line-height: 1.2em;
181
- }
182
- .wpuf-form-template-modal {
183
- background: #fff;
184
- position: fixed;
185
- top: 5%;
186
- bottom: 5%;
187
- right: 10%;
188
- left: 10%;
189
- display: none;
190
- box-shadow: 0 1px 20px 5px rgba(0, 0, 0, 0.1);
191
- z-index: 160000;
192
- }
193
- .wpuf-form-template-modal * {
194
- box-sizing: border-box;
195
- }
196
- .wpuf-form-template-modal a.close {
197
- position: absolute;
198
- top: 0;
199
- right: 0;
200
- font: 300 1.71429em "dashicons" !important;
201
- color: #777;
202
- content: '\f335';
203
- display: inline-block;
204
- padding: 10px 20px;
205
- z-index: 5;
206
- text-decoration: none;
207
- height: 50px;
208
- cursor: pointer;
209
- border-left: 1px solid #ddd;
210
- }
211
- .wpuf-form-template-modal a.close:hover {
212
- background: #eee;
213
- opacity: 0.8;
214
- text-decoration: none;
215
- }
216
- .wpuf-form-template-modal a.close:active {
217
- background: #eee;
218
- opacity: 0.4;
219
- }
220
- .wpuf-form-template-modal .modal-header {
221
- position: absolute;
222
- top: 0;
223
- left: 0;
224
- right: 0;
225
- height: 50px;
226
- z-index: 4;
227
- border-bottom: 1px solid #ddd;
228
- padding-left: 15px;
229
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
230
- }
231
- .wpuf-form-template-modal .modal-header h2 {
232
- line-height: 50px;
233
- text-align: left;
234
- margin-top: 0;
235
- color: #5d6d74;
236
- font-size: 20px;
237
- text-shadow: 0 1px 1px #fff;
238
- }
239
- .wpuf-form-template-modal .modal-header h2 small {
240
- font-weight: normal;
241
- font-size: 13px;
242
- margin-left: 15px;
243
- }
244
- .wpuf-form-template-modal .content-container {
245
- position: absolute;
246
- top: 75px;
247
- right: 0;
248
- bottom: 50px;
249
- left: 0;
250
- overflow: auto;
251
- padding: 2em 2em;
252
- }
253
- .wpuf-form-template-modal .content {
254
- margin: 0 auto;
255
- max-width: 900px;
256
- text-align: left;
257
- }
258
- .wpuf-form-template-modal .content ul {
259
- width: 100%;
260
- margin: 0;
261
- padding: 0;
262
- }
263
- .wpuf-form-template-modal .content ul li {
264
- float: left;
265
- width: 31.292517006803%;
266
- border: 1px solid #e4e4e4;
267
- padding: 0;
268
- margin-left: 3.0612244897959%;
269
- margin-bottom: 30px;
270
- position: relative;
271
- min-height: 120px;
272
- }
273
- .wpuf-form-template-modal .content ul li:hover {
274
- background: #F5F5F5;
275
- }
276
- .wpuf-form-template-modal .content ul li a {
277
- text-decoration: none;
278
- color: #555;
279
- padding: 20px;
280
- display: block;
281
- }
282
- .wpuf-form-template-modal .content ul li .title {
283
- font-size: 17px;
284
- margin: 0 0 10px 0;
285
- line-height: 23px;
286
- }
287
- .wpuf-form-template-modal .content ul li .description {
288
- color: #888;
289
- }
290
- .wpuf-form-template-modal .content ul li:nth-child(3n+1) {
291
- margin-left: 0;
292
- clear: both;
293
- }
294
- .wpuf-form-template-modal .content ul li.template-inactive .title,
295
- .wpuf-form-template-modal .content ul li.template-inactive .description {
296
- color: #ddd;
297
- }
298
- .wpuf-form-template-modal .content ul li.blank-form {
299
- text-align: center;
300
- }
301
- .wpuf-form-template-modal .content ul li.blank-form span {
302
- display: block;
303
- }
304
- .wpuf-form-template-modal .content ul li.blank-form span.dashicons {
305
- font-size: 45px;
306
- color: #ddd;
307
- margin: 0 auto;
308
- width: auto;
309
- height: auto;
310
- }
311
- .wpuf-form-template-modal footer {
312
- position: absolute;
313
- left: 0;
314
- bottom: 0;
315
- width: 100%;
316
- padding: 12px 20px;
317
- border-top: 1px solid #ddd;
318
- background: #fff;
319
- text-align: left;
320
- }
321
- .wpuf-form-template-modal-backdrop {
322
- position: fixed;
323
- z-index: 159999;
324
- top: 0;
325
- left: 0;
326
- right: 0;
327
- bottom: 0;
328
- min-height: 360px;
329
- background: #000;
330
- opacity: .7;
331
- display: none;
332
- }
333
- /* Smartphones (portrait and landscape) ----------- */
334
- @media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
335
- .wpuf-form-template-modal .modal-header h2 small {
336
- display: none;
337
- }
338
- .wpuf-form-template-modal .content ul li {
339
- float: none;
340
- width: 100%;
341
- margin-left: 0;
342
- }
343
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/formbuilder.less DELETED
@@ -1,423 +0,0 @@
1
- .clearfix() {
2
- &:after {
3
- clear: both;
4
- content: "";
5
- display: table;
6
- }
7
- }
8
-
9
- //variables
10
- @fontSize: 12px;
11
-
12
- .wpuf-hide {
13
- display: none;
14
- }
15
-
16
- .wpuf-pro-text-alert {
17
- font-style: italic;
18
- color: #ccc;
19
-
20
- a {
21
- text-decoration: none;
22
- color: #aaa;
23
- }
24
- }
25
- #wpuf-pro-content{
26
- opacity: 0.7;
27
- }
28
- .wpuf-pro-content{
29
- opacity: 0.7;
30
- }
31
- #wpuf-metabox-editor {
32
- background: transparent;
33
- border: none;
34
- box-shadow: none;
35
-
36
- .handlediv { display: none; }
37
- .hndle { display: none; }
38
-
39
- .wpuf-updated {
40
- background-color: #ffffe0;
41
- border: 1px solid #e6db55;
42
- border-radius: 5px;
43
- padding: 0 10px;
44
- margin: 5px 0 15px;
45
- font-weight: bold;
46
- }
47
-
48
- h2.nav-tab-wrapper {
49
- padding: 0;
50
-
51
- a:first-child {
52
- margin-left: 10px;
53
- }
54
- }
55
-
56
- .inside {
57
- margin: 0;
58
- padding: 0;
59
-
60
- h3 {
61
- border-bottom: 1px solid #E6E6E6;
62
- cursor: pointer;
63
- padding-left: 0;
64
- padding-bottom: 10px;
65
- }
66
- }
67
- }
68
-
69
- #wpuf-metabox-fields {
70
- h2 {
71
- margin:0;
72
- }
73
-
74
- .wpuf-form-buttons {
75
- margin-bottom: 10px;
76
- }
77
-
78
- button {
79
- margin-bottom: 5px;
80
- }
81
-
82
- .wpuf-loading {
83
- width: 16px;
84
- height: 16px;
85
- background: url('../images/wpspin_light.gif') no-repeat;
86
-
87
- &.hide {
88
- display: none;
89
- }
90
- }
91
- }
92
-
93
- .wpuf-form-editor {
94
- font-size: @fontSize;
95
- margin: 0;
96
-
97
- li {
98
- background: #FFF;
99
- margin-bottom: 10px;
100
- border: 1px solid #dfdfdf;
101
- box-shadow: 0 1px 1px rgba(0,0,0,0.04);
102
-
103
- &.ui-state-highlight {
104
- border: 1px dashed #DDD;
105
- min-height: 50px;
106
- background: #eee;
107
- }
108
-
109
- &.password, &.user_email {
110
- .required-field {
111
- display: none;
112
- }
113
- }
114
-
115
- .wpuf-legend {
116
- .clearfix();
117
-
118
- background: #fff;
119
- color: #464646;
120
- border-bottom: 1px solid #eee;
121
- padding-bottom: 5px;
122
- // margin-bottom: 5px;
123
- padding: 7px 10px;
124
-
125
- &:hover {
126
- cursor: move;
127
- }
128
-
129
- .wpuf-label {
130
- float: left;
131
- width: 70%;
132
- // font-weight: bold;
133
- }
134
-
135
- .wpuf-actions {
136
- float: right;
137
-
138
- a {
139
- // background: #ccc;
140
- font-size: 11px;
141
- padding: 2px 5px;
142
- }
143
-
144
- a.wpuf-remove {
145
- background: transparent url(../images/delete.png) no-repeat 70% 50%;
146
- color: #f00;
147
- width: 16px;
148
- text-indent: -9999px;
149
- display: inline-block;
150
- }
151
-
152
- a.wpuf-toggle {
153
- background: transparent url(../images/arrows.png) no-repeat 0 2px;
154
- width: 10px;
155
- text-indent: -9999px;
156
- display: inline-block;
157
- }
158
- }
159
- }
160
-
161
- .wpuf-form-holder {
162
- padding: 10px;
163
- }
164
-
165
- .wpuf-form-rows {
166
- .clearfix();
167
- padding-bottom: 3px;
168
-
169
- label {
170
- float: left;
171
- width: 20%;
172
- font-size: @fontSize;
173
- }
174
-
175
- textarea {
176
- width: 60%;
177
- }
178
-
179
- .wpuf-form-sub-fields {
180
- width: 77%;
181
- float: left;
182
-
183
- label {
184
- float: none;
185
- display: inline-block;
186
- width: auto;
187
- }
188
-
189
- .wpuf-show-field-value {
190
- margin: 7px 0 7px 0;
191
- }
192
-
193
- .wpuf-option-label-value {
194
- margin: 0;
195
-
196
- span {
197
- font-weight: bold;
198
- margin-left: 5%;
199
- margin-right: 27%;
200
- }
201
- }
202
-
203
- &.wpuf-options {
204
- margin-bottom: 10px;
205
- }
206
- }
207
-
208
- table.address-table {
209
- width: 100%;
210
- margin-bottom: 15px;
211
-
212
- label {
213
- float: none;
214
- width: 100%;
215
- }
216
- }
217
- }
218
- }
219
- }
220
-
221
- .ui-state-highlight { height: 1.5em; line-height: 1.2em; }
222
-
223
- .wpuf-form-template-modal {
224
- background: #fff;
225
- position: fixed;
226
- top: 5%;
227
- bottom: 5%;
228
- right: 10%;
229
- left: 10%;
230
- // display: block;
231
- display: none;
232
- box-shadow: 0 1px 20px 5px rgba(0, 0, 0, 0.1);
233
- z-index: 160000;
234
-
235
- * { box-sizing: border-box; }
236
-
237
-
238
- a.close {
239
- position: absolute;
240
- top: 0;
241
- right: 0;
242
- font: 300 1.71429em "dashicons" !important;
243
- color: #777;
244
- content: '\f335';
245
- display: inline-block;
246
- padding: 10px 20px;
247
- z-index: 5;
248
- text-decoration: none;
249
- height: 50px;
250
- cursor: pointer;
251
- border-left: 1px solid #ddd;
252
-
253
- &:hover {
254
- background: #eee;
255
- opacity: 0.8;
256
- text-decoration: none;
257
- }
258
-
259
- &:active {
260
- background: #eee;
261
- opacity: 0.4;
262
- }
263
- }
264
-
265
- .modal-header {
266
- position: absolute;
267
- top: 0;
268
- left: 0;
269
- right: 0;
270
- height: 50px;
271
- z-index: 4;
272
- border-bottom: 1px solid #ddd;
273
- padding-left: 15px;
274
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
275
-
276
- h2 {
277
- line-height: 50px;
278
- text-align: left;
279
- margin-top: 0;
280
- color: #5d6d74;
281
- font-size: 20px;
282
- text-shadow: 0 1px 1px #fff;
283
-
284
- small {
285
- font-weight: normal;
286
- font-size: 13px;
287
- margin-left: 15px;
288
- }
289
- }
290
- }
291
-
292
- .content-container {
293
- position: absolute;
294
- top: 75px;
295
- right: 0;
296
- bottom: 50px;
297
- left: 0;
298
- overflow: auto;
299
- padding: 2em 2em;
300
- }
301
-
302
- .content {
303
- margin: 0 auto;
304
- max-width: 900px;
305
- text-align: left;
306
-
307
- ul {
308
- width: 100%;
309
- margin: 0;
310
- padding: 0;
311
-
312
- li {
313
- float: left;
314
- width: 31.292517006803%;
315
- border: 1px solid #e4e4e4;
316
- padding: 0;
317
- margin-left: 3.0612244897959%;
318
- margin-bottom: 30px;
319
- position: relative;
320
- min-height: 120px;
321
-
322
- &:hover {
323
- background: #F5F5F5;
324
- }
325
-
326
- a {
327
- text-decoration: none;
328
- color: #555;
329
- padding: 20px;
330
- display: block;
331
- }
332
-
333
- .title {
334
- font-size: 17px;
335
- margin: 0 0 10px 0;
336
- line-height: 23px;
337
- }
338
-
339
- .description {
340
- color: #888;
341
- }
342
-
343
- &:nth-child(3n+1) {
344
- margin-left: 0;
345
- clear: both;
346
- }
347
-
348
- &.template-inactive {
349
- .title,
350
- .description {
351
- color: #ddd;
352
- }
353
- }
354
-
355
- &.blank-form {
356
- text-align: center;
357
-
358
- span {
359
- display: block;
360
- }
361
-
362
- span.dashicons {
363
- font-size: 45px;
364
- color: #ddd;
365
- margin: 0 auto;
366
- width: auto;
367
- height: auto;
368
- }
369
-
370
- span.label {
371
-
372
- }
373
- }
374
- }
375
- }
376
- }
377
-
378
- footer {
379
- position: absolute;
380
- left: 0;
381
- bottom: 0;
382
- width: 100%;
383
- padding: 12px 20px;
384
- border-top: 1px solid #ddd;
385
- background: #fff;
386
- text-align: left;
387
- }
388
- }
389
-
390
- .wpuf-form-template-modal-backdrop {
391
- position: fixed;
392
- z-index: 159999;
393
- top: 0;
394
- left: 0;
395
- right: 0;
396
- bottom: 0;
397
- min-height: 360px;
398
- background: #000;
399
- opacity: .7;
400
- display: none;
401
- }
402
-
403
- /* Smartphones (portrait and landscape) ----------- */
404
- @media only screen
405
- and (min-device-width : 320px)
406
- and (max-device-width : 480px) {
407
- .wpuf-form-template-modal {
408
- .modal-header h2 small {
409
- display: none;
410
- }
411
-
412
- .content {
413
-
414
- ul {
415
- li {
416
- float: none;
417
- width: 100%;
418
- margin-left: 0;
419
- }
420
- }
421
- }
422
- }
423
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/frontend-forms.css DELETED
@@ -1,1096 +0,0 @@
1
- .wpuf-loading {
2
- width: 16px;
3
- height: 16px;
4
- background: url('../images/wpspin_light.gif') no-repeat;
5
- display: inline-block;
6
- }
7
- .wpuf-loading.hide {
8
- display: none;
9
- }
10
- .wpuf-button {
11
- background: #f3f3f3;
12
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#f4f4f4));
13
- background-image: -webkit-linear-gradient(top, #fefefe, #f4f4f4);
14
- background-image: -moz-linear-gradient(top, #fefefe, #f4f4f4);
15
- background-image: -o-linear-gradient(top, #fefefe, #f4f4f4);
16
- background-image: linear-gradient(to bottom, #fefefe, #f4f4f4);
17
- border-color: #bbb;
18
- color: #333;
19
- text-shadow: 0 1px 0 #fff;
20
- }
21
- .wpuf-button:hover,
22
- .wpuf-button:focus {
23
- background: #f3f3f3;
24
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
25
- background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
26
- background-image: -moz-linear-gradient(top, #fff, #f3f3f3);
27
- background-image: -ms-linear-gradient(top, #fff, #f3f3f3);
28
- background-image: -o-linear-gradient(top, #fff, #f3f3f3);
29
- background-image: linear-gradient(to bottom, #fff, #f3f3f3);
30
- border-color: #999;
31
- color: #222;
32
- }
33
- .wpuf-success {
34
- background-color: #dff0d8;
35
- border: 1px solid #d6e9c6;
36
- color: #3c763d;
37
- padding: 10px;
38
- margin: 10px 0 20px 0;
39
- }
40
- .wpuf-error {
41
- background-color: #f2dede;
42
- color: #a94442;
43
- border: 1px solid #ebccd1;
44
- margin: 10px 0 20px 0;
45
- padding: 10px;
46
- -webkit-border-radius: 3px;
47
- -moz-border-radius: 3px;
48
- border-radius: 3px;
49
- font-size: 13px;
50
- }
51
- .wpuf-message {
52
- background: #fcf8e3;
53
- border: 1px solid #faebcc;
54
- color: #8a6d3b;
55
- margin: 10px 0 20px 0;
56
- padding: 10px;
57
- -webkit-border-radius: 3px;
58
- -moz-border-radius: 3px;
59
- border-radius: 3px;
60
- font-size: 13px;
61
- }
62
- .wpuf-info {
63
- background-color: #fef5be;
64
- border: 2px solid #fdd425;
65
- border-radius: 5px;
66
- -moz-border-radius: 5px;
67
- -webkit-border-radius: 5px;
68
- padding: 5px 10px;
69
- margin: 0 0 10px 0;
70
- font-size: 13px;
71
- }
72
- ul.wpuf-form {
73
- list-style: none !important;
74
- margin: 0 !important;
75
- padding: 0 !important;
76
- width: 100%;
77
- }
78
- ul.wpuf-form li {
79
- margin-left: 0;
80
- margin-bottom: 10px;
81
- padding: 10px;
82
- }
83
- ul.wpuf-form li:after {
84
- clear: both;
85
- content: "";
86
- display: table;
87
- }
88
- ul.wpuf-form li.has-error {
89
- background: #FFE4E4;
90
- }
91
- ul.wpuf-form li .wp-editor-wrap {
92
- border: 1px solid #eee;
93
- }
94
- ul.wpuf-form li .wpuf-label {
95
- float: left;
96
- width: 25%;
97
- min-height: 1px;
98
- }
99
- ul.wpuf-form li .wpuf-label .required {
100
- color: red;
101
- }
102
- ul.wpuf-form li .wpuf-fields {
103
- float: left;
104
- width: 75%;
105
- }
106
- ul.wpuf-form li .wpuf-fields input[type=text],
107
- ul.wpuf-form li .wpuf-fields input[type=password],
108
- ul.wpuf-form li .wpuf-fields input[type=email],
109
- ul.wpuf-form li .wpuf-fields input[type=url],
110
- ul.wpuf-form li .wpuf-fields input[type=number],
111
- ul.wpuf-form li .wpuf-fields textarea {
112
- background: #fafafa;
113
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
114
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
115
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
116
- border: 1px solid #ddd;
117
- color: #888;
118
- }
119
- ul.wpuf-form li .wpuf-fields input[type=text]:focus,
120
- ul.wpuf-form li .wpuf-fields input[type=password]:focus,
121
- ul.wpuf-form li .wpuf-fields input[type=email]:focus,
122
- ul.wpuf-form li .wpuf-fields input[type=url]:focus,
123
- ul.wpuf-form li .wpuf-fields input[type=number]:focus,
124
- ul.wpuf-form li .wpuf-fields textarea:focus {
125
- color: #373737;
126
- }
127
- ul.wpuf-form li .wpuf-fields textarea {
128
- padding-left: 3px;
129
- width: 98%;
130
- }
131
- ul.wpuf-form li .wpuf-fields input[type=text],
132
- ul.wpuf-form li .wpuf-fields input[type=password],
133
- ul.wpuf-form li .wpuf-fields input[type=email],
134
- ul.wpuf-form li .wpuf-fields input[type=url],
135
- ul.wpuf-form li .wpuf-fields input[type=number] {
136
- padding: 5px;
137
- }
138
- ul.wpuf-form li .wpuf-fields select {
139
- border: 1px solid #eee;
140
- padding: 2px;
141
- height: 2em;
142
- -webkit-border-radius: 3px;
143
- -moz-border-radius: 3px;
144
- border-radius: 3px;
145
- min-width: 150px;
146
- }
147
- ul.wpuf-form li .wpuf-fields select[multiple] {
148
- height: auto;
149
- }
150
- ul.wpuf-form li .wpuf-fields a.file-selector {
151
- display: inline;
152
- padding: 5px 12px;
153
- height: 30px;
154
- line-height: 28px;
155
- border: 1px solid #ccc;
156
- -webkit-border-radius: 3px;
157
- -moz-border-radius: 3px;
158
- border-radius: 3px;
159
- background-color: #21759b;
160
- background-image: -webkit-gradient(linear, left top, left bottom, from(#2a95c5), to(#21759b));
161
- background-image: -webkit-linear-gradient(top, #2a95c5, #21759b);
162
- background-image: -moz-linear-gradient(top, #2a95c5, #21759b);
163
- background-image: -ms-linear-gradient(top, #2a95c5, #21759b);
164
- background-image: -o-linear-gradient(top, #2a95c5, #21759b);
165
- background-image: linear-gradient(to bottom, #2a95c5, #21759b);
166
- border-color: #21759b;
167
- border-bottom-color: #1e6a8d;
168
- -webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.5);
169
- box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.5);
170
- color: #fff;
171
- text-decoration: none;
172
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
173
- }
174
- ul.wpuf-form li .wpuf-fields a.file-selector:hover,
175
- ul.wpuf-form li .wpuf-fields a.file-selector:focus {
176
- background-color: #278ab7;
177
- background-image: -webkit-gradient(linear, left top, left bottom, from(#2e9fd2), to(#21759b));
178
- background-image: -webkit-linear-gradient(top, #2e9fd2, #21759b);
179
- background-image: -moz-linear-gradient(top, #2e9fd2, #21759b);
180
- background-image: -ms-linear-gradient(top, #2e9fd2, #21759b);
181
- background-image: -o-linear-gradient(top, #2e9fd2, #21759b);
182
- background-image: linear-gradient(to bottom, #2e9fd2, #21759b);
183
- border-color: #1b607f;
184
- -webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.6);
185
- box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.6);
186
- color: #fff;
187
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
188
- }
189
- ul.wpuf-form li .wpuf-fields .google-map img {
190
- max-width: none !important;
191
- }
192
- ul.wpuf-form li .wpuf-fields .wpuf-help {
193
- color: #666;
194
- margin: 2px 0 5px 0;
195
- font-size: 12px;
196
- font-style: italic;
197
- font-family: sans-serif;
198
- display: block;
199
- }
200
- ul.wpuf-form li .wpuf-fields table,
201
- ul.wpuf-form li .wpuf-fields td {
202
- border: none;
203
- margin: 0;
204
- }
205
- ul.wpuf-form li .wpuf-fields table {
206
- width: 100%;
207
- }
208
- ul.wpuf-form li .wpuf-fields img.wpuf-clone-field,
209
- ul.wpuf-form li .wpuf-fields img.wpuf-remove-field {
210
- cursor: pointer;
211
- margin: 0 3px;
212
- box-shadow: none;
213
- border: none;
214
- }
215
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list {
216
- list-style: none;
217
- margin: 5px 0 0 0;
218
- padding: 0;
219
- }
220
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li {
221
- display: inline-block;
222
- border: 1px solid #eee;
223
- padding: 5px;
224
- width: 150px;
225
- margin-right: 5px;
226
- -webkit-border-radius: 5px;
227
- -moz-border-radius: 5px;
228
- border-radius: 5px;
229
- }
230
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li .wpuf-file-input-wrap {
231
- margin: 10px 0;
232
- }
233
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li .wpuf-file-input-wrap input,
234
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li .wpuf-file-input-wrap textarea {
235
- border: 1px solid #eee;
236
- width: 93%;
237
- }
238
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li .attachment-name {
239
- text-align: center;
240
- }
241
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li a.attachment-delete,
242
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li a.wpuf-delete-avatar {
243
- text-decoration: none;
244
- padding: 3px 12px;
245
- border: 1px solid #C47272;
246
- color: #ffffff;
247
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
248
- -webkit-border-radius: 3px;
249
- -moz-border-radius: 3px;
250
- border-radius: 3px;
251
- background-color: #da4f49;
252
- background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
253
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
254
- background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
255
- background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
256
- background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
257
- background-repeat: repeat-x;
258
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
259
- border-color: #bd362f #bd362f #802420;
260
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
261
- *background-color: #bd362f;
262
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
263
- }
264
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li a.attachment-delete:hover,
265
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li a.wpuf-delete-avatar:hover,
266
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li a.attachment-delete:active,
267
- ul.wpuf-form li .wpuf-fields ul.wpuf-attachment-list li a.wpuf-delete-avatar:active {
268
- color: #ffffff;
269
- background-color: #bd362f;
270
- *background-color: #a9302a;
271
- }
272
- ul.wpuf-form li .wpuf-fields .progress {
273
- background: -moz-linear-gradient(center bottom, #FFFFFF 0%, #F7F7F7 100%) repeat scroll 0 0 #FFFFFF;
274
- border: 1px solid #D1D1D1;
275
- border-radius: 3px 3px 3px 3px;
276
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.1) inset;
277
- float: right;
278
- height: 22px;
279
- line-height: 2em;
280
- margin: 0;
281
- overflow: hidden;
282
- padding: 0;
283
- width: 200px;
284
- }
285
- ul.wpuf-form li .wpuf-fields .bar {
286
- background-color: #83B4D8;
287
- background-image: -moz-linear-gradient(center bottom, #72A7CF 0%, #90C5EE 100%);
288
- border-radius: 3px 3px 3px 3px;
289
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
290
- height: 100%;
291
- width: 0;
292
- z-index: 9;
293
- }
294
- ul.wpuf-form li .wpuf-fields .progress .percent {
295
- color: rgba(0, 0, 0, 0.6);
296
- padding: 0 8px;
297
- position: relative;
298
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
299
- width: 200px;
300
- z-index: 10;
301
- }
302
- ul.wpuf-form li .wpuf-fields ul.wpuf-category-checklist {
303
- list-style: none;
304
- margin: 0;
305
- padding: 0;
306
- }
307
- ul.wpuf-form li .wpuf-fields ul.wpuf-category-checklist li {
308
- margin-bottom: 5px;
309
- padding: 0;
310
- }
311
- ul.wpuf-form li .wpuf-fields ul.wpuf-category-checklist ul.children {
312
- list-style: none;
313
- margin-left: 25px;
314
- }
315
- ul.wpuf-form li .wpuf-fields #wpuf-insert-image-container {
316
- margin-bottom: 3px;
317
- }
318
- ul.wpuf-form li .wpuf-fields #wpuf-insert-image-container:after {
319
- clear: both;
320
- content: "";
321
- display: table;
322
- }
323
- ul.wpuf-form li .wpuf-fields #wpuf-insert-image-container a.wpuf-insert-image {
324
- text-decoration: none;
325
- border: 1px solid #DFDFDF;
326
- font-size: 11px;
327
- -webkit-border-radius: 3px;
328
- -moz-border-radius: 3px;
329
- border-radius: 3px;
330
- padding: 4px 6px;
331
- margin-right: 10px;
332
- }
333
- ul.wpuf-form li .wpuf-fields #wpuf-insert-image-container a.wpuf-insert-image .wpuf-media-icon {
334
- height: 12px;
335
- width: 12px;
336
- }
337
- ul.wpuf-form li .wpuf-fields .wpuf-fields-list {
338
- box-sizing: border-box;
339
- margin: 0;
340
- padding: 0;
341
- list-style: none;
342
- }
343
- ul.wpuf-form li .wpuf-fields .wpuf-fields-list li {
344
- padding: 0;
345
- margin: 0 0 6px;
346
- }
347
- ul.wpuf-form li .wpuf-fields .wpuf-fields-list.wpuf-list-inline {
348
- margin-left: -5px;
349
- }
350
- ul.wpuf-form li .wpuf-fields .wpuf-fields-list.wpuf-list-inline li {
351
- display: inline-block;
352
- padding-left: 5px;
353
- padding-right: 5px;
354
- }
355
- ul.wpuf-form li .wpuf-fields table.wpuf-repeatable-field {
356
- border-collapse: collapse;
357
- }
358
- ul.wpuf-form li .wpuf-fields table.wpuf-repeatable-field * {
359
- box-sizing: border-box;
360
- }
361
- ul.wpuf-form li .wpuf-fields table.wpuf-repeatable-field input {
362
- width: 100%;
363
- }
364
- ul.wpuf-form li .wpuf-fields table.wpuf-repeatable-field .wpuf-repeater-buttons {
365
- width: 75px;
366
- padding-left: 12px;
367
- }
368
- ul.wpuf-form li .wpuf-fields table.wpuf-repeatable-field .wpuf-repeater-buttons img {
369
- width: 100%;
370
- height: auto;
371
- }
372
- ul.wpuf-form li .wpuf-fields table.wpuf-repeatable-field .wpuf-repeater-buttons i {
373
- display: inline-block;
374
- width: 15px;
375
- height: 15px;
376
- margin: 2px 4px 0 0;
377
- }
378
- ul.wpuf-form li .wpuf-address-field {
379
- width: 100%;
380
- margin-bottom: 10px;
381
- }
382
- ul.wpuf-form li .wpuf-address-field:after {
383
- clear: both;
384
- content: "";
385
- display: table;
386
- }
387
- ul.wpuf-form li .wpuf-section-wrap {
388
- border-bottom: 1px solid #ccc;
389
- margin: 15px 0;
390
- }
391
- ul.wpuf-form li .wpuf-section-wrap h2.wpuf-section-title {
392
- margin: 0;
393
- }
394
- ul.wpuf-form li .wpuf-section-wrap .wpuf-section-details {
395
- padding: 4px 0 8px;
396
- font-size: 12px;
397
- }
398
- ul.wpuf-form .wpuf-submit input[type=submit] {
399
- font-size: 16px;
400
- padding: 5px 15px;
401
- border: 1px solid #ccc;
402
- -webkit-border-radius: 3px;
403
- -moz-border-radius: 3px;
404
- border-radius: 3px;
405
- background-color: #21759b;
406
- background-image: -webkit-gradient(linear, left top, left bottom, from(#2a95c5), to(#21759b));
407
- background-image: -webkit-linear-gradient(top, #2a95c5, #21759b);
408
- background-image: -moz-linear-gradient(top, #2a95c5, #21759b);
409
- background-image: -ms-linear-gradient(top, #2a95c5, #21759b);
410
- background-image: -o-linear-gradient(top, #2a95c5, #21759b);
411
- background-image: linear-gradient(to bottom, #2a95c5, #21759b);
412
- border-color: #21759b;
413
- border-bottom-color: #1e6a8d;
414
- -webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.5);
415
- box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.5);
416
- color: #fff;
417
- text-decoration: none;
418
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
419
- }
420
- ul.wpuf-form .wpuf-submit .button-primary-disabled {
421
- color: #94cde7 !important;
422
- background: #298cba !important;
423
- border-color: #1b607f !important;
424
- -webkit-box-shadow: none !important;
425
- box-shadow: none !important;
426
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
427
- cursor: default;
428
- }
429
- ul.wpuf-form .wpuf-submit .wpuf-errors {
430
- background: #FFE4E4;
431
- border: 1px solid #ffb1b1;
432
- margin: 10px 0;
433
- padding: 10px;
434
- -webkit-border-radius: 3px;
435
- -moz-border-radius: 3px;
436
- border-radius: 3px;
437
- font-size: 13px;
438
- }
439
- #wpuf-login-form label {
440
- display: block;
441
- }
442
- #wpuf-login-form .forgetmenot label {
443
- display: inline-block;
444
- }
445
- .wpuf_sub_info {
446
- padding: 0;
447
- margin: 10px 5px;
448
- border: 1px solid #eee;
449
- border-radius: 3px;
450
- }
451
- .wpuf_sub_info h3 {
452
- background-color: #f1f1f1;
453
- padding: 10px;
454
- margin: 0 0 5px 0 !important;
455
- font-weight: 300 !important;
456
- }
457
- .wpuf_sub_info .wpuf-text {
458
- padding: 5px 10px;
459
- }
460
- .wpuf_sub_info .wpuf-expire {
461
- border-top: 1px solid #eee;
462
- padding-top: 5px;
463
- margin-top: 5px;
464
- }
465
- .wpuf-coupon-info-wrap {
466
- border: 1px solid #eee;
467
- padding: 15px;
468
- margin-bottom: 20px;
469
- }
470
- .wpuf-coupon-info-wrap .wpuf-coupon-field-spinner {
471
- background: url('../images/wpspin_light.gif') no-repeat right scroll rgba(0, 0, 0, 0);
472
- }
473
- .wpuf-coupon-info-wrap .wpuf-copon-show {
474
- background: #EEEEEE;
475
- border-radius: 3px;
476
- border-width: 1px;
477
- box-shadow: 0 1px 0 rgba(217, 217, 217, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15);
478
- color: #5C5A5A;
479
- cursor: pointer;
480
- display: inline-block;
481
- font-size: 14px;
482
- padding: 5px 12px;
483
- text-decoration: none;
484
- width: 175px;
485
- margin-bottom: 8px;
486
- }
487
- .wpuf-coupon-info-wrap .wpuf-copon-wrap {
488
- margin: 15px 0;
489
- }
490
- .wpuf-coupon-info-wrap .wpuf-pack-info {
491
- margin-bottom: 20px;
492
- }
493
- .wpuf-coupon-info-wrap .wpuf-pack-info h3 {
494
- margin: 0 0 10px 0;
495
- padding: 0 0 10px 0;
496
- border-bottom: 1px solid #eee;
497
- }
498
- .wpuf-coupon-info-wrap .wpuf-pack-info h3 a {
499
- float: right;
500
- text-decoration: none;
501
- background: #64C3DE;
502
- color: #fff;
503
- padding: 3px 8px;
504
- font-size: 14px;
505
- }
506
- .wpuf-coupon-info-wrap .wpuf-copon-show:hover {
507
- background: none repeat scroll 0 0 #1E8CBE;
508
- border-color: #0074A2;
509
- box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6) inset;
510
- color: #FFFFFF;
511
- }
512
- .wpuf-coupon-info-wrap a.wpuf-apply-coupon {
513
- text-decoration: none;
514
- font-size: 11px;
515
- margin-top: 10px;
516
- margin-right: 10px;
517
- background: #21759b;
518
- color: #fff;
519
- padding: 5px 10px;
520
- display: inline-block;
521
- -webkit-border-radius: 3px;
522
- -moz-border-radius: 3px;
523
- border-radius: 3px;
524
- }
525
- .wpuf-coupon-info-wrap .wpuf-copon-cancel {
526
- text-decoration: none;
527
- font-size: 11px;
528
- }
529
- .entry-content ul.wpuf_packs,
530
- ul.wpuf_packs {
531
- overflow: hidden;
532
- margin: 15px;
533
- }
534
- .entry-content ul.wpuf_packs > li,
535
- ul.wpuf_packs > li {
536
- background: #fff;
537
- border: 1px solid #DDD;
538
- border-radius: 5px 5px 5px 5px;
539
- float: left;
540
- list-style: none outside none;
541
- margin: 5px 25px 25px 0;
542
- position: relative;
543
- width: 200px;
544
- box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
545
- }
546
- .entry-content ul.wpuf_packs > li:first-child,
547
- ul.wpuf_packs > li:first-child {
548
- margin-left: 5px;
549
- }
550
- .entry-content ul.wpuf_packs h3,
551
- ul.wpuf_packs h3 {
552
- background: #52B5D5;
553
- color: #fff;
554
- font-size: 18px;
555
- font-weight: normal;
556
- margin: 0;
557
- padding: 10px !important;
558
- text-align: center;
559
- border-bottom: 1px solid #3dacd0;
560
- }
561
- .entry-content ul.wpuf_packs .wpuf-pricing-wrap,
562
- ul.wpuf_packs .wpuf-pricing-wrap {
563
- background: #64C3DE;
564
- }
565
- .entry-content ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount,
566
- ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount {
567
- position: relative;
568
- text-align: center;
569
- color: #FFF;
570
- border-bottom: 1px solid #4fbbda;
571
- padding: 10px 0;
572
- }
573
- .entry-content ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount .wpuf-sub-symbol,
574
- ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount .wpuf-sub-symbol {
575
- font-size: 19px;
576
- position: absolute;
577
- top: 25px;
578
- line-height: 10px;
579
- }
580
- .entry-content ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount .wpuf-sub-cost,
581
- ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount .wpuf-sub-cost {
582
- font-size: 40px;
583
- margin-left: 10px;
584
- line-height: 50px;
585
- }
586
- .entry-content ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount .wpuf-pack-cycle,
587
- ul.wpuf_packs .wpuf-pricing-wrap .wpuf-sub-amount .wpuf-pack-cycle {
588
- font-size: 13px;
589
- padding-bottom: 5px;
590
- }
591
- .entry-content ul.wpuf_packs .wpuf-sub-body,
592
- ul.wpuf_packs .wpuf-sub-body {
593
- margin: 0;
594
- padding: 8px 0 0 8px;
595
- background: #fff;
596
- font-size: 11px;
597
- color: #999;
598
- }
599
- .entry-content ul.wpuf_packs .wpuf-sub-button,
600
- ul.wpuf_packs .wpuf-sub-button {
601
- text-align: center;
602
- margin-bottom: 20px;
603
- margin-top: 20px;
604
- overflow: hidden;
605
- }
606
- .entry-content ul.wpuf_packs .wpuf-sub-button a,
607
- ul.wpuf_packs .wpuf-sub-button a {
608
- background: #64C3DE;
609
- color: #fff;
610
- text-decoration: none;
611
- padding: 5px 10px;
612
- -webkit-border-radius: 3px;
613
- -moz-border-radius: 3px;
614
- border-radius: 3px;
615
- display: inline-block;
616
- }
617
- .entry-content ul.wpuf_packs .wpuf-sub-button a:hover,
618
- ul.wpuf_packs .wpuf-sub-button a:hover {
619
- background: #3ab3d5;
620
- }
621
- .entry-content ul.wpuf_packs .wpuf-sub-button a:hover,
622
- ul.wpuf_packs .wpuf-sub-button a:hover {
623
- background: none repeat scroll 0 0 #1E8CBE;
624
- border-color: #0074A2;
625
- box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6) inset;
626
- color: #FFFFFF;
627
- }
628
- .entry-content ul.wpuf_packs .wpuf-sub-desciption,
629
- ul.wpuf_packs .wpuf-sub-desciption {
630
- margin-top: 15px;
631
- }
632
- .entry-content ul.wpuf_packs .wpuf-sub-desciption ul,
633
- ul.wpuf_packs .wpuf-sub-desciption ul,
634
- .entry-content ul.wpuf_packs .wpuf-sub-desciption li,
635
- ul.wpuf_packs .wpuf-sub-desciption li {
636
- margin: 0;
637
- padding: 0;
638
- list-style: none;
639
- }
640
- .entry-content ul.wpuf_packs .wpuf-sub-desciption li,
641
- ul.wpuf_packs .wpuf-sub-desciption li {
642
- text-align: center;
643
- border-top: 1px solid #eee;
644
- padding: 7px 0;
645
- }
646
- .entry-content ul.wpuf_packs .wpuf-sub-desciption li:last-child,
647
- ul.wpuf_packs .wpuf-sub-desciption li:last-child {
648
- border-bottom: 1px solid #eee;
649
- }
650
- .entry-content ul.wpuf_packs .wpuf-sub-desciption li:first-child,
651
- ul.wpuf_packs .wpuf-sub-desciption li:first-child {
652
- border-top: none;
653
- }
654
- .entry-content ul.wpuf_packs .wpuf-sub-desciption p,
655
- ul.wpuf_packs .wpuf-sub-desciption p {
656
- padding: 0 10px;
657
- margin-bottom: 15px;
658
- }
659
- .entry-content ul.wpuf_packs .button,
660
- ul.wpuf_packs .button {
661
- background: none repeat scroll 0 0 #2EA2CC;
662
- border-color: #0074A2;
663
- box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15);
664
- color: #FFFFFF;
665
- text-decoration: none;
666
- padding: 0 12px 2px;
667
- color: #fff;
668
- }
669
- .entry-content ul.wpuf_packs .cost,
670
- ul.wpuf_packs .cost {
671
- background: red;
672
- border-radius: 30px 30px 30px 30px;
673
- color: #FFFFFF;
674
- margin: -16px -12px 0 0;
675
- padding: 10px 8px 8px;
676
- position: absolute;
677
- right: 0;
678
- top: 0;
679
- }
680
- /* css for timepicker */
681
- .ui-timepicker-div .ui-widget-header {
682
- margin-bottom: 8px;
683
- }
684
- .ui-timepicker-div dl {
685
- text-align: left;
686
- }
687
- .ui-timepicker-div dl dt {
688
- height: 25px;
689
- margin-bottom: -25px;
690
- }
691
- .ui-timepicker-div dl dd {
692
- margin: 0 10px 10px 65px;
693
- }
694
- .ui-timepicker-div td {
695
- font-size: 90%;
696
- }
697
- .ui-tpicker-grid-label {
698
- background: none;
699
- border: none;
700
- margin: 0;
701
- padding: 0;
702
- }
703
- .ui-timepicker-rtl {
704
- direction: rtl;
705
- }
706
- .ui-timepicker-rtl dl {
707
- text-align: right;
708
- }
709
- .ui-timepicker-rtl dl dd {
710
- margin: 0 65px 10px 10px;
711
- }
712
- #pass-strength-result {
713
- border-style: solid;
714
- border-width: 1px;
715
- float: left;
716
- margin: 0;
717
- padding: 3px 5px;
718
- text-align: center;
719
- width: 200px;
720
- display: none;
721
- background-color: #eee;
722
- border-color: #ddd !important;
723
- }
724
- #pass-strength-result.bad {
725
- background-color: #ffb78c;
726
- border-color: #ff853c !important;
727
- }
728
- #pass-strength-result.good {
729
- background-color: #ffec8b;
730
- border-color: #fc0 !important;
731
- }
732
- #pass-strength-result.short {
733
- background-color: #ffa0a0;
734
- border-color: #f04040 !important;
735
- }
736
- #pass-strength-result.strong {
737
- background-color: #c3ff88;
738
- border-color: #8dff1c !important;
739
- }
740
- .password[type="text"] {
741
- display: none;
742
- }
743
- table.wpuf-table {
744
- border: 1px solid #E7E7E7;
745
- margin: 0 0px 10px 0;
746
- text-align: left;
747
- width: 100%;
748
- }
749
- table.wpuf-table thead th,
750
- table.wpuf-table th {
751
- color: #888888;
752
- font-size: 12px;
753
- font-weight: bold;
754
- line-height: 18px;
755
- padding: 9px 24px;
756
- }
757
- table.wpuf-table td {
758
- border-top: 1px solid #E7E7E7;
759
- padding: 6px 24px;
760
- }
761
- #wpuf-payment-gateway ul.wpuf-payment-gateways {
762
- list-style: none;
763
- margin: 10px 0;
764
- }
765
- #wpuf-payment-gateway ul.wpuf-payment-gateways li {
766
- margin: 0;
767
- }
768
- #wpuf-payment-gateway ul.wpuf-payment-gateways li .wpuf-payment-instruction {
769
- padding: 8px 10px;
770
- margin: 0 10px;
771
- }
772
- #wpuf-payment-gateway ul.wpuf-payment-gateways li .wpuf-instruction {
773
- padding: 8px 10px;
774
- margin-bottom: 10px;
775
- background: #ebe8eb;
776
- font-size: 13px;
777
- -webkit-border-radius: 2px;
778
- -moz-border-radius: 2px;
779
- border-radius: 2px;
780
- }
781
- .wpuf-pagination div.pagination {
782
- text-align: center;
783
- padding: 7px;
784
- margin: 3px;
785
- }
786
- .wpuf-pagination .page-numbers {
787
- padding: 2px 8px;
788
- margin: 2px;
789
- border: 1px solid #4A5154;
790
- text-decoration: none;
791
- color: #4A5154;
792
- background: #fff;
793
- border-radius: 5px;
794
- -moz-border-radius: 5px;
795
- }
796
- .wpuf-pagination .page-numbers:hover,
797
- .wpuf-pagination .page-numbers:active {
798
- border: 1px solid #4A5154;
799
- background-color: #4A5154;
800
- color: #fff;
801
- border-radius: 5px;
802
- -moz-border-radius: 5px;
803
- }
804
- .wpuf-pagination .page-numbers.current {
805
- padding: 2px 8px;
806
- margin: 2px;
807
- border: 1px solid #4A5154;
808
- font-weight: bold;
809
- background-color: #4A5154;
810
- color: #FFF;
811
- border-radius: 5px;
812
- -moz-border-radius: 5px;
813
- }
814
- /** author info **/
815
- .wpuf-author {
816
- margin: 20px 0;
817
- }
818
- .wpuf-author:after {
819
- clear: both;
820
- content: "";
821
- display: table;
822
- }
823
- .wpuf-author h3 {
824
- margin: 0 !important;
825
- background: #CFCFCF;
826
- text-align: left;
827
- padding: 3px 10px;
828
- }
829
- .wpuf-author .wpuf-author-inside {
830
- background: none repeat scroll 0 0 #F0F0F0;
831
- border-bottom: 2px solid #DDDDDD;
832
- height: auto;
833
- padding-left: 10px;
834
- padding-top: 15px;
835
- margin-bottom: 15px;
836
- }
837
- .wpuf-author .wpuf-author-inside:after {
838
- clear: both;
839
- content: "";
840
- display: table;
841
- }
842
- .wpuf-author .wpuf-author-inside .wpuf-user-image {
843
- float: left;
844
- padding-right: 15px;
845
- }
846
- .wpuf-author .wpuf-author-inside p {
847
- margin-bottom: 10px !important;
848
- }
849
- .wpuf-author .wpuf-author-inside p.wpuf-author-info {
850
- padding-top: 8px;
851
- word-wrap: break-word;
852
- }
853
- .wpuf-author .wpuf-author-inside p.wpuf-user-name a {
854
- color: #335160;
855
- font-size: 1.2em;
856
- font-weight: bold;
857
- }
858
- /** jQuery Suggest **/
859
- .ac_results {
860
- padding: 0;
861
- margin: 0;
862
- list-style: none;
863
- position: absolute;
864
- z-index: 10000;
865
- display: none;
866
- border: 1px solid #ccc;
867
- }
868
- .ac_results li {
869
- padding: 2px 5px;
870
- white-space: nowrap;
871
- text-align: left;
872
- }
873
- .ac_over {
874
- cursor: pointer;
875
- }
876
- .ac_match {
877
- text-decoration: underline;
878
- }
879
- /*------------------------------------
880
- * Multistep form
881
- *-----------------------------------*/
882
- fieldset.wpuf-multistep-fieldset {
883
- position: relative;
884
- padding-bottom: 50px;
885
- border: none;
886
- display: none;
887
- }
888
- fieldset.wpuf-multistep-fieldset.field-active {
889
- display: block;
890
- }
891
- fieldset.wpuf-multistep-fieldset .wpuf-multistep-prev-btn,
892
- fieldset.wpuf-multistep-fieldset .wpuf-multistep-next-btn {
893
- position: absolute;
894
- bottom: 5px;
895
- }
896
- fieldset.wpuf-multistep-fieldset .wpuf-multistep-prev-btn {
897
- left: 10px;
898
- }
899
- fieldset.wpuf-multistep-fieldset .wpuf-multistep-next-btn {
900
- right: 10px;
901
- }
902
- .wpuf-multistep-progressbar {
903
- overflow: hidden;
904
- }
905
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard {
906
- margin: 20px 0 40px 0;
907
- padding: 0;
908
- list-style: none;
909
- }
910
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard * {
911
- box-sizing: border-box;
912
- }
913
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li {
914
- background-color: #E4E4E4;
915
- border-radius: 5px;
916
- display: inline-block;
917
- padding: 10px 30px 10px 40px;
918
- margin-right: -7px;
919
- width: auto;
920
- margin: 0;
921
- position: relative;
922
- text-align: center;
923
- }
924
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li::before,
925
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li::after {
926
- border: solid transparent;
927
- content: " ";
928
- height: 0;
929
- width: 0;
930
- position: absolute;
931
- border-color: transparent;
932
- border-left-color: #fff;
933
- border-radius: 10px;
934
- }
935
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li::before {
936
- border-width: 26px;
937
- margin-top: -14px;
938
- right: -50px;
939
- z-index: 98;
940
- }
941
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li::after {
942
- border-left-color: #E4E4E4;
943
- border-width: 25px;
944
- margin-top: -37px;
945
- right: -44px;
946
- z-index: 99;
947
- }
948
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li.active-step {
949
- background-color: #00a0d2;
950
- color: #fff;
951
- }
952
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li.active-step::after {
953
- border-left-color: #00a0d2;
954
- }
955
- .wpuf-form .wpuf-multistep-progressbar ul.wpuf-step-wizard li:last-child::after {
956
- border-left-color: transparent;
957
- }
958
- .wpuf-form .wpuf-multistep-progressbar .ui-widget-header {
959
- background: #00a0d2;
960
- }
961
- .wpuf-form .wpuf-multistep-progressbar.ui-progressbar {
962
- margin-bottom: 30px;
963
- height: 25px;
964
- border: 1px solid #eee;
965
- position: relative;
966
- }
967
- .wpuf-form .wpuf-multistep-progressbar.ui-progressbar .wpuf-progress-percentage {
968
- position: absolute;
969
- left: 50%;
970
- font-size: 12px;
971
- font-weight: bold;
972
- text-shadow: 1px 1px 0 #fff;
973
- top: 20%;
974
- }
975
- input.wpuf-btn {
976
- text-decoration: none !important;
977
- font-size: 15px !important;
978
- margin-top: 10px;
979
- margin-right: 10px;
980
- background: #21759b !important;
981
- color: #fff !important;
982
- padding: 5px 10px;
983
- display: inline-block;
984
- -webkit-border-radius: 3px !important;
985
- -moz-border-radius: 3px !important;
986
- border-radius: 3px !important;
987
- border: none !important;
988
- }
989
- /*rtl*/
990
- body.rtl ul.wpuf-form li .wpuf-label {
991
- float: right;
992
- }
993
- @media (max-width: 480px) {
994
- ul.wpuf-form li .wpuf-label,
995
- ul.wpuf-form li .wpuf-fields {
996
- float: none;
997
- width: 100%;
998
- }
999
- }
1000
- .wpuf-form .required {
1001
- color: red;
1002
- font-weight: 700;
1003
- border: 0;
1004
- }
1005
- .wpuf-dashboard-container .wpuf-dashboard-navigation {
1006
- width: 30%;
1007
- float: left;
1008
- }
1009
- .wpuf-dashboard-container .wpuf-dashboard-navigation a {
1010
- text-decoration: none;
1011
- box-shadow: none;
1012
- }
1013
- .wpuf-dashboard-container .wpuf-dashboard-navigation ul {
1014
- list-style: none;
1015
- }
1016
- .wpuf-dashboard-container .wpuf-dashboard-navigation ul li {
1017
- padding-bottom: 2px;
1018
- }
1019
- .wpuf-dashboard-container .wpuf-dashboard-content {
1020
- width: 68%;
1021
- float: right;
1022
- }
1023
- .wpuf-dashboard-container table.items-table {
1024
- border: 0;
1025
- }
1026
- .wpuf-dashboard-container table.items-table a {
1027
- text-decoration: none;
1028
- box-shadow: none;
1029
- }
1030
- .wpuf-dashboard-container table.items-table th,
1031
- .wpuf-dashboard-container table.items-table td {
1032
- border: 0;
1033
- padding: 10px;
1034
- }
1035
- .wpuf-dashboard-container table.items-table tr {
1036
- outline: 1px solid #f1f1f1;
1037
- }
1038
- .wpuf-dashboard-container table.items-table .items-list-header {
1039
- background-color: #f1f1f1;
1040
- }
1041
- .wpuf-dashboard-container .wpuf-update-profile-form .form-row-first {
1042
- float: left;
1043
- width: 47%;
1044
- overflow: visible;
1045
- }
1046
- .wpuf-dashboard-container .wpuf-update-profile-form .form-row-last {
1047
- float: right;
1048
- width: 47%;
1049
- overflow: visible;
1050
- }
1051
- .wpuf-toc-container .wpuf-fields {
1052
- position: relative;
1053
- }
1054
- .wpuf-toc-container .wpuf-fields .wpuf-toc-checkbox {
1055
- position: absolute;
1056
- top: 0;
1057
- left: 0;
1058
- }
1059
- .wpuf-toc-container .wpuf-fields.has-toc-checkbox .wpuf-toc-description {
1060
- margin-left: 25px;
1061
- }
1062
- .wpuf-field-google-map {
1063
- height: 300px;
1064
- width: 100%;
1065
- }
1066
- .wpuf-form-google-map {
1067
- height: 300px;
1068
- width: 100%;
1069
- }
1070
- input[type="text"].wpuf-google-map-search {
1071
- margin-top: 10px !important;
1072
- border: 1px solid transparent !important;
1073
- border-radius: 2px 0 0 2px !important;
1074
- box-sizing: border-box !important;
1075
- -moz-box-sizing: border-box !important;
1076
- height: 32px !important;
1077
- outline: none !important;
1078
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
1079
- background-color: #fff !important;
1080
- text-overflow: ellipsis !important;
1081
- width: 170px !important;
1082
- font-family: Roboto !important;
1083
- font-size: 15px !important;
1084
- font-weight: 300 !important;
1085
- padding: 0 11px 0 13px !important;
1086
- display: none;
1087
- }
1088
- .gm-style input[type="text"].wpuf-google-map-search {
1089
- display: block;
1090
- }
1091
- .wpuf-form-google-map-container input[type="text"].wpuf-google-map-search {
1092
- width: 230px !important;
1093
- }
1094
- .wpuf-form-google-map-container.hide-search-box .gm-style input[type="text"].wpuf-google-map-search {
1095
- display: none;
1096
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/frontend-forms.less DELETED
@@ -1,1219 +0,0 @@
1
- @borderColor: #eee;
2
- @mainColor: #64C3DE;
3
-
4
- .clearfix() {
5
- &:after {
6
- clear: both;
7
- content: "";
8
- display: table;
9
- }
10
- }
11
-
12
- .border-radius(@radius) {
13
- -webkit-border-radius: @radius;
14
- -moz-border-radius: @radius;
15
- border-radius: @radius;
16
- }
17
-
18
- .core-button() {
19
- background-color: #21759b;
20
- background-image: -webkit-gradient(linear, left top, left bottom, from(#2a95c5), to(#21759b));
21
- background-image: -webkit-linear-gradient(top, #2a95c5, #21759b);
22
- background-image: -moz-linear-gradient(top, #2a95c5, #21759b);
23
- background-image: -ms-linear-gradient(top, #2a95c5, #21759b);
24
- background-image: -o-linear-gradient(top, #2a95c5, #21759b);
25
- background-image: linear-gradient(to bottom, #2a95c5, #21759b);
26
- border-color: #21759b;
27
- border-bottom-color: #1e6a8d;
28
- -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
29
- box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
30
- color: #fff;
31
- text-decoration: none;
32
- text-shadow: 0 1px 0 rgba(0,0,0,0.1);
33
- }
34
-
35
- .core-button-hover() {
36
- background-color: #278ab7;
37
- background-image: -webkit-gradient(linear, left top, left bottom, from(#2e9fd2), to(#21759b));
38
- background-image: -webkit-linear-gradient(top, #2e9fd2, #21759b);
39
- background-image: -moz-linear-gradient(top, #2e9fd2, #21759b);
40
- background-image: -ms-linear-gradient(top, #2e9fd2, #21759b);
41
- background-image: -o-linear-gradient(top, #2e9fd2, #21759b);
42
- background-image: linear-gradient(to bottom, #2e9fd2, #21759b);
43
- border-color: #1b607f;
44
- -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
45
- box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
46
- color: #fff;
47
- text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
48
- }
49
-
50
- .wpuf-loading {
51
- width: 16px;
52
- height: 16px;
53
- background: url('../images/wpspin_light.gif') no-repeat;
54
- display: inline-block;
55
-
56
- &.hide {
57
- display: none;
58
- }
59
- }
60
-
61
- .wpuf-button {
62
- background: #f3f3f3;
63
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#f4f4f4));
64
- background-image: -webkit-linear-gradient(top, #fefefe, #f4f4f4);
65
- background-image: -moz-linear-gradient(top, #fefefe, #f4f4f4);
66
- background-image: -o-linear-gradient(top, #fefefe, #f4f4f4);
67
- background-image: linear-gradient(to bottom, #fefefe, #f4f4f4);
68
- border-color: #bbb;
69
- color: #333;
70
- text-shadow: 0 1px 0 #fff;
71
-
72
- &:hover, &:focus {
73
- background: #f3f3f3;
74
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
75
- background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
76
- background-image: -moz-linear-gradient(top, #fff, #f3f3f3);
77
- background-image: -ms-linear-gradient(top, #fff, #f3f3f3);
78
- background-image: -o-linear-gradient(top, #fff, #f3f3f3);
79
- background-image: linear-gradient(to bottom, #fff, #f3f3f3);
80
- border-color: #999;
81
- color: #222;
82
- }
83
- }
84
-
85
- .wpuf-success {
86
- background-color: #dff0d8;
87
- border: 1px solid #d6e9c6;
88
- color: #3c763d;
89
- padding: 10px;
90
- margin: 10px 0 20px 0;
91
- }
92
-
93
- .wpuf-error {
94
- background-color: #f2dede;
95
- color: #a94442;
96
- border: 1px solid #ebccd1;
97
- margin: 10px 0 20px 0;
98
- padding: 10px;
99
- .border-radius(3px);
100
- font-size: 13px;
101
- }
102
-
103
- .wpuf-message {
104
- background: #fcf8e3;
105
- border: 1px solid #faebcc;
106
- color: #8a6d3b;
107
- margin: 10px 0 20px 0;
108
- padding: 10px;
109
- .border-radius(3px);
110
- font-size: 13px;
111
- }
112
-
113
- .wpuf-info {
114
- background-color: #fef5be;
115
- border: 2px solid #fdd425;
116
- border-radius: 5px;
117
- -moz-border-radius: 5px;
118
- -webkit-border-radius: 5px;
119
- padding: 5px 10px;
120
- margin: 0 0 10px 0;
121
- font-size: 13px;
122
- }
123
-
124
- ul.wpuf-form {
125
- list-style: none !important;
126
- margin: 0 !important;
127
- padding: 0 !important;
128
- width: 100%;
129
-
130
- li {
131
- .clearfix();
132
- margin-left: 0;
133
- margin-bottom: 10px;
134
- padding: 10px;
135
-
136
- &.has-error {
137
- background: #FFE4E4;
138
- }
139
-
140
- .wp-editor-wrap {
141
- border: 1px solid @borderColor;
142
- }
143
-
144
- .wpuf-label {
145
- float: left;
146
- width: 25%;
147
- min-height: 1px;
148
-
149
- .required {
150
- color: red;
151
- }
152
- }
153
-
154
- .wpuf-fields {
155
- float: left;
156
- width: 75%;
157
-
158
- input[type=text],
159
- input[type=password],
160
- input[type=email],
161
- input[type=url],
162
- input[type=number],
163
- textarea {
164
- background: #fafafa;
165
- -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
166
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
167
- box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
168
- border: 1px solid #ddd;
169
- color: #888;
170
- }
171
- input[type=text]:focus,
172
- input[type=password]:focus,
173
- input[type=email]:focus,
174
- input[type=url]:focus,
175
- input[type=number]:focus,
176
- textarea:focus {
177
- color: #373737;
178
- }
179
- textarea {
180
- padding-left: 3px;
181
- width: 98%;
182
- }
183
- input[type=text],
184
- input[type=password],
185
- input[type=email],
186
- input[type=url],
187
- input[type=number] {
188
- padding: 5px;
189
- }
190
-
191
- select {
192
- border: 1px solid @borderColor;
193
- padding: 2px;
194
- height: 2em;
195
- .border-radius(3px);
196
- min-width: 150px;
197
- }
198
-
199
- select[multiple] {
200
- height: auto;
201
- }
202
-
203
- a.file-selector {
204
- display: inline;
205
- text-decoration: none;
206
- padding: 5px 12px;
207
- height: 30px;
208
- line-height: 28px;
209
- border: 1px solid #ccc;
210
- .border-radius(3px);
211
- .core-button();
212
-
213
- &:hover,
214
- &:focus {
215
- .core-button-hover();
216
- }
217
- }
218
-
219
- .google-map {
220
- img {
221
- max-width: none !important;
222
- }
223
- }
224
-
225
- .wpuf-help {
226
- color: #666;
227
- margin: 2px 0 5px 0;
228
- font-size: 12px;
229
- font-style: italic;
230
- font-family: sans-serif;
231
- display: block;
232
- }
233
-
234
- table, td {
235
- border: none;
236
- margin: 0;
237
- }
238
-
239
- table {
240
- width: 100%;
241
- }
242
-
243
- img.wpuf-clone-field,
244
- img.wpuf-remove-field {
245
- cursor: pointer;
246
- margin: 0 3px;
247
- box-shadow: none;
248
- border: none;
249
- }
250
-
251
- ul.wpuf-attachment-list {
252
- list-style: none;
253
- margin: 5px 0 0 0;
254
- padding: 0;
255
-
256
- li {
257
- display: inline-block;
258
- border: 1px solid @borderColor;
259
- padding: 5px;
260
- width: 150px;
261
- margin-right: 5px;
262
- .border-radius(5px);
263
-
264
- .wpuf-file-input-wrap {
265
- margin: 10px 0;
266
-
267
- input, textarea {
268
- border: 1px solid @borderColor;
269
- width: 93%;
270
- }
271
- }
272
-
273
- .attachment-name {
274
- text-align: center;
275
- }
276
-
277
- a.attachment-delete,a.wpuf-delete-avatar {
278
- text-decoration: none;
279
- padding: 3px 12px;
280
- border: 1px solid #C47272;
281
- color:#ffffff;
282
- text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
283
- .border-radius(3px);
284
- background-color:#da4f49;
285
- background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);
286
- background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
287
- background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);
288
- background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);
289
- background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);
290
- background-repeat:repeat-x;
291
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
292
- border-color:#bd362f #bd362f #802420;
293
- border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
294
- *background-color:#bd362f;
295
- filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);
296
-
297
- &:hover, &:active {
298
- color:#ffffff;
299
- background-color:#bd362f;
300
- *background-color:#a9302a;
301
- }
302
- }
303
- }
304
- }
305
-
306
- .progress {
307
- background: -moz-linear-gradient(center bottom , #FFFFFF 0%, #F7F7F7 100%) repeat scroll 0 0 #FFFFFF;
308
- border: 1px solid #D1D1D1;
309
- border-radius: 3px 3px 3px 3px;
310
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.1) inset;
311
- float: right;
312
- height: 22px;
313
- line-height: 2em;
314
- margin: 0;
315
- overflow: hidden;
316
- padding: 0;
317
- width: 200px;
318
- }
319
-
320
- .bar {
321
- background-color: #83B4D8;
322
- background-image: -moz-linear-gradient(center bottom , #72A7CF 0%, #90C5EE 100%);
323
- border-radius: 3px 3px 3px 3px;
324
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
325
- height: 100%;
326
- // margin-top: -26px;
327
- width: 0;
328
- z-index: 9;
329
- }
330
-
331
- .progress .percent {
332
- color: rgba(0, 0, 0, 0.6);
333
- padding: 0 8px;
334
- position: relative;
335
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
336
- width: 200px;
337
- z-index: 10;
338
- }
339
-
340
- ul.wpuf-category-checklist {
341
- list-style: none;
342
- margin: 0;
343
- padding: 0;
344
-
345
- li {
346
- margin-bottom: 5px;
347
- padding: 0;
348
- }
349
-
350
- ul.children {
351
- list-style: none;
352
- margin-left: 25px;
353
- }
354
- }
355
-
356
- #wpuf-insert-image-container {
357
- .clearfix();
358
- margin-bottom: 3px;
359
-
360
- a.wpuf-insert-image {
361
- text-decoration: none;
362
- // float: left;
363
- border: 1px solid #DFDFDF;
364
- font-size: 11px;
365
- .border-radius(3px);
366
- padding: 4px 6px;
367
- margin-right: 10px;
368
-
369
- .wpuf-media-icon {
370
- // background: url('../images/photo.png') no-repeat;
371
- height: 12px;
372
- width: 12px;
373
- // display: inline-block;
374
- }
375
- }
376
- }
377
-
378
- .wpuf-fields-list {
379
- box-sizing: border-box;
380
- margin: 0;
381
- padding: 0;
382
- list-style: none;
383
-
384
- li {
385
- padding: 0;
386
- margin: 0 0 6px;
387
- }
388
-
389
- &.wpuf-list-inline {
390
- margin-left: -5px;
391
-
392
- li {
393
- display: inline-block;
394
- padding-left: 5px;
395
- padding-right: 5px;
396
- }
397
- }
398
- }
399
-
400
- table.wpuf-repeatable-field {
401
- border-collapse: collapse;
402
-
403
- & * {
404
- box-sizing: border-box;
405
- }
406
-
407
- input {
408
- width: 100%;
409
- }
410
-
411
- .wpuf-repeater-buttons {
412
- width: 75px;
413
- padding-left: 12px;
414
-
415
- img {
416
- width: 100%;
417
- height: auto;
418
- }
419
-
420
- i {
421
- display: inline-block;
422
- width: 15px;
423
- height: 15px;
424
- margin: 2px 4px 0 0;
425
- }
426
- }
427
- }
428
- }
429
-
430
- .wpuf-address-field {
431
- .clearfix();
432
- width: 100%;
433
- margin-bottom: 10px;
434
- }
435
-
436
- .wpuf-section-wrap {
437
- border-bottom: 1px solid #ccc;
438
- margin: 15px 0;
439
-
440
- h2.wpuf-section-title {
441
- margin: 0;
442
- }
443
-
444
- .wpuf-section-details {
445
- padding: 4px 0 8px;
446
- font-size: 12px;
447
- }
448
- }
449
- }
450
-
451
- .wpuf-submit {
452
- input[type=submit] {
453
- font-size: 16px;
454
- padding: 5px 15px;
455
- border: 1px solid #ccc;
456
- .border-radius(3px);
457
- .core-button();
458
- }
459
-
460
- .button-primary-disabled {
461
- color: #94cde7 !important;
462
- background: #298cba !important;
463
- border-color: #1b607f !important;
464
- -webkit-box-shadow: none !important;
465
- box-shadow: none !important;
466
- text-shadow: 0 -1px 0 rgba(0,0,0,0.1) !important;
467
- cursor: default;
468
- }
469
-
470
- .wpuf-errors {
471
- background: #FFE4E4;
472
- border: 1px solid darken(#FFE4E4, 10%);
473
- margin: 10px 0;
474
- padding: 10px;
475
- .border-radius(3px);
476
- font-size: 13px;
477
- }
478
- }
479
- }
480
-
481
- #wpuf-login-form {
482
- label {
483
- display: block;
484
- }
485
-
486
- .forgetmenot label {
487
- display: inline-block;
488
- }
489
- }
490
-
491
- .wpuf_sub_info {
492
- padding: 0;
493
- margin: 10px 5px;
494
- border: 1px solid @borderColor;
495
- border-radius: 3px;
496
-
497
- h3 {
498
- background-color: #f1f1f1;
499
- padding: 10px;
500
- margin: 0 0 5px 0 !important;
501
- font-weight: 300 !important;
502
- }
503
-
504
- .wpuf-text{
505
- padding: 5px 10px;
506
- }
507
-
508
- .wpuf-expire {
509
- border-top: 1px solid @borderColor;
510
- padding-top: 5px;
511
- margin-top: 5px;
512
- }
513
- }
514
-
515
- .wpuf-coupon-info-wrap {
516
- border: 1px solid @borderColor;
517
- padding: 15px;
518
- margin-bottom: 20px;
519
-
520
- .wpuf-coupon-field-spinner {
521
- background: url( '../images/wpspin_light.gif' ) no-repeat right scroll rgba(0, 0, 0, 0);
522
- }
523
- .wpuf-copon-show {
524
- background: #EEEEEE;
525
- border-radius: 3px;
526
- border-width: 1px;
527
- box-shadow: 0 1px 0 rgba(217, 217, 217, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15);
528
- color: #5C5A5A;
529
- cursor: pointer;
530
- display: inline-block;
531
- font-size: 14px;
532
- padding: 5px 12px;
533
- text-decoration: none;
534
- width: 175px;
535
- margin-bottom: 8px;
536
- }
537
-
538
- .wpuf-copon-wrap {
539
- margin: 15px 0;
540
- }
541
-
542
- .wpuf-pack-info {
543
- margin-bottom: 20px;
544
-
545
- h3 {
546
- margin: 0 0 10px 0;
547
- padding: 0 0 10px 0;
548
- border-bottom: 1px solid @borderColor;
549
-
550
- a {
551
- float: right;
552
- text-decoration: none;
553
- background: @mainColor;
554
- color: #fff;
555
- padding: 3px 8px;
556
- font-size: 14px;
557
- }
558
- }
559
- }
560
-
561
- .wpuf-copon-show:hover {
562
- background: none repeat scroll 0 0 #1E8CBE;
563
- border-color: #0074A2;
564
- box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6) inset;
565
- color: #FFFFFF;
566
- }
567
-
568
- a.wpuf-apply-coupon {
569
- text-decoration: none;
570
- font-size: 11px;
571
- margin-top: 10px;
572
- margin-right: 10px;
573
- background: #21759b;
574
- color: #fff;
575
- padding: 5px 10px;
576
- display: inline-block;
577
- .border-radius(3px);
578
- }
579
-
580
- .wpuf-copon-cancel {
581
- text-decoration: none;
582
- font-size: 11px;
583
- }
584
- }
585
-
586
- .entry-content ul.wpuf_packs,
587
- ul.wpuf_packs {
588
- overflow: hidden;
589
- margin: 15px;
590
-
591
- > li {
592
- background: #fff;
593
- border: 1px solid #DDD;
594
- border-radius: 5px 5px 5px 5px;
595
- float: left;
596
- list-style: none outside none;
597
- margin: 5px 25px 25px 0;
598
- position: relative;
599
- width: 200px;
600
- box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
601
-
602
- &:first-child {
603
- margin-left: 5px;
604
- }
605
- }
606
-
607
- h3 {
608
- background: #52B5D5;
609
- color: #fff;
610
- font-size: 18px;
611
- font-weight: normal;
612
- margin: 0;
613
- padding: 10px !important;
614
- text-align: center;
615
- border-bottom: 1px solid darken(#52B5D5, 5%);
616
- }
617
-
618
- .wpuf-pricing-wrap {
619
- background: @mainColor;
620
-
621
- .wpuf-sub-amount {
622
- position: relative;
623
- text-align: center;
624
- color: #FFF;
625
- border-bottom: 1px solid darken(@mainColor, 5%);
626
- padding: 10px 0;
627
-
628
- .wpuf-sub-symbol {
629
- font-size: 19px;
630
- position: absolute;
631
- top: 25px;
632
- line-height: 10px;
633
- }
634
-
635
- .wpuf-sub-cost {
636
- font-size: 40px;
637
- margin-left: 10px;
638
- line-height: 50px;
639
- }
640
-
641
- .wpuf-pack-cycle {
642
- font-size: 13px;
643
- padding-bottom: 5px;
644
- }
645
- }
646
- }
647
-
648
- .wpuf-sub-body {
649
- margin: 0;
650
- padding: 8px 0 0 8px;
651
- background: #fff;
652
- font-size: 11px;
653
- color: #999;
654
- }
655
-
656
- .wpuf-sub-button {
657
- text-align: center;
658
- margin-bottom: 20px;
659
- margin-top: 20px;
660
- overflow: hidden;
661
-
662
- a {
663
- // .core-button();
664
- background: @mainColor;
665
- color: #fff;
666
- text-decoration: none;
667
- padding: 5px 10px;
668
- .border-radius(3px);
669
- display: inline-block;
670
-
671
- &:hover {
672
- background: darken(@mainColor, 10%);
673
- }
674
- }
675
-
676
- a:hover {
677
- background: none repeat scroll 0 0 #1E8CBE;
678
- border-color: #0074A2;
679
- box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6) inset;
680
- color: #FFFFFF;
681
- }
682
- }
683
-
684
- .wpuf-sub-desciption {
685
- margin-top: 15px;
686
-
687
- ul, li {
688
- margin: 0;
689
- padding: 0;
690
- list-style: none;
691
- }
692
-
693
- li {
694
- text-align: center;
695
- border-top: 1px solid #eee;
696
- padding: 7px 0;
697
-
698
- &:last-child {
699
- border-bottom: 1px solid #eee;
700
- }
701
-
702
- &:first-child {
703
- border-top: none;
704
- }
705
- }
706
-
707
- p {
708
- padding: 0 10px;
709
- margin-bottom: 15px;
710
- }
711
- }
712
-
713
- .button {
714
- background: none repeat scroll 0 0 #2EA2CC;
715
- border-color: #0074A2;
716
- box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15);
717
- color: #FFFFFF;
718
- text-decoration: none;
719
- padding: 0 12px 2px;
720
- color: #fff;
721
- }
722
-
723
- .cost {
724
- background: red;
725
- border-radius: 30px 30px 30px 30px;
726
- color: #FFFFFF;
727
- margin: -16px -12px 0 0;
728
- padding: 10px 8px 8px;
729
- position: absolute;
730
- right: 0;
731
- top: 0;
732
- }
733
- }
734
-
735
- /* css for timepicker */
736
- .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
737
- .ui-timepicker-div dl { text-align: left; }
738
- .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
739
- .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
740
- .ui-timepicker-div td { font-size: 90%; }
741
- .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
742
-
743
- .ui-timepicker-rtl{ direction: rtl; }
744
- .ui-timepicker-rtl dl { text-align: right; }
745
- .ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
746
-
747
- // Password Strength
748
- #pass-strength-result {
749
- border-style: solid;
750
- border-width: 1px;
751
- float: left;
752
- margin: 0;
753
- padding: 3px 5px;
754
- text-align: center;
755
- width: 200px;
756
- display: none;
757
- background-color: #eee;
758
- border-color: #ddd !important;
759
-
760
- &.bad {
761
- background-color: #ffb78c;
762
- border-color: #ff853c !important;
763
- }
764
-
765
- &.good {
766
- background-color: #ffec8b;
767
- border-color: #fc0 !important;
768
- }
769
-
770
- &.short {
771
- background-color: #ffa0a0;
772
- border-color: #f04040 !important;
773
- }
774
-
775
- &.strong {
776
- background-color: #c3ff88;
777
- border-color: #8dff1c !important;
778
- }
779
- }
780
-
781
- .password[type="text"]{
782
- display: none;
783
- }
784
-
785
- table.wpuf-table {
786
- border: 1px solid #E7E7E7;
787
- margin: 0 0px 10px 0;
788
- text-align: left;
789
- width: 100%;
790
-
791
- thead th, th {
792
- color: #888888;
793
- font-size: 12px;
794
- font-weight: bold;
795
- line-height: 18px;
796
- padding: 9px 24px;
797
- }
798
-
799
- td {
800
- border-top: 1px solid #E7E7E7;
801
- padding: 6px 24px;
802
- }
803
- }
804
-
805
- #wpuf-payment-gateway {
806
- ul.wpuf-payment-gateways {
807
- list-style: none;
808
- margin: 10px 0;
809
-
810
- li {
811
- margin: 0;
812
-
813
- .wpuf-payment-instruction {
814
- padding: 8px 10px;
815
- margin: 0 10px;
816
- }
817
-
818
- .wpuf-instruction {
819
- padding: 8px 10px;
820
- margin-bottom: 10px;
821
- background: #ebe8eb;
822
- font-size: 13px;
823
- .border-radius(2px);
824
- }
825
- }
826
- }
827
- }
828
-
829
- .wpuf-pagination {
830
- div.pagination{
831
- text-align:center;
832
- padding:7px;
833
- margin:3px;
834
- }
835
-
836
- .page-numbers{
837
- padding:2px 8px;
838
- margin:2px;
839
- border:1px solid #4A5154;
840
- text-decoration:none;
841
- color:#4A5154;
842
- background: #fff;
843
- border-radius: 5px;
844
- -moz-border-radius: 5px;
845
-
846
- &:hover,
847
- &:active{
848
- border:1px solid #4A5154;
849
- background-color:#4A5154;
850
- color:#fff;
851
- border-radius: 5px;
852
- -moz-border-radius: 5px;
853
- }
854
-
855
- &.current{
856
- padding:2px 8px;
857
- margin:2px;
858
- border:1px solid #4A5154;
859
- font-weight:bold;
860
- background-color:#4A5154;
861
- color:#FFF;
862
- border-radius: 5px;
863
- -moz-border-radius: 5px;
864
- }
865
- }
866
- }
867
-
868
- /** author info **/
869
- .wpuf-author {
870
- .clearfix();
871
- margin: 20px 0;
872
-
873
- h3{
874
- margin: 0 !important;
875
- background: #CFCFCF;
876
- text-align: left;
877
- padding: 3px 10px;
878
- }
879
-
880
- .wpuf-author-inside {
881
- background: none repeat scroll 0 0 #F0F0F0;
882
- border-bottom: 2px solid #DDDDDD;
883
- height: auto;
884
- padding-left: 10px;
885
- padding-top: 15px;
886
- margin-bottom: 15px;
887
- .clearfix();
888
-
889
- .wpuf-user-image {
890
- float: left;
891
- padding-right: 15px;
892
- }
893
-
894
- p {
895
- margin-bottom: 10px !important;
896
- }
897
-
898
- p.wpuf-author-info {
899
- padding-top: 8px;
900
- word-wrap: break-word;
901
- }
902
-
903
- p.wpuf-user-name a {
904
- color: #335160;
905
- font-size: 1.2em;
906
- font-weight: bold;
907
- }
908
- }
909
- }
910
-
911
- /** jQuery Suggest **/
912
-
913
- .ac_results {
914
- padding: 0;
915
- margin: 0;
916
- list-style: none;
917
- position: absolute;
918
- z-index: 10000;
919
- display: none;
920
- border: 1px solid #ccc;
921
-
922
- li {
923
- padding: 2px 5px;
924
- white-space: nowrap;
925
- text-align: left;
926
- }
927
- }
928
-
929
- .ac_over {
930
- cursor: pointer;
931
- }
932
-
933
- .ac_match {
934
- text-decoration: underline;
935
- }
936
-
937
- /*------------------------------------
938
- * Multistep form
939
- *-----------------------------------*/
940
- fieldset.wpuf-multistep-fieldset {
941
- position: relative;
942
- padding-bottom: 50px;
943
- border: none;
944
- display: none;
945
-
946
- &.field-active {
947
- display: block;
948
- }
949
-
950
- .wpuf-multistep-prev-btn,
951
- .wpuf-multistep-next-btn {
952
- position: absolute;
953
- bottom: 5px;
954
- }
955
- .wpuf-multistep-prev-btn {
956
- left: 10px;
957
- }
958
- .wpuf-multistep-next-btn {
959
- right: 10px;
960
- }
961
- }
962
-
963
- .wpuf-multistep-progressbar {
964
- overflow: hidden;
965
- }
966
-
967
- .wpuf-form .wpuf-multistep-progressbar {
968
-
969
- @stepBackground: #00a0d2;
970
-
971
- ul.wpuf-step-wizard {
972
- margin: 20px 0 40px 0;
973
- padding: 0;
974
- list-style: none;
975
-
976
- * {
977
- box-sizing: border-box;
978
- }
979
-
980
- li {
981
- background-color: #E4E4E4;
982
- border-radius: 5px;
983
- display: inline-block;
984
- padding: 10px 30px 10px 40px;
985
- margin-right: -7px;
986
- width: auto;
987
- margin: 0;
988
- position: relative;
989
- text-align: center;
990
-
991
- &::before,
992
- &::after {
993
- border: solid transparent;
994
- content: " ";
995
- height: 0;
996
- width: 0;
997
- position: absolute;
998
- border-color: transparent;
999
- border-left-color: #fff;
1000
- border-radius: 10px;
1001
- }
1002
-
1003
- &::before {
1004
- border-width: 26px;
1005
- margin-top: -14px;
1006
- right: -50px;
1007
- z-index: 98;
1008
- }
1009
-
1010
- &::after {
1011
- border-left-color: #E4E4E4;
1012
- border-width: 25px;
1013
- margin-top: -37px;
1014
- right: -44px;
1015
- z-index: 99;
1016
- }
1017
-
1018
- &.active-step {
1019
- background-color: @stepBackground;
1020
- color: #fff;
1021
-
1022
- &::after {
1023
- border-left-color: @stepBackground;
1024
- }
1025
- }
1026
-
1027
- &:last-child::after {
1028
- border-left-color: transparent;
1029
- }
1030
- }
1031
- }
1032
-
1033
- .ui-widget-header {
1034
- background: @stepBackground;
1035
- }
1036
-
1037
- &.ui-progressbar {
1038
- margin-bottom: 30px;
1039
- height: 25px;
1040
- border: 1px solid @borderColor;
1041
- position: relative;
1042
-
1043
- .wpuf-progress-percentage {
1044
- position: absolute;
1045
- left: 50%;
1046
- font-size: 12px;
1047
- font-weight: bold;
1048
- text-shadow: 1px 1px 0 #fff;
1049
- top: 20%;
1050
- }
1051
- }
1052
- }
1053
- input.wpuf-btn {
1054
- text-decoration: none !important;
1055
- font-size: 15px !important;
1056
- margin-top: 10px;
1057
- margin-right: 10px;
1058
- background: #21759b !important;
1059
- color: #fff !important;
1060
- padding: 5px 10px;
1061
- display: inline-block;
1062
- -webkit-border-radius: 3px !important;
1063
- -moz-border-radius: 3px !important;
1064
- border-radius: 3px !important;
1065
- border: none !important;
1066
- }
1067
- /*rtl*/
1068
- body.rtl{
1069
- ul.wpuf-form li .wpuf-label{
1070
- float: right;
1071
- }
1072
- }
1073
-
1074
- // landscape phones and smaller
1075
- @media (max-width: 480px) {
1076
- ul.wpuf-form {
1077
- li {
1078
- .wpuf-label, .wpuf-fields {
1079
- float: none;
1080
- width: 100%;
1081
- }
1082
- }
1083
- }
1084
- }
1085
-
1086
- .wpuf-form {
1087
- .required {
1088
- color: red;
1089
- font-weight: 700;
1090
- border: 0;
1091
- }
1092
- }
1093
- .wpuf-dashboard-container {
1094
- .wpuf-dashboard-navigation {
1095
- width: 30%;
1096
- float: left;
1097
-
1098
- a {
1099
- text-decoration: none;
1100
- box-shadow: none;
1101
- }
1102
-
1103
- ul {
1104
- list-style: none;
1105
- li {
1106
- padding-bottom: 2px;
1107
- }
1108
- }
1109
- }
1110
-
1111
- .wpuf-dashboard-content {
1112
- width: 68%;
1113
- float: right;
1114
- }
1115
-
1116
- table.items-table {
1117
- a {
1118
- text-decoration: none;
1119
- box-shadow: none;
1120
- }
1121
-
1122
- border: 0;
1123
-
1124
- th, td {
1125
- border: 0;
1126
- padding: 10px;
1127
- }
1128
-
1129
- tr {
1130
- outline: 1px solid #f1f1f1;
1131
- }
1132
-
1133
- .items-list-header {
1134
- background-color: #f1f1f1;
1135
- }
1136
- }
1137
-
1138
- .wpuf-update-profile-form {
1139
- .form-row-first {
1140
- float: left;
1141
- width: 47%;
1142
- overflow: visible;
1143
- }
1144
-
1145
- .form-row-last {
1146
- float: right;
1147
- width: 47%;
1148
- overflow: visible;
1149
- }
1150
- }
1151
- }
1152
-
1153
- .wpuf-toc-container {
1154
- .wpuf-fields {
1155
- position: relative;
1156
-
1157
- .wpuf-toc-checkbox {
1158
- position: absolute;
1159
- top: 0;
1160
- left: 0;
1161
- }
1162
-
1163
- &.has-toc-checkbox {
1164
-
1165
- .wpuf-toc-description {
1166
- margin-left: 25px;
1167
- }
1168
- }
1169
- }
1170
- }
1171
-
1172
- // Google Map
1173
- // --------------------------------------------------
1174
- .wpuf-field-google-map {
1175
- height: 300px;
1176
- width: 100%;
1177
- }
1178
-
1179
- .wpuf-form-google-map {
1180
- height: 300px;
1181
- width: 100%;
1182
- }
1183
-
1184
- input[type="text"].wpuf-google-map-search {
1185
- margin-top: 10px !important;
1186
- border: 1px solid transparent !important;
1187
- border-radius: 2px 0 0 2px !important;
1188
- box-sizing: border-box !important;
1189
- -moz-box-sizing: border-box !important;
1190
- height: 32px !important;
1191
- outline: none !important;
1192
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
1193
- background-color: #fff !important;
1194
- text-overflow: ellipsis !important;
1195
- width: 170px !important;
1196
- font-family: Roboto !important;
1197
- font-size: 15px !important;
1198
- font-weight: 300 !important;
1199
- padding: 0 11px 0 13px !important;
1200
- display: none;
1201
-
1202
- .gm-style & {
1203
- display: block;
1204
- }
1205
- }
1206
-
1207
- .wpuf-form-google-map-container {
1208
-
1209
- input[type="text"].wpuf-google-map-search {
1210
- width: 230px !important;
1211
- }
1212
-
1213
- &.hide-search-box {
1214
-
1215
- .gm-style input[type="text"].wpuf-google-map-search {
1216
- display: none;
1217
- }
1218
- }
1219
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/images/ui-bg_diagonals-small_75_cccccc_40x40.png DELETED
Binary file
assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png DELETED
Binary file
assets/css/images/ui-bg_flat_0_ffffff_40x100.png DELETED
Binary file
assets/css/images/ui-bg_flat_75_ffffff_40x100.png DELETED
Binary file
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png DELETED
Binary file
assets/css/images/ui-bg_glass_65_ffffff_1x400.png DELETED
Binary file
assets/css/images/ui-bg_glass_75_dadada_1x400.png DELETED
Binary file
assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png DELETED
Binary file
assets/css/images/ui-bg_glass_95_fef1ec_1x400.png DELETED
Binary file
assets/css/images/ui-icons_222222_256x240.png DELETED
Binary file
assets/css/images/ui-icons_2e83ff_256x240.png DELETED
Binary file
assets/css/images/ui-icons_454545_256x240.png DELETED
Binary file
assets/css/images/ui-icons_888888_256x240.png DELETED
Binary file
assets/css/images/ui-icons_cd0a0a_256x240.png DELETED
Binary file
assets/css/jquery-ui-1.9.1.custom.css DELETED
@@ -1,461 +0,0 @@
1
- /*! jQuery UI - v1.9.1 - 2012-11-14
2
- * http://jqueryui.com
3
- * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=07_diagonals_small.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=ffffff&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=90&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
- * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
6
-
7
- /* Layout helpers
8
- ----------------------------------*/
9
- .ui-helper-hidden { display: none; }
10
- .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
11
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
- .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
13
- .ui-helper-clearfix:after { clear: both; }
14
- .ui-helper-clearfix { zoom: 1; }
15
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
16
-
17
-
18
- /* Interaction Cues
19
- ----------------------------------*/
20
- .ui-state-disabled { cursor: default !important; }
21
-
22
-
23
- /* Icons
24
- ----------------------------------*/
25
-
26
- /* states and images */
27
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
28
-
29
-
30
- /* Misc visuals
31
- ----------------------------------*/
32
-
33
- /* Overlays */
34
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
35
- .ui-resizable { position: relative;}
36
- .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
37
- .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
38
- .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
39
- .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
40
- .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
41
- .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
42
- .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
43
- .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
44
- .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
45
- .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
46
- .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
47
- .ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
48
- .ui-accordion .ui-accordion-noicons { padding-left: .7em; }
49
- .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
50
- .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
51
- .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
52
- .ui-autocomplete {
53
- position: absolute;
54
- top: 0; /* #8656 */
55
- cursor: default;
56
- }
57
-
58
- /* workarounds */
59
- * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
60
- .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
61
- .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
62
- .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
63
- button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
64
- .ui-button-icons-only { width: 3.4em; }
65
- button.ui-button-icons-only { width: 3.7em; }
66
-
67
- /*button text element */
68
- .ui-button .ui-button-text { display: block; line-height: 1.4; }
69
- .ui-button-text-only .ui-button-text { padding: .4em 1em; }
70
- .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
71
- .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
72
- .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
73
- .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
74
- /* no icon support for input elements, provide padding by default */
75
- input.ui-button { padding: .4em 1em; }
76
-
77
- /*button icon element(s) */
78
- .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
79
- .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
80
- .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
81
- .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
82
- .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
83
-
84
- /*button sets*/
85
- .ui-buttonset { margin-right: 7px; }
86
- .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
87
-
88
- /* workarounds */
89
- button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
90
- .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
91
- .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
92
- .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
93
- .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
94
- .ui-datepicker .ui-datepicker-prev { left:2px; }
95
- .ui-datepicker .ui-datepicker-next { right:2px; }
96
- .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
97
- .ui-datepicker .ui-datepicker-next-hover { right:1px; }
98
- .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
99
- .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
100
- .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
101
- .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
102
- .ui-datepicker select.ui-datepicker-month,
103
- .ui-datepicker select.ui-datepicker-year { width: 49%;}
104
- .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
105
- .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
106
- .ui-datepicker td { border: 0; padding: 1px; }
107
- .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
108
- .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
109
- .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
110
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
111
-
112
- /* with multiple calendars */
113
- .ui-datepicker.ui-datepicker-multi { width:auto; }
114
- .ui-datepicker-multi .ui-datepicker-group { float:left; }
115
- .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
116
- .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
117
- .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
118
- .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
119
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
120
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
121
- .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
122
- .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
123
-
124
- /* RTL support */
125
- .ui-datepicker-rtl { direction: rtl; }
126
- .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
127
- .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
128
- .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
129
- .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
130
- .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
131
- .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
132
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
133
- .ui-datepicker-rtl .ui-datepicker-group { float:right; }
134
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
135
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
136
-
137
- /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
138
- .ui-datepicker-cover {
139
- position: absolute; /*must have*/
140
- z-index: -1; /*must have*/
141
- filter: mask(); /*must have*/
142
- top: -4px; /*must have*/
143
- left: -4px; /*must have*/
144
- width: 200px; /*must have*/
145
- height: 200px; /*must have*/
146
- }.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
147
- .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
148
- .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
149
- .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
150
- .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
151
- .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
152
- .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
153
- .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
154
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
155
- .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
156
- .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
157
- .ui-draggable .ui-dialog-titlebar { cursor: move; }
158
- .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
159
- .ui-menu .ui-menu { margin-top: -3px; position: absolute; }
160
- .ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
161
- .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
162
- .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
163
- .ui-menu .ui-menu-item a.ui-state-focus,
164
- .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
165
-
166
- .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
167
- .ui-menu .ui-state-disabled a { cursor: default; }
168
-
169
- /* icon support */
170
- .ui-menu-icons { position: relative; }
171
- .ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
172
-
173
- /* left-aligned */
174
- .ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
175
-
176
- /* right-aligned */
177
- .ui-menu .ui-menu-icon { position: static; float: right; }
178
- .ui-progressbar { height:2em; text-align: left; overflow: hidden; }
179
- .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
180
- .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
181
- .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
182
-
183
- .ui-slider-horizontal { height: .8em; }
184
- .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
185
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
186
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
187
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
188
-
189
- .ui-slider-vertical { width: .8em; height: 100px; }
190
- .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
191
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
192
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
193
- .ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
194
- .ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
195
- .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
196
- .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
197
- .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
198
- .ui-spinner-up { top: 0; }
199
- .ui-spinner-down { bottom: 0; }
200
-
201
- /* TR overrides */
202
- .ui-spinner .ui-icon-triangle-1-s {
203
- /* need to fix icons sprite */
204
- background-position:-65px -16px;
205
- }
206
- .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
207
- .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
208
- .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
209
- .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
210
- .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
211
- .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
212
- .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
213
- .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
214
- .ui-tooltip {
215
- padding: 8px;
216
- position: absolute;
217
- z-index: 9999;
218
- max-width: 300px;
219
- -webkit-box-shadow: 0 0 5px #aaa;
220
- box-shadow: 0 0 5px #aaa;
221
- }
222
- /* Fades and background-images don't work well together in IE6, drop the image */
223
- * html .ui-tooltip {
224
- background-image: none;
225
- }
226
- body .ui-tooltip { border-width: 2px; }
227
-
228
- /* Component containers
229
- ----------------------------------*/
230
- .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
231
- .ui-widget .ui-widget { font-size: 1em; }
232
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
233
- .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
234
- .ui-widget-content a { color: #222222; }
235
- .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_diagonals-small_75_cccccc_40x40.png) 50% 50% repeat; color: #222222; font-weight: bold; }
236
- .ui-widget-header a { color: #222222; }
237
-
238
- /* Interaction states
239
- ----------------------------------*/
240
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
241
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
242
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
243
- .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
244
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
245
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
246
-
247
- /* Interaction Cues
248
- ----------------------------------*/
249
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
250
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
251
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
252
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
253
- .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
254
- .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
255
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
256
- .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
257
- .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
258
-
259
- /* Icons
260
- ----------------------------------*/
261
-
262
- /* states and images */
263
- .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
264
- .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
265
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
266
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
267
- .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
268
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
269
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
270
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
271
-
272
- /* positioning */
273
- .ui-icon-carat-1-n { background-position: 0 0; }
274
- .ui-icon-carat-1-ne { background-position: -16px 0; }
275
- .ui-icon-carat-1-e { background-position: -32px 0; }
276
- .ui-icon-carat-1-se { background-position: -48px 0; }
277
- .ui-icon-carat-1-s { background-position: -64px 0; }
278
- .ui-icon-carat-1-sw { background-position: -80px 0; }
279
- .ui-icon-carat-1-w { background-position: -96px 0; }
280
- .ui-icon-carat-1-nw { background-position: -112px 0; }
281
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
282
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
283
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
284
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
285
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
286
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
287
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
288
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
289
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
290
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
291
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
292
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
293
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
294
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
295
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
296
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
297
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
298
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
299
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
300
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
301
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
302
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
303
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
304
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
305
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
306
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
307
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
308
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
309
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
310
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
311
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
312
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
313
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
314
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
315
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
316
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
317
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
318
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
319
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
320
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
321
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
322
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
323
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
324
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
325
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
326
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
327
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
328
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
329
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
330
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
331
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
332
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
333
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
334
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
335
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
336
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
337
- .ui-icon-arrow-4 { background-position: 0 -80px; }
338
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
339
- .ui-icon-extlink { background-position: -32px -80px; }
340
- .ui-icon-newwin { background-position: -48px -80px; }
341
- .ui-icon-refresh { background-position: -64px -80px; }
342
- .ui-icon-shuffle { background-position: -80px -80px; }
343
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
344
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
345
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
346
- .ui-icon-folder-open { background-position: -16px -96px; }
347
- .ui-icon-document { background-position: -32px -96px; }
348
- .ui-icon-document-b { background-position: -48px -96px; }
349
- .ui-icon-note { background-position: -64px -96px; }
350
- .ui-icon-mail-closed { background-position: -80px -96px; }
351
- .ui-icon-mail-open { background-position: -96px -96px; }
352
- .ui-icon-suitcase { background-position: -112px -96px; }
353
- .ui-icon-comment { background-position: -128px -96px; }
354
- .ui-icon-person { background-position: -144px -96px; }
355
- .ui-icon-print { background-position: -160px -96px; }
356
- .ui-icon-trash { background-position: -176px -96px; }
357
- .ui-icon-locked { background-position: -192px -96px; }
358
- .ui-icon-unlocked { background-position: -208px -96px; }
359
- .ui-icon-bookmark { background-position: -224px -96px; }
360
- .ui-icon-tag { background-position: -240px -96px; }
361
- .ui-icon-home { background-position: 0 -112px; }
362
- .ui-icon-flag { background-position: -16px -112px; }
363
- .ui-icon-calendar { background-position: -32px -112px; }
364
- .ui-icon-cart { background-position: -48px -112px; }
365
- .ui-icon-pencil { background-position: -64px -112px; }
366
- .ui-icon-clock { background-position: -80px -112px; }
367
- .ui-icon-disk { background-position: -96px -112px; }
368
- .ui-icon-calculator { background-position: -112px -112px; }
369
- .ui-icon-zoomin { background-position: -128px -112px; }
370
- .ui-icon-zoomout { background-position: -144px -112px; }
371
- .ui-icon-search { background-position: -160px -112px; }
372
- .ui-icon-wrench { background-position: -176px -112px; }
373
- .ui-icon-gear { background-position: -192px -112px; }
374
- .ui-icon-heart { background-position: -208px -112px; }
375
- .ui-icon-star { background-position: -224px -112px; }
376
- .ui-icon-link { background-position: -240px -112px; }
377
- .ui-icon-cancel { background-position: 0 -128px; }
378
- .ui-icon-plus { background-position: -16px -128px; }
379
- .ui-icon-plusthick { background-position: -32px -128px; }
380
- .ui-icon-minus { background-position: -48px -128px; }
381
- .ui-icon-minusthick { background-position: -64px -128px; }
382
- .ui-icon-close { background-position: -80px -128px; }
383
- .ui-icon-closethick { background-position: -96px -128px; }
384
- .ui-icon-key { background-position: -112px -128px; }
385
- .ui-icon-lightbulb { background-position: -128px -128px; }
386
- .ui-icon-scissors { background-position: -144px -128px; }
387
- .ui-icon-clipboard { background-position: -160px -128px; }
388
- .ui-icon-copy { background-position: -176px -128px; }
389
- .ui-icon-contact { background-position: -192px -128px; }
390
- .ui-icon-image { background-position: -208px -128px; }
391
- .ui-icon-video { background-position: -224px -128px; }
392
- .ui-icon-script { background-position: -240px -128px; }
393
- .ui-icon-alert { background-position: 0 -144px; }
394
- .ui-icon-info { background-position: -16px -144px; }
395
- .ui-icon-notice { background-position: -32px -144px; }
396
- .ui-icon-help { background-position: -48px -144px; }
397
- .ui-icon-check { background-position: -64px -144px; }
398
- .ui-icon-bullet { background-position: -80px -144px; }
399
- .ui-icon-radio-on { background-position: -96px -144px; }
400
- .ui-icon-radio-off { background-position: -112px -144px; }
401
- .ui-icon-pin-w { background-position: -128px -144px; }
402
- .ui-icon-pin-s { background-position: -144px -144px; }
403
- .ui-icon-play { background-position: 0 -160px; }
404
- .ui-icon-pause { background-position: -16px -160px; }
405
- .ui-icon-seek-next { background-position: -32px -160px; }
406
- .ui-icon-seek-prev { background-position: -48px -160px; }
407
- .ui-icon-seek-end { background-position: -64px -160px; }
408
- .ui-icon-seek-start { background-position: -80px -160px; }
409
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
410
- .ui-icon-seek-first { background-position: -80px -160px; }
411
- .ui-icon-stop { background-position: -96px -160px; }
412
- .ui-icon-eject { background-position: -112px -160px; }
413
- .ui-icon-volume-off { background-position: -128px -160px; }
414
- .ui-icon-volume-on { background-position: -144px -160px; }
415
- .ui-icon-power { background-position: 0 -176px; }
416
- .ui-icon-signal-diag { background-position: -16px -176px; }
417
- .ui-icon-signal { background-position: -32px -176px; }
418
- .ui-icon-battery-0 { background-position: -48px -176px; }
419
- .ui-icon-battery-1 { background-position: -64px -176px; }
420
- .ui-icon-battery-2 { background-position: -80px -176px; }
421
- .ui-icon-battery-3 { background-position: -96px -176px; }
422
- .ui-icon-circle-plus { background-position: 0 -192px; }
423
- .ui-icon-circle-minus { background-position: -16px -192px; }
424
- .ui-icon-circle-close { background-position: -32px -192px; }
425
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
426
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
427
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
428
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
429
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
430
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
431
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
432
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
433
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
434
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
435
- .ui-icon-circle-check { background-position: -208px -192px; }
436
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
437
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
438
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
439
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
440
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
441
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
442
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
443
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
444
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
445
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
446
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
447
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
448
-
449
-
450
- /* Misc visuals
451
- ----------------------------------*/
452
-
453
- /* Corner radius */
454
- .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
455
- .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
456
- .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
457
- .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
458
-
459
- /* Overlays */
460
- .ui-widget-overlay { background: #ffffff url(images/ui-bg_flat_0_ffffff_40x100.png) 50% 50% repeat-x; opacity: .9;filter:Alpha(Opacity=90); }
461
- .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/jquery.smallipop.css DELETED
@@ -1,117 +0,0 @@
1
- /* smallipop css */
2
- .smallipopHint { display: none; }
3
-
4
- .smallipop-instance { position: absolute; display: none; top: 0; left: 0; background-color: #314b64; border: 1px solid #0f161e; color: #d2dfe7; z-index: 9999; max-width: 400px; }
5
- .smallipop-instance font { size: 11px; family: arial; }
6
- .smallipop-instance a { color: #98cbea; }
7
- .smallipop-instance .sipContent { padding: 10px; }
8
- .smallipop-instance .sipArrow, .smallipop-instance .sipArrowBorder { position: absolute; left: 50%; height: 0; width: 0; }
9
- .smallipop-instance .sipArrow { bottom: -20px; margin-left: -10px; border: 10px solid transparent; }
10
- .smallipop-instance .sipArrowBorder { bottom: -24px; margin-left: -12px; border: 12px solid transparent; }
11
- .smallipop-instance.sipAlignLeft .sipArrow { margin-left: 0; left: auto; right: 20px; }
12
- .smallipop-instance.sipAlignLeft .sipArrowBorder { margin-left: 0; left: auto; right: 18px; }
13
- .smallipop-instance.sipAlignRight .sipArrow { margin-left: 0; left: 20px; right: auto; }
14
- .smallipop-instance.sipAlignRight .sipArrowBorder { margin-left: 0; left: 18px; right: auto; }
15
- .smallipop-instance.sipAlignBottom .sipArrow { bottom: auto; top: -20px; }
16
- .smallipop-instance.sipAlignBottom .sipArrowBorder { bottom: auto; top: -24px; }
17
- .smallipop-instance.sipPositionedLeft .sipArrow, .smallipop-instance.sipPositionedLeft .sipArrowBorder { right: -16px; left: auto; top: 50%; bottom: auto; border-width: 8px; margin: -8px 0 0; }
18
- .smallipop-instance.sipPositionedLeft .sipArrowBorder { right: -20px; border-width: 10px; margin: -10px 0 0; }
19
- .smallipop-instance.sipPositionedRight .sipArrow, .smallipop-instance.sipPositionedRight .sipArrowBorder { left: -16px; right: auto; top: 50%; bottom: auto; border-width: 8px; margin: -8px 0 0; }
20
- .smallipop-instance.sipPositionedRight .sipArrowBorder { left: -20px; border-width: 10px; margin: -10px 0 0; }
21
- .smallipop-instance .smallipop-tour-content { padding: 5px 0; min-width: 150px; }
22
- .smallipop-instance .smallipop-tour-footer { padding-top: 5px; position: relative; }
23
- .smallipop-instance .smallipop-tour-progress { color: #bbb; text-align: center; position: absolute; left: 50%; width: 80px; margin-left: -40px; top: 8px; }
24
- .smallipop-instance .smallipop-tour-close-icon { position: absolute; right: -8px; top: -8px; width: 16px; height: 16px; padding-top: 0px; font-size: 11px; background: #555; color: #ccc; text-align: center; text-shadow: 0 -1px 1px #666666; border-radius: 8px; -o-border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
25
- .smallipop-instance .smallipop-tour-close-icon:hover { text-decoration: none; background: #666; color: #fff; }
26
- .smallipop-instance .smallipop-tour-prev, .smallipop-instance .smallipop-tour-next, .smallipop-instance .smallipop-tour-close { color: #ccc; display: block; padding: 3px 4px 2px; line-height: 1em; float: left; background: #203142; border-radius: 3px; -o-border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
27
- .smallipop-instance .smallipop-tour-prev:hover, .smallipop-instance .smallipop-tour-next:hover, .smallipop-instance .smallipop-tour-close:hover { color: #fff; background: #293e53; text-decoration: none; }
28
- .smallipop-instance .smallipop-tour-next, .smallipop-instance .smallipop-tour-close { float: right; }
29
-
30
- /* default theme */
31
- .smallipop-instance.default { text-shadow: 0 -1px 1px #0f161e; -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); border-radius: 12px; -o-border-radius: 12px; -moz-border-radius: 12px; -webkit-border-radius: 12px; background-repeat: repeat-x; background-image: -webkit-linear-gradient(top, rgba(49, 75, 100, 0.9), rgba(26, 38, 52, 0.9)); background-image: -moz-linear-gradient(top, rgba(49, 75, 100, 0.9), rgba(26, 38, 52, 0.9)); background-image: -ms-linear-gradient(top, rgba(49, 75, 100, 0.9), rgba(26, 38, 52, 0.9)); background-image: -o-linear-gradient(top, rgba(49, 75, 100, 0.9), rgba(26, 38, 52, 0.9)); background-image: linear-gradient(top, rgba(49, 75, 100, 0.9), rgba(26, 38, 52, 0.9)); /* Fallback for opera */ background-image: -webkit-radial-gradient(50% -100px, circle contain, rgba(49, 75, 100, 0.9) 100px, rgba(33, 50, 66, 0.9) 130px, rgba(26, 38, 52, 0.9) 150px); background-image: -moz-radial-gradient(50% -100px, circle contain, rgba(49, 75, 100, 0.9) 100px, rgba(33, 50, 66, 0.9) 130px, rgba(26, 38, 52, 0.9) 150px); background-image: -ms-radial-gradient(50% -100px, circle contain, rgba(49, 75, 100, 0.9) 100px, rgba(33, 50, 66, 0.9) 130px, rgba(26, 38, 52, 0.9) 150px); background-image: -o-radial-gradient(50% -100px, circle contain, rgba(49, 75, 100, 0.9) 100px, rgba(33, 50, 66, 0.9) 130px, rgba(26, 38, 52, 0.9) 150px); background-image: radial-gradient(50% -100px, circle contain, rgba(49, 75, 100, 0.9) 100px, rgba(33, 50, 66, 0.9) 130px, rgba(26, 38, 52, 0.9) 150px); }
32
- .smallipop-instance.default a { text-shadow: 0 -1px 1px #0f161e; }
33
- .smallipop-instance.default .sipContent { border-top: 1px solid #586d82; border-radius: 12px; -o-border-radius: 12px; -moz-border-radius: 12px; -webkit-border-radius: 12px; }
34
- .smallipop-instance.default .sipArrow { border-color: #1a2634 transparent transparent transparent; }
35
- .smallipop-instance.default .sipArrowBorder { border-color: #0f161e transparent transparent transparent; }
36
- .smallipop-instance.default.sipAlignBottom .sipArrow { border-color: transparent transparent #1a2634 transparent; }
37
- .smallipop-instance.default.sipAlignBottom .sipArrowBorder { border-color: transparent transparent #0f161e transparent; }
38
- .smallipop-instance.default.sipPositionedLeft .sipArrow { border-color: transparent transparent transparent #1a2634; }
39
- .smallipop-instance.default.sipPositionedLeft .sipArrowBorder { border-color: transparent transparent transparent #0f161e; }
40
- .smallipop-instance.default.sipPositionedRight .sipArrow { border-color: transparent #1a2634 transparent transparent; }
41
- .smallipop-instance.default.sipPositionedRight .sipArrowBorder { border-color: transparent #0f161e transparent transparent; }
42
-
43
- .cssgradients.rgba .smallipop-instance.default { background-color: transparent; }
44
-
45
- /* blue theme */
46
- .smallipop-instance.blue { background: transparent; color: #111; border: 10px solid #0064b4; border-color: rgba(0, 100, 180, 0.9); -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); border-radius: 7px; -o-border-radius: 7px; -moz-border-radius: 7px; -webkit-border-radius: 7px; }
47
- .smallipop-instance.blue a { color: #2276aa; }
48
- .smallipop-instance.blue .sipContent { border: 0; background: #fcfcfc; }
49
- .smallipop-instance.blue .sipArrow { bottom: -30px; border-color: #0064b4 transparent transparent transparent; border-color: rgba(0, 100, 180, 0.9) transparent transparent transparent; }
50
- .smallipop-instance.blue.sipAlignBottom .sipArrow { top: -30px; border-color: transparent transparent #0064b4 transparent; border-color: transparent transparent rgba(0, 100, 180, 0.9) transparent; }
51
- .smallipop-instance.blue.sipPositionedLeft .sipArrow { right: -26px; border-color: transparent transparent transparent #0064b4; border-color: transparent transparent transparent rgba(0, 100, 180, 0.9); }
52
- .smallipop-instance.blue.sipPositionedRight .sipArrow { left: -26px; border-color: transparent #0064b4 transparent transparent; border-color: transparent rgba(0, 100, 180, 0.9) transparent transparent; }
53
- .smallipop-instance.blue .smallipop-tour-progress { color: #777; }
54
- .smallipop-instance.blue .smallipop-tour-prev, .smallipop-instance.blue .smallipop-tour-next, .smallipop-instance.blue .smallipop-tour-close { color: #222; background: #efefef; }
55
- .smallipop-instance.blue .smallipop-tour-prev:hover, .smallipop-instance.blue .smallipop-tour-next:hover, .smallipop-instance.blue .smallipop-tour-close:hover { color: #111; background: #f7f7f7; }
56
-
57
- /* black theme */
58
- .smallipop-instance.black { background-color: #222; border-color: #111; text-shadow: 0 -1px 1px #111111; color: #f5f5f5; -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); background-repeat: repeat-x; background-image: -webkit-linear-gradient(top, #333333, #222222); background-image: -moz-linear-gradient(top, #333333, #222222); background-image: -ms-linear-gradient(top, #333333, #222222); background-image: -o-linear-gradient(top, #333333, #222222); background-image: linear-gradient(top, #333333, #222222); border-radius: 5px; -o-border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; }
59
- .smallipop-instance.black a { color: #eef8ff; text-shadow: 0 -1px 1px #111111; }
60
- .smallipop-instance.black .sipContent { border-top: 1px solid #666; border-radius: 5px; -o-border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; }
61
- .smallipop-instance.black .sipArrow { border-color: #222 transparent transparent transparent; }
62
- .smallipop-instance.black .sipArrowBorder { border-color: #111 transparent transparent transparent; }
63
- .smallipop-instance.black.sipAlignBottom .sipArrow { border-color: transparent transparent #222 transparent; }
64
- .smallipop-instance.black.sipAlignBottom .sipArrowBorder { border-color: transparent transparent #111 transparent; }
65
- .smallipop-instance.black.sipPositionedLeft .sipArrow { border-color: transparent transparent transparent #222; }
66
- .smallipop-instance.black.sipPositionedLeft .sipArrowBorder { border-color: transparent transparent transparent #111; }
67
- .smallipop-instance.black.sipPositionedRight .sipArrow { border-color: transparent #222 transparent transparent; }
68
- .smallipop-instance.black.sipPositionedRight .sipArrowBorder { border-color: transparent #111 transparent transparent; }
69
- .smallipop-instance.black .smallipop-tour-progress { color: #888; }
70
- .smallipop-instance.black .smallipop-tour-prev, .smallipop-instance.black .smallipop-tour-next, .smallipop-instance.black .smallipop-tour-close { color: #ccc; background: #333; }
71
- .smallipop-instance.black .smallipop-tour-prev:hover, .smallipop-instance.black .smallipop-tour-next:hover, .smallipop-instance.black .smallipop-tour-close:hover { color: #fff; background: #3a3a3a; }
72
-
73
- .cssgradients .smallipop-instance.black { background-color: transparent; }
74
-
75
- /* orange theme */
76
- .smallipop-instance.orange { background-color: #f9aa18; border-color: #e17500; text-shadow: 0 1px 1px #fff24d; color: #714900; background-repeat: repeat-x; background-image: -webkit-linear-gradient(top, #fff24d, #f9aa18); background-image: -moz-linear-gradient(top, #fff24d, #f9aa18); background-image: -ms-linear-gradient(top, #fff24d, #f9aa18); background-image: -o-linear-gradient(top, #fff24d, #f9aa18); background-image: linear-gradient(top, #fff24d, #f9aa18); -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); border-radius: 10px; -o-border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; }
77
- .smallipop-instance.orange a { color: #145d95; text-shadow: 0 1px 1px #fff24d; }
78
- .smallipop-instance.orange .sipContent { border-top: 1px solid #fffabc; border-radius: 10px; -o-border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; }
79
- .smallipop-instance.orange .sipArrow { border-color: #f9aa18 transparent transparent transparent; }
80
- .smallipop-instance.orange .sipArrowBorder { border-color: #e17500 transparent transparent transparent; }
81
- .smallipop-instance.orange.sipAlignBottom .sipArrow { border-color: transparent transparent #f9aa18 transparent; }
82
- .smallipop-instance.orange.sipAlignBottom .sipArrowBorder { border-color: transparent transparent #e17500 transparent; }
83
- .smallipop-instance.orange.sipPositionedLeft .sipArrow { border-color: transparent transparent transparent #f9c718; }
84
- .smallipop-instance.orange.sipPositionedLeft .sipArrowBorder { border-color: transparent transparent transparent #e17500; }
85
- .smallipop-instance.orange.sipPositionedRight .sipArrow { border-color: transparent #f9c718 transparent transparent; }
86
- .smallipop-instance.orange.sipPositionedRight .sipArrowBorder { border-color: transparent #e17500 transparent transparent; }
87
- .smallipop-instance.orange .smallipop-tour-progress { color: #444; }
88
- .smallipop-instance.orange .smallipop-tour-prev, .smallipop-instance.orange .smallipop-tour-next, .smallipop-instance.orange .smallipop-tour-close { color: #444; background: #f19f06; }
89
- .smallipop-instance.orange .smallipop-tour-prev:hover, .smallipop-instance.orange .smallipop-tour-next:hover, .smallipop-instance.orange .smallipop-tour-close:hover { color: #333; background: #f9a509; }
90
-
91
- /* white theme */
92
- .smallipop-instance.white { background-color: #fcfcfc; border-color: #ccc; text-shadow: 0 1px 1px #eee; color: #444; width: 200px; max-width: 200px; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); border-radius: 6px; -o-border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; }
93
- .smallipop-instance.white .sipContent { text-align: center; border-radius: 6px; -o-border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; }
94
- .smallipop-instance.white .sipArrow { border-color: #fcfcfc transparent transparent transparent; }
95
- .smallipop-instance.white .sipArrowBorder { border-color: #ccc transparent transparent transparent; }
96
- .smallipop-instance.white.sipAlignBottom .sipArrow { border-color: transparent transparent #fcfcfc transparent; }
97
- .smallipop-instance.white.sipAlignBottom .sipArrowBorder { border-color: transparent transparent #ccc transparent; }
98
- .smallipop-instance.white.sipPositionedLeft .sipArrow { border-color: transparent transparent transparent #fcfcfc; }
99
- .smallipop-instance.white.sipPositionedLeft .sipArrowBorder { border-color: transparent transparent transparent #ccc; }
100
- .smallipop-instance.white.sipPositionedRight .sipArrow { border-color: transparent #fcfcfc transparent transparent; }
101
- .smallipop-instance.white.sipPositionedRight .sipArrowBorder { border-color: transparent #ccc transparent transparent; }
102
- .smallipop-instance.white .smallipop-tour-progress { color: #777; }
103
- .smallipop-instance.white .smallipop-tour-close-icon { background: #fafafa; color: #555; text-shadow: 0 1px 1px #fff; }
104
- .smallipop-instance.white .smallipop-tour-close-icon:hover { background: #f5f5f5; color: #222; }
105
- .smallipop-instance.white .smallipop-tour-prev, .smallipop-instance.white .smallipop-tour-next, .smallipop-instance.white .smallipop-tour-close { color: #666; background: #f0f0f0; }
106
- .smallipop-instance.white .smallipop-tour-prev:hover, .smallipop-instance.white .smallipop-tour-next:hover, .smallipop-instance.white .smallipop-tour-close:hover { color: #333; background: #f4f4f4; }
107
-
108
- /* white theme extended, requires rgba support */
109
- .smallipop-instance.whiteTransparent { background-color: rgba(255, 255, 255, 0.8); }
110
- .smallipop-instance.whiteTransparent .sipArrow { bottom: -21px; border-color: rgba(255, 255, 255, 0.8) transparent transparent transparent; }
111
- .smallipop-instance.whiteTransparent .sipArrowBorder { border-color: transparent; }
112
- .smallipop-instance.whiteTransparent.sipAlignBottom .sipArrow { top: -21px; border-color: transparent transparent rgba(255, 255, 255, 0.8) transparent; }
113
- .smallipop-instance.whiteTransparent.sipPositionedLeft .sipArrow { border-color: transparent transparent transparent rgba(255, 255, 255, 0.8); }
114
- .smallipop-instance.whiteTransparent.sipPositionedRight .sipArrow { border-color: transparent rgba(255, 255, 255, 0.8) transparent transparent; }
115
-
116
- /* fat shadow extension theme */
117
- .smallipop-instance.fatShadow { -webkit-box-shadow: 0 2px 20px rgba(0, 0, 0, 0.8); -moz-box-shadow: 0 2px 20px rgba(0, 0, 0, 0.8); box-shadow: 0 2px 20px rgba(0, 0, 0, 0.8); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/wpuf-form-builder.css DELETED
@@ -1,725 +0,0 @@
1
- [v-cloak] {
2
- display: none;
3
- }
4
- .wpuf-pro-text-alert {
5
- font-style: italic;
6
- color: #cccccc;
7
- }
8
- .wpuf-pro-text-alert a {
9
- text-decoration: none;
10
- color: #aaa;
11
- }
12
- #wpuf-pro-content {
13
- opacity: 0.7;
14
- }
15
- .clearfix:before,
16
- .clearfix:after {
17
- content: " ";
18
- display: table;
19
- }
20
- .clearfix:after {
21
- clear: both;
22
- }
23
- .pull-left {
24
- float: left !important;
25
- }
26
- .pull-right {
27
- float: right !important;
28
- }
29
- .text-center {
30
- text-align: center;
31
- }
32
- .text-right {
33
- text-align: right;
34
- }
35
- .margin-0 {
36
- margin: 0;
37
- }
38
- .margin-bottom-10 {
39
- margin-bottom: 10px;
40
- }
41
- .list-inline {
42
- padding-left: 0;
43
- list-style: none;
44
- margin-left: -5px;
45
- }
46
- .list-inline > li {
47
- display: inline-block;
48
- padding-left: 5px;
49
- padding-right: 5px;
50
- }
51
- .disabled {
52
- pointer-events: none;
53
- cursor: not-allowed;
54
- opacity: 0.7;
55
- }
56
- .label-hr {
57
- border-bottom: 1px solid #ccc;
58
- display: block;
59
- padding-bottom: 8px;
60
- }
61
- .slide-fade-enter-active {
62
- -webkit-transition: all 0.6s;
63
- -o-transition: all 0.6s;
64
- transition: all 0.6s;
65
- overflow: hidden;
66
- }
67
- .slide-fade-leave-active {
68
- -webkit-transition: all 0.4s;
69
- -o-transition: all 0.4s;
70
- transition: all 0.4s;
71
- overflow: hidden;
72
- }
73
- .slide-fade-enter,
74
- .slide-fade-leave-active {
75
- opacity: .3 !important;
76
- max-height: 0 !important;
77
- margin: 0 !important;
78
- }
79
- .sweet-alert {
80
- border-radius: 0;
81
- }
82
- .sweet-alert h2 {
83
- font-size: 26px;
84
- line-height: 1.6;
85
- }
86
- .sweet-alert p {
87
- font-size: 15px;
88
- font-weight: 400;
89
- color: #656565;
90
- line-height: 1.7;
91
- }
92
- .sweet-alert p a {
93
- text-decoration: none;
94
- }
95
- .sweet-alert button {
96
- border-radius: 3px;
97
- padding: 10px 20px;
98
- min-width: 100px;
99
- }
100
- .loader,
101
- .loader:after {
102
- border-radius: 50%;
103
- width: 25px;
104
- height: 25px;
105
- }
106
- .loader {
107
- display: inline-block;
108
- position: relative;
109
- text-indent: -9999em;
110
- border-top: 3px solid rgba(0, 115, 170, 0.2);
111
- border-right: 3px solid rgba(0, 115, 170, 0.2);
112
- border-bottom: 3px solid rgba(0, 115, 170, 0.2);
113
- border-left: 3px solid #0073aa;
114
- -webkit-transform: translateZ(0);
115
- -ms-transform: translateZ(0);
116
- transform: translateZ(0);
117
- -webkit-animation: wpuf_form_builder_loader 1.1s infinite linear;
118
- animation: wpuf_form_builder_loader 1.1s infinite linear;
119
- }
120
- .button.button-ajax-working .loader {
121
- display: inline-block;
122
- width: 17px;
123
- height: 17px;
124
- top: 4px;
125
- margin-right: 3px;
126
- border-top: 1px solid #66c6e4;
127
- border-right: 1px solid #66c6e4;
128
- border-bottom: 1px solid #66c6e4;
129
- border-left: 1px solid rgba(102, 198, 228, 0);
130
- }
131
- @-webkit-keyframes wpuf_form_builder_loader {
132
- 0% {
133
- -webkit-transform: rotate(0deg);
134
- transform: rotate(0deg);
135
- }
136
- 100% {
137
- -webkit-transform: rotate(360deg);
138
- transform: rotate(360deg);
139
- }
140
- }
141
- @keyframes wpuf_form_builder_loader {
142
- 0% {
143
- -webkit-transform: rotate(0deg);
144
- transform: rotate(0deg);
145
- }
146
- 100% {
147
- -webkit-transform: rotate(360deg);
148
- transform: rotate(360deg);
149
- }
150
- }
151
- #toast-container.toast-top-right {
152
- top: 40px;
153
- right: 18px;
154
- }
155
- #toast-container > div {
156
- opacity: 1;
157
- }
158
- #toast-container > :hover {
159
- opacity: .9;
160
- }
161
- .wp-core-ui .button-group.wpuf-flex-button-group {
162
- position: relative;
163
- z-index: 1;
164
- display: flex;
165
- flex-flow: row nowrap;
166
- justify-content: flex-start;
167
- align-content: center;
168
- align-items: center;
169
- }
170
- .wp-core-ui .button-group.wpuf-flex-button-group .button {
171
- flex-grow: 1;
172
- flex-shrink: 1;
173
- flex-basis: 0;
174
- align-self: auto;
175
- text-align: center;
176
- }
177
- .selectize-input {
178
- padding: 6px 5px;
179
- border: 1px solid #ddd;
180
- }
181
- .selectize-dropdown .active {
182
- background-color: #0073aa;
183
- color: #fff;
184
- }
185
- .selectize-element-group {
186
- display: none;
187
- }
188
- .selectize-element-group + .selectize-control {
189
- display: none;
190
- }
191
- .selectize-element-group.active + .selectize-control {
192
- display: block;
193
- margin-top: 10px;
194
- }
195
- .selectize-control.multi .selectize-input [data-value] {
196
- text-shadow: 0 1px 0 rgba(0, 51, 83, 0.3);
197
- -webkit-border-radius: 3px;
198
- -moz-border-radius: 3px;
199
- border-radius: 3px;
200
- background-color: rgba(0, 115, 170, 0.64);
201
- background-image: -moz-linear-gradient(top, rgba(0, 115, 170, 0.4), #0073aa);
202
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(0, 115, 170, 0.4)), to(#0073aa));
203
- background-image: -webkit-linear-gradient(top, rgba(0, 115, 170, 0.4), #0073aa);
204
- background-image: -o-linear-gradient(top, rgba(0, 115, 170, 0.4), #0073aa);
205
- background-image: linear-gradient(to bottom, rgba(0, 115, 170, 0.4), #0073aa);
206
- background-repeat: repeat-x;
207
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#660073aa', endColorstr='#ff0073aa', GradientType=0);
208
- -webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03);
209
- box-shadow: 0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03);
210
- }
211
- .selectize-control.multi .selectize-input [data-value].active {
212
- background-color: rgba(0, 115, 170, 0.64);
213
- background-image: -moz-linear-gradient(top, rgba(0, 115, 170, 0.4), #0073aa);
214
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(0, 115, 170, 0.4)), to(#0073aa));
215
- background-image: -webkit-linear-gradient(top, rgba(0, 115, 170, 0.4), #0073aa);
216
- background-image: -o-linear-gradient(top, rgba(0, 115, 170, 0.4), #0073aa);
217
- background-image: linear-gradient(to bottom, rgba(0, 115, 170, 0.4), #0073aa);
218
- background-repeat: repeat-x;
219
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#660073aa', endColorstr='#ff0073aa', GradientType=0);
220
- }
221
- #wpuf-form-builder {
222
- width: calc(100% - 200px);
223
- padding-top: 10px;
224
- position: fixed;
225
- top: 25px;
226
- }
227
- #wpuf-form-builder * {
228
- box-sizing: border-box;
229
- }
230
- #wpuf-form-builder > fieldset > .nav-tab-wrapper .nav-tab:focus {
231
- outline: 0;
232
- -webkit-box-shadow: none;
233
- box-shadow: none;
234
- }
235
- #wpuf-form-builder > fieldset > .nav-tab-wrapper .button {
236
- font-weight: 400;
237
- }
238
- #wpuf-form-builder > fieldset > .tab-contents {
239
- border-bottom: 1px solid #cccccc;
240
- }
241
- #wpuf-form-builder > fieldset > .tab-contents > .group {
242
- display: none;
243
- }
244
- #wpuf-form-builder > fieldset > .tab-contents > .group.active {
245
- display: block;
246
- }
247
- #wpuf-form-builder > fieldset > .tab-contents > .group:not(#wpuf-form-builder-container):not(#wpuf-form-builder-settings) {
248
- height: calc(100vh - 125px);
249
- overflow-y: auto;
250
- padding-top: 15px;
251
- }
252
- #wpuf-form-builder .wpuf-settings-nav-tab-wrapper {
253
- width: 200px;
254
- }
255
- #wpuf-form-builder .wp-picker-holder * {
256
- box-sizing: content-box;
257
- }
258
- #wpuf-form-builder-settings {
259
- position: relative;
260
- margin-top: 15px;
261
- }
262
- #wpuf-form-builder-settings .nav-tab-wrapper {
263
- position: absolute;
264
- top: 0;
265
- left: 0;
266
- width: 170px;
267
- border-bottom: 0;
268
- }
269
- #wpuf-form-builder-settings .nav-tab-wrapper a {
270
- width: calc(100% - -1px);
271
- margin-left: 0;
272
- margin-bottom: .5em;
273
- border-right: 1px solid #cccccc;
274
- border-bottom: 1px solid #cccccc;
275
- font-weight: 400;
276
- font-size: 13px;
277
- }
278
- #wpuf-form-builder-settings .nav-tab-wrapper a.nav-tab-active {
279
- border-right-color: #f1f1f1;
280
- }
281
- #wpuf-form-builder-settings .nav-tab-wrapper a:focus {
282
- outline: 0;
283
- -webkit-box-shadow: none;
284
- box-shadow: none;
285
- }
286
- #wpuf-form-builder-settings .tab-contents {
287
- margin-left: 170px;
288
- border-left: 1px solid #cccccc;
289
- padding-left: 20px;
290
- }
291
- #wpuf-form-builder-settings .tab-contents > .group {
292
- display: none;
293
- height: calc(100vh - 140px);
294
- overflow-y: auto;
295
- }
296
- #wpuf-form-builder-settings .tab-contents > .group.active {
297
- display: block;
298
- }
299
- #wpuf-form-builder-settings .tab-contents .form-table {
300
- margin-top: 0;
301
- }
302
- #wpuf-form-builder-container {
303
- position: relative;
304
- }
305
- #wpuf-form-builder-container header {
306
- height: 45px;
307
- border-right: 1px solid #cccccc;
308
- }
309
- #wpuf-form-builder-container header .form-title {
310
- cursor: pointer;
311
- font-size: 1.3em;
312
- font-weight: 600;
313
- float: left;
314
- margin-right: 10px;
315
- margin-top: 10px;
316
- line-height: 1.5;
317
- max-width: 300px;
318
- white-space: nowrap;
319
- overflow: hidden;
320
- text-overflow: ellipsis;
321
- }
322
- #wpuf-form-builder-container header .form-title:hover {
323
- background-color: rgba(85, 85, 85, 0.2);
324
- }
325
- #wpuf-form-builder-container header .form-switcher-arrow {
326
- cursor: pointer;
327
- font-size: 24px;
328
- margin-top: 10px;
329
- line-height: 1;
330
- width: 20px;
331
- text-align: center;
332
- }
333
- #wpuf-form-builder-container header .form-switcher-arrow:hover {
334
- background-color: rgba(85, 85, 85, 0.2);
335
- }
336
- #wpuf-form-builder-container header .form-id {
337
- color: #fff;
338
- background-color: #008ec2;
339
- line-height: 170%;
340
- padding: 0 8px;
341
- border-radius: 2px;
342
- font-size: 13px;
343
- display: inline-block;
344
- margin: 10px 0 0 15px;
345
- cursor: pointer;
346
- }
347
- #wpuf-form-builder-container section {
348
- height: calc(100vh - 170px);
349
- overflow-y: auto;
350
- }
351
- #wpuf-form-builder-container #builder-form-fields {
352
- position: absolute;
353
- top: 0;
354
- right: 0;
355
- width: 360px;
356
- }
357
- #wpuf-form-builder-container #builder-form-fields header ul {
358
- margin: 0;
359
- }
360
- #wpuf-form-builder-container #builder-form-fields header ul li {
361
- width: 50%;
362
- text-align: center;
363
- float: left;
364
- line-height: 1;
365
- margin: 0;
366
- }
367
- #wpuf-form-builder-container #builder-form-fields header ul li a {
368
- text-decoration: none;
369
- line-height: 44px;
370
- display: block;
371
- background-color: #e5e5e5;
372
- color: #777;
373
- border-bottom: 1px solid #cccccc;
374
- -webkit-transition: background-color 0.4s;
375
- -o-transition: background-color 0.4s;
376
- transition: background-color 0.4s;
377
- }
378
- #wpuf-form-builder-container #builder-form-fields header ul li a:hover {
379
- background-color: #f2f2f2;
380
- }
381
- #wpuf-form-builder-container #builder-form-fields header ul li a:focus {
382
- outline: 0;
383
- -webkit-box-shadow: none;
384
- box-shadow: none;
385
- }
386
- #wpuf-form-builder-container #builder-form-fields header ul li.active a {
387
- background-color: #fff;
388
- color: #444;
389
- border-bottom: 1px solid #fff;
390
- }
391
- #wpuf-form-builder-container #builder-form-fields header ul li:first-child {
392
- border-right: 1px solid #cccccc;
393
- }
394
- #wpuf-form-builder-container #builder-form-fields section {
395
- background-color: #fff;
396
- border-right: 1px solid #cccccc;
397
- }
398
- #wpuf-form-builder-container #builder-form-fields section .wpuf-form-builder-panel {
399
- padding: 10px;
400
- }
401
- #wpuf-form-builder-container #builder-stage {
402
- margin-right: 360px;
403
- }
404
- #wpuf-form-builder-container #builder-stage section {
405
- background-color: #6b6b6b;
406
- padding: 30px;
407
- }
408
- #wpuf-form-builder-container #builder-stage section #form-preview {
409
- background-color: #fff;
410
- -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
411
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
412
- padding: 25px;
413
- max-width: 800px;
414
- margin: 0 auto;
415
- }
416
- #form-preview-stage .field-items {
417
- position: relative;
418
- background-color: #fff;
419
- }
420
- #form-preview-stage .field-items .control-buttons {
421
- position: absolute;
422
- top: 0;
423
- left: 0;
424
- z-index: 10;
425
- display: none;
426
- width: 100%;
427
- height: 100%;
428
- margin: 0;
429
- text-align: center;
430
- background: rgba(255, 185, 0, 0.08);
431
- border: 1px dashed #ffb900;
432
- }
433
- #form-preview-stage .field-items .control-buttons p {
434
- position: absolute;
435
- top: 50%;
436
- left: 50%;
437
- margin: -14px 0 0 -61px;
438
- line-height: 1;
439
- color: #eee;
440
- background-color: #23282d;
441
- }
442
- #form-preview-stage .field-items .control-buttons i {
443
- cursor: pointer;
444
- padding: 8px;
445
- }
446
- #form-preview-stage .field-items .control-buttons i.move {
447
- cursor: move;
448
- }
449
- #form-preview-stage .field-items .control-buttons i:hover {
450
- background-color: #0073aa;
451
- }
452
- #form-preview-stage .field-items:hover .control-buttons {
453
- display: block;
454
- }
455
- #form-preview-stage .field-items.current-editing {
456
- background-color: rgba(255, 185, 0, 0.15);
457
- }
458
- #form-preview-stage .field-items.current-editing.ui-sortable-helper {
459
- background-color: #fff;
460
- }
461
- #form-preview-stage .field-items.ui-sortable-helper {
462
- -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
463
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
464
- }
465
- #form-preview-stage .form-preview-stage-dropzone {
466
- background-color: rgba(255, 185, 0, 0.3) !important;
467
- border: 1px solid #ffb900;
468
- height: 50px;
469
- }
470
- #form-preview-stage .wpuf-submit + .button + .form-preview-stage-dropzone,
471
- #form-preview-stage .field-items.empty-list-item + .form-preview-stage-dropzone {
472
- display: none;
473
- }
474
- #form-preview-stage .field-items.empty-list-item {
475
- padding: 24px;
476
- margin: 0;
477
- border: 1px dashed rgba(35, 40, 45, 0.5);
478
- }
479
- #form-preview-stage .form-preview-stage-dropzone + .field-items.empty-list-item {
480
- display: none;
481
- }
482
- #form-preview-stage .hidden-field-list {
483
- border-top: 1px dashed #cccccc;
484
- }
485
- #form-preview-stage .hidden-field-list h4 {
486
- font-weight: 400;
487
- font-size: 16px;
488
- margin: 12px 0;
489
- }
490
- #form-preview-stage .hidden-field-list ul li {
491
- background-color: #f1f1f1;
492
- }
493
- .panel-form-field-group {
494
- margin-bottom: 15px;
495
- }
496
- .panel-form-field-group h3 {
497
- margin: 0;
498
- font-size: 15px;
499
- border-bottom: 1px solid #eee;
500
- padding-bottom: 10px;
501
- cursor: pointer;
502
- }
503
- .panel-form-field-group h3 i {
504
- float: right;
505
- }
506
- .panel-form-field-group .panel-form-field-buttons {
507
- opacity: 1;
508
- max-height: 100vh;
509
- overflow: hidden;
510
- margin: 15px 0 0;
511
- }
512
- .panel-form-field-group .button {
513
- display: block;
514
- width: 48%;
515
- margin: 0 0 10px 0;
516
- float: left;
517
- text-align: left;
518
- }
519
- .panel-form-field-group .button:nth-child(odd) {
520
- margin-right: 2%;
521
- }
522
- .panel-form-field-group .button.button-faded {
523
- opacity: .5;
524
- }
525
- .button.ui-draggable-dragging {
526
- margin: 0;
527
- text-align: left;
528
- }
529
- .wpuf-form-builder-field-options .option-fields-section {
530
- margin-bottom: 15px;
531
- }
532
- .wpuf-form-builder-field-options .section-title {
533
- margin: 0;
534
- font-size: 15px;
535
- border-bottom: 1px solid #eee;
536
- padding-bottom: 10px;
537
- cursor: pointer;
538
- }
539
- .wpuf-form-builder-field-options .section-title i {
540
- float: right;
541
- }
542
- .wpuf-form-builder-field-options .option-field-section-fields {
543
- margin-top: 15px;
544
- max-height: 150vh;
545
- opacity: 1;
546
- }
547
- .wpuf-form-builder-field-options .panel-field-opt {
548
- margin-bottom: 15px;
549
- }
550
- .wpuf-form-builder-field-options .panel-field-opt .field-helper-text {
551
- color: rgba(35, 40, 45, 0.5);
552
- margin-left: 6px;
553
- }
554
- .wpuf-form-builder-field-options .panel-field-opt.panel-field-opt-text input[type="text"],
555
- .wpuf-form-builder-field-options .panel-field-opt.panel-field-opt-text input[type="number"] {
556
- display: block;
557
- width: 100%;
558
- margin: 5px 0 0;
559
- line-height: 1.75;
560
- }
561
- .wpuf-form-builder-field-options .panel-field-opt.panel-field-opt-radio > label {
562
- display: block;
563
- margin-bottom: 5px;
564
- }
565
- .wpuf-form-builder-field-options .panel-field-opt.panel-field-opt-radio > ul {
566
- margin-top: 0;
567
- margin-bottom: 0;
568
- }
569
- .wpuf-form-builder-field-options .panel-field-opt.panel-field-opt-select select {
570
- width: 100%;
571
- height: 32px;
572
- margin: 4px 0 0;
573
- }
574
- .wpuf-form-builder-field-options .panel-field-opt .chosen-select + .chosen-container {
575
- margin-top: 10px;
576
- }
577
- .wpuf-form-builder-field-options .panel-field-opt .label-title-block {
578
- display: block;
579
- margin-bottom: 3px;
580
- }
581
- .option-field-option-chooser {
582
- margin: 12px 0 0;
583
- }
584
- .option-field-option-chooser.margin-0 {
585
- margin: 0;
586
- }
587
- .option-field-option-chooser .selector,
588
- .option-field-option-chooser .sort-handler,
589
- .option-field-option-chooser .label,
590
- .option-field-option-chooser .value,
591
- .option-field-option-chooser .action-buttons {
592
- float: left;
593
- }
594
- .option-field-option-chooser .selector {
595
- width: 25px;
596
- }
597
- .option-field-option-chooser .selector input {
598
- margin-top: 14px;
599
- }
600
- .option-field-option-chooser .sort-handler {
601
- width: 22px;
602
- cursor: ns-resize;
603
- }
604
- .option-field-option-chooser .sort-handler i {
605
- margin-top: 14px;
606
- font-size: 15px;
607
- }
608
- .option-field-option-chooser .label {
609
- width: 208px;
610
- margin-right: 8px;
611
- }
612
- .option-field-option-chooser.show-value .label,
613
- .option-field-option-chooser.show-value .value {
614
- width: 100px;
615
- margin-right: 8px;
616
- }
617
- .option-field-option-chooser .header .label,
618
- .option-field-option-chooser .header .value {
619
- color: #909090;
620
- }
621
- .option-field-option-chooser .action-buttons {
622
- width: 36px;
623
- }
624
- .option-field-option-chooser .action-buttons i {
625
- cursor: pointer;
626
- font-size: 16px;
627
- margin-top: 13px;
628
- }
629
- .panel-field-opt-repeater-columns .repeater-columns li > div {
630
- float: left;
631
- }
632
- .panel-field-opt-repeater-columns .repeater-columns .sorter {
633
- width: 30px;
634
- }
635
- .panel-field-opt-repeater-columns .repeater-columns .sorter i {
636
- cursor: ns-resize;
637
- font-size: 16px;
638
- margin-top: 5px;
639
- }
640
- .panel-field-opt-repeater-columns .repeater-columns .input-container {
641
- width: 195px;
642
- margin-right: 10px;
643
- }
644
- .panel-field-opt-repeater-columns .repeater-columns .input-container input {
645
- width: 100%;
646
- }
647
- .panel-field-opt-repeater-columns .repeater-columns .action-buttons {
648
- width: 50px;
649
- }
650
- .panel-field-opt-repeater-columns .repeater-columns .action-buttons i {
651
- cursor: pointer;
652
- font-size: 16px;
653
- padding: 0 3px;
654
- margin-top: 4px;
655
- }
656
- .panel-field-opt-textarea textarea {
657
- display: block;
658
- width: 100%;
659
- margin: 5px 0 0;
660
- line-height: 1.75;
661
- }
662
- .panel-field-html-help-text pre {
663
- max-width: 100%;
664
- overflow-x: auto;
665
- }
666
- .panel-field-opt-select .opt-select-element {
667
- display: block;
668
- max-width: 100%;
669
- }
670
- ul.wpuf-form li .wpuf-text-editor .wp-editor-wrap {
671
- border: 0;
672
- }
673
- .form-switcher-content {
674
- position: absolute;
675
- background-color: #f9f9f9;
676
- min-width: 160px;
677
- box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
678
- z-index: 9999;
679
- margin: 0;
680
- }
681
- .form-switcher-content li {
682
- margin: 0;
683
- }
684
- .form-switcher-content a {
685
- color: black;
686
- padding: 12px;
687
- text-decoration: none;
688
- display: block;
689
- text-align: center;
690
- }
691
- .form-switcher-content a:hover {
692
- color: #fff;
693
- background-color: #008ec2;
694
- }
695
- .form-switcher-content a.active {
696
- font-weight: bold;
697
- color: #fff;
698
- background-color: #008ec2;
699
- }
700
- .insert-photo-icon {
701
- vertical-align: text-top;
702
- color: #82878c;
703
- font-size: 18px;
704
- }
705
- .password-strength-meter {
706
- border-style: solid;
707
- border-width: 1px;
708
- float: left;
709
- margin: 0;
710
- padding: 3px 5px;
711
- text-align: center;
712
- width: 200px;
713
- display: block;
714
- background-color: #eee;
715
- border-color: #ddd;
716
- }
717
- ul.wpuf-form li .wpuf-password-field {
718
- width: 100%;
719
- margin-bottom: 10px;
720
- }
721
- ul.wpuf-form li .wpuf-password-field:after {
722
- clear: both;
723
- content: "";
724
- display: table;
725
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/wpuf.css DELETED
@@ -1,467 +0,0 @@
1
- .wpuf-post-form{
2
- list-style: none;
3
- margin: 0;
4
- padding: 0;
5
- }
6
- .wpuf-post-form li{
7
- margin: 5px 0;
8
- padding: 0;
9
- }
10
-
11
- .wpuf-post-form label {
12
- float: left;
13
- font-weight: bold;
14
- height: 20px;
15
- margin: 0;
16
- min-width: 130px;
17
- padding: 0 10px 0 0;
18
- font-size: 12px;
19
- cursor: pointer;
20
- }
21
-
22
- .wpuf-post-form input, .wpuf-post-form textarea, .wpuf-post-form select{
23
- margin: 0;
24
- padding: 5px;
25
- border: 1px solid #ccc;
26
- font-size: 12px;
27
- -moz-border-radius: 5px;
28
- border-radius: 5px;
29
- }
30
-
31
- .wpuf-post-form input:focus, .wpuf-post-form textarea:focus, .wpuf-post-form select:focus{
32
- background: #F2F2F2;
33
- }
34
-
35
- .wpuf-post-form .childCategory {
36
- padding-top: 5px;
37
- }
38
-
39
- .wpuf-post-form input[type=text]{
40
- width: 50%;
41
- }
42
-
43
- .wpuf-post-form textarea{
44
- width: 70%;
45
- }
46
-
47
- .wpuf-post-form .wpuf-check-container {
48
- float: left;
49
- width: 70%;
50
- }
51
-
52
- .wpuf-post-form input[type=submit], .wpuf-submit, .wpuf-button{
53
- -moz-border-radius: 5px;
54
- border-radius: 5px;
55
- color: #333;
56
- padding: 5px 10px;
57
- border: 1px solid #ccc;
58
- text-shadow: 0 1px 0 #FFFFFF;
59
- background: #eeeeee; /* old browsers */
60
- background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* firefox */
61
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* webkit */
62
- cursor: pointer;
63
- }
64
-
65
- .wpuf-post-form input[type=submit]:active, .wpuf-submit:active, .wpuf-button:active{
66
- background: #ddd;
67
- }
68
-
69
- .wpuf-post-form input[type=submit]:hover, .wpuf-submit:hover, .wpuf-button:hover{
70
- background: #ddd; /* old browsers */
71
- background: -moz-linear-gradient(top, #cccccc 0%, #eeeeee 100%); /* firefox */
72
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cccccc), color-stop(100%,#eeeeee)); /* webkit */
73
- }
74
-
75
- .wpuf-post-form p.description {
76
- color: #868686;
77
- margin: 0;
78
- padding: 3px 0 3px 140px;
79
- font-size: 12px;
80
- }
81
-
82
- .wpuf-post-form #wp-new-post-desc-wrap tr td {
83
- padding: 0;
84
- }
85
-
86
- .clear{
87
- clear:both;
88
- height:0;
89
- font-size: 1px;
90
- line-height: 0px;
91
- }
92
-
93
- .success {
94
- background-color: #DFF2BF;
95
- border: 1px solid #BCDF7D;
96
- color: #4F8A10;
97
- padding: 10px;
98
- font-size: 13px;
99
- font-weight: bold;
100
- margin-bottom: 10px;
101
- -moz-border-radius: 5px;
102
- -webkit-border-radius: 5px;
103
- border-radius: 5px;
104
- text-shadow: 0 1px 0 #FFFFFF;
105
- font-size: 13px;
106
- }
107
-
108
-
109
- .error {
110
- margin: 0 10px 10px 10px;
111
- padding: 3px 10px;
112
- color: #D8000C;
113
- background-color: #FFBABA;
114
- border: solid 1px #dd3c10;
115
- border-radius: 5px;
116
- -moz-border-radius: 5px;
117
- -webkit-border-radius: 5px;
118
- font-weight: bold;
119
- text-shadow: 0 1px 0 #FFFFFF;
120
- font-size: 13px;
121
- }
122
-
123
- .info {
124
- background-color: #fef5be;
125
- border: 2px solid #fdd425;
126
- border-radius: 5px;
127
- -moz-border-radius: 5px;
128
- -webkit-border-radius: 5px;
129
- padding: 5px 10px;
130
- margin: 0 0 10px 0;
131
- font-size: 13px;
132
- }
133
-
134
- #content .wpuf-profile table, .wpuf-profile table{
135
- border: none;
136
- }
137
-
138
- #content .wpuf-profile legend, .wpuf-profile legend{
139
- border: 1px solid #eee;
140
- padding: 5px 10px;
141
- }
142
-
143
- #content .wpuf-profile th, #content .wpuf-profile td, .wpuf-profile th, .wpuf-profile td{
144
- vertical-align: top;
145
- border-top: 1px solid #eee;
146
- border: none;
147
- }
148
-
149
- #content .wpuf-profile input, .wpuf-profile input, .wpuf-profile textarea{
150
- border: 1px solid #CCCCCC;
151
- margin: 0;
152
- padding: 5px;
153
- }
154
-
155
- .wpuf-profile h3, #content .wpuf-profile h3{
156
- margin: 0;
157
- }
158
-
159
- .wpuf-profile table, #content .wpuf-profile table{
160
- margin: 0 0 5px 0;
161
- }
162
-
163
- #content #editorcontainer tr td, #content #editorcontainer table {
164
- padding: 0;
165
- margin: 0;
166
- }
167
-
168
- #wpuf-post-area li{
169
- list-style: none;
170
- }
171
-
172
- span.required {
173
- color: red;
174
- }
175
-
176
- table.wpuf-table {
177
- border: 1px solid #E7E7E7;
178
- margin: 0 opx 10px 0;
179
- text-align: left;
180
- width: 100%;
181
- }
182
-
183
- table.wpuf-table thead th, table.wpuf-table th {
184
- color: #888888;
185
- font-size: 12px;
186
- font-weight: bold;
187
- line-height: 18px;
188
- padding: 9px 24px;
189
- }
190
-
191
- table.wpuf-table td {
192
- border-top: 1px solid #E7E7E7;
193
- padding: 6px 24px;
194
- }
195
-
196
- .post_count {
197
- border: 1px solid #E7E7E7;
198
- margin: 5px 0;
199
- padding: 5px;
200
- }
201
-
202
- .post_count span {
203
- font-weight: bold;
204
- }
205
-
206
- .wpuf-pagination {
207
- display: block;
208
- width: 100%;
209
- margin: 10px 0;
210
- }
211
-
212
- /** author info **/
213
- .wpuf-author {
214
- clear: both;
215
- margin: 10px 0;
216
- }
217
- .wpuf-author h3{
218
- margin: 0 !important;
219
- background: #CFCFCF;
220
- text-align: left;
221
- padding: 3px 10px;
222
- }
223
- .wpuf-author-inside {
224
- background: none repeat scroll 0 0 #F0F0F0;
225
- border-bottom: 2px solid #DDDDDD;
226
- height: 90px;
227
- padding-left: 10px;
228
- padding-top: 15px;
229
- margin-bottom: 15px;
230
- }
231
-
232
- .wpuf-author-inside .wpuf-user-image {
233
- float: left;
234
- padding-right: 15px;
235
- }
236
- .wpuf-author-body p {
237
- margin-bottom: 10px !important;
238
- }
239
-
240
- .wpuf-author-body p.wpuf-user-name a {
241
- color: #335160;
242
- font-size: 1.2em;
243
- font-weight: bold;
244
- }
245
-
246
- .wpuf-author-inside p.wpuf-author-info {
247
- padding-top: 8px;
248
- }
249
-
250
- .invalid {
251
- border: 1px solid #FF7272 !important;
252
- }
253
-
254
-
255
- #pass-strength-result {
256
- border-radius: 6px 6px 6px 6px;
257
- border-style: solid;
258
- border-width: 1px;
259
- float: left;
260
- margin: 12px 5px 5px 1px;
261
- padding: 7px;
262
- text-align: center;
263
- width: 248px;
264
- }
265
- #pass-strength-result.good {
266
- background-color: #FFEC8B;
267
- border-color: #FFCC00 !important;
268
- }
269
- #pass-strength-result {
270
- background-color: #EEEEEE;
271
- border-color: #DDDDDD !important;
272
- }
273
- #pass-strength-result.bad {
274
- background-color: #FFB78C;
275
- border-color: #FF853C !important;
276
- }
277
- #pass-strength-result.strong {
278
- background-color: #C3FF88;
279
- border-color: #8DFF1C !important;
280
- }
281
- #pass-strength-result.short {
282
- background-color: #FFA0A0;
283
- border-color: #F04040 !important;
284
- }
285
-
286
- .timestamp-wrap input {
287
- width: 40px !important;
288
- }
289
-
290
- .wpuf_sub_info {
291
- padding: 0;
292
- margin: 10px 5px;
293
- border: 1px solid green;
294
- border-radius: 5px;
295
- }
296
-
297
- .wpuf_sub_info h3{
298
- margin: 0 0 5px 0 !important;
299
- background: green;
300
- color: #fff !important;
301
- padding: 3px 10px !important;
302
- font-weight: bold;
303
- }
304
-
305
- .wpuf_sub_info .text{
306
- padding: 5px 10px;
307
- }
308
-
309
-
310
- ul.wpuf_packs {
311
- overflow: hidden;
312
- margin: 35px 0 15px;
313
- }
314
-
315
- ul.wpuf_packs li {
316
- background: #EEEEEE;
317
- border: 1px solid #DDDDDD;
318
- border-radius: 5px 5px 5px 5px;
319
- float: left;
320
- list-style: none outside none;
321
- margin: 25px 25px 10px 0;
322
- padding: 5px;
323
- position: relative;
324
- width: 200px;
325
- }
326
-
327
- ul.wpuf_packs h3 {
328
- padding: 10px !important;
329
- font-size: 14px;
330
- font-weight: bold;
331
- }
332
-
333
- ul.wpuf_packs p {
334
- padding: 0 10px;
335
- margin-bottom: 8px;
336
- }
337
-
338
- .wpuf_packs .cost {
339
- background: red;
340
- border-radius: 30px 30px 30px 30px;
341
- color: #FFFFFF;
342
- margin: -16px -12px 0 0;
343
- padding: 10px 8px 8px;
344
- position: absolute;
345
- right: 0;
346
- top: 0;
347
- }
348
-
349
- .wpuf-loading {
350
- height: 16px;
351
- width: 16px;
352
- background: url('../images/wpspin_light.gif') no-repeat;
353
- padding: 0;
354
- margin: 5px 10px;
355
- right: -40px;
356
- top: 0;
357
- float: left;
358
- }
359
-
360
- .wpuf-pagination div.pagination{
361
- text-align:center;
362
- padding:7px;
363
- margin:3px;
364
- }
365
-
366
- .wpuf-pagination .page-numbers{
367
- padding:2px 8px;
368
- margin:2px;
369
- border:1px solid #4A5154;
370
- text-decoration:none;
371
- color:#4A5154;
372
- background: #fff;
373
- border-radius: 5px;
374
- -moz-border-radius: 5px;
375
- }
376
-
377
- .wpuf-pagination .page-numbers:hover,
378
- .wpuf-pagination .page-numbers:active{
379
- border:1px solid #4A5154;
380
- background-color:#4A5154;
381
- color:#fff;
382
- border-radius: 5px;
383
- -moz-border-radius: 5px;
384
- }
385
-
386
- .wpuf-pagination .page-numbers.current{
387
- padding:2px 8px;
388
- margin:2px;
389
- border:1px solid #4A5154;
390
- font-weight:bold;
391
- background-color:#4A5154;
392
- color:#FFF;
393
- border-radius: 5px;
394
- -moz-border-radius: 5px;
395
- }
396
-
397
- #wpuf-ft-upload-filelist img {
398
- border: 1px solid #ddd;
399
- padding: 5px;
400
- border-radius: 5px;
401
- margin: 0 10px 10px 0;
402
- float: left;
403
- }
404
-
405
- #wpuf-ft-upload-filelist .button {
406
- border: 1px solid #ddd;
407
- padding: 5px;
408
- border-radius: 5px;
409
- font-size: 12px;
410
- color: #5F5F5F;
411
- }
412
-
413
- ul.wpuf-category-checklist {
414
- margin: 0;
415
- list-style: none;
416
- }
417
- .wpuf-post-form .category-wrap {
418
- position: relative;
419
- }
420
-
421
- .wpuf-post-form .category-wrap select {
422
- display: block;
423
- margin: 0 0 5px 0;
424
- }
425
-
426
- #wpuf-attachment-upload-filelist .wpuf-attachment {
427
- display: block;
428
- margin: 0 0 10px 0;
429
- padding: 0 0 10px 0;
430
- border-bottom: 1px solid #eee;
431
- }
432
-
433
- #wpuf-attachment-upload-filelist .wpuf-attachment .attachment-name {
434
- font-size: 12px;
435
- margin: 0 0 0 15px;
436
- }
437
-
438
- #wpuf-attachment-upload-filelist .wpuf-attachment .button {
439
- padding: 3px 8px;
440
- border: 1px solid #ccc;
441
- background: #f2f2f2;
442
- color: #333;
443
- font-size: 12px;
444
- margin: 0 0 0 15px;
445
- border-radius: 5px;
446
- }
447
-
448
- #wpuf-attachment-upload-pickfiles {
449
- font-weight: bold;
450
- color: #333;
451
- padding: 3px 8px;
452
- border: 1px solid #ccc;
453
- background: #f2f2f2;
454
- margin: 5px 0 15px 0;
455
- border-radius: 5px;
456
- }
457
-
458
- #wpuf-attachment-upload-filelist .handle {
459
- background: url('../images/arrow-move.png') no-repeat;
460
- cursor: move;
461
- display: inline-block;
462
- height: 16px;
463
- margin: 0 10px 0 0;
464
- padding: 0;
465
- text-indent: -9999px;
466
- width: 16px;
467
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/images/add.png DELETED
Binary file
assets/images/arrow-move.png DELETED
Binary file
assets/images/arrows.png DELETED
Binary file
assets/images/completed.png DELETED
Binary file
assets/images/cross.png DELETED
Binary file
assets/images/del.png DELETED
Binary file
assets/images/delete.png DELETED
Binary file
assets/images/edit.png DELETED
Binary file
assets/images/help.png DELETED
Binary file
assets/images/icon-minus.png DELETED
Binary file
assets/images/icon-plus.png DELETED
Binary file
assets/images/no-image.png DELETED
Binary file
assets/images/paypal.png DELETED
Binary file
assets/images/processing.png DELETED
Binary file
assets/images/remove.png DELETED
Binary file
assets/images/tick.png DELETED
Binary file
assets/images/wpspin_light.gif DELETED
Binary file
assets/js/chosen.jquery.js DELETED
@@ -1,1211 +0,0 @@
1
- /*!
2
- Chosen, a Select Box Enhancer for jQuery and Prototype
3
- by Patrick Filler for Harvest, http://getharvest.com
4
-
5
- Version 1.1.0
6
- Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011 Harvest http://getharvest.com
8
-
9
- MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
- This file is generated by `grunt build`, do not edit it by hand.
11
- */
12
-
13
- (function() {
14
- var $, AbstractChosen, Chosen, SelectParser, _ref,
15
- __hasProp = {}.hasOwnProperty,
16
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
17
-
18
- SelectParser = (function() {
19
- function SelectParser() {
20
- this.options_index = 0;
21
- this.parsed = [];
22
- }
23
-
24
- SelectParser.prototype.add_node = function(child) {
25
- if (child.nodeName.toUpperCase() === "OPTGROUP") {
26
- return this.add_group(child);
27
- } else {
28
- return this.add_option(child);
29
- }
30
- };
31
-
32
- SelectParser.prototype.add_group = function(group) {
33
- var group_position, option, _i, _len, _ref, _results;
34
- group_position = this.parsed.length;
35
- this.parsed.push({
36
- array_index: group_position,
37
- group: true,
38
- label: this.escapeExpression(group.label),
39
- children: 0,
40
- disabled: group.disabled
41
- });
42
- _ref = group.childNodes;
43
- _results = [];
44
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
45
- option = _ref[_i];
46
- _results.push(this.add_option(option, group_position, group.disabled));
47
- }
48
- return _results;
49
- };
50
-
51
- SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
52
- if (option.nodeName.toUpperCase() === "OPTION") {
53
- if (option.text !== "") {
54
- if (group_position != null) {
55
- this.parsed[group_position].children += 1;
56
- }
57
- this.parsed.push({
58
- array_index: this.parsed.length,
59
- options_index: this.options_index,
60
- value: option.value,
61
- text: option.text,
62
- html: option.innerHTML,
63
- selected: option.selected,
64
- disabled: group_disabled === true ? group_disabled : option.disabled,
65
- group_array_index: group_position,
66
- classes: option.className,
67
- style: option.style.cssText
68
- });
69
- } else {
70
- this.parsed.push({
71
- array_index: this.parsed.length,
72
- options_index: this.options_index,
73
- empty: true
74
- });
75
- }
76
- return this.options_index += 1;
77
- }
78
- };
79
-
80
- SelectParser.prototype.escapeExpression = function(text) {
81
- var map, unsafe_chars;
82
- if ((text == null) || text === false) {
83
- return "";
84
- }
85
- if (!/[\&\<\>\"\'\`]/.test(text)) {
86
- return text;
87
- }
88
- map = {
89
- "<": "&lt;",
90
- ">": "&gt;",
91
- '"': "&quot;",
92
- "'": "&#x27;",
93
- "`": "&#x60;"
94
- };
95
- unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
96
- return text.replace(unsafe_chars, function(chr) {
97
- return map[chr] || "&amp;";
98
- });
99
- };
100
-
101
- return SelectParser;
102
-
103
- })();
104
-
105
- SelectParser.select_to_array = function(select) {
106
- var child, parser, _i, _len, _ref;
107
- parser = new SelectParser();
108
- _ref = select.childNodes;
109
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
110
- child = _ref[_i];
111
- parser.add_node(child);
112
- }
113
- return parser.parsed;
114
- };
115
-
116
- AbstractChosen = (function() {
117
- function AbstractChosen(form_field, options) {
118
- this.form_field = form_field;
119
- this.options = options != null ? options : {};
120
- if (!AbstractChosen.browser_is_supported()) {
121
- return;
122
- }
123
- this.is_multiple = this.form_field.multiple;
124
- this.set_default_text();
125
- this.set_default_values();
126
- this.setup();
127
- this.set_up_html();
128
- this.register_observers();
129
- }
130
-
131
- AbstractChosen.prototype.set_default_values = function() {
132
- var _this = this;
133
- this.click_test_action = function(evt) {
134
- return _this.test_active_click(evt);
135
- };
136
- this.activate_action = function(evt) {
137
- return _this.activate_field(evt);
138
- };
139
- this.active_field = false;
140
- this.mouse_on_container = false;
141
- this.results_showing = false;
142
- this.result_highlighted = null;
143
- this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
144
- this.disable_search_threshold = this.options.disable_search_threshold || 0;
145
- this.disable_search = this.options.disable_search || false;
146
- this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
147
- this.group_search = this.options.group_search != null ? this.options.group_search : true;
148
- this.search_contains = this.options.search_contains || false;
149
- this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
150
- this.max_selected_options = this.options.max_selected_options || Infinity;
151
- this.inherit_select_classes = this.options.inherit_select_classes || false;
152
- this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
153
- return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
154
- };
155
-
156
- AbstractChosen.prototype.set_default_text = function() {
157
- if (this.form_field.getAttribute("data-placeholder")) {
158
- this.default_text = this.form_field.getAttribute("data-placeholder");
159
- } else if (this.is_multiple) {
160
- this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
161
- } else {
162
- this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
163
- }
164
- return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
165
- };
166
-
167
- AbstractChosen.prototype.mouse_enter = function() {
168
- return this.mouse_on_container = true;
169
- };
170
-
171
- AbstractChosen.prototype.mouse_leave = function() {
172
- return this.mouse_on_container = false;
173
- };
174
-
175
- AbstractChosen.prototype.input_focus = function(evt) {
176
- var _this = this;
177
- if (this.is_multiple) {
178
- if (!this.active_field) {
179
- return setTimeout((function() {
180
- return _this.container_mousedown();
181
- }), 50);
182
- }
183
- } else {
184
- if (!this.active_field) {
185
- return this.activate_field();
186
- }
187
- }
188
- };
189
-
190
- AbstractChosen.prototype.input_blur = function(evt) {
191
- var _this = this;
192
- if (!this.mouse_on_container) {
193
- this.active_field = false;
194
- return setTimeout((function() {
195
- return _this.blur_test();
196
- }), 100);
197
- }
198
- };
199
-
200
- AbstractChosen.prototype.results_option_build = function(options) {
201
- var content, data, _i, _len, _ref;
202
- content = '';
203
- _ref = this.results_data;
204
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
205
- data = _ref[_i];
206
- if (data.group) {
207
- content += this.result_add_group(data);
208
- } else {
209
- content += this.result_add_option(data);
210
- }
211
- if (options != null ? options.first : void 0) {
212
- if (data.selected && this.is_multiple) {
213
- this.choice_build(data);
214
- } else if (data.selected && !this.is_multiple) {
215
- this.single_set_selected_text(data.text);
216
- }
217
- }
218
- }
219
- return content;
220
- };
221
-
222
- AbstractChosen.prototype.result_add_option = function(option) {
223
- var classes, option_el;
224
- if (!option.search_match) {
225
- return '';
226
- }
227
- if (!this.include_option_in_results(option)) {
228
- return '';
229
- }
230
- classes = [];
231
- if (!option.disabled && !(option.selected && this.is_multiple)) {
232
- classes.push("active-result");
233
- }
234
- if (option.disabled && !(option.selected && this.is_multiple)) {
235
- classes.push("disabled-result");
236
- }
237
- if (option.selected) {
238
- classes.push("result-selected");
239
- }
240
- if (option.group_array_index != null) {
241
- classes.push("group-option");
242
- }
243
- if (option.classes !== "") {
244
- classes.push(option.classes);
245
- }
246
- option_el = document.createElement("li");
247
- option_el.className = classes.join(" ");
248
- option_el.style.cssText = option.style;
249
- option_el.setAttribute("data-option-array-index", option.array_index);
250
- option_el.innerHTML = option.search_text;
251
- return this.outerHTML(option_el);
252
- };
253
-
254
- AbstractChosen.prototype.result_add_group = function(group) {
255
- var group_el;
256
- if (!(group.search_match || group.group_match)) {
257
- return '';
258
- }
259
- if (!(group.active_options > 0)) {
260
- return '';
261
- }
262
- group_el = document.createElement("li");
263
- group_el.className = "group-result";
264
- group_el.innerHTML = group.search_text;
265
- return this.outerHTML(group_el);
266
- };
267
-
268
- AbstractChosen.prototype.results_update_field = function() {
269
- this.set_default_text();
270
- if (!this.is_multiple) {
271
- this.results_reset_cleanup();
272
- }
273
- this.result_clear_highlight();
274
- this.results_build();
275
- if (this.results_showing) {
276
- return this.winnow_results();
277
- }
278
- };
279
-
280
- AbstractChosen.prototype.reset_single_select_options = function() {
281
- var result, _i, _len, _ref, _results;
282
- _ref = this.results_data;
283
- _results = [];
284
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
285
- result = _ref[_i];
286
- if (result.selected) {
287
- _results.push(result.selected = false);
288
- } else {
289
- _results.push(void 0);
290
- }
291
- }
292
- return _results;
293
- };
294
-
295
- AbstractChosen.prototype.results_toggle = function() {
296
- if (this.results_showing) {
297
- return this.results_hide();
298
- } else {
299
- return this.results_show();
300
- }
301
- };
302
-
303
- AbstractChosen.prototype.results_search = function(evt) {
304
- if (this.results_showing) {
305
- return this.winnow_results();
306
- } else {
307
- return this.results_show();
308
- }
309
- };
310
-
311
- AbstractChosen.prototype.winnow_results = function() {
312
- var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
313
- this.no_results_clear();
314
- results = 0;
315
- searchText = this.get_search_text();
316
- escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
317
- regexAnchor = this.search_contains ? "" : "^";
318
- regex = new RegExp(regexAnchor + escapedSearchText, 'i');
319
- zregex = new RegExp(escapedSearchText, 'i');
320
- _ref = this.results_data;
321
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
322
- option = _ref[_i];
323
- option.search_match = false;
324
- results_group = null;
325
- if (this.include_option_in_results(option)) {
326
- if (option.group) {
327
- option.group_match = false;
328
- option.active_options = 0;
329
- }
330
- if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
331
- results_group = this.results_data[option.group_array_index];
332
- if (results_group.active_options === 0 && results_group.search_match) {
333
- results += 1;
334
- }
335
- results_group.active_options += 1;
336
- }
337
- if (!(option.group && !this.group_search)) {
338
- option.search_text = option.group ? option.label : option.html;
339
- option.search_match = this.search_string_match(option.search_text, regex);
340
- if (option.search_match && !option.group) {
341
- results += 1;
342
- }
343
- if (option.search_match) {
344
- if (searchText.length) {
345
- startpos = option.search_text.search(zregex);
346
- text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
347
- option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
348
- }
349
- if (results_group != null) {
350
- results_group.group_match = true;
351
- }
352
- } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
353
- option.search_match = true;
354
- }
355
- }
356
- }
357
- }
358
- this.result_clear_highlight();
359
- if (results < 1 && searchText.length) {
360
- this.update_results_content("");
361
- return this.no_results(searchText);
362
- } else {
363
- this.update_results_content(this.results_option_build());
364
- return this.winnow_results_set_highlight();
365
- }
366
- };
367
-
368
- AbstractChosen.prototype.search_string_match = function(search_string, regex) {
369
- var part, parts, _i, _len;
370
- if (regex.test(search_string)) {
371
- return true;
372
- } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
373
- parts = search_string.replace(/\[|\]/g, "").split(" ");
374
- if (parts.length) {
375
- for (_i = 0, _len = parts.length; _i < _len; _i++) {
376
- part = parts[_i];
377
- if (regex.test(part)) {
378
- return true;
379
- }
380
- }
381
- }
382
- }
383
- };
384
-
385
- AbstractChosen.prototype.choices_count = function() {
386
- var option, _i, _len, _ref;
387
- if (this.selected_option_count != null) {
388
- return this.selected_option_count;
389
- }
390
- this.selected_option_count = 0;
391
- _ref = this.form_field.options;
392
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
393
- option = _ref[_i];
394
- if (option.selected) {
395
- this.selected_option_count += 1;
396
- }
397
- }
398
- return this.selected_option_count;
399
- };
400
-
401
- AbstractChosen.prototype.choices_click = function(evt) {
402
- evt.preventDefault();
403
- if (!(this.results_showing || this.is_disabled)) {
404
- return this.results_show();
405
- }
406
- };
407
-
408
- AbstractChosen.prototype.keyup_checker = function(evt) {
409
- var stroke, _ref;
410
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
411
- this.search_field_scale();
412
- switch (stroke) {
413
- case 8:
414
- if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
415
- return this.keydown_backstroke();
416
- } else if (!this.pending_backstroke) {
417
- this.result_clear_highlight();
418
- return this.results_search();
419
- }
420
- break;
421
- case 13:
422
- evt.preventDefault();
423
- if (this.results_showing) {
424
- return this.result_select(evt);
425
- }
426
- break;
427
- case 27:
428
- if (this.results_showing) {
429
- this.results_hide();
430
- }
431
- return true;
432
- case 9:
433
- case 38:
434
- case 40:
435
- case 16:
436
- case 91:
437
- case 17:
438
- break;
439
- default:
440
- return this.results_search();
441
- }
442
- };
443
-
444
- AbstractChosen.prototype.clipboard_event_checker = function(evt) {
445
- var _this = this;
446
- return setTimeout((function() {
447
- return _this.results_search();
448
- }), 50);
449
- };
450
-
451
- AbstractChosen.prototype.container_width = function() {
452
- if (this.options.width != null) {
453
- return this.options.width;
454
- } else {
455
- return "" + this.form_field.offsetWidth + "px";
456
- }
457
- };
458
-
459
- AbstractChosen.prototype.include_option_in_results = function(option) {
460
- if (this.is_multiple && (!this.display_selected_options && option.selected)) {
461
- return false;
462
- }
463
- if (!this.display_disabled_options && option.disabled) {
464
- return false;
465
- }
466
- if (option.empty) {
467
- return false;
468
- }
469
- return true;
470
- };
471
-
472
- AbstractChosen.prototype.search_results_touchstart = function(evt) {
473
- this.touch_started = true;
474
- return this.search_results_mouseover(evt);
475
- };
476
-
477
- AbstractChosen.prototype.search_results_touchmove = function(evt) {
478
- this.touch_started = false;
479
- return this.search_results_mouseout(evt);
480
- };
481
-
482
- AbstractChosen.prototype.search_results_touchend = function(evt) {
483
- if (this.touch_started) {
484
- return this.search_results_mouseup(evt);
485
- }
486
- };
487
-
488
- AbstractChosen.prototype.outerHTML = function(element) {
489
- var tmp;
490
- if (element.outerHTML) {
491
- return element.outerHTML;
492
- }
493
- tmp = document.createElement("div");
494
- tmp.appendChild(element);
495
- return tmp.innerHTML;
496
- };
497
-
498
- AbstractChosen.browser_is_supported = function() {
499
- if (window.navigator.appName === "Microsoft Internet Explorer") {
500
- return document.documentMode >= 8;
501
- }
502
- if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
503
- return false;
504
- }
505
- if (/Android/i.test(window.navigator.userAgent)) {
506
- if (/Mobile/i.test(window.navigator.userAgent)) {
507
- return false;
508
- }
509
- }
510
- return true;
511
- };
512
-
513
- AbstractChosen.default_multiple_text = "Select Some Options";
514
-
515
- AbstractChosen.default_single_text = "Select an Option";
516
-
517
- AbstractChosen.default_no_result_text = "No results match";
518
-
519
- return AbstractChosen;
520
-
521
- })();
522
-
523
- $ = jQuery;
524
-
525
- $.fn.extend({
526
- chosen: function(options) {
527
- if (!AbstractChosen.browser_is_supported()) {
528
- return this;
529
- }
530
- return this.each(function(input_field) {
531
- var $this, chosen;
532
- $this = $(this);
533
- chosen = $this.data('chosen');
534
- if (options === 'destroy' && chosen) {
535
- chosen.destroy();
536
- } else if (!chosen) {
537
- $this.data('chosen', new Chosen(this, options));
538
- }
539
- });
540
- }
541
- });
542
-
543
- Chosen = (function(_super) {
544
- __extends(Chosen, _super);
545
-
546
- function Chosen() {
547
- _ref = Chosen.__super__.constructor.apply(this, arguments);
548
- return _ref;
549
- }
550
-
551
- Chosen.prototype.setup = function() {
552
- this.form_field_jq = $(this.form_field);
553
- this.current_selectedIndex = this.form_field.selectedIndex;
554
- return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
555
- };
556
-
557
- Chosen.prototype.set_up_html = function() {
558
- var container_classes, container_props;
559
- container_classes = ["chosen-container"];
560
- container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
561
- if (this.inherit_select_classes && this.form_field.className) {
562
- container_classes.push(this.form_field.className);
563
- }
564
- if (this.is_rtl) {
565
- container_classes.push("chosen-rtl");
566
- }
567
- container_props = {
568
- 'class': container_classes.join(' '),
569
- 'style': "width: " + (this.container_width()) + ";",
570
- 'title': this.form_field.title
571
- };
572
- if (this.form_field.id.length) {
573
- container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
574
- }
575
- this.container = $("<div />", container_props);
576
- if (this.is_multiple) {
577
- this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
578
- } else {
579
- this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
580
- }
581
- this.form_field_jq.hide().after(this.container);
582
- this.dropdown = this.container.find('div.chosen-drop').first();
583
- this.search_field = this.container.find('input').first();
584
- this.search_results = this.container.find('ul.chosen-results').first();
585
- this.search_field_scale();
586
- this.search_no_results = this.container.find('li.no-results').first();
587
- if (this.is_multiple) {
588
- this.search_choices = this.container.find('ul.chosen-choices').first();
589
- this.search_container = this.container.find('li.search-field').first();
590
- } else {
591
- this.search_container = this.container.find('div.chosen-search').first();
592
- this.selected_item = this.container.find('.chosen-single').first();
593
- }
594
- this.results_build();
595
- this.set_tab_index();
596
- this.set_label_behavior();
597
- return this.form_field_jq.trigger("chosen:ready", {
598
- chosen: this
599
- });
600
- };
601
-
602
- Chosen.prototype.register_observers = function() {
603
- var _this = this;
604
- this.container.bind('mousedown.chosen', function(evt) {
605
- _this.container_mousedown(evt);
606
- });
607
- this.container.bind('mouseup.chosen', function(evt) {
608
- _this.container_mouseup(evt);
609
- });
610
- this.container.bind('mouseenter.chosen', function(evt) {
611
- _this.mouse_enter(evt);
612
- });
613
- this.container.bind('mouseleave.chosen', function(evt) {
614
- _this.mouse_leave(evt);
615
- });
616
- this.search_results.bind('mouseup.chosen', function(evt) {
617
- _this.search_results_mouseup(evt);
618
- });
619
- this.search_results.bind('mouseover.chosen', function(evt) {
620
- _this.search_results_mouseover(evt);
621
- });
622
- this.search_results.bind('mouseout.chosen', function(evt) {
623
- _this.search_results_mouseout(evt);
624
- });
625
- this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
626
- _this.search_results_mousewheel(evt);
627
- });
628
- this.search_results.bind('touchstart.chosen', function(evt) {
629
- _this.search_results_touchstart(evt);
630
- });
631
- this.search_results.bind('touchmove.chosen', function(evt) {
632
- _this.search_results_touchmove(evt);
633
- });
634
- this.search_results.bind('touchend.chosen', function(evt) {
635
- _this.search_results_touchend(evt);
636
- });
637
- this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
638
- _this.results_update_field(evt);
639
- });
640
- this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
641
- _this.activate_field(evt);
642
- });
643
- this.form_field_jq.bind("chosen:open.chosen", function(evt) {
644
- _this.container_mousedown(evt);
645
- });
646
- this.form_field_jq.bind("chosen:close.chosen", function(evt) {
647
- _this.input_blur(evt);
648
- });
649
- this.search_field.bind('blur.chosen', function(evt) {
650
- _this.input_blur(evt);
651
- });
652
- this.search_field.bind('keyup.chosen', function(evt) {
653
- _this.keyup_checker(evt);
654
- });
655
- this.search_field.bind('keydown.chosen', function(evt) {
656
- _this.keydown_checker(evt);
657
- });
658
- this.search_field.bind('focus.chosen', function(evt) {
659
- _this.input_focus(evt);
660
- });
661
- this.search_field.bind('cut.chosen', function(evt) {
662
- _this.clipboard_event_checker(evt);
663
- });
664
- this.search_field.bind('paste.chosen', function(evt) {
665
- _this.clipboard_event_checker(evt);
666
- });
667
- if (this.is_multiple) {
668
- return this.search_choices.bind('click.chosen', function(evt) {
669
- _this.choices_click(evt);
670
- });
671
- } else {
672
- return this.container.bind('click.chosen', function(evt) {
673
- evt.preventDefault();
674
- });
675
- }
676
- };
677
-
678
- Chosen.prototype.destroy = function() {
679
- $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
680
- if (this.search_field[0].tabIndex) {
681
- this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
682
- }
683
- this.container.remove();
684
- this.form_field_jq.removeData('chosen');
685
- return this.form_field_jq.show();
686
- };
687
-
688
- Chosen.prototype.search_field_disabled = function() {
689
- this.is_disabled = this.form_field_jq[0].disabled;
690
- if (this.is_disabled) {
691
- this.container.addClass('chosen-disabled');
692
- this.search_field[0].disabled = true;
693
- if (!this.is_multiple) {
694
- this.selected_item.unbind("focus.chosen", this.activate_action);
695
- }
696
- return this.close_field();
697
- } else {
698
- this.container.removeClass('chosen-disabled');
699
- this.search_field[0].disabled = false;
700
- if (!this.is_multiple) {
701
- return this.selected_item.bind("focus.chosen", this.activate_action);
702
- }
703
- }
704
- };
705
-
706
- Chosen.prototype.container_mousedown = function(evt) {
707
- if (!this.is_disabled) {
708
- if (evt && evt.type === "mousedown" && !this.results_showing) {
709
- evt.preventDefault();
710
- }
711
- if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
712
- if (!this.active_field) {
713
- if (this.is_multiple) {
714
- this.search_field.val("");
715
- }
716
- $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
717
- this.results_show();
718
- } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
719
- evt.preventDefault();
720
- this.results_toggle();
721
- }
722
- return this.activate_field();
723
- }
724
- }
725
- };
726
-
727
- Chosen.prototype.container_mouseup = function(evt) {
728
- if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
729
- return this.results_reset(evt);
730
- }
731
- };
732
-
733
- Chosen.prototype.search_results_mousewheel = function(evt) {
734
- var delta;
735
- if (evt.originalEvent) {
736
- delta = -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
737
- }
738
- if (delta != null) {
739
- evt.preventDefault();
740
- if (evt.type === 'DOMMouseScroll') {
741
- delta = delta * 40;
742
- }
743
- return this.search_results.scrollTop(delta + this.search_results.scrollTop());
744
- }
745
- };
746
-
747
- Chosen.prototype.blur_test = function(evt) {
748
- if (!this.active_field && this.container.hasClass("chosen-container-active")) {
749
- return this.close_field();
750
- }
751
- };
752
-
753
- Chosen.prototype.close_field = function() {
754
- $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
755
- this.active_field = false;
756
- this.results_hide();
757
- this.container.removeClass("chosen-container-active");
758
- this.clear_backstroke();
759
- this.show_search_field_default();
760
- return this.search_field_scale();
761
- };
762
-
763
- Chosen.prototype.activate_field = function() {
764
- this.container.addClass("chosen-container-active");
765
- this.active_field = true;
766
- this.search_field.val(this.search_field.val());
767
- return this.search_field.focus();
768
- };
769
-
770
- Chosen.prototype.test_active_click = function(evt) {
771
- var active_container;
772
- active_container = $(evt.target).closest('.chosen-container');
773
- if (active_container.length && this.container[0] === active_container[0]) {
774
- return this.active_field = true;
775
- } else {
776
- return this.close_field();
777
- }
778
- };
779
-
780
- Chosen.prototype.results_build = function() {
781
- this.parsing = true;
782
- this.selected_option_count = null;
783
- this.results_data = SelectParser.select_to_array(this.form_field);
784
- if (this.is_multiple) {
785
- this.search_choices.find("li.search-choice").remove();
786
- } else if (!this.is_multiple) {
787
- this.single_set_selected_text();
788
- if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
789
- this.search_field[0].readOnly = true;
790
- this.container.addClass("chosen-container-single-nosearch");
791
- } else {
792
- this.search_field[0].readOnly = false;
793
- this.container.removeClass("chosen-container-single-nosearch");
794
- }
795
- }
796
- this.update_results_content(this.results_option_build({
797
- first: true
798
- }));
799
- this.search_field_disabled();
800
- this.show_search_field_default();
801
- this.search_field_scale();
802
- return this.parsing = false;
803
- };
804
-
805
- Chosen.prototype.result_do_highlight = function(el) {
806
- var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
807
- if (el.length) {
808
- this.result_clear_highlight();
809
- this.result_highlight = el;
810
- this.result_highlight.addClass("highlighted");
811
- maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
812
- visible_top = this.search_results.scrollTop();
813
- visible_bottom = maxHeight + visible_top;
814
- high_top = this.result_highlight.position().top + this.search_results.scrollTop();
815
- high_bottom = high_top + this.result_highlight.outerHeight();
816
- if (high_bottom >= visible_bottom) {
817
- return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
818
- } else if (high_top < visible_top) {
819
- return this.search_results.scrollTop(high_top);
820
- }
821
- }
822
- };
823
-
824
- Chosen.prototype.result_clear_highlight = function() {
825
- if (this.result_highlight) {
826
- this.result_highlight.removeClass("highlighted");
827
- }
828
- return this.result_highlight = null;
829
- };
830
-
831
- Chosen.prototype.results_show = function() {
832
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
833
- this.form_field_jq.trigger("chosen:maxselected", {
834
- chosen: this
835
- });
836
- return false;
837
- }
838
- this.container.addClass("chosen-with-drop");
839
- this.results_showing = true;
840
- this.search_field.focus();
841
- this.search_field.val(this.search_field.val());
842
- this.winnow_results();
843
- return this.form_field_jq.trigger("chosen:showing_dropdown", {
844
- chosen: this
845
- });
846
- };
847
-
848
- Chosen.prototype.update_results_content = function(content) {
849
- return this.search_results.html(content);
850
- };
851
-
852
- Chosen.prototype.results_hide = function() {
853
- if (this.results_showing) {
854
- this.result_clear_highlight();
855
- this.container.removeClass("chosen-with-drop");
856
- this.form_field_jq.trigger("chosen:hiding_dropdown", {
857
- chosen: this
858
- });
859
- }
860
- return this.results_showing = false;
861
- };
862
-
863
- Chosen.prototype.set_tab_index = function(el) {
864
- var ti;
865
- if (this.form_field.tabIndex) {
866
- ti = this.form_field.tabIndex;
867
- this.form_field.tabIndex = -1;
868
- return this.search_field[0].tabIndex = ti;
869
- }
870
- };
871
-
872
- Chosen.prototype.set_label_behavior = function() {
873
- var _this = this;
874
- this.form_field_label = this.form_field_jq.parents("label");
875
- if (!this.form_field_label.length && this.form_field.id.length) {
876
- this.form_field_label = $("label[for='" + this.form_field.id + "']");
877
- }
878
- if (this.form_field_label.length > 0) {
879
- return this.form_field_label.bind('click.chosen', function(evt) {
880
- if (_this.is_multiple) {
881
- return _this.container_mousedown(evt);
882
- } else {
883
- return _this.activate_field();
884
- }
885
- });
886
- }
887
- };
888
-
889
- Chosen.prototype.show_search_field_default = function() {
890
- if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
891
- this.search_field.val(this.default_text);
892
- return this.search_field.addClass("default");
893
- } else {
894
- this.search_field.val("");
895
- return this.search_field.removeClass("default");
896
- }
897
- };
898
-
899
- Chosen.prototype.search_results_mouseup = function(evt) {
900
- var target;
901
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
902
- if (target.length) {
903
- this.result_highlight = target;
904
- this.result_select(evt);
905
- return this.search_field.focus();
906
- }
907
- };
908
-
909
- Chosen.prototype.search_results_mouseover = function(evt) {
910
- var target;
911
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
912
- if (target) {
913
- return this.result_do_highlight(target);
914
- }
915
- };
916
-
917
- Chosen.prototype.search_results_mouseout = function(evt) {
918
- if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
919
- return this.result_clear_highlight();
920
- }
921
- };
922
-
923
- Chosen.prototype.choice_build = function(item) {
924
- var choice, close_link,
925
- _this = this;
926
- choice = $('<li />', {
927
- "class": "search-choice"
928
- }).html("<span>" + item.html + "</span>");
929
- if (item.disabled) {
930
- choice.addClass('search-choice-disabled');
931
- } else {
932
- close_link = $('<a />', {
933
- "class": 'search-choice-close',
934
- 'data-option-array-index': item.array_index
935
- });
936
- close_link.bind('click.chosen', function(evt) {
937
- return _this.choice_destroy_link_click(evt);
938
- });
939
- choice.append(close_link);
940
- }
941
- return this.search_container.before(choice);
942
- };
943
-
944
- Chosen.prototype.choice_destroy_link_click = function(evt) {
945
- evt.preventDefault();
946
- evt.stopPropagation();
947
- if (!this.is_disabled) {
948
- return this.choice_destroy($(evt.target));
949
- }
950
- };
951
-
952
- Chosen.prototype.choice_destroy = function(link) {
953
- if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
954
- this.show_search_field_default();
955
- if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
956
- this.results_hide();
957
- }
958
- link.parents('li').first().remove();
959
- return this.search_field_scale();
960
- }
961
- };
962
-
963
- Chosen.prototype.results_reset = function() {
964
- this.reset_single_select_options();
965
- this.form_field.options[0].selected = true;
966
- this.single_set_selected_text();
967
- this.show_search_field_default();
968
- this.results_reset_cleanup();
969
- this.form_field_jq.trigger("change");
970
- if (this.active_field) {
971
- return this.results_hide();
972
- }
973
- };
974
-
975
- Chosen.prototype.results_reset_cleanup = function() {
976
- this.current_selectedIndex = this.form_field.selectedIndex;
977
- return this.selected_item.find("abbr").remove();
978
- };
979
-
980
- Chosen.prototype.result_select = function(evt) {
981
- var high, item;
982
- if (this.result_highlight) {
983
- high = this.result_highlight;
984
- this.result_clear_highlight();
985
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
986
- this.form_field_jq.trigger("chosen:maxselected", {
987
- chosen: this
988
- });
989
- return false;
990
- }
991
- if (this.is_multiple) {
992
- high.removeClass("active-result");
993
- } else {
994
- this.reset_single_select_options();
995
- }
996
- item = this.results_data[high[0].getAttribute("data-option-array-index")];
997
- item.selected = true;
998
- this.form_field.options[item.options_index].selected = true;
999
- this.selected_option_count = null;
1000
- if (this.is_multiple) {
1001
- this.choice_build(item);
1002
- } else {
1003
- this.single_set_selected_text(item.text);
1004
- }
1005
- if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
1006
- this.results_hide();
1007
- }
1008
- this.search_field.val("");
1009
- if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1010
- this.form_field_jq.trigger("change", {
1011
- 'selected': this.form_field.options[item.options_index].value
1012
- });
1013
- }
1014
- this.current_selectedIndex = this.form_field.selectedIndex;
1015
- return this.search_field_scale();
1016
- }
1017
- };
1018
-
1019
- Chosen.prototype.single_set_selected_text = function(text) {
1020
- if (text == null) {
1021
- text = this.default_text;
1022
- }
1023
- if (text === this.default_text) {
1024
- this.selected_item.addClass("chosen-default");
1025
- } else {
1026
- this.single_deselect_control_build();
1027
- this.selected_item.removeClass("chosen-default");
1028
- }
1029
- return this.selected_item.find("span").text(text);
1030
- };
1031
-
1032
- Chosen.prototype.result_deselect = function(pos) {
1033
- var result_data;
1034
- result_data = this.results_data[pos];
1035
- if (!this.form_field.options[result_data.options_index].disabled) {
1036
- result_data.selected = false;
1037
- this.form_field.options[result_data.options_index].selected = false;
1038
- this.selected_option_count = null;
1039
- this.result_clear_highlight();
1040
- if (this.results_showing) {
1041
- this.winnow_results();
1042
- }
1043
- this.form_field_jq.trigger("change", {
1044
- deselected: this.form_field.options[result_data.options_index].value
1045
- });
1046
- this.search_field_scale();
1047
- return true;
1048
- } else {
1049
- return false;
1050
- }
1051
- };
1052
-
1053
- Chosen.prototype.single_deselect_control_build = function() {
1054
- if (!this.allow_single_deselect) {
1055
- return;
1056
- }
1057
- if (!this.selected_item.find("abbr").length) {
1058
- this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1059
- }
1060
- return this.selected_item.addClass("chosen-single-with-deselect");
1061
- };
1062
-
1063
- Chosen.prototype.get_search_text = function() {
1064
- if (this.search_field.val() === this.default_text) {
1065
- return "";
1066
- } else {
1067
- return $('<div/>').text($.trim(this.search_field.val())).html();
1068
- }
1069
- };
1070
-
1071
- Chosen.prototype.winnow_results_set_highlight = function() {
1072
- var do_high, selected_results;
1073
- selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1074
- do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1075
- if (do_high != null) {
1076
- return this.result_do_highlight(do_high);
1077
- }
1078
- };
1079
-
1080
- Chosen.prototype.no_results = function(terms) {
1081
- var no_results_html;
1082
- no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
1083
- no_results_html.find("span").first().html(terms);
1084
- this.search_results.append(no_results_html);
1085
- return this.form_field_jq.trigger("chosen:no_results", {
1086
- chosen: this
1087
- });
1088
- };
1089
-
1090
- Chosen.prototype.no_results_clear = function() {
1091
- return this.search_results.find(".no-results").remove();
1092
- };
1093
-
1094
- Chosen.prototype.keydown_arrow = function() {
1095
- var next_sib;
1096
- if (this.results_showing && this.result_highlight) {
1097
- next_sib = this.result_highlight.nextAll("li.active-result").first();
1098
- if (next_sib) {
1099
- return this.result_do_highlight(next_sib);
1100
- }
1101
- } else {
1102
- return this.results_show();
1103
- }
1104
- };
1105
-
1106
- Chosen.prototype.keyup_arrow = function() {
1107
- var prev_sibs;
1108
- if (!this.results_showing && !this.is_multiple) {
1109
- return this.results_show();
1110
- } else if (this.result_highlight) {
1111
- prev_sibs = this.result_highlight.prevAll("li.active-result");
1112
- if (prev_sibs.length) {
1113
- return this.result_do_highlight(prev_sibs.first());
1114
- } else {
1115
- if (this.choices_count() > 0) {
1116
- this.results_hide();
1117
- }
1118
- return this.result_clear_highlight();
1119
- }
1120
- }
1121
- };
1122
-
1123
- Chosen.prototype.keydown_backstroke = function() {
1124
- var next_available_destroy;
1125
- if (this.pending_backstroke) {
1126
- this.choice_destroy(this.pending_backstroke.find("a").first());
1127
- return this.clear_backstroke();
1128
- } else {
1129
- next_available_destroy = this.search_container.siblings("li.search-choice").last();
1130
- if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1131
- this.pending_backstroke = next_available_destroy;
1132
- if (this.single_backstroke_delete) {
1133
- return this.keydown_backstroke();
1134
- } else {
1135
- return this.pending_backstroke.addClass("search-choice-focus");
1136
- }
1137
- }
1138
- }
1139
- };
1140
-
1141
- Chosen.prototype.clear_backstroke = function() {
1142
- if (this.pending_backstroke) {
1143
- this.pending_backstroke.removeClass("search-choice-focus");
1144
- }
1145
- return this.pending_backstroke = null;
1146
- };
1147
-
1148
- Chosen.prototype.keydown_checker = function(evt) {
1149
- var stroke, _ref1;
1150
- stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1151
- this.search_field_scale();
1152
- if (stroke !== 8 && this.pending_backstroke) {
1153
- this.clear_backstroke();
1154
- }
1155
- switch (stroke) {
1156
- case 8:
1157
- this.backstroke_length = this.search_field.val().length;
1158
- break;
1159
- case 9:
1160
- if (this.results_showing && !this.is_multiple) {
1161
- this.result_select(evt);
1162
- }
1163
- this.mouse_on_container = false;
1164
- break;
1165
- case 13:
1166
- evt.preventDefault();
1167
- break;
1168
- case 38:
1169
- evt.preventDefault();
1170
- this.keyup_arrow();
1171
- break;
1172
- case 40:
1173
- evt.preventDefault();
1174
- this.keydown_arrow();
1175
- break;
1176
- }
1177
- };
1178
-
1179
- Chosen.prototype.search_field_scale = function() {
1180
- var div, f_width, h, style, style_block, styles, w, _i, _len;
1181
- if (this.is_multiple) {
1182
- h = 0;
1183
- w = 0;
1184
- style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1185
- styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1186
- for (_i = 0, _len = styles.length; _i < _len; _i++) {
1187
- style = styles[_i];
1188
- style_block += style + ":" + this.search_field.css(style) + ";";
1189
- }
1190
- div = $('<div />', {
1191
- 'style': style_block
1192
- });
1193
- div.text(this.search_field.val());
1194
- $('body').append(div);
1195
- w = div.width() + 25;
1196
- div.remove();
1197
- f_width = this.container.outerWidth();
1198
- if (w > f_width - 10) {
1199
- w = f_width - 10;
1200
- }
1201
- return this.search_field.css({
1202
- 'width': w + 'px'
1203
- });
1204
- }
1205
- };
1206
-
1207
- return Chosen;
1208
-
1209
- })(AbstractChosen);
1210
-
1211
- }).call(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/conditional-logic.js DELETED
@@ -1,139 +0,0 @@
1
- (function($) {
2
-
3
- var conditional_logic = {
4
-
5
- init: function() {
6
-
7
- var _this = this;
8
- _this.change();
9
-
10
- // events
11
- $(document).on( 'change', '.wpuf-fields input, .wpuf-fields textarea, .wpuf-fields select', function(){
12
- _this.change();
13
- });
14
- },
15
-
16
- change: function() {
17
-
18
- var cond_field_val = [],
19
- all = [],
20
- prefix = 'wpuf_';
21
-
22
- if ( typeof wpuf_conditional_items === 'undefined' ) {
23
- return;
24
- }
25
-
26
- $.each( wpuf_conditional_items, function( k, item ) {
27
-
28
- $.each( item.cond_field, function( key, value ) {
29
-
30
- var form_id = '_'+item.form_id,
31
- selector = '.'+prefix+value+form_id,
32
- value = item.cond_option[key],
33
- operator = ( item.cond_operator[key] == '=' ) ? true : false,
34
- select = $('select'+selector),
35
- checkbox = $('input[type=checkbox][value="'+value+'"]'+selector ),
36
- radio = $('input[type=radio][value="'+value+'"]'+selector),
37
- select = $('select'+selector+'>option[value="'+value+'"]');
38
-
39
-
40
- if ( select.length ) {
41
-
42
- var select_selectd_status = select.is(':selected') ? true : false;
43
-
44
- if ( operator && select_selectd_status ) {
45
- all[key] = true;
46
-
47
- } else if ( operator === false && select_selectd_status === false ) {
48
- all[key] = true;
49
-
50
- } else {
51
- all[key] = false;
52
- }
53
- }
54
-
55
- if ( radio.length ) {
56
-
57
- var radio_checked_status = radio.is(':checked') ? true : false;
58
-
59
- if ( operator && radio_checked_status ) {
60
-
61
- all[key] = true;
62
-
63
- } else if ( operator === false && radio_checked_status === false ) {
64
-
65
- all[key] = true;
66
-
67
- } else {
68
- all[key] = false;
69
- }
70
- }
71
-
72
- if ( checkbox.length ) {
73
-
74
- var checkbox_checked_status = checkbox.is(':checked') ? true : false;
75
-
76
- if( operator && checkbox_checked_status ) {
77
- all[key] = true;
78
-
79
- } else if ( operator === false && checkbox_checked_status === false ) {
80
- all[key] = true;
81
-
82
- } else {
83
- all[key] = false;
84
- }
85
- }
86
- });
87
-
88
- if ( item.cond_logic == 'any') {
89
-
90
- var check = all.indexOf( true );
91
-
92
- if ( check != '-1') {
93
-
94
- if ( item.type == 'address' ) {
95
- $( 'li.wpuf-el.' + item.name ).show();
96
- } else {
97
- $( '.' + prefix + item.name + '_' + item.form_id).closest('li').show();
98
- }
99
-
100
- } else {
101
-
102
- if ( item.type == 'address' ) {
103
- $( 'li.wpuf-el.' + item.name ).hide();
104
- } else {
105
- $( '.' + prefix + item.name + '_' + item.form_id).closest('li').hide();
106
- }
107
-
108
- }
109
-
110
- } else {
111
-
112
- var check = all.indexOf( false );
113
-
114
- if ( check == '-1') {
115
-
116
- if ( item.type == 'address' ) {
117
- $( 'li.wpuf-el.' + item.name ).show();
118
- } else {
119
- $( '.' + prefix + item.name + '_' + item.form_id).closest('li').show();
120
- }
121
-
122
- } else {
123
-
124
- if ( item.type == 'address' ) {
125
- $( 'li.wpuf-el.' + item.name ).hide();
126
- } else {
127
- $( '.' + prefix+item.name + '_' + item.form_id).closest('li').hide();
128
- }
129
- }
130
-
131
- }
132
-
133
- all.length = 0;
134
- });
135
- }
136
- }
137
-
138
- conditional_logic.init();
139
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/conditional.js DELETED
@@ -1,321 +0,0 @@
1
- /*
2
- * This is a JavaScript Scratchpad.
3
- *
4
- * Enter some JavaScript, then Right Click or choose from the Execute Menu:
5
- * 1. Run to evaluate the selected text (Cmd-R),
6
- * 2. Inspect to bring up an Object Inspector on the result (Cmd-I), or,
7
- * 3. Display to insert the result in a comment after the selection. (Cmd-L)
8
- */
9
-
10
- (function($, window) {
11
-
12
- var WPUF_Conditional = {
13
-
14
- init: function() {
15
- var form = $('#wpuf-form-editor');
16
- form.on('click', 'a.wpuf-conditional-plus', this.duplicateRow);
17
- form.on('click', 'a.wpuf-conditional-minus', this.removeRow);
18
- form.on('click', 'input[type=radio].wpuf-conditional-enable', this.showHide);
19
- form.on('change', 'input[type=text][data-type="label"]', this.labelRender );
20
- form.on('change', 'input[type=text][data-type="option"]', this.optionRender );
21
- form.on('change', 'input[type=text][data-type="option_value"]', this.optionRender );
22
- form.on('change', 'select.wpuf-conditional-fields', this.optionChange);
23
-
24
- this.getLabel( true );
25
-
26
- //initially get options values array
27
- this.getOption( true );
28
-
29
- this.labelRender();
30
- this.optionRender();
31
-
32
- },
33
-
34
-
35
- newOptionValue: [],
36
-
37
- prevOptionValue: [],
38
-
39
- prevLabelValue: [],
40
-
41
- newLabelValue: [],
42
-
43
- getOption: function( optionStatus ) {
44
- var labels = $('#wpuf-form-editor').find('input[data-type="name"]');
45
-
46
- $.each( labels, function(k, label_field ) {
47
- var label = $(label_field),
48
- label_name = label.val();
49
- if( label_name != '' ) {
50
-
51
- var label_option = label.closest('.wpuf-form-holder').find('input[data-type="option_value"]');
52
-
53
- var generate = [];
54
-
55
- $.each( label_option, function( key, option ) {
56
- var field_value = $(option).val();
57
- if ( field_value == '' ) {
58
- var field_value = $(option).closest('div').find('input[data-type=option]').val();
59
- }
60
- generate.push( field_value );
61
- });
62
-
63
- if( optionStatus === true ) {
64
- WPUF_Conditional.prevOptionValue[label_name] = generate;
65
- }
66
-
67
- if( optionStatus === false ) {
68
- WPUF_Conditional.newOptionValue[label_name] = generate;
69
- }
70
- }
71
- });
72
- },
73
-
74
- getLabel: function( labelStatus ) {
75
- var label = $('#wpuf-form-editor').find('input[data-type="name"]'),
76
- prev_label = WPUF_Conditional.prevLabelValue,
77
- new_label = WPUF_Conditional.newLabelValue;
78
-
79
- if( labelStatus === true ) {
80
- prev_label.length = 0;
81
- }
82
-
83
- if( labelStatus === false ) {
84
- new_label.length = 0;
85
- }
86
-
87
- $.each( label, function(k, label_field ) {
88
- var label = $(label_field),
89
- label_name = label.val();
90
- if( label_name != '' && labelStatus === true ) {
91
- prev_label.push( label_name );
92
- }
93
-
94
- if( label_name != '' && labelStatus === false ) {
95
- new_label.push( label_name );
96
- }
97
- });
98
- },
99
-
100
- labelRender: function() {
101
-
102
- //after change get options values array
103
- WPUF_Conditional.getLabel( false );
104
-
105
- var options = WPUF_Conditional.fieldDropdown(),
106
- label = $('#wpuf-form-editor').find('input[data-type="name"]'),
107
- cond_select_wraps = $('select.wpuf-conditional-fields'),
108
- wrap = $('.wpuf-form-holder'),
109
- prev_label = WPUF_Conditional.prevLabelValue,
110
- new_label = WPUF_Conditional.newLabelValue;
111
-
112
- $.each( wrap, function( key, parent ) {
113
-
114
- var label_name = $(parent).find('input[data-type="name"]').val(),
115
- cond_select_wraps = $(parent).find('select.wpuf-conditional-fields'),
116
- new_option = [];
117
-
118
- $.each( options, function( k, opt_value ) {
119
- var opt_val = $( opt_value ).attr('value');
120
-
121
- if( opt_val !== label_name || label_name == '' ) {
122
- new_option.push( opt_value );
123
- }
124
-
125
- });
126
-
127
- $.each( cond_select_wraps, function( i, select_val) {
128
- var select = $(select_val),
129
- select_val = select.val();
130
-
131
- var index = new_label.indexOf( select_val );
132
-
133
- if( index == '-1' ) {
134
- var oldindex = prev_label.indexOf( select_val );
135
- select.html( new_option.join('') ).val( new_label[oldindex] );
136
- } else {
137
- select.html( new_option.join('') ).val( select_val );
138
- }
139
- });
140
- });
141
-
142
-
143
-
144
- WPUF_Conditional.getLabel( true );
145
- WPUF_Conditional.getOption( true );
146
- },
147
-
148
- optionRender: function() {
149
-
150
- //after change get options values array
151
- WPUF_Conditional.getOption( false );
152
-
153
- var option = WPUF_Conditional.labelOptionValue,
154
- cond_select_wraps = $('select.wpuf-conditional-fields');
155
-
156
- $.each( cond_select_wraps, function( i, select_val) {
157
-
158
- var select = $(select_val),
159
- select_val = $(select_val).val(),
160
- option_generate = WPUF_Conditional.optionDropdown( select_val ),
161
- optionDropdown = select.closest('tr').find('select.wpuf-conditional-fields-option'),
162
- option_prev_val = optionDropdown.val(),
163
- prev_options = WPUF_Conditional.prevOptionValue,
164
- new_options = WPUF_Conditional.newOptionValue;
165
-
166
- if( select_val !== '' ) {
167
-
168
- var index = new_options[select_val].indexOf( option_prev_val );
169
-
170
- if( index == '-1') {
171
-
172
- var oldindex = prev_options[select_val].indexOf( option_prev_val );
173
-
174
- optionDropdown.html(option_generate).val( new_options[select_val][oldindex] );
175
- } else {
176
- optionDropdown.html(option_generate).val(option_prev_val);
177
- }
178
- } else {
179
- optionDropdown.html('<option>- select -</option>');
180
- }
181
- });
182
-
183
- WPUF_Conditional.getOption( true );
184
- },
185
-
186
-
187
- getFields: function() {
188
- var elements = [],
189
- form_editor = $('#wpuf-form-editor');
190
-
191
- form_editor.find('li.wpuf-conditional').each(function(i, el) {
192
- el = $(el);
193
-
194
- var label = el.find('input[type=text][data-type="label"]').val(),
195
- name = el.find('[data-type="name"]').val();
196
-
197
- elements[i] = {
198
- 'name': name,
199
- 'label': label,
200
- 'options': [],
201
- 'values': [],
202
- };
203
-
204
- el.find('.wpuf-options [data-type="option"]').each(function(j, jel){
205
- var option_value = $(this).siblings('input[data-type="option_value"]').val();
206
- if ( option_value == '') {
207
- option_value = $(jel).val();
208
- }
209
- elements[i].options.push( $(jel).val() );
210
- elements[i].values.push( option_value );
211
- });
212
- });
213
-
214
- return elements;
215
- },
216
-
217
- fieldDropdown: function() {
218
-
219
- var fields = this.getFields(),
220
- dropdown = [];
221
-
222
- dropdown.push('<option value="">- select -</option>');
223
-
224
- for( var field in fields ) {
225
-
226
- var label = fields[field].label;
227
- if( label != '') {
228
- dropdown.push('<option value="' + fields[field].name + '">' + label + '</option>');
229
- }
230
- }
231
-
232
- return dropdown;
233
- },
234
-
235
- optionDropdown: function(fieldName) {
236
- var fields = this.getFields(),
237
- dropdown = '<option value="">- select -</option>',
238
- options = [],
239
- values =[];
240
-
241
- for(field in fields) {
242
-
243
- if(fields[field].name === fieldName) {
244
- options = fields[field].options;
245
- values = fields[field].values;
246
- }
247
- }
248
-
249
- for( var option in options ) {
250
-
251
- var o = options[option],
252
- v = values[option];
253
- dropdown += '<option value="' + v + '">' + o + '</option>';
254
- }
255
-
256
- return dropdown;
257
- },
258
-
259
- fillFields: function() {
260
- var options = this.fieldDropdown();
261
- $('.wpuf-conditional-fields').each(function(i, el) {
262
- $(el).empty().append(options);
263
- });
264
- },
265
-
266
- showHide: function() {
267
-
268
- var self = $(this),
269
- parent = self.closest('.wpuf-form-sub-fields').find('.conditional-rules-wrap'),
270
- val = self.val();
271
-
272
- if ( val === 'yes' ) {
273
- parent.removeClass('wpuf-hide');
274
- WPUF_Conditional.labelRender();
275
- WPUF_Conditional.optionRender();
276
-
277
- } else {
278
- parent.addClass('wpuf-hide');
279
- }
280
- },
281
-
282
- duplicateRow: function(e) {
283
- e.preventDefault();
284
-
285
- var self = $(this),
286
- tr = self.closest('tr');
287
-
288
- tr.clone().insertAfter(tr);
289
- },
290
-
291
- removeRow: function(e) {
292
- e.preventDefault();
293
-
294
- var table = $(this).closest('table'),
295
- rows = table.find('tr').length;
296
-
297
- if ( rows > 1 ) {
298
- $(this).closest('tr').remove();
299
- }
300
- },
301
-
302
- optionChange: function() {
303
- var self = $(this),
304
- value = self.val(),
305
- optionDropdown = self.closest('tr').find('select.wpuf-conditional-fields-option');
306
-
307
- if ( value !== '' ) {
308
- options = WPUF_Conditional.optionDropdown(value);
309
- optionDropdown.empty().append(options);
310
- } else {
311
- optionDropdown.html('<option>- Select -</option>');
312
- }
313
- }
314
- };
315
-
316
- $(function(){
317
- window.wpuf_conditional = WPUF_Conditional;
318
- WPUF_Conditional.init();
319
- });
320
-
321
- })(jQuery, window);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/countries.json DELETED
@@ -1,245 +0,0 @@
1
- [
2
- {"name": "Afghanistan", "code": "AF"},
3
- {"name": "Åland Islands", "code": "AX"},
4
- {"name": "Albania", "code": "AL"},
5
- {"name": "Algeria", "code": "DZ"},
6
- {"name": "American Samoa", "code": "AS"},
7
- {"name": "AndorrA", "code": "AD"},
8
- {"name": "Angola", "code": "AO"},
9
- {"name": "Anguilla", "code": "AI"},
10
- {"name": "Antarctica", "code": "AQ"},
11
- {"name": "Antigua and Barbuda", "code": "AG"},
12
- {"name": "Argentina", "code": "AR"},
13
- {"name": "Armenia", "code": "AM"},
14
- {"name": "Aruba", "code": "AW"},
15
- {"name": "Australia", "code": "AU"},
16
- {"name": "Austria", "code": "AT"},
17
- {"name": "Azerbaijan", "code": "AZ"},
18
- {"name": "Bahamas", "code": "BS"},
19
- {"name": "Bahrain", "code": "BH"},
20
- {"name": "Bangladesh", "code": "BD"},
21
- {"name": "Barbados", "code": "BB"},
22
- {"name": "Belarus", "code": "BY"},
23
- {"name": "Belgium", "code": "BE"},
24
- {"name": "Belize", "code": "BZ"},
25
- {"name": "Benin", "code": "BJ"},
26
- {"name": "Bermuda", "code": "BM"},
27
- {"name": "Bhutan", "code": "BT"},
28
- {"name": "Bolivia", "code": "BO"},
29
- {"name": "Bosnia and Herzegovina", "code": "BA"},
30
- {"name": "Botswana", "code": "BW"},
31
- {"name": "Bouvet Island", "code": "BV"},
32
- {"name": "Brazil", "code": "BR"},
33
- {"name": "British Indian Ocean Territory", "code": "IO"},
34
- {"name": "Brunei Darussalam", "code": "BN"},
35
- {"name": "Bulgaria", "code": "BG"},
36
- {"name": "Burkina Faso", "code": "BF"},
37
- {"name": "Burundi", "code": "BI"},
38
- {"name": "Cambodia", "code": "KH"},
39
- {"name": "Cameroon", "code": "CM"},
40
- {"name": "Canada", "code": "CA"},
41
- {"name": "Cape Verde", "code": "CV"},
42
- {"name": "Cayman Islands", "code": "KY"},
43
- {"name": "Central African Republic", "code": "CF"},
44
- {"name": "Chad", "code": "TD"},
45
- {"name": "Chile", "code": "CL"},
46
- {"name": "China", "code": "CN"},
47
- {"name": "Christmas Island", "code": "CX"},
48
- {"name": "Cocos (Keeling) Islands", "code": "CC"},
49
- {"name": "Colombia", "code": "CO"},
50
- {"name": "Comoros", "code": "KM"},
51
- {"name": "Congo", "code": "CG"},
52
- {"name": "Congo, The Democratic Republic of the", "code": "CD"},
53
- {"name": "Cook Islands", "code": "CK"},
54
- {"name": "Costa Rica", "code": "CR"},
55
- {"name": "Cote D\"Ivoire", "code": "CI"},
56
- {"name": "Croatia", "code": "HR"},
57
- {"name": "Cuba", "code": "CU"},
58
- {"name": "Cyprus", "code": "CY"},
59
- {"name": "Czech Republic", "code": "CZ"},
60
- {"name": "Denmark", "code": "DK"},
61
- {"name": "Djibouti", "code": "DJ"},
62
- {"name": "Dominica", "code": "DM"},
63
- {"name": "Dominican Republic", "code": "DO"},
64
- {"name": "Ecuador", "code": "EC"},
65
- {"name": "Egypt", "code": "EG"},
66
- {"name": "El Salvador", "code": "SV"},
67
- {"name": "Equatorial Guinea", "code": "GQ"},
68
- {"name": "Eritrea", "code": "ER"},
69
- {"name": "Estonia", "code": "EE"},
70
- {"name": "Ethiopia", "code": "ET"},
71
- {"name": "Falkland Islands (Malvinas)", "code": "FK"},
72
- {"name": "Faroe Islands", "code": "FO"},
73
- {"name": "Fiji", "code": "FJ"},
74
- {"name": "Finland", "code": "FI"},
75
- {"name": "France", "code": "FR"},
76
- {"name": "French Guiana", "code": "GF"},
77
- {"name": "French Polynesia", "code": "PF"},
78
- {"name": "French Southern Territories", "code": "TF"},
79
- {"name": "Gabon", "code": "GA"},
80
- {"name": "Gambia", "code": "GM"},
81
- {"name": "Georgia", "code": "GE"},
82
- {"name": "Germany", "code": "DE"},
83
- {"name": "Ghana", "code": "GH"},
84
- {"name": "Gibraltar", "code": "GI"},
85
- {"name": "Greece", "code": "GR"},
86
- {"name": "Greenland", "code": "GL"},
87
- {"name": "Grenada", "code": "GD"},
88
- {"name": "Guadeloupe", "code": "GP"},
89
- {"name": "Guam", "code": "GU"},
90
- {"name": "Guatemala", "code": "GT"},
91
- {"name": "Guernsey", "code": "GG"},
92
- {"name": "Guinea", "code": "GN"},
93
- {"name": "Guinea-Bissau", "code": "GW"},
94
- {"name": "Guyana", "code": "GY"},
95
- {"name": "Haiti", "code": "HT"},
96
- {"name": "Heard Island and Mcdonald Islands", "code": "HM"},
97
- {"name": "Holy See (Vatican City State)", "code": "VA"},
98
- {"name": "Honduras", "code": "HN"},
99
- {"name": "Hong Kong", "code": "HK"},
100
- {"name": "Hungary", "code": "HU"},
101
- {"name": "Iceland", "code": "IS"},
102
- {"name": "India", "code": "IN"},
103
- {"name": "Indonesia", "code": "ID"},
104
- {"name": "Iran, Islamic Republic Of", "code": "IR"},
105
- {"name": "Iraq", "code": "IQ"},
106
- {"name": "Ireland", "code": "IE"},
107
- {"name": "Isle of Man", "code": "IM"},
108
- {"name": "Israel", "code": "IL"},
109
- {"name": "Italy", "code": "IT"},
110
- {"name": "Jamaica", "code": "JM"},
111
- {"name": "Japan", "code": "JP"},
112
- {"name": "Jersey", "code": "JE"},
113
- {"name": "Jordan", "code": "JO"},
114
- {"name": "Kazakhstan", "code": "KZ"},
115
- {"name": "Kenya", "code": "KE"},
116
- {"name": "Kiribati", "code": "KI"},
117
- {"name": "Korea, Democratic People\"S Republic of", "code": "KP"},
118
- {"name": "Korea, Republic of", "code": "KR"},
119
- {"name": "Kuwait", "code": "KW"},
120
- {"name": "Kyrgyzstan", "code": "KG"},
121
- {"name": "Lao People\"S Democratic Republic", "code": "LA"},
122
- {"name": "Latvia", "code": "LV"},
123
- {"name": "Lebanon", "code": "LB"},
124
- {"name": "Lesotho", "code": "LS"},
125
- {"name": "Liberia", "code": "LR"},
126
- {"name": "Libyan Arab Jamahiriya", "code": "LY"},
127
- {"name": "Liechtenstein", "code": "LI"},
128
- {"name": "Lithuania", "code": "LT"},
129
- {"name": "Luxembourg", "code": "LU"},
130
- {"name": "Macao", "code": "MO"},
131
- {"name": "Macedonia, The Former Yugoslav Republic of", "code": "MK"},
132
- {"name": "Madagascar", "code": "MG"},
133
- {"name": "Malawi", "code": "MW"},
134
- {"name": "Malaysia", "code": "MY"},
135
- {"name": "Maldives", "code": "MV"},
136
- {"name": "Mali", "code": "ML"},
137
- {"name": "Malta", "code": "MT"},
138
- {"name": "Marshall Islands", "code": "MH"},
139
- {"name": "Martinique", "code": "MQ"},
140
- {"name": "Mauritania", "code": "MR"},
141
- {"name": "Mauritius", "code": "MU"},
142
- {"name": "Mayotte", "code": "YT"},
143
- {"name": "Mexico", "code": "MX"},
144
- {"name": "Micronesia, Federated States of", "code": "FM"},
145
- {"name": "Moldova, Republic of", "code": "MD"},
146
- {"name": "Monaco", "code": "MC"},
147
- {"name": "Mongolia", "code": "MN"},
148
- {"name": "Montserrat", "code": "MS"},
149
- {"name": "Morocco", "code": "MA"},
150
- {"name": "Mozambique", "code": "MZ"},
151
- {"name": "Myanmar", "code": "MM"},
152
- {"name": "Namibia", "code": "NA"},
153
- {"name": "Nauru", "code": "NR"},
154
- {"name": "Nepal", "code": "NP"},
155
- {"name": "Netherlands", "code": "NL"},
156
- {"name": "Netherlands Antilles", "code": "AN"},
157
- {"name": "New Caledonia", "code": "NC"},
158
- {"name": "New Zealand", "code": "NZ"},
159
- {"name": "Nicaragua", "code": "NI"},
160
- {"name": "Niger", "code": "NE"},
161
- {"name": "Nigeria", "code": "NG"},
162
- {"name": "Niue", "code": "NU"},
163
- {"name": "Norfolk Island", "code": "NF"},
164
- {"name": "Northern Mariana Islands", "code": "MP"},
165
- {"name": "Norway", "code": "NO"},
166
- {"name": "Oman", "code": "OM"},
167
- {"name": "Pakistan", "code": "PK"},
168
- {"name": "Palau", "code": "PW"},
169
- {"name": "Palestinian Territory, Occupied", "code": "PS"},
170
- {"name": "Panama", "code": "PA"},
171
- {"name": "Papua New Guinea", "code": "PG"},
172
- {"name": "Paraguay", "code": "PY"},
173
- {"name": "Peru", "code": "PE"},
174
- {"name": "Philippines", "code": "PH"},
175
- {"name": "Pitcairn", "code": "PN"},
176
- {"name": "Poland", "code": "PL"},
177
- {"name": "Portugal", "code": "PT"},
178
- {"name": "Puerto Rico", "code": "PR"},
179
- {"name": "Qatar", "code": "QA"},
180
- {"name": "Reunion", "code": "RE"},
181
- {"name": "Romania", "code": "RO"},
182
- {"name": "Russian Federation", "code": "RU"},
183
- {"name": "RWANDA", "code": "RW"},
184
- {"name": "Saint Helena", "code": "SH"},
185
- {"name": "Saint Kitts and Nevis", "code": "KN"},
186
- {"name": "Saint Lucia", "code": "LC"},
187
- {"name": "Saint Pierre and Miquelon", "code": "PM"},
188
- {"name": "Saint Vincent and the Grenadines", "code": "VC"},
189
- {"name": "Samoa", "code": "WS"},
190
- {"name": "San Marino", "code": "SM"},
191
- {"name": "Sao Tome and Principe", "code": "ST"},
192
- {"name": "Saudi Arabia", "code": "SA"},
193
- {"name": "Senegal", "code": "SN"},
194
- {"name": "Serbia and Montenegro", "code": "CS"},
195
- {"name": "Seychelles", "code": "SC"},
196
- {"name": "Sierra Leone", "code": "SL"},
197
- {"name": "Singapore", "code": "SG"},
198
- {"name": "Slovakia", "code": "SK"},
199
- {"name": "Slovenia", "code": "SI"},
200
- {"name": "Solomon Islands", "code": "SB"},
201
- {"name": "Somalia", "code": "SO"},
202
- {"name": "South Africa", "code": "ZA"},
203
- {"name": "South Georgia and the South Sandwich Islands", "code": "GS"},
204
- {"name": "Spain", "code": "ES"},
205
- {"name": "Sri Lanka", "code": "LK"},
206
- {"name": "Sudan", "code": "SD"},
207
- {"name": "Suriname", "code": "SR"},
208
- {"name": "Svalbard and Jan Mayen", "code": "SJ"},
209
- {"name": "Swaziland", "code": "SZ"},
210
- {"name": "Sweden", "code": "SE"},
211
- {"name": "Switzerland", "code": "CH"},
212
- {"name": "Syrian Arab Republic", "code": "SY"},
213
- {"name": "Taiwan, Province of China", "code": "TW"},
214
- {"name": "Tajikistan", "code": "TJ"},
215
- {"name": "Tanzania, United Republic of", "code": "TZ"},
216
- {"name": "Thailand", "code": "TH"},
217
- {"name": "Timor-Leste", "code": "TL"},
218
- {"name": "Togo", "code": "TG"},
219
- {"name": "Tokelau", "code": "TK"},
220
- {"name": "Tonga", "code": "TO"},
221
- {"name": "Trinidad and Tobago", "code": "TT"},
222
- {"name": "Tunisia", "code": "TN"},
223
- {"name": "Turkey", "code": "TR"},
224
- {"name": "Turkmenistan", "code": "TM"},
225
- {"name": "Turks and Caicos Islands", "code": "TC"},
226
- {"name": "Tuvalu", "code": "TV"},
227
- {"name": "Uganda", "code": "UG"},
228
- {"name": "Ukraine", "code": "UA"},
229
- {"name": "United Arab Emirates", "code": "AE"},
230
- {"name": "United Kingdom", "code": "GB"},
231
- {"name": "United States", "code": "US"},
232
- {"name": "United States Minor Outlying Islands", "code": "UM"},
233
- {"name": "Uruguay", "code": "UY"},
234
- {"name": "Uzbekistan", "code": "UZ"},
235
- {"name": "Vanuatu", "code": "VU"},
236
- {"name": "Venezuela", "code": "VE"},
237
- {"name": "Viet Nam", "code": "VN"},
238
- {"name": "Virgin Islands, British", "code": "VG"},
239
- {"name": "Virgin Islands, U.S.", "code": "VI"},
240
- {"name": "Wallis and Futuna", "code": "WF"},
241
- {"name": "Western Sahara", "code": "EH"},
242
- {"name": "Yemen", "code": "YE"},
243
- {"name": "Zambia", "code": "ZM"},
244
- {"name": "Zimbabwe", "code": "ZW"}
245
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/formbuilder.js DELETED
@@ -1,398 +0,0 @@
1
- /*jshint devel:true */
2
- /*global ajaxurl */
3
-
4
- ;(function($) {
5
-
6
- var $formEditor = $('ul#wpuf-form-editor');
7
-
8
- var Editor = {
9
- init: function() {
10
-
11
- $(function() {
12
- $('.wpuf-ms-color').wpColorPicker();
13
- });
14
-
15
- // make it sortable
16
- this.makeSortable();
17
-
18
- this.tooltip();
19
- this.tabber();
20
- this.showHideHelp();
21
-
22
- var this_obj = this;
23
- // Form Settings
24
- $('#wpuf-metabox-settings').on('change', 'select[name="wpuf_settings[redirect_to]"]', this.settingsRedirect);
25
- $('#wpuf-metabox-settings-update').on('change', 'select[name="wpuf_settings[edit_redirect_to]"]', this.settingsRedirect);
26
- $('select[name="wpuf_settings[redirect_to]"]').change();
27
- $('select[name="wpuf_settings[edit_redirect_to]"]').change();
28
-
29
- // Form settings: Guest post
30
- $('#wpuf-metabox-settings').on('change', 'input[type=checkbox][name="wpuf_settings[guest_post]"]', this.settingsGuest);
31
- $('input[type=checkbox][name="wpuf_settings[guest_post]"]').trigger('change');
32
-
33
- // From settings: User details
34
- $('#wpuf-metabox-settings').on('change', 'input[type=checkbox][name="wpuf_settings[guest_details]"]', this.settingsGuestDetails);
35
- // $('input[type=checkbox][name="wpuf_settings[guest_details]"]').trigger('change');
36
-
37
- // collapse all
38
- $('button.wpuf-collapse').on('click', this.collpaseEditFields);
39
-
40
- // add field click
41
- $('.wpuf-form-buttons').on('click', 'button', this.addNewField);
42
-
43
- // remove form field
44
- $('#wpuf-form-editor').on('click', '.wpuf-remove', this.removeFormField);
45
-
46
- // on change event: meta key
47
- $('#wpuf-form-editor').on('change', 'li.custom-field input[data-type="label"]', this.setMetaKey);
48
-
49
- // on change event: checkbox|radio fields
50
- $('#wpuf-form-editor').on('change', '.wpuf-form-sub-fields input[type=text]', function() {
51
- var self = $(this),
52
- value = self.closest('div').find('input[data-type=option_value]').val();
53
-
54
- if ( value === '' ) {
55
- var replace_val = self.closest('div').find('input[data-type=option]').val();
56
- self.siblings('input[type=checkbox], input[type=radio]').val(replace_val);
57
- } else {
58
- self.siblings('input[type=checkbox], input[type=radio]').val(value);
59
- }
60
-
61
-
62
- });
63
-
64
- // on change event: checkbox|radio fields
65
- $('#wpuf-form-editor').on('click', 'input[type=checkbox].multicolumn', function() {
66
- // $(this).prev('input[type=checkbox], input[type=radio]').val($(this).val());
67
- var $self = $(this),
68
- $parent = $self.closest('.wpuf-form-rows');
69
-
70
- if ($self.is(':checked')) {
71
- $parent.next().hide().next().hide();
72
- $parent.siblings('.column-names').show();
73
- } else {
74
- $parent.next().show().next().show();
75
- $parent.siblings('.column-names').hide();
76
- }
77
- });
78
-
79
- // on change event: checkbox|radio fields
80
- $('#wpuf-form-editor').on('click', 'input[type=checkbox].retype-pass', function() {
81
- // $(this).prev('input[type=checkbox], input[type=radio]').val($(this).val());
82
- var $self = $(this),
83
- $parent = $self.closest('.wpuf-form-rows');
84
-
85
- if ($self.is(':checked')) {
86
- $parent.next().show().next().show();
87
- } else {
88
- $parent.next().hide().next().hide();
89
- }
90
- });
91
-
92
- // woo attribute
93
- $('#wpuf-form-editor').on('click', 'input[type=checkbox].woo_attr', function() {
94
- var $self = $(this),
95
- $parent = $self.closest('.wpuf-form-rows');
96
-
97
- if ($self.is(':checked')) {
98
- $parent.next().show();
99
- } else {
100
- $parent.next().hide();
101
- }
102
- });
103
-
104
- // toggle form field
105
- $('#wpuf-form-editor').on('click', '.wpuf-toggle', this.toggleFormField);
106
-
107
- // clone and remove repeated field
108
- $('#wpuf-form-editor').on('click', 'img.wpuf-clone-field', this.cloneField);
109
- $('#wpuf-form-editor').on('click', 'img.wpuf-remove-field', this.removeField);
110
- $('#wpuf-form-editor').on('click', '.wpuf-value-handelar', this.showValueField);
111
-
112
- //on change enable expiration check status
113
- this.changeExpirationFieldVisibility(':checkbox#wpuf-enable_post_expiration')
114
- $('.wpuf-metabox-post_expiration').on('change',':checkbox#wpuf-enable_post_expiration',this.changeExpirationFieldVisibility);
115
- //on change expiration type drop down
116
- //$('.wpuf-metabox-post_expiration').on('change','select#wpuf-expiration_time_type',this.setTimeExpiration);
117
-
118
- this_obj.changeMultistepVisibility( $('.wpuf_enable_multistep_section :input[type="checkbox"]') );
119
- $('.wpuf_enable_multistep_section :input[type="checkbox"]').click(function(){
120
- this_obj.changeMultistepVisibility( $(this) );
121
- });
122
-
123
- //when changing the post type from the drop down
124
- $(document).on( 'change', ':input[name="wpuf_settings[post_type]"]', function() {
125
- $('.attributes_holder, .wpuf-custom-tax-btn', '.wpuf-taxonomies-holder ' ).hide();
126
- $( '.attributes_holder.' + $(this).val() + ', .wpuf-custom-tax-btn.' + $(this).val(),'.wpuf-taxonomies-holder ').show();
127
- } );
128
- },
129
-
130
- changeMultistepVisibility : function( target ){
131
- if(target.is(':checked')){
132
- $('.wpuf_multistep_content').show();
133
- }else{
134
- $('.wpuf_multistep_content').hide();
135
- }
136
- },
137
-
138
- showValueField: function() {
139
- var self = $(this),
140
- field = self.closest('div').find( 'input[data-type=option_value], span.wpuf-option-value');
141
-
142
- if ( self.is(':checked') ) {
143
- field.show();
144
- } else {
145
- field.hide();
146
- }
147
-
148
- },
149
-
150
- showHideHelp: function() {
151
- var childs = $('ul#wpuf-form-editor').children('li');
152
-
153
- if ( !childs.length) {
154
- $('.wpuf-updated').show();
155
- } else {
156
- $('.wpuf-updated').hide();
157
- }
158
- },
159
-
160
- makeSortable: function() {
161
- $formEditor = $('ul#wpuf-form-editor');
162
-
163
- if ($formEditor) {
164
- $formEditor.sortable({
165
- placeholder: "ui-state-highlight",
166
- handle: '> .wpuf-legend',
167
- distance: 5
168
- });
169
- }
170
- },
171
-
172
- addNewField: function(e) {
173
- e.preventDefault();
174
-
175
- var $self = $(this),
176
- $formEditor = $('ul#wpuf-form-editor'),
177
- name = $self.data('name'),
178
- type = $self.data('type'),
179
- data = {
180
- name: name,
181
- type: type,
182
- order: $formEditor.find('li').length + 1,
183
- action: 'wpuf_form_add_el'
184
- };
185
-
186
- // console.log($self, data);
187
-
188
- // check if these are already inserted
189
- var oneInstance = ['post_title', 'post_content', 'post_excerpt', 'featured_image',
190
- 'user_login', 'first_name', 'last_name', 'nickname', 'user_email', 'user_url',
191
- 'user_bio', 'password', 'user_avatar'];
192
-
193
- if ($.inArray(name, oneInstance) >= 0) {
194
- if( $formEditor.find('li.' + name).length ) {
195
- alert('You already have this field in the form');
196
- return false;
197
- }
198
- }
199
-
200
- $('.wpuf-loading').removeClass('hide');
201
- $.post(ajaxurl, data, function(res) {
202
- $formEditor.append(res);
203
-
204
- // re-call sortable
205
- Editor.makeSortable();
206
-
207
- // enable tooltip
208
- Editor.tooltip();
209
-
210
- $('.wpuf-loading').addClass('hide');
211
- Editor.showHideHelp();
212
- });
213
- },
214
-
215
- removeFormField: function(e) {
216
- e.preventDefault();
217
-
218
- if (confirm('are you sure?')) {
219
-
220
- $(this).closest('li').fadeOut(function() {
221
- $(this).remove();
222
-
223
- Editor.showHideHelp();
224
- });
225
- }
226
- },
227
-
228
- toggleFormField: function(e) {
229
- e.preventDefault();
230
-
231
- $(this).closest('li').find('.wpuf-form-holder').slideToggle('fast');
232
- },
233
-
234
- cloneField: function(e) {
235
- e.preventDefault();
236
-
237
- var $div = $(this).closest('div');
238
- var $clone = $div.clone();
239
- // console.log($clone);
240
-
241
- //clear the inputs
242
- $clone.find('input').val('');
243
- $clone.find(':checked').attr('checked', '');
244
- $div.after($clone);
245
- },
246
-
247
- removeField: function() {
248
- //check if it's the only item
249
- var $parent = $(this).closest('div');
250
- var items = $parent.siblings('.wpuf-clone-field').andSelf().length;
251
-
252
- if( items > 1 ) {
253
- $parent.remove();
254
- }
255
- },
256
-
257
- setMetaKey: function() {
258
- var $self = $(this),
259
- val = $self.val().toLowerCase().split(' ').join('_').split('\'').join(''),
260
- $metaKey = $(this).closest('.wpuf-form-rows').next().find('input[type=text]');
261
-
262
- val = val.replace(/[^a-z0-9]|\s+|\r?\n|\r/gmi, "_");
263
-
264
- if ($metaKey.length && !$metaKey.val()) {
265
- $metaKey.val(val);
266
- }
267
- },
268
-
269
- tooltip: function() {
270
- $('.smallipopInput').smallipop({
271
- preferredPosition: 'right',
272
- theme: 'black',
273
- popupOffset: 0,
274
- triggerOnClick: true
275
- });
276
- },
277
-
278
- collpaseEditFields: function(e) {
279
- e.preventDefault();
280
-
281
- $('ul#wpuf-form-editor').children('li').find('.wpuf-form-holder').slideToggle();
282
- },
283
-
284
- settingsGuest: function (e) {
285
- e.preventDefault();
286
-
287
- var table = $(this).closest('table');
288
-
289
- if ( $(this).is(':checked') ) {
290
- table.find('tr.show-if-guest').show();
291
- table.find('tr.show-if-not-guest').hide();
292
-
293
- $('input[type=checkbox][name="wpuf_settings[guest_details]"]').trigger('change');
294
-
295
- } else {
296
- table.find('tr.show-if-guest').hide();
297
- table.find('tr.show-if-not-guest').show();
298
- }
299
- },
300
-
301
- settingsGuestDetails: function (e) {
302
- e.preventDefault();
303
-
304
- var table = $(this).closest('table');
305
-
306
- if ( $(this).is(':checked') ) {
307
- table.find('tr.show-if-details').show();
308
- } else {
309
- table.find('tr.show-if-details').hide();
310
- }
311
- },
312
-
313
- settingsRedirect: function(e) {
314
- e.preventDefault();
315
-
316
- var $self = $(this),
317
- $table = $self.closest('table'),
318
- value = $self.val();
319
-
320
- switch( value ) {
321
- case 'post':
322
- $table.find('tr.wpuf-page-id, tr.wpuf-url, tr.wpuf-same-page').hide();
323
- break;
324
-
325
- case 'page':
326
- $table.find('tr.wpuf-page-id').show();
327
- $table.find('tr.wpuf-same-page').hide();
328
- $table.find('tr.wpuf-url').hide();
329
- break;
330
-
331
- case 'url':
332
- $table.find('tr.wpuf-page-id').hide();
333
- $table.find('tr.wpuf-same-page').hide();
334
- $table.find('tr.wpuf-url').show();
335
- break;
336
-
337
- case 'same':
338
- $table.find('tr.wpuf-page-id').hide();
339
- $table.find('tr.wpuf-url').hide();
340
- $table.find('tr.wpuf-same-page').show();
341
- break;
342
- }
343
- },
344
-
345
- tabber: function() {
346
- // Switches option sections
347
- $('.group').hide();
348
- $('.group:first').fadeIn();
349
-
350
- $('.group .collapsed').each(function(){
351
- $(this).find('input:checked').parent().parent().parent().nextAll().each(
352
- function(){
353
- if ($(this).hasClass('last')) {
354
- $(this).removeClass('hidden');
355
- return false;
356
- }
357
- $(this).filter('.hidden').removeClass('hidden');
358
- });
359
- });
360
-
361
- $('.nav-tab-wrapper a:first').addClass('nav-tab-active');
362
-
363
- $('.nav-tab-wrapper a').click(function(evt) {
364
- $('.nav-tab-wrapper a').removeClass('nav-tab-active');
365
- $(this).addClass('nav-tab-active').blur();
366
- var clicked_group = $(this).attr('href');
367
- $('.group').hide();
368
- $(clicked_group).fadeIn();
369
- evt.preventDefault();
370
- });
371
- },
372
-
373
- setTimeExpiration: function(e){
374
- var timeArray = {
375
- 'day' : 30,
376
- 'month' : 12,
377
- 'year': 100
378
- };
379
- $('#wpuf-expiration_time_value').html('');
380
- var timeVal = e.target?$(e.target).val():$(e).val();
381
- for(var time = 1; time <= timeArray[timeVal]; time++){
382
- $('#wpuf-expiration_time_value').append('<option value="'+ time +'" >'+ time +'</option>');
383
- }
384
- },
385
-
386
- changeExpirationFieldVisibility : function(e){
387
- console.log(e);
388
- var checkbox_obj = e.target? $(e.target):$(e);
389
- checkbox_obj.is(':checked')?$('.wpuf_expiration_field').show():$('.wpuf_expiration_field').hide();
390
- }
391
- };
392
-
393
- // on DOM ready
394
- $(function() {
395
- Editor.init();
396
- });
397
-
398
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/formbuilder.min.js DELETED
@@ -1 +0,0 @@
1
- !function(e){var t=e("ul#wpuf-form-editor"),i={init:function(){this.makeSortable(),this.tooltip(),this.tabber(),this.showHideHelp(),e("#wpuf-metabox-settings").on("change",'select[name="wpuf_settings[redirect_to]"]',this.settingsRedirect),e("#wpuf-metabox-settings-update").on("change",'select[name="wpuf_settings[edit_redirect_to]"]',this.settingsRedirect),e('select[name="wpuf_settings[redirect_to]"]').change(),e('select[name="wpuf_settings[edit_redirect_to]"]').change(),e("#wpuf-metabox-settings").on("change",'input[type=checkbox][name="wpuf_settings[guest_post]"]',this.settingsGuest),e('input[type=checkbox][name="wpuf_settings[guest_post]"]').trigger("change"),e("#wpuf-metabox-settings").on("change",'input[type=checkbox][name="wpuf_settings[guest_details]"]',this.settingsGuestDetails),e("button.wpuf-collapse").on("click",this.collpaseEditFields),e(".wpuf-form-buttons").on("click","button",this.addNewField),e("#wpuf-form-editor").on("click",".wpuf-remove",this.removeFormField),e("#wpuf-form-editor").on("change",'li.custom-field input[data-type="label"]',this.setMetaKey),e("#wpuf-form-editor").on("change",".wpuf-form-sub-fields input[type=text]",function(){var t=e(this),i=t.closest("div").find("input[data-type=option_value]").val();if(""===i){var s=t.closest("div").find("input[data-type=option]").val();t.siblings("input[type=checkbox], input[type=radio]").val(s)}else t.siblings("input[type=checkbox], input[type=radio]").val(i)}),e("#wpuf-form-editor").on("click","input[type=checkbox].multicolumn",function(){var t=e(this),i=t.closest(".wpuf-form-rows");t.is(":checked")?(i.next().hide().next().hide(),i.siblings(".column-names").show()):(i.next().show().next().show(),i.siblings(".column-names").hide())}),e("#wpuf-form-editor").on("click","input[type=checkbox].retype-pass",function(){var t=e(this),i=t.closest(".wpuf-form-rows");t.is(":checked")?i.next().show().next().show():i.next().hide().next().hide()}),e("#wpuf-form-editor").on("click","input[type=checkbox].woo_attr",function(){var t=e(this),i=t.closest(".wpuf-form-rows");t.is(":checked")?i.next().show():i.next().hide()}),e("#wpuf-form-editor").on("click",".wpuf-toggle",this.toggleFormField),e("#wpuf-form-editor").on("click","img.wpuf-clone-field",this.cloneField),e("#wpuf-form-editor").on("click","img.wpuf-remove-field",this.removeField),e("#wpuf-form-editor").on("click",".wpuf-value-handelar",this.showValueField)},showValueField:function(){var t=e(this),i=t.closest("div").find("input[data-type=option_value], span.wpuf-option-value");t.is(":checked")?i.show():i.hide()},showHideHelp:function(){var t=e("ul#wpuf-form-editor").children("li");t.length?e(".wpuf-updated").hide():e(".wpuf-updated").show()},makeSortable:function(){t=e("ul#wpuf-form-editor"),t&&t.sortable({placeholder:"ui-state-highlight",handle:"> .wpuf-legend",distance:5})},addNewField:function(t){t.preventDefault();var s=e(this),n=e("ul#wpuf-form-editor"),o=s.data("name"),a=s.data("type"),r={name:o,type:a,order:n.find("li").length+1,action:"wpuf_form_add_el"},l=["post_title","post_content","post_excerpt","featured_image","user_login","first_name","last_name","nickname","user_email","user_url","user_bio","password","user_avatar"];return e.inArray(o,l)>=0&&n.find("li."+o).length?(alert("You already have this field in the form"),!1):(e(".wpuf-loading").removeClass("hide"),void e.post(ajaxurl,r,function(t){n.append(t),i.makeSortable(),i.tooltip(),e(".wpuf-loading").addClass("hide"),i.showHideHelp()}))},removeFormField:function(t){t.preventDefault(),confirm("are you sure?")&&e(this).closest("li").fadeOut(function(){e(this).remove(),i.showHideHelp()})},toggleFormField:function(t){t.preventDefault(),e(this).closest("li").find(".wpuf-form-holder").slideToggle("fast")},cloneField:function(t){t.preventDefault();var i=e(this).closest("div"),s=i.clone();s.find("input").val(""),s.find(":checked").attr("checked",""),i.after(s)},removeField:function(){var t=e(this).closest("div"),i=t.siblings(".wpuf-clone-field").andSelf().length;i>1&&t.remove()},setMetaKey:function(){var t=e(this),i=t.val().toLowerCase().split(" ").join("_").split("'").join(""),s=e(this).closest(".wpuf-form-rows").next().find("input[type=text]");i=i.replace(/[^a-z0-9]|\s+|\r?\n|\r/gim,"_"),s.length&&s.val(i)},tooltip:function(){e(".smallipopInput").smallipop({preferredPosition:"right",theme:"black",popupOffset:0,triggerOnClick:!0})},collpaseEditFields:function(t){t.preventDefault(),e("ul#wpuf-form-editor").children("li").find(".wpuf-form-holder").slideToggle()},settingsGuest:function(t){t.preventDefault();var i=e(this).closest("table");e(this).is(":checked")?(i.find("tr.show-if-guest").show(),i.find("tr.show-if-not-guest").hide(),e('input[type=checkbox][name="wpuf_settings[guest_details]"]').trigger("change")):(i.find("tr.show-if-guest").hide(),i.find("tr.show-if-not-guest").show())},settingsGuestDetails:function(t){t.preventDefault();var i=e(this).closest("table");e(this).is(":checked")?i.find("tr.show-if-details").show():i.find("tr.show-if-details").hide()},settingsRedirect:function(t){t.preventDefault();var i=e(this),s=i.closest("table"),n=i.val();switch(n){case"post":s.find("tr.wpuf-page-id, tr.wpuf-url, tr.wpuf-same-page").hide();break;case"page":s.find("tr.wpuf-page-id").show(),s.find("tr.wpuf-same-page").hide(),s.find("tr.wpuf-url").hide();break;case"url":s.find("tr.wpuf-page-id").hide(),s.find("tr.wpuf-same-page").hide(),s.find("tr.wpuf-url").show();break;case"same":s.find("tr.wpuf-page-id").hide(),s.find("tr.wpuf-url").hide(),s.find("tr.wpuf-same-page").show()}},tabber:function(){e(".group").hide(),e(".group:first").fadeIn(),e(".group .collapsed").each(function(){e(this).find("input:checked").parent().parent().parent().nextAll().each(function(){return e(this).hasClass("last")?(e(this).removeClass("hidden"),!1):void e(this).filter(".hidden").removeClass("hidden")})}),e(".nav-tab-wrapper a:first").addClass("nav-tab-active"),e(".nav-tab-wrapper a").click(function(t){e(".nav-tab-wrapper a").removeClass("nav-tab-active"),e(this).addClass("nav-tab-active").blur();var i=e(this).attr("href");e(".group").hide(),e(i).fadeIn(),t.preventDefault()})}};e(function(){i.init()})}(jQuery);
 
assets/js/frontend-form.js DELETED
@@ -1,892 +0,0 @@
1
- ;(function($, window) {
2
-
3
- $.fn.listautowidth = function() {
4
- return this.each(function() {
5
- var w = $(this).width();
6
- var liw = w / $(this).children('li').length;
7
- $(this).children('li').each(function(){
8
- var s = $(this).outerWidth(true)-$(this).width();
9
- $(this).width(liw-s);
10
- });
11
- });
12
- };
13
-
14
- window.WP_User_Frontend = {
15
-
16
- pass_val : '',
17
- retype_pass_val : '',
18
-
19
- init: function() {
20
-
21
- //enable multistep
22
- this.enableMultistep(this);
23
-
24
- // clone and remove repeated field
25
- $('.wpuf-form').on('click', 'img.wpuf-clone-field', this.cloneField);
26
- $('.wpuf-form').on('click', 'img.wpuf-remove-field', this.removeField);
27
- $('.wpuf-form').on('click', 'a.wpuf-delete-avatar', this.deleteAvatar);
28
- $('.wpuf-form').on('click', 'a#wpuf-post-draft', this.draftPost);
29
- $('.wpuf-form').on('click', 'button#wpuf-account-update-profile', this.account_update_profile);
30
-
31
- $('.wpuf-form-add').on('submit', this.formSubmit);
32
- $('form#post').on('submit', this.adminPostSubmit);
33
- $( '.wpuf-form').on('keyup', '#pass1', this.check_pass_strength );
34
-
35
- this.ajaxCategory();
36
- // image insert
37
- // this.insertImage();
38
-
39
- //comfirmation alert for canceling subscription
40
- $( ':submit[name="wpuf_cancel_subscription"]').click(function(){
41
- if ( !confirm( 'Are you sure you want to cancel your current subscription ?' ) ) {
42
- return false;
43
- }
44
-
45
- });
46
- },
47
-
48
- check_pass_strength : function() {
49
- var pass1 = $('#pass1').val(), strength;
50
-
51
- $('#pass-strength-result').show();
52
-
53
- $('#pass-strength-result').removeClass('short bad good strong');
54
- if ( ! pass1 ) {
55
- $('#pass-strength-result').html( '&nbsp;' );
56
- $('#pass-strength-result').hide();
57
- return;
58
- }
59
-
60
- if ( typeof wp.passwordStrength != 'undefined' ) {
61
-
62
- strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass1 );
63
-
64
- switch ( strength ) {
65
- case 2:
66
- $('#pass-strength-result').addClass('bad').html( pwsL10n.bad );
67
- break;
68
- case 3:
69
- $('#pass-strength-result').addClass('good').html( pwsL10n.good );
70
- break;
71
- case 4:
72
- $('#pass-strength-result').addClass('strong').html( pwsL10n.strong );
73
- break;
74
- case 5:
75
- $('#pass-strength-result').addClass('short').html( pwsL10n.mismatch );
76
- break;
77
- default:
78
- $('#pass-strength-result').addClass('short').html( pwsL10n['short'] );
79
- }
80
-
81
- }
82
- },
83
-
84
- enableMultistep: function(o) {
85
-
86
- var js_obj = this;
87
- var step_number = 0;
88
- var progressbar_type = $(':hidden[name="wpuf_multistep_type"]').val();
89
-
90
- if ( progressbar_type == null ) {
91
- return;
92
- }
93
-
94
- // first fieldset doesn't have prev button,
95
- // last fieldset doesn't have next button
96
- $('fieldset.wpuf-multistep-fieldset').find('.wpuf-multistep-prev-btn').first().remove();
97
- $('fieldset.wpuf-multistep-fieldset').find('.wpuf-multistep-next-btn').last().remove();
98
-
99
- // at first first fieldset will be shown, and others will be hidden
100
- $('.wpuf-form fieldset').removeClass('field-active').first().addClass('field-active');
101
-
102
- if ( progressbar_type == 'progressive' && $('.wpuf-form .wpuf-multistep-fieldset').length != 0 ) {
103
-
104
- var firstLegend = $('fieldset.wpuf-multistep-fieldset legend').first();
105
- $('.wpuf-multistep-progressbar').html('<div class="wpuf-progress-percentage"></div>' );
106
-
107
- var progressbar = $( ".wpuf-multistep-progressbar" ),
108
- progressLabel = $( ".wpuf-progress-percentage" );
109
-
110
- $( ".wpuf-multistep-progressbar" ).progressbar({
111
- change: function() {
112
- progressLabel.text( progressbar.progressbar( "value" ) + "%" );
113
- }
114
- });
115
-
116
- $('.wpuf-multistep-fieldset legend').hide();
117
-
118
- } else {
119
- $('.wpuf-form').each(function() {
120
- var this_obj = $(this);
121
- var progressbar = $('.wpuf-multistep-progressbar', this_obj);
122
- var nav = '';
123
-
124
- progressbar.addClass('wizard-steps');
125
- nav += '<ul class="wpuf-step-wizard">';
126
-
127
- $('.wpuf-multistep-fieldset', this).each(function(){
128
- nav += '<li>' + $.trim( $('legend', this).text() ) + '</li>';
129
- $('legend', this).hide();
130
- });
131
-
132
- nav += '</ul>';
133
- progressbar.append( nav );
134
-
135
- $('.wpuf-step-wizard li', progressbar).first().addClass('active-step');
136
- $('.wpuf-step-wizard', progressbar).listautowidth();
137
- });
138
- }
139
-
140
- this.change_fieldset(step_number, progressbar_type);
141
-
142
- $('fieldset .wpuf-multistep-prev-btn, fieldset .wpuf-multistep-next-btn').click(function(e) {
143
-
144
- // js_obj.formSubmit();
145
- if ( $(this).hasClass('wpuf-multistep-next-btn') ) {
146
- var result = js_obj.formStepCheck( '', $(this).closest('fieldset') );
147
-
148
- if ( result != false ) {
149
- o.change_fieldset(++step_number,progressbar_type);
150
- }
151
-
152
- } else if ( $(this).hasClass('wpuf-multistep-prev-btn') ) {
153
- o.change_fieldset( --step_number,progressbar_type );
154
- }
155
-
156
- return false;
157
- });
158
- },
159
-
160
- change_fieldset: function(step_number, progressbar_type) {
161
- $('fieldset.wpuf-multistep-fieldset').removeClass('field-active').eq(step_number).addClass('field-active');
162
-
163
- $('.wpuf-step-wizard li').each(function(){
164
- if ( $(this).index() <= step_number ){
165
- progressbar_type == 'step_by_step'? $(this).addClass('passed-wpuf-ms-bar') : $('.wpuf-ps-bar',this).addClass('passed-wpuf-ms-bar');
166
- } else {
167
- progressbar_type == 'step_by_step'? $(this).removeClass('passed-wpuf-ms-bar') : $('.wpuf-ps-bar',this).removeClass('passed-wpuf-ms-bar');
168
- }
169
- });
170
-
171
- $('.wpuf-step-wizard li').removeClass('wpuf-ms-bar-active active-step completed-step');
172
- $('.passed-wpuf-ms-bar').addClass('completed-step').last().addClass('wpuf-ms-bar-active');
173
- $('.wpuf-ms-bar-active').addClass('active-step');
174
-
175
- var legend = $('fieldset.wpuf-multistep-fieldset').eq(step_number).find('legend').text();
176
- legend = $.trim( legend );
177
-
178
- if ( progressbar_type == 'progressive' && $('.wpuf-form .wpuf-multistep-fieldset').length != 0 ) {
179
- var progress_percent = ( step_number + 1 ) * 100 / $('fieldset.wpuf-multistep-fieldset').length ;
180
- var progress_percent = Number( progress_percent.toFixed(2) );
181
- $( ".wpuf-multistep-progressbar" ).progressbar({value: progress_percent });
182
- $( '.wpuf-progress-percentage' ).text( legend + ' (' + progress_percent + '%)');
183
- }
184
-
185
- // trigger a change event
186
- $('.wpuf-form').trigger('step-change-fieldset');
187
- },
188
-
189
- ajaxCategory: function () {
190
-
191
- var el = '.cat-ajax',
192
- wrap = '.category-wrap';
193
-
194
- $(wrap).on('change', el, function(){
195
- currentLevel = parseInt( $(this).parent().attr('level') );
196
- WP_User_Frontend.getChildCats( $(this), 'lvl', currentLevel+1, wrap, 'category');
197
- });
198
- },
199
-
200
- getChildCats: function (dropdown, result_div, level, wrap_div, taxonomy) {
201
-
202
- cat = $(dropdown).val();
203
- results_div = result_div + level;
204
- taxonomy = typeof taxonomy !== 'undefined' ? taxonomy : 'category';
205
- field_attr = $(dropdown).siblings('span').data('taxonomy');
206
-
207
- $.ajax({
208
- type: 'post',
209
- url: wpuf_frontend.ajaxurl,
210
- data: {
211
- action: 'wpuf_get_child_cat',
212
- catID: cat,
213
- nonce: wpuf_frontend.nonce,
214
- field_attr: field_attr
215
- },
216
- beforeSend: function() {
217
- $(dropdown).parent().parent().next('.loading').addClass('wpuf-loading');
218
- },
219
- complete: function() {
220
- $(dropdown).parent().parent().next('.loading').removeClass('wpuf-loading');
221
- },
222
- success: function(html) {
223
- //console.log( html ); return;
224
- $(dropdown).parent().nextAll().each(function(){
225
- $(this).remove();
226
- });
227
-
228
- if(html != "") {
229
- $(dropdown).parent().addClass('hasChild').parent().append('<div id="'+result_div+level+'" level="'+level+'"></div>');
230
- dropdown.parent().parent().find('#'+results_div).html(html).slideDown('fast');
231
- }
232
- }
233
- });
234
- },
235
-
236
- cloneField: function(e) {
237
- e.preventDefault();
238
-
239
- var $div = $(this).closest('tr');
240
- var $clone = $div.clone();
241
- // console.log($clone);
242
-
243
- //clear the inputs
244
- $clone.find('input').val('');
245
- $clone.find(':checked').attr('checked', '');
246
- $div.after($clone);
247
- },
248
-
249
- removeField: function() {
250
- //check if it's the only item
251
- var $parent = $(this).closest('tr');
252
- var items = $parent.siblings().andSelf().length;
253
-
254
- if( items > 1 ) {
255
- $parent.remove();
256
- }
257
- },
258
-
259
- adminPostSubmit: function(e) {
260
- e.preventDefault();
261
-
262
- var form = $(this),
263
- form_data = WP_User_Frontend.validateForm(form);
264
-
265
- if (form_data) {
266
- return true;
267
- }
268
- },
269
-
270
- draftPost: function (e) {
271
- e.preventDefault();
272
-
273
- var self = $(this),
274
- form = $(this).closest('form'),
275
- form_data = form.serialize() + '&action=wpuf_draft_post',
276
- post_id = form.find('input[type="hidden"][name="post_id"]').val();
277
-
278
- var rich_texts = [],
279
- temp, val;
280
-
281
- // grab rich texts from tinyMCE
282
- $('.wpuf-rich-validation').each(function (index, item) {
283
- temp = $(item).data('id');
284
- val = $.trim( tinyMCE.get(temp).getContent() );
285
-
286
- rich_texts.push(temp + '=' + encodeURIComponent( val ) );
287
- });
288
-
289
- // append them to the form var
290
- form_data = form_data + '&' + rich_texts.join('&');
291
-
292
-
293
- self.after(' <span class="wpuf-loading"></span>');
294
- $.post(wpuf_frontend.ajaxurl, form_data, function(res) {
295
- // console.log(res, post_id);
296
- if ( typeof post_id === 'undefined') {
297
- var html = '<input type="hidden" name="post_id" value="' + res.post_id +'">';
298
- html += '<input type="hidden" name="post_date" value="' + res.date +'">';
299
- html += '<input type="hidden" name="post_author" value="' + res.post_author +'">';
300
- html += '<input type="hidden" name="comment_status" value="' + res.comment_status +'">';
301
-
302
- form.append( html );
303
- }
304
-
305
- self.next('span.wpuf-loading').remove();
306
-
307
- self.after('<span class="wpuf-draft-saved">&nbsp; Post Saved</span>');
308
- $('.wpuf-draft-saved').delay(2500).fadeOut('fast', function(){
309
- $(this).remove();
310
- });
311
- })
312
- },
313
-
314
- // Frontend account dashboard update profile
315
- account_update_profile: function (e) {
316
- e.preventDefault();
317
- var form = $(this).closest('form');
318
-
319
- $.post(wpuf_frontend.ajaxurl, form.serialize(), function (res) {
320
- if (res.success) {
321
- form.find('.wpuf-error').hide();
322
- form.find('.wpuf-success').show();
323
- } else {
324
- form.find('.wpuf-success').hide();
325
- form.find('.wpuf-error').show();
326
- form.find('.wpuf-error').text(res.data);
327
- }
328
- });
329
- },
330
-
331
- formStepCheck : function(e,fieldset) {
332
- var form = fieldset,
333
- submitButton = form.find('input[type=submit]');
334
- form_data = WP_User_Frontend.validateForm(form);
335
-
336
- if ( form_data == false ) {
337
- WP_User_Frontend.addErrorNotice( self, 'bottom' );
338
- }
339
- return form_data;
340
- },
341
-
342
- formSubmit: function(e) {
343
- e.preventDefault();
344
-
345
- var form = $(this),
346
- submitButton = form.find('input[type=submit]')
347
- form_data = WP_User_Frontend.validateForm(form);
348
-
349
- if (form_data) {
350
-
351
- // send the request
352
- form.find('li.wpuf-submit').append('<span class="wpuf-loading"></span>');
353
- submitButton.attr('disabled', 'disabled').addClass('button-primary-disabled');
354
-
355
- $.post(wpuf_frontend.ajaxurl, form_data, function(res) {
356
- // var res = $.parseJSON(res);
357
-
358
- if ( res.success) {
359
-
360
- // enable external plugins to use events
361
- $('body').trigger('wpuf:postform:success', res);
362
-
363
- if ( res.show_message == true) {
364
- form.before( '<div class="wpuf-success">' + res.message + '</div>');
365
- form.slideUp( 'fast', function() {
366
- form.remove();
367
- });
368
-
369
- //focus
370
- $('html, body').animate({
371
- scrollTop: $('.wpuf-success').offset().top - 100
372
- }, 'fast');
373
-
374
- } else {
375
- window.location = res.redirect_to;
376
- }
377
-
378
- } else {
379
-
380
- if ( typeof res.type !== 'undefined' && res.type === 'login' ) {
381
-
382
- if ( confirm(res.error) ) {
383
- window.location = res.redirect_to;
384
- } else {
385
- submitButton.removeAttr('disabled');
386
- submitButton.removeClass('button-primary-disabled');
387
- form.find('span.wpuf-loading').remove();
388
- }
389
-
390
- return;
391
- } else {
392
- if ( form.find('.g-recaptcha').length > 0 ) {
393
- grecaptcha.reset();
394
- }
395
-
396
- alert( res.error );
397
- }
398
-
399
- submitButton.removeAttr('disabled');
400
- }
401
-
402
- submitButton.removeClass('button-primary-disabled');
403
- form.find('span.wpuf-loading').remove();
404
- });
405
- }
406
- },
407
-
408
- validateForm: function( self ) {
409
-
410
- var temp,
411
- temp_val = '',
412
- error = false,
413
- error_items = [];
414
- error_type = '';
415
-
416
- // remove all initial errors if any
417
- WP_User_Frontend.removeErrors(self);
418
- WP_User_Frontend.removeErrorNotice(self);
419
-
420
- // ===== Validate: Text and Textarea ========
421
- var required = self.find('[data-required="yes"]:visible');
422
-
423
- required.each(function(i, item) {
424
- // temp_val = $.trim($(item).val());
425
-
426
- // console.log( $(item).data('type') );
427
- var data_type = $(item).data('type')
428
- val = '';
429
-
430
- switch(data_type) {
431
- case 'rich':
432
- var name = $(item).data('id')
433
- val = $.trim( tinyMCE.get(name).getContent() );
434
-
435
- if ( val === '') {
436
- error = true;
437
-
438
- // make it warn collor
439
- WP_User_Frontend.markError(item);
440
- }
441
- break;
442
-
443
- case 'textarea':
444
- case 'text':
445
-
446
- if ( $(item).hasClass('password') ) {
447
- if ( WP_User_Frontend.pass_val == '' ) {
448
- WP_User_Frontend.pass_val = $(item).val();
449
- } else {
450
- WP_User_Frontend.retype_pass_val = $(item).val();
451
- }
452
- if ( WP_User_Frontend.pass_val != '' && WP_User_Frontend.retype_pass_val != '' && WP_User_Frontend.pass_val != WP_User_Frontend.retype_pass_val ) {
453
- error = true;
454
- error_type = 'mismatch';
455
-
456
- WP_User_Frontend.markError( item, error_type );
457
- break;
458
- }
459
-
460
- }
461
- val = $.trim( $(item).val() );
462
-
463
- if ( val === '') {
464
- error = true;
465
- error_type = 'required';
466
-
467
- // make it warn collor
468
- WP_User_Frontend.markError( item, error_type );
469
- }
470
- break;
471
-
472
- case 'select':
473
- val = $(item).val();
474
-
475
- // console.log(val);
476
- if ( !val || val === '-1' ) {
477
- error = true;
478
- error_type = 'required';
479
-
480
- // make it warn collor
481
- WP_User_Frontend.markError( item, error_type );
482
- }
483
- break;
484
-
485
- case 'multiselect':
486
- val = $(item).val();
487
-
488
- if ( val === null || val.length === 0 ) {
489
- error = true;
490
- error_type = 'required';
491
-
492
- // make it warn collor
493
- WP_User_Frontend.markError( item, error_type );
494
- }
495
- break;
496
-
497
- case 'tax-checkbox':
498
- var length = $(item).children().find('input:checked').length;
499
-
500
- if ( !length ) {
501
- error = true;
502
- error_type = 'required';
503
-
504
- // make it warn collor
505
- WP_User_Frontend.markError( item, error_type );
506
- }
507
- break;
508
-
509
- case 'radio':
510
- var length = $(item).find('input:checked').length;
511
-
512
- if ( !length ) {
513
- error = true;
514
- error_type = 'required';
515
-
516
- // make it warn collor
517
- WP_User_Frontend.markError( item, error_type );
518
- }
519
- break;
520
-
521
- case 'file':
522
- var length = $(item).find('ul').children().length;
523
-
524
- if ( !length ) {
525
- error = true;
526
- error_type = 'required';
527
-
528
- // make it warn collor
529
- WP_User_Frontend.markError( item, error_type );
530
- }
531
- break;
532
-
533
- case 'email':
534
- var val = $(item).val();
535
-
536
- if ( val !== '' ) {
537
- //run the validation
538
- if( !WP_User_Frontend.isValidEmail( val ) ) {
539
- error = true;
540
- error_type = 'validation';
541
-
542
- WP_User_Frontend.markError( item, error_type );
543
- }
544
- } else if( val === '' ) {
545
- error = true;
546
- error_type = 'required';
547
-
548
- WP_User_Frontend.markError( item, error_type );
549
- }
550
- break;
551
-
552
-
553
- case 'url':
554
- var val = $(item).val();
555
-
556
- if ( val !== '' ) {
557
- //run the validation
558
- if( !WP_User_Frontend.isValidURL( val ) ) {
559
- error = true;
560
- error_type = 'validation';
561
-
562
- WP_User_Frontend.markError( item, error_type );
563
- }
564
- }
565
- break;
566
-
567
- };
568
-
569
- });
570
-
571
- // if already some error found, bail out
572
- if (error) {
573
- // add error notice
574
- WP_User_Frontend.addErrorNotice(self,'end');
575
-
576
- return false;
577
- }
578
-
579
- var form_data = self.serialize(),
580
- rich_texts = [];
581
-
582
- // grab rich texts from tinyMCE
583
- $('.wpuf-rich-validation', self).each(function (index, item) {
584
- var item = $(item);
585
- var editor_id = item.data('id');
586
- var item_name = item.data('name');
587
- var val = $.trim( tinyMCE.get(editor_id).getContent() );
588
-
589
- rich_texts.push(item_name + '=' + encodeURIComponent( val ) );
590
- });
591
-
592
- // append them to the form var
593
- form_data = form_data + '&' + rich_texts.join('&');
594
- return form_data;
595
- },
596
-
597
- /**
598
- *
599
- * @param form
600
- * @param position (value = bottom or end) end if form is onepare, bottom, if form is multistep
601
- */
602
- addErrorNotice: function( form, position ) {
603
- if( position == 'bottom' ) {
604
- $('.wpuf-multistep-fieldset:visible').append('<div class="wpuf-errors">' + wpuf_frontend.error_message + '</div>');
605
- } else {
606
- $(form).find('li.wpuf-submit').append('<div class="wpuf-errors">' + wpuf_frontend.error_message + '</div>');
607
- }
608
-
609
- },
610
-
611
- removeErrorNotice: function(form) {
612
- $(form).find('.wpuf-errors').remove();
613
- },
614
-
615
- markError: function(item, error_type) {
616
-
617
- var error_string = '';
618
- $(item).closest('li').addClass('has-error');
619
-
620
- if ( error_type ) {
621
- error_string = $(item).closest('li').data('label');
622
- switch ( error_type ) {
623
- case 'required' :
624
- error_string = error_string + ' ' + error_str_obj[error_type];
625
- break;
626
- case 'mismatch' :
627
- error_string = error_string + ' ' +error_str_obj[error_type];
628
- break;
629
- case 'validation' :
630
- error_string = error_string + ' ' + error_str_obj[error_type];
631
- break
632
- }
633
- $(item).siblings('.wpuf-error-msg').remove();
634
- $(item).after('<div class="wpuf-error-msg">'+ error_string +'</div>')
635
- }
636
-
637
- $(item).focus();
638
- },
639
-
640
- removeErrors: function(item) {
641
- $(item).find('.has-error').removeClass('has-error');
642
- $('.wpuf-error-msg').remove();
643
- },
644
-
645
- isValidEmail: function( email ) {
646
- var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
647
- return pattern.test(email);
648
- },
649
-
650
- isValidURL: function(url) {
651
- var urlregex = new RegExp("^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.|http:\/\/|https:\/\/){1}([0-9A-Za-z]+\.)");
652
- return urlregex.test(url);
653
- },
654
-
655
- insertImage: function(button, form_id) {
656
-
657
- var container = 'wpuf-insert-image-container';
658
-
659
- if ( ! $( '#' + button ).length ) {
660
- return;
661
- };
662
-
663
- var imageUploader = new plupload.Uploader({
664
- runtimes: 'html5,html4',
665
- browse_button: button,
666
- container: container,
667
- multipart: true,
668
- multipart_params: {
669
- action: 'wpuf_insert_image',
670
- form_id: $( '#' + button ).data('form_id')
671
- },
672
- multiple_queues: false,
673
- multi_selection: false,
674
- urlstream_upload: true,
675
- file_data_name: 'wpuf_file',
676
- max_file_size: '2mb',
677
- url: wpuf_frontend_upload.plupload.url,
678
- flash_swf_url: wpuf_frontend_upload.flash_swf_url,
679
- filters: [{
680
- title: 'Allowed Files',
681
- extensions: 'jpg,jpeg,gif,png,bmp'
682
- }]
683
- });
684
-
685
- imageUploader.bind('Init', function(up, params) {
686
- // console.log("Current runtime environment: " + params.runtime);
687
- });
688
-
689
- imageUploader.bind('FilesAdded', function(up, files) {
690
- var $container = $('#' + container);
691
-
692
- $.each(files, function(i, file) {
693
- $container.append(
694
- '<div class="upload-item" id="' + file.id + '"><div class="progress progress-striped active"><div class="bar"></div></div></div>');
695
- });
696
-
697
- up.refresh();
698
- up.start();
699
- });
700
-
701
- imageUploader.bind('QueueChanged', function (uploader) {
702
- imageUploader.start();
703
- });
704
-
705
- imageUploader.bind('UploadProgress', function(up, file) {
706
- var item = $('#' + file.id);
707
-
708
- $('.bar', item).css({ width: file.percent + '%' });
709
- $('.percent', item).html( file.percent + '%' );
710
- });
711
-
712
- imageUploader.bind('Error', function(up, error) {
713
- alert('Error #' + error.code + ': ' + error.message);
714
- });
715
-
716
- imageUploader.bind('FileUploaded', function(up, file, response) {
717
-
718
- $('#' + file.id).remove();
719
-
720
- if ( response.response !== 'error' ) {
721
- var success = false;
722
-
723
- if ( typeof tinyMCE !== 'undefined' ) {
724
-
725
- if ( typeof tinyMCE.execInstanceCommand !== 'function' ) {
726
- // tinyMCE 4.x
727
- var mce = tinyMCE.get( 'post_content_' + form_id );
728
-
729
- if ( mce !== null ) {
730
- mce.insertContent(response.response);
731
- }
732
- } else {
733
- // tinyMCE 3.x
734
- tinyMCE.execInstanceCommand( 'post_content_' + form_id, 'mceInsertContent', false, response.response);
735
- }
736
- }
737
-
738
- // insert failed to the edit, perhaps insert into textarea
739
- var post_content = $('#post_content_' + form_id);
740
- post_content.val( post_content.val() + response.response );
741
-
742
- } else {
743
- alert('Something went wrong');
744
- }
745
- });
746
-
747
- imageUploader.init();
748
- },
749
-
750
- deleteAvatar: function(e) {
751
- e.preventDefault();
752
-
753
- if ( confirm( $(this).data('confirm') ) ) {
754
- $.post(wpuf_frontend.ajaxurl, {action: 'wpuf_delete_avatar', _wpnonce: wpuf_frontend.nonce}, function() {
755
- $(e.target).parent().remove();
756
- });
757
- }
758
- },
759
-
760
- editorLimit: {
761
-
762
- bind: function(limit, field, type) {
763
- if ( type === 'no' ) {
764
- // it's a textarea
765
-
766
- $('textarea#' + field).keydown( function(event) {
767
- WP_User_Frontend.editorLimit.textareaLimit.call(this, event, limit);
768
- });
769
-
770
- $('textarea#' + field).on('paste', function(event) {
771
- var self = $(this);
772
-
773
- setTimeout(function() {
774
- WP_User_Frontend.editorLimit.textareaLimit.call(self, event, limit);
775
- }, 100);
776
- });
777
-
778
- } else {
779
- // it's a rich textarea
780
- setTimeout(function () {
781
- tinyMCE.get(field).onKeyDown.add( function(ed, event) {
782
- WP_User_Frontend.editorLimit.tinymce.onKeyDown(ed, event, limit);
783
- } );
784
-
785
- tinyMCE.get(field).onPaste.add(function(ed, event) {
786
- setTimeout(function() {
787
- WP_User_Frontend.editorLimit.tinymce.onPaste(ed, event, limit);
788
- }, 100);
789
- });
790
-
791
- }, 1000);
792
- }
793
- },
794
-
795
- tinymce: {
796
-
797
- getStats: function(ed) {
798
- var body = ed.getBody(), text = tinymce.trim(body.innerText || body.textContent);
799
-
800
- return {
801
- chars: text.length,
802
- words: text.split(/[\w\u2019\'-]+/).length
803
- };
804
- },
805
-
806
- onKeyDown: function(ed, event, limit) {
807
- var numWords = WP_User_Frontend.editorLimit.tinymce.getStats(ed).words - 1;
808
-
809
- limit ? $('.mce-path-item.mce-last', ed.container).html('Word Limit : '+ numWords +'/'+limit):'';
810
-
811
- if ( limit && numWords > limit ) {
812
- WP_User_Frontend.editorLimit.blockTyping(event);
813
- jQuery('.mce-path-item.mce-last', ed.container).html( wpuf_frontend.word_limit );
814
- }
815
- },
816
-
817
- onPaste: function(ed, event, limit) {
818
- var editorContent = ed.getContent().split(' ').slice(0, limit).join(' ');
819
-
820
- // Let TinyMCE do the heavy lifting for inserting that content into the editor.
821
- // ed.insertContent(content); //ed.execCommand('mceInsertContent', false, content);
822
- ed.setContent(editorContent);
823
-
824
- WP_User_Frontend.editorLimit.make_media_embed_code(editorContent, ed);
825
- }
826
- },
827
-
828
- textareaLimit: function(event, limit) {
829
- var self = $(this),
830
- content = self.val().split(' ');
831
-
832
- if ( limit && content.length > limit ) {
833
- self.closest('.wpuf-fields').find('span.wpuf-wordlimit-message').html( wpuf_frontend.word_limit );
834
- WP_User_Frontend.editorLimit.blockTyping(event);
835
- } else {
836
- self.closest('.wpuf-fields').find('span.wpuf-wordlimit-message').html('');
837
- }
838
-
839
- // handle the paste event
840
- if ( event.type === 'paste' ) {
841
- self.val( content.slice(0, limit).join( ' ' ) );
842
- }
843
- },
844
-
845
- blockTyping: function(event) {
846
- // Allow: backspace, delete, tab, escape, minus enter and . backspace = 8,delete=46,tab=9,enter=13,.=190,escape=27, minus = 189
847
- if ($.inArray(event.keyCode, [46, 8, 9, 27, 13, 110, 190, 189]) !== -1 ||
848
- // Allow: Ctrl+A
849
- (event.keyCode == 65 && event.ctrlKey === true) ||
850
- // Allow: home, end, left, right, down, up
851
- (event.keyCode >= 35 && event.keyCode <= 40)) {
852
- // let it happen, don't do anything
853
- return;
854
- }
855
-
856
- event.preventDefault();
857
- event.stopPropagation();
858
- },
859
-
860
- make_media_embed_code: function(content, editor){
861
- $.post( ajaxurl, {
862
- action:'make_media_embed_code',
863
- content: content
864
- },
865
- function(data){
866
- // console.log(data);
867
- editor.setContent(editor.getContent() + editor.setContent(data));
868
- }
869
- )
870
- }
871
- }
872
- };
873
-
874
- $(function() {
875
- WP_User_Frontend.init();
876
-
877
- // payment gateway selection
878
- $('ul.wpuf-payment-gateways').on('click', 'input[type=radio]', function(e) {
879
- $('.wpuf-payment-instruction').slideUp(250);
880
-
881
- $(this).parents('li').find('.wpuf-payment-instruction').slideDown(250);
882
- });
883
-
884
- if( !$('ul.wpuf-payment-gateways li').find('input[type=radio]').is(':checked') ) {
885
- $('ul.wpuf-payment-gateways li').first().find('input[type=radio]').click()
886
- } else {
887
- var el = $('ul.wpuf-payment-gateways li').find('input[type=radio]:checked');
888
- el.parents('li').find('.wpuf-payment-instruction').slideDown(250);
889
- }
890
- });
891
-
892
- })(jQuery, window);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/frontend-form.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a,b){a.fn.listautowidth=function(){return this.each(function(){var b=a(this).width(),c=b/a(this).children("li").length;a(this).children("li").each(function(){var b=a(this).outerWidth(!0)-a(this).width();a(this).width(c-b)})})},b.WP_User_Frontend={pass_val:"",retype_pass_val:"",init:function(){this.enableMultistep(this),a(".wpuf-form").on("click","img.wpuf-clone-field",this.cloneField),a(".wpuf-form").on("click","img.wpuf-remove-field",this.removeField),a(".wpuf-form").on("click","a.wpuf-delete-avatar",this.deleteAvatar),a(".wpuf-form").on("click","a#wpuf-post-draft",this.draftPost),a(".wpuf-form").on("click","button#wpuf-account-update-profile",this.account_update_profile),a(".wpuf-form-add").on("submit",this.formSubmit),a("form#post").on("submit",this.adminPostSubmit),a(".wpuf-form").on("keyup","#pass1",this.check_pass_strength),this.ajaxCategory(),a(':submit[name="wpuf_cancel_subscription"]').click(function(){if(!confirm("Are you sure you want to cancel your current subscription ?"))return!1})},check_pass_strength:function(){var b=a("#pass1").val();if(a("#pass-strength-result").show(),a("#pass-strength-result").removeClass("short bad good strong"),!b)return a("#pass-strength-result").html("&nbsp;"),void a("#pass-strength-result").hide();if(void 0!==wp.passwordStrength)switch(wp.passwordStrength.meter(b,wp.passwordStrength.userInputBlacklist(),b)){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n.short)}},enableMultistep:function(b){var c=this,d=0,e=a(':hidden[name="wpuf_multistep_type"]').val();if(null!=e){if(a("fieldset.wpuf-multistep-fieldset").find(".wpuf-multistep-prev-btn").first().remove(),a("fieldset.wpuf-multistep-fieldset").find(".wpuf-multistep-next-btn").last().remove(),a(".wpuf-form fieldset").removeClass("field-active").first().addClass("field-active"),"progressive"==e&&0!=a(".wpuf-form .wpuf-multistep-fieldset").length){a("fieldset.wpuf-multistep-fieldset legend").first();a(".wpuf-multistep-progressbar").html('<div class="wpuf-progress-percentage"></div>');var f=a(".wpuf-multistep-progressbar"),g=a(".wpuf-progress-percentage");a(".wpuf-multistep-progressbar").progressbar({change:function(){g.text(f.progressbar("value")+"%")}}),a(".wpuf-multistep-fieldset legend").hide()}else a(".wpuf-form").each(function(){var b=a(this),c=a(".wpuf-multistep-progressbar",b),d="";c.addClass("wizard-steps"),d+='<ul class="wpuf-step-wizard">',a(".wpuf-multistep-fieldset",this).each(function(){d+="<li>"+a.trim(a("legend",this).text())+"</li>",a("legend",this).hide()}),d+="</ul>",c.append(d),a(".wpuf-step-wizard li",c).first().addClass("active-step"),a(".wpuf-step-wizard",c).listautowidth()});this.change_fieldset(d,e),a("fieldset .wpuf-multistep-prev-btn, fieldset .wpuf-multistep-next-btn").click(function(f){if(a(this).hasClass("wpuf-multistep-next-btn")){0!=c.formStepCheck("",a(this).closest("fieldset"))&&b.change_fieldset(++d,e)}else a(this).hasClass("wpuf-multistep-prev-btn")&&b.change_fieldset(--d,e);return!1})}},change_fieldset:function(b,c){a("fieldset.wpuf-multistep-fieldset").removeClass("field-active").eq(b).addClass("field-active"),a(".wpuf-step-wizard li").each(function(){a(this).index()<=b?"step_by_step"==c?a(this).addClass("passed-wpuf-ms-bar"):a(".wpuf-ps-bar",this).addClass("passed-wpuf-ms-bar"):"step_by_step"==c?a(this).removeClass("passed-wpuf-ms-bar"):a(".wpuf-ps-bar",this).removeClass("passed-wpuf-ms-bar")}),a(".wpuf-step-wizard li").removeClass("wpuf-ms-bar-active active-step completed-step"),a(".passed-wpuf-ms-bar").addClass("completed-step").last().addClass("wpuf-ms-bar-active"),a(".wpuf-ms-bar-active").addClass("active-step");var d=a("fieldset.wpuf-multistep-fieldset").eq(b).find("legend").text();if(d=a.trim(d),"progressive"==c&&0!=a(".wpuf-form .wpuf-multistep-fieldset").length){var e=100*(b+1)/a("fieldset.wpuf-multistep-fieldset").length,e=Number(e.toFixed(2));a(".wpuf-multistep-progressbar").progressbar({value:e}),a(".wpuf-progress-percentage").text(d+" ("+e+"%)")}a(".wpuf-form").trigger("step-change-fieldset")},ajaxCategory:function(){var b=".category-wrap";a(b).on("change",".cat-ajax",function(){currentLevel=parseInt(a(this).parent().attr("level")),WP_User_Frontend.getChildCats(a(this),"lvl",currentLevel+1,b,"category")})},getChildCats:function(b,c,d,e,f){cat=a(b).val(),results_div=c+d,f=void 0!==f?f:"category",field_attr=a(b).siblings("span").data("taxonomy"),a.ajax({type:"post",url:wpuf_frontend.ajaxurl,data:{action:"wpuf_get_child_cat",catID:cat,nonce:wpuf_frontend.nonce,field_attr:field_attr},beforeSend:function(){a(b).parent().parent().next(".loading").addClass("wpuf-loading")},complete:function(){a(b).parent().parent().next(".loading").removeClass("wpuf-loading")},success:function(e){a(b).parent().nextAll().each(function(){a(this).remove()}),""!=e&&(a(b).parent().addClass("hasChild").parent().append('<div id="'+c+d+'" level="'+d+'"></div>'),b.parent().parent().find("#"+results_div).html(e).slideDown("fast"))}})},cloneField:function(b){b.preventDefault();var c=a(this).closest("tr"),d=c.clone();d.find("input").val(""),d.find(":checked").attr("checked",""),c.after(d)},removeField:function(){var b=a(this).closest("tr");b.siblings().andSelf().length>1&&b.remove()},adminPostSubmit:function(b){b.preventDefault();var c=a(this);if(WP_User_Frontend.validateForm(c))return!0},draftPost:function(b){b.preventDefault();var c,d,e=a(this),f=a(this).closest("form"),g=f.serialize()+"&action=wpuf_draft_post",h=f.find('input[type="hidden"][name="post_id"]').val(),i=[];a(".wpuf-rich-validation").each(function(b,e){c=a(e).data("id"),d=a.trim(tinyMCE.get(c).getContent()),i.push(c+"="+encodeURIComponent(d))}),g=g+"&"+i.join("&"),e.after(' <span class="wpuf-loading"></span>'),a.post(wpuf_frontend.ajaxurl,g,function(b){if(void 0===h){var c='<input type="hidden" name="post_id" value="'+b.post_id+'">';c+='<input type="hidden" name="post_date" value="'+b.date+'">',c+='<input type="hidden" name="post_author" value="'+b.post_author+'">',c+='<input type="hidden" name="comment_status" value="'+b.comment_status+'">',f.append(c)}e.next("span.wpuf-loading").remove(),e.after('<span class="wpuf-draft-saved">&nbsp; Post Saved</span>'),a(".wpuf-draft-saved").delay(2500).fadeOut("fast",function(){a(this).remove()})})},account_update_profile:function(b){b.preventDefault();var c=a(this).closest("form");a.post(wpuf_frontend.ajaxurl,c.serialize(),function(a){a.success?(c.find(".wpuf-error").hide(),c.find(".wpuf-success").show()):(c.find(".wpuf-success").hide(),c.find(".wpuf-error").show(),c.find(".wpuf-error").text(a.data))})},formStepCheck:function(a,b){var c=b;c.find("input[type=submit]");return form_data=WP_User_Frontend.validateForm(c),0==form_data&&WP_User_Frontend.addErrorNotice(self,"bottom"),form_data},formSubmit:function(c){c.preventDefault();var d=a(this),e=d.find("input[type=submit]");form_data=WP_User_Frontend.validateForm(d),form_data&&(d.find("li.wpuf-submit").append('<span class="wpuf-loading"></span>'),e.attr("disabled","disabled").addClass("button-primary-disabled"),a.post(wpuf_frontend.ajaxurl,form_data,function(c){if(c.success)a("body").trigger("wpuf:postform:success",c),1==c.show_message?(d.before('<div class="wpuf-success">'+c.message+"</div>"),d.slideUp("fast",function(){d.remove()}),a("html, body").animate({scrollTop:a(".wpuf-success").offset().top-100},"fast")):b.location=c.redirect_to;else{if(void 0!==c.type&&"login"===c.type)return void(confirm(c.error)?b.location=c.redirect_to:(e.removeAttr("disabled"),e.removeClass("button-primary-disabled"),d.find("span.wpuf-loading").remove()));d.find(".g-recaptcha").length>0&&grecaptcha.reset(),alert(c.error),e.removeAttr("disabled")}e.removeClass("button-primary-disabled"),d.find("span.wpuf-loading").remove()}))},validateForm:function(b){var c=!1;if(error_type="",WP_User_Frontend.removeErrors(b),WP_User_Frontend.removeErrorNotice(b),b.find('[data-required="yes"]:visible').each(function(b,d){var e=a(d).data("type");switch(h="",e){case"rich":var f=a(d).data("id");""===(h=a.trim(tinyMCE.get(f).getContent()))&&(c=!0,WP_User_Frontend.markError(d));break;case"textarea":case"text":if(a(d).hasClass("password")&&(""==WP_User_Frontend.pass_val?WP_User_Frontend.pass_val=a(d).val():WP_User_Frontend.retype_pass_val=a(d).val(),""!=WP_User_Frontend.pass_val&&""!=WP_User_Frontend.retype_pass_val&&WP_User_Frontend.pass_val!=WP_User_Frontend.retype_pass_val)){c=!0,error_type="mismatch",WP_User_Frontend.markError(d,error_type);break}""===(h=a.trim(a(d).val()))&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"select":(h=a(d).val())&&"-1"!==h||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"multiselect":null!==(h=a(d).val())&&0!==h.length||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"tax-checkbox":var g=a(d).children().find("input:checked").length;g||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"radio":var g=a(d).find("input:checked").length;g||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"file":var g=a(d).find("ul").children().length;g||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"email":var h=a(d).val();""!==h?WP_User_Frontend.isValidEmail(h)||(c=!0,error_type="validation",WP_User_Frontend.markError(d,error_type)):""===h&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"url":var h=a(d).val();""!==h&&(WP_User_Frontend.isValidURL(h)||(c=!0,error_type="validation",WP_User_Frontend.markError(d,error_type)))}}),c)return WP_User_Frontend.addErrorNotice(b,"end"),!1;var d=b.serialize(),e=[];return a(".wpuf-rich-validation",b).each(function(b,c){var c=a(c),d=c.data("id"),f=c.data("name"),g=a.trim(tinyMCE.get(d).getContent());e.push(f+"="+encodeURIComponent(g))}),d=d+"&"+e.join("&")},addErrorNotice:function(b,c){"bottom"==c?a(".wpuf-multistep-fieldset:visible").append('<div class="wpuf-errors">'+wpuf_frontend.error_message+"</div>"):a(b).find("li.wpuf-submit").append('<div class="wpuf-errors">'+wpuf_frontend.error_message+"</div>")},removeErrorNotice:function(b){a(b).find(".wpuf-errors").remove()},markError:function(b,c){var d="";if(a(b).closest("li").addClass("has-error"),c){switch(d=a(b).closest("li").data("label"),c){case"required":d=d+" "+error_str_obj[c];break;case"mismatch":d=d+" "+error_str_obj[c];break;case"validation":d=d+" "+error_str_obj[c]}a(b).siblings(".wpuf-error-msg").remove(),a(b).after('<div class="wpuf-error-msg">'+d+"</div>")}a(b).focus()},removeErrors:function(b){a(b).find(".has-error").removeClass("has-error"),a(".wpuf-error-msg").remove()},isValidEmail:function(a){return new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i).test(a)},isValidURL:function(a){return new RegExp("^(http://www.|https://www.|ftp://www.|www.|http://|https://){1}([0-9A-Za-z]+.)").test(a)},insertImage:function(b,c){if(a("#"+b).length){var d=new plupload.Uploader({runtimes:"html5,html4",browse_button:b,container:"wpuf-insert-image-container",multipart:!0,multipart_params:{action:"wpuf_insert_image",form_id:a("#"+b).data("form_id")},multiple_queues:!1,multi_selection:!1,urlstream_upload:!0,file_data_name:"wpuf_file",max_file_size:"2mb",url:wpuf_frontend_upload.plupload.url,flash_swf_url:wpuf_frontend_upload.flash_swf_url,filters:[{title:"Allowed Files",extensions:"jpg,jpeg,gif,png,bmp"}]});d.bind("Init",function(a,b){}),d.bind("FilesAdded",function(b,c){var d=a("#wpuf-insert-image-container");a.each(c,function(a,b){d.append('<div class="upload-item" id="'+b.id+'"><div class="progress progress-striped active"><div class="bar"></div></div></div>')}),b.refresh(),b.start()}),d.bind("QueueChanged",function(a){d.start()}),d.bind("UploadProgress",function(b,c){var d=a("#"+c.id);a(".bar",d).css({width:c.percent+"%"}),a(".percent",d).html(c.percent+"%")}),d.bind("Error",function(a,b){alert("Error #"+b.code+": "+b.message)}),d.bind("FileUploaded",function(b,d,e){if(a("#"+d.id).remove(),"error"!==e.response){if("undefined"!=typeof tinyMCE)if("function"!=typeof tinyMCE.execInstanceCommand){var f=tinyMCE.get("post_content_"+c);null!==f&&f.insertContent(e.response)}else tinyMCE.execInstanceCommand("post_content_"+c,"mceInsertContent",!1,e.response);var g=a("#post_content_"+c);g.val(g.val()+e.response)}else alert("Something went wrong")}),d.init()}},deleteAvatar:function(b){b.preventDefault(),confirm(a(this).data("confirm"))&&a.post(wpuf_frontend.ajaxurl,{action:"wpuf_delete_avatar",_wpnonce:wpuf_frontend.nonce},function(){a(b.target).parent().remove()})},editorLimit:{bind:function(b,c,d){"no"===d?(a("textarea#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textareaLimit.call(this,a,b)}),a("textarea#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textareaLimit.call(d,c,b)},100)})):setTimeout(function(){tinyMCE.get(c).onKeyDown.add(function(a,c){WP_User_Frontend.editorLimit.tinymce.onKeyDown(a,c,b)}),tinyMCE.get(c).onPaste.add(function(a,c){setTimeout(function(){WP_User_Frontend.editorLimit.tinymce.onPaste(a,c,b)},100)})},1e3)},tinymce:{getStats:function(a){var b=a.getBody(),c=tinymce.trim(b.innerText||b.textContent);return{chars:c.length,words:c.split(/[\w\u2019\'-]+/).length}},onKeyDown:function(b,c,d){var e=WP_User_Frontend.editorLimit.tinymce.getStats(b).words-1;d&&a(".mce-path-item.mce-last",b.container).html("Word Limit : "+e+"/"+d),d&&e>d&&(WP_User_Frontend.editorLimit.blockTyping(c),jQuery(".mce-path-item.mce-last",b.container).html(wpuf_frontend.word_limit))},onPaste:function(a,b,c){var d=a.getContent().split(" ").slice(0,c).join(" ");a.setContent(d),WP_User_Frontend.editorLimit.make_media_embed_code(d,a)}},textareaLimit:function(b,c){var d=a(this),e=d.val().split(" ");c&&e.length>c?(d.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(wpuf_frontend.word_limit),WP_User_Frontend.editorLimit.blockTyping(b)):d.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(""),"paste"===b.type&&d.val(e.slice(0,c).join(" "))},blockTyping:function(b){a.inArray(b.keyCode,[46,8,9,27,13,110,190,189])!==-1||65==b.keyCode&&b.ctrlKey===!0||b.keyCode>=35&&b.keyCode<=40||(b.preventDefault(),b.stopPropagation())},make_media_embed_code:function(b,c){a.post(ajaxurl,{action:"make_media_embed_code",content:b},function(a){c.setContent(c.getContent()+c.setContent(a))})}}},a(function(){if(WP_User_Frontend.init(),a("ul.wpuf-payment-gateways").on("click","input[type=radio]",function(b){a(".wpuf-payment-instruction").slideUp(250),a(this).parents("li").find(".wpuf-payment-instruction").slideDown(250)}),a("ul.wpuf-payment-gateways li").find("input[type=radio]").is(":checked")){a("ul.wpuf-payment-gateways li").find("input[type=radio]:checked").parents("li").find(".wpuf-payment-instruction").slideDown(250)}else a("ul.wpuf-payment-gateways li").first().find("input[type=radio]").click()})}(jQuery,window);
 
assets/js/jquery-ui-timepicker-addon.js DELETED
@@ -1,1919 +0,0 @@
1
- /*
2
- * jQuery timepicker addon
3
- * By: Trent Richardson [http://trentrichardson.com]
4
- * Version 1.2
5
- * Last Modified: 02/02/2013
6
- *
7
- * Copyright 2013 Trent Richardson
8
- * You may use this project under MIT or GPL licenses.
9
- * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
10
- * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
11
- */
12
-
13
- /*jslint evil: true, white: false, undef: false, nomen: false */
14
-
15
- (function($) {
16
-
17
- /*
18
- * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
19
- */
20
- $.ui.timepicker = $.ui.timepicker || {};
21
- if ($.ui.timepicker.version) {
22
- return;
23
- }
24
-
25
- /*
26
- * Extend jQueryUI, get it started with our version number
27
- */
28
- $.extend($.ui, {
29
- timepicker: {
30
- version: "1.2"
31
- }
32
- });
33
-
34
- /*
35
- * Timepicker manager.
36
- * Use the singleton instance of this class, $.timepicker, to interact with the time picker.
37
- * Settings for (groups of) time pickers are maintained in an instance object,
38
- * allowing multiple different settings on the same page.
39
- */
40
- var Timepicker = function() {
41
- this.regional = []; // Available regional settings, indexed by language code
42
- this.regional[''] = { // Default regional settings
43
- currentText: 'Now',
44
- closeText: 'Done',
45
- amNames: ['AM', 'A'],
46
- pmNames: ['PM', 'P'],
47
- timeFormat: 'HH:mm',
48
- timeSuffix: '',
49
- timeOnlyTitle: 'Choose Time',
50
- timeText: 'Time',
51
- hourText: 'Hour',
52
- minuteText: 'Minute',
53
- secondText: 'Second',
54
- millisecText: 'Millisecond',
55
- timezoneText: 'Time Zone',
56
- isRTL: false
57
- };
58
- this._defaults = { // Global defaults for all the datetime picker instances
59
- showButtonPanel: true,
60
- timeOnly: false,
61
- showHour: true,
62
- showMinute: true,
63
- showSecond: false,
64
- showMillisec: false,
65
- showTimezone: false,
66
- showTime: true,
67
- stepHour: 1,
68
- stepMinute: 1,
69
- stepSecond: 1,
70
- stepMillisec: 1,
71
- hour: 0,
72
- minute: 0,
73
- second: 0,
74
- millisec: 0,
75
- timezone: null,
76
- useLocalTimezone: false,
77
- defaultTimezone: "+0000",
78
- hourMin: 0,
79
- minuteMin: 0,
80
- secondMin: 0,
81
- millisecMin: 0,
82
- hourMax: 23,
83
- minuteMax: 59,
84
- secondMax: 59,
85
- millisecMax: 999,
86
- minDateTime: null,
87
- maxDateTime: null,
88
- onSelect: null,
89
- hourGrid: 0,
90
- minuteGrid: 0,
91
- secondGrid: 0,
92
- millisecGrid: 0,
93
- alwaysSetTime: true,
94
- separator: ' ',
95
- altFieldTimeOnly: true,
96
- altTimeFormat: null,
97
- altSeparator: null,
98
- altTimeSuffix: null,
99
- pickerTimeFormat: null,
100
- pickerTimeSuffix: null,
101
- showTimepicker: true,
102
- timezoneIso8601: false,
103
- timezoneList: null,
104
- addSliderAccess: false,
105
- sliderAccessArgs: null,
106
- controlType: 'slider',
107
- defaultValue: null,
108
- parse: 'strict'
109
- };
110
- $.extend(this._defaults, this.regional['']);
111
- };
112
-
113
- $.extend(Timepicker.prototype, {
114
- $input: null,
115
- $altInput: null,
116
- $timeObj: null,
117
- inst: null,
118
- hour_slider: null,
119
- minute_slider: null,
120
- second_slider: null,
121
- millisec_slider: null,
122
- timezone_select: null,
123
- hour: 0,
124
- minute: 0,
125
- second: 0,
126
- millisec: 0,
127
- timezone: null,
128
- defaultTimezone: "+0000",
129
- hourMinOriginal: null,
130
- minuteMinOriginal: null,
131
- secondMinOriginal: null,
132
- millisecMinOriginal: null,
133
- hourMaxOriginal: null,
134
- minuteMaxOriginal: null,
135
- secondMaxOriginal: null,
136
- millisecMaxOriginal: null,
137
- ampm: '',
138
- formattedDate: '',
139
- formattedTime: '',
140
- formattedDateTime: '',
141
- timezoneList: null,
142
- units: ['hour','minute','second','millisec'],
143
- control: null,
144
-
145
- /*
146
- * Override the default settings for all instances of the time picker.
147
- * @param settings object - the new settings to use as defaults (anonymous object)
148
- * @return the manager object
149
- */
150
- setDefaults: function(settings) {
151
- extendRemove(this._defaults, settings || {});
152
- return this;
153
- },
154
-
155
- /*
156
- * Create a new Timepicker instance
157
- */
158
- _newInst: function($input, o) {
159
- var tp_inst = new Timepicker(),
160
- inlineSettings = {},
161
- fns = {},
162
- overrides, i;
163
-
164
- for (var attrName in this._defaults) {
165
- if(this._defaults.hasOwnProperty(attrName)){
166
- var attrValue = $input.attr('time:' + attrName);
167
- if (attrValue) {
168
- try {
169
- inlineSettings[attrName] = eval(attrValue);
170
- } catch (err) {
171
- inlineSettings[attrName] = attrValue;
172
- }
173
- }
174
- }
175
- }
176
- overrides = {
177
- beforeShow: function (input, dp_inst) {
178
- if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
179
- return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
180
- }
181
- },
182
- onChangeMonthYear: function (year, month, dp_inst) {
183
- // Update the time as well : this prevents the time from disappearing from the $input field.
184
- tp_inst._updateDateTime(dp_inst);
185
- if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
186
- tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
187
- }
188
- },
189
- onClose: function (dateText, dp_inst) {
190
- if (tp_inst.timeDefined === true && $input.val() !== '') {
191
- tp_inst._updateDateTime(dp_inst);
192
- }
193
- if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
194
- tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
195
- }
196
- }
197
- };
198
- for (i in overrides) {
199
- if (overrides.hasOwnProperty(i)) {
200
- fns[i] = o[i] || null;
201
- }
202
- }
203
- tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, overrides, {
204
- evnts:fns,
205
- timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
206
- });
207
- tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) {
208
- return val.toUpperCase();
209
- });
210
- tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) {
211
- return val.toUpperCase();
212
- });
213
-
214
- // controlType is string - key to our this._controls
215
- if(typeof(tp_inst._defaults.controlType) === 'string'){
216
- if($.fn[tp_inst._defaults.controlType] === undefined){
217
- tp_inst._defaults.controlType = 'select';
218
- }
219
- tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
220
- }
221
- // controlType is an object and must implement create, options, value methods
222
- else{
223
- tp_inst.control = tp_inst._defaults.controlType;
224
- }
225
-
226
- if (tp_inst._defaults.timezoneList === null) {
227
- var timezoneList = ['-1200', '-1100', '-1000', '-0930', '-0900', '-0800', '-0700', '-0600', '-0500', '-0430', '-0400', '-0330', '-0300', '-0200', '-0100', '+0000',
228
- '+0100', '+0200', '+0300', '+0330', '+0400', '+0430', '+0500', '+0530', '+0545', '+0600', '+0630', '+0700', '+0800', '+0845', '+0900', '+0930',
229
- '+1000', '+1030', '+1100', '+1130', '+1200', '+1245', '+1300', '+1400'];
230
-
231
- if (tp_inst._defaults.timezoneIso8601) {
232
- timezoneList = $.map(timezoneList, function(val) {
233
- return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3));
234
- });
235
- }
236
- tp_inst._defaults.timezoneList = timezoneList;
237
- }
238
-
239
- tp_inst.timezone = tp_inst._defaults.timezone;
240
- tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin? tp_inst._defaults.hourMin :
241
- tp_inst._defaults.hour > tp_inst._defaults.hourMax? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
242
- tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin? tp_inst._defaults.minuteMin :
243
- tp_inst._defaults.minute > tp_inst._defaults.minuteMax? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
244
- tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin? tp_inst._defaults.secondMin :
245
- tp_inst._defaults.second > tp_inst._defaults.secondMax? tp_inst._defaults.secondMax : tp_inst._defaults.second;
246
- tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin? tp_inst._defaults.millisecMin :
247
- tp_inst._defaults.millisec > tp_inst._defaults.millisecMax? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
248
- tp_inst.ampm = '';
249
- tp_inst.$input = $input;
250
-
251
- if (o.altField) {
252
- tp_inst.$altInput = $(o.altField).css({
253
- cursor: 'pointer'
254
- }).focus(function() {
255
- $input.trigger("focus");
256
- });
257
- }
258
-
259
- if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
260
- tp_inst._defaults.minDate = new Date();
261
- }
262
- if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
263
- tp_inst._defaults.maxDate = new Date();
264
- }
265
-
266
- // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
267
- if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
268
- tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
269
- }
270
- if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
271
- tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
272
- }
273
- if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
274
- tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
275
- }
276
- if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
277
- tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
278
- }
279
- tp_inst.$input.bind('focus', function() {
280
- tp_inst._onFocus();
281
- });
282
-
283
- return tp_inst;
284
- },
285
-
286
- /*
287
- * add our sliders to the calendar
288
- */
289
- _addTimePicker: function(dp_inst) {
290
- var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
291
-
292
- this.timeDefined = this._parseTime(currDT);
293
- this._limitMinMaxDateTime(dp_inst, false);
294
- this._injectTimePicker();
295
- },
296
-
297
- /*
298
- * parse the time string from input value or _setTime
299
- */
300
- _parseTime: function(timeString, withDate) {
301
- if (!this.inst) {
302
- this.inst = $.datepicker._getInst(this.$input[0]);
303
- }
304
-
305
- if (withDate || !this._defaults.timeOnly) {
306
- var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
307
- try {
308
- var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
309
- if (!parseRes.timeObj) {
310
- return false;
311
- }
312
- $.extend(this, parseRes.timeObj);
313
- } catch (err) {
314
- $.timepicker.log("Error parsing the date/time string: " + err +
315
- "\ndate/time string = " + timeString +
316
- "\ntimeFormat = " + this._defaults.timeFormat +
317
- "\ndateFormat = " + dp_dateFormat);
318
- return false;
319
- }
320
- return true;
321
- } else {
322
- var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
323
- if (!timeObj) {
324
- return false;
325
- }
326
- $.extend(this, timeObj);
327
- return true;
328
- }
329
- },
330
-
331
- /*
332
- * generate and inject html for timepicker into ui datepicker
333
- */
334
- _injectTimePicker: function() {
335
- var $dp = this.inst.dpDiv,
336
- o = this.inst.settings,
337
- tp_inst = this,
338
- litem = '',
339
- uitem = '',
340
- max = {},
341
- gridSize = {},
342
- size = null;
343
-
344
- // Prevent displaying twice
345
- if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
346
- var noDisplay = ' style="display:none;"',
347
- html = '<div class="ui-timepicker-div'+ (o.isRTL? ' ui-timepicker-rtl' : '') +'"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
348
- '<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';
349
-
350
- // Create the markup
351
- for(var i=0,l=this.units.length; i<l; i++){
352
- litem = this.units[i];
353
- uitem = litem.substr(0,1).toUpperCase() + litem.substr(1);
354
- // Added by Peter Medeiros:
355
- // - Figure out what the hour/minute/second max should be based on the step values.
356
- // - Example: if stepMinute is 15, then minMax is 45.
357
- max[litem] = parseInt((o[litem+'Max'] - ((o[litem+'Max'] - o[litem+'Min']) % o['step'+uitem])), 10);
358
- gridSize[litem] = 0;
359
-
360
- html += '<dt class="ui_tpicker_'+ litem +'_label"' + ((o['show'+uitem]) ? '' : noDisplay) + '>' + o[litem +'Text'] + '</dt>' +
361
- '<dd class="ui_tpicker_'+ litem +'"><div class="ui_tpicker_'+ litem +'_slider"' + ((o['show'+uitem]) ? '' : noDisplay) + '></div>';
362
-
363
- if (o['show'+uitem] && o[litem+'Grid'] > 0) {
364
- html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
365
-
366
- if(litem == 'hour'){
367
- for (var h = o[litem+'Min']; h <= max[litem]; h += parseInt(o[litem+'Grid'], 10)) {
368
- gridSize[litem]++;
369
- var tmph = $.datepicker.formatTime(useAmpm(o.pickerTimeFormat || o.timeFormat)? 'hht':'HH', {hour:h}, o);
370
- html += '<td data-for="'+litem+'">' + tmph + '</td>';
371
- }
372
- }
373
- else{
374
- for (var m = o[litem+'Min']; m <= max[litem]; m += parseInt(o[litem+'Grid'], 10)) {
375
- gridSize[litem]++;
376
- html += '<td data-for="'+litem+'">' + ((m < 10) ? '0' : '') + m + '</td>';
377
- }
378
- }
379
-
380
- html += '</tr></table></div>';
381
- }
382
- html += '</dd>';
383
- }
384
-
385
- // Timezone
386
- html += '<dt class="ui_tpicker_timezone_label"' + ((o.showTimezone) ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
387
- html += '<dd class="ui_tpicker_timezone" ' + ((o.showTimezone) ? '' : noDisplay) + '></dd>';
388
-
389
- // Create the elements from string
390
- html += '</dl></div>';
391
- var $tp = $(html);
392
-
393
- // if we only want time picker...
394
- if (o.timeOnly === true) {
395
- $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
396
- $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
397
- }
398
-
399
- // add sliders, adjust grids, add events
400
- for(var i=0,l=tp_inst.units.length; i<l; i++){
401
- litem = tp_inst.units[i];
402
- uitem = litem.substr(0,1).toUpperCase() + litem.substr(1);
403
-
404
- // add the slider
405
- tp_inst[litem+'_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_'+litem+'_slider'), litem, tp_inst[litem], o[litem+'Min'], max[litem], o['step'+uitem]);
406
-
407
- // adjust the grid and add click event
408
- if (o['show'+uitem] && o[litem+'Grid'] > 0) {
409
- size = 100 * gridSize[litem] * o[litem+'Grid'] / (max[litem] - o[litem+'Min']);
410
- $tp.find('.ui_tpicker_'+litem+' table').css({
411
- width: size + "%",
412
- marginLeft: o.isRTL? '0' : ((size / (-2 * gridSize[litem])) + "%"),
413
- marginRight: o.isRTL? ((size / (-2 * gridSize[litem])) + "%") : '0',
414
- borderCollapse: 'collapse'
415
- }).find("td").click(function(e){
416
- var $t = $(this),
417
- h = $t.html(),
418
- n = parseInt(h.replace(/[^0-9]/g),10),
419
- ap = h.replace(/[^apm]/ig),
420
- f = $t.data('for'); // loses scope, so we use data-for
421
-
422
- if(f == 'hour'){
423
- if(ap.indexOf('p') !== -1 && n < 12){
424
- n += 12;
425
- }
426
- else{
427
- if(ap.indexOf('a') !== -1 && n === 12){
428
- n = 0;
429
- }
430
- }
431
- }
432
-
433
- tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], litem, n);
434
-
435
- tp_inst._onTimeChange();
436
- tp_inst._onSelectHandler();
437
- })
438
- .css({
439
- cursor: 'pointer',
440
- width: (100 / gridSize[litem]) + '%',
441
- textAlign: 'center',
442
- overflow: 'hidden'
443
- });
444
- } // end if grid > 0
445
- } // end for loop
446
-
447
- // Add timezone options
448
- this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
449
- $.fn.append.apply(this.timezone_select,
450
- $.map(o.timezoneList, function(val, idx) {
451
- return $("<option />").val(typeof val == "object" ? val.value : val).text(typeof val == "object" ? val.label : val);
452
- }));
453
- if (typeof(this.timezone) != "undefined" && this.timezone !== null && this.timezone !== "") {
454
- var local_date = new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12);
455
- var local_timezone = $.timepicker.timeZoneOffsetString(local_date);
456
- if (local_timezone == this.timezone) {
457
- selectLocalTimeZone(tp_inst);
458
- } else {
459
- this.timezone_select.val(this.timezone);
460
- }
461
- } else {
462
- if (typeof(this.hour) != "undefined" && this.hour !== null && this.hour !== "") {
463
- this.timezone_select.val(o.defaultTimezone);
464
- } else {
465
- selectLocalTimeZone(tp_inst);
466
- }
467
- }
468
- this.timezone_select.change(function() {
469
- tp_inst._defaults.useLocalTimezone = false;
470
- tp_inst._onTimeChange();
471
- tp_inst._onSelectHandler();
472
- });
473
- // End timezone options
474
-
475
- // inject timepicker into datepicker
476
- var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
477
- if ($buttonPanel.length) {
478
- $buttonPanel.before($tp);
479
- } else {
480
- $dp.append($tp);
481
- }
482
-
483
- this.$timeObj = $tp.find('.ui_tpicker_time');
484
-
485
- if (this.inst !== null) {
486
- var timeDefined = this.timeDefined;
487
- this._onTimeChange();
488
- this.timeDefined = timeDefined;
489
- }
490
-
491
- // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
492
- if (this._defaults.addSliderAccess) {
493
- var sliderAccessArgs = this._defaults.sliderAccessArgs,
494
- rtl = this._defaults.isRTL;
495
- sliderAccessArgs.isRTL = rtl;
496
-
497
- setTimeout(function() { // fix for inline mode
498
- if ($tp.find('.ui-slider-access').length === 0) {
499
- $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
500
-
501
- // fix any grids since sliders are shorter
502
- var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
503
- if (sliderAccessWidth) {
504
- $tp.find('table:visible').each(function() {
505
- var $g = $(this),
506
- oldWidth = $g.outerWidth(),
507
- oldMarginLeft = $g.css(rtl? 'marginRight':'marginLeft').toString().replace('%', ''),
508
- newWidth = oldWidth - sliderAccessWidth,
509
- newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
510
- css = { width: newWidth, marginRight: 0, marginLeft: 0 };
511
- css[rtl? 'marginRight':'marginLeft'] = newMarginLeft;
512
- $g.css(css);
513
- });
514
- }
515
- }
516
- }, 10);
517
- }
518
- // end slideAccess integration
519
-
520
- }
521
- },
522
-
523
- /*
524
- * This function tries to limit the ability to go outside the
525
- * min/max date range
526
- */
527
- _limitMinMaxDateTime: function(dp_inst, adjustSliders) {
528
- var o = this._defaults,
529
- dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
530
-
531
- if (!this._defaults.showTimepicker) {
532
- return;
533
- } // No time so nothing to check here
534
-
535
- if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
536
- var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
537
- minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
538
-
539
- if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null) {
540
- this.hourMinOriginal = o.hourMin;
541
- this.minuteMinOriginal = o.minuteMin;
542
- this.secondMinOriginal = o.secondMin;
543
- this.millisecMinOriginal = o.millisecMin;
544
- }
545
-
546
- if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
547
- this._defaults.hourMin = minDateTime.getHours();
548
- if (this.hour <= this._defaults.hourMin) {
549
- this.hour = this._defaults.hourMin;
550
- this._defaults.minuteMin = minDateTime.getMinutes();
551
- if (this.minute <= this._defaults.minuteMin) {
552
- this.minute = this._defaults.minuteMin;
553
- this._defaults.secondMin = minDateTime.getSeconds();
554
- if (this.second <= this._defaults.secondMin) {
555
- this.second = this._defaults.secondMin;
556
- this._defaults.millisecMin = minDateTime.getMilliseconds();
557
- } else {
558
- if (this.millisec < this._defaults.millisecMin) {
559
- this.millisec = this._defaults.millisecMin;
560
- }
561
- this._defaults.millisecMin = this.millisecMinOriginal;
562
- }
563
- } else {
564
- this._defaults.secondMin = this.secondMinOriginal;
565
- this._defaults.millisecMin = this.millisecMinOriginal;
566
- }
567
- } else {
568
- this._defaults.minuteMin = this.minuteMinOriginal;
569
- this._defaults.secondMin = this.secondMinOriginal;
570
- this._defaults.millisecMin = this.millisecMinOriginal;
571
- }
572
- } else {
573
- this._defaults.hourMin = this.hourMinOriginal;
574
- this._defaults.minuteMin = this.minuteMinOriginal;
575
- this._defaults.secondMin = this.secondMinOriginal;
576
- this._defaults.millisecMin = this.millisecMinOriginal;
577
- }
578
- }
579
-
580
- if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
581
- var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
582
- maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
583
-
584
- if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null) {
585
- this.hourMaxOriginal = o.hourMax;
586
- this.minuteMaxOriginal = o.minuteMax;
587
- this.secondMaxOriginal = o.secondMax;
588
- this.millisecMaxOriginal = o.millisecMax;
589
- }
590
-
591
- if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()) {
592
- this._defaults.hourMax = maxDateTime.getHours();
593
- if (this.hour >= this._defaults.hourMax) {
594
- this.hour = this._defaults.hourMax;
595
- this._defaults.minuteMax = maxDateTime.getMinutes();
596
- if (this.minute >= this._defaults.minuteMax) {
597
- this.minute = this._defaults.minuteMax;
598
- this._defaults.secondMax = maxDateTime.getSeconds();
599
- if (this.second >= this._defaults.secondMax) {
600
- this.second = this._defaults.secondMax;
601
- this._defaults.millisecMax = maxDateTime.getMilliseconds();
602
- } else {
603
- if (this.millisec > this._defaults.millisecMax) {
604
- this.millisec = this._defaults.millisecMax;
605
- }
606
- this._defaults.millisecMax = this.millisecMaxOriginal;
607
- }
608
- } else {
609
- this._defaults.secondMax = this.secondMaxOriginal;
610
- this._defaults.millisecMax = this.millisecMaxOriginal;
611
- }
612
- } else {
613
- this._defaults.minuteMax = this.minuteMaxOriginal;
614
- this._defaults.secondMax = this.secondMaxOriginal;
615
- this._defaults.millisecMax = this.millisecMaxOriginal;
616
- }
617
- } else {
618
- this._defaults.hourMax = this.hourMaxOriginal;
619
- this._defaults.minuteMax = this.minuteMaxOriginal;
620
- this._defaults.secondMax = this.secondMaxOriginal;
621
- this._defaults.millisecMax = this.millisecMaxOriginal;
622
- }
623
- }
624
-
625
- if (adjustSliders !== undefined && adjustSliders === true) {
626
- var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
627
- minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
628
- secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
629
- millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10);
630
-
631
- if (this.hour_slider) {
632
- this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
633
- this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
634
- }
635
- if (this.minute_slider) {
636
- this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
637
- this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
638
- }
639
- if (this.second_slider) {
640
- this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
641
- this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
642
- }
643
- if (this.millisec_slider) {
644
- this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
645
- this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
646
- }
647
- }
648
-
649
- },
650
-
651
- /*
652
- * when a slider moves, set the internal time...
653
- * on time change is also called when the time is updated in the text field
654
- */
655
- _onTimeChange: function() {
656
- var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
657
- minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
658
- second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
659
- millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
660
- timezone = (this.timezone_select) ? this.timezone_select.val() : false,
661
- o = this._defaults,
662
- pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
663
- pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
664
-
665
- if (typeof(hour) == 'object') {
666
- hour = false;
667
- }
668
- if (typeof(minute) == 'object') {
669
- minute = false;
670
- }
671
- if (typeof(second) == 'object') {
672
- second = false;
673
- }
674
- if (typeof(millisec) == 'object') {
675
- millisec = false;
676
- }
677
- if (typeof(timezone) == 'object') {
678
- timezone = false;
679
- }
680
-
681
- if (hour !== false) {
682
- hour = parseInt(hour, 10);
683
- }
684
- if (minute !== false) {
685
- minute = parseInt(minute, 10);
686
- }
687
- if (second !== false) {
688
- second = parseInt(second, 10);
689
- }
690
- if (millisec !== false) {
691
- millisec = parseInt(millisec, 10);
692
- }
693
-
694
- var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
695
-
696
- // If the update was done in the input field, the input field should not be updated.
697
- // If the update was done using the sliders, update the input field.
698
- var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec
699
- || (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1))
700
- || ((this.timezone === null && timezone != this.defaultTimezone) || (this.timezone !== null && timezone != this.timezone)));
701
-
702
- if (hasChanged) {
703
-
704
- if (hour !== false) {
705
- this.hour = hour;
706
- }
707
- if (minute !== false) {
708
- this.minute = minute;
709
- }
710
- if (second !== false) {
711
- this.second = second;
712
- }
713
- if (millisec !== false) {
714
- this.millisec = millisec;
715
- }
716
- if (timezone !== false) {
717
- this.timezone = timezone;
718
- }
719
-
720
- if (!this.inst) {
721
- this.inst = $.datepicker._getInst(this.$input[0]);
722
- }
723
-
724
- this._limitMinMaxDateTime(this.inst, true);
725
- }
726
- if (useAmpm(o.timeFormat)) {
727
- this.ampm = ampm;
728
- }
729
-
730
- // Updates the time within the timepicker
731
- this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
732
- if (this.$timeObj) {
733
- if(pickerTimeFormat === o.timeFormat){
734
- this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
735
- }
736
- else{
737
- this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
738
- }
739
- }
740
-
741
- this.timeDefined = true;
742
- if (hasChanged) {
743
- this._updateDateTime();
744
- }
745
- },
746
-
747
- /*
748
- * call custom onSelect.
749
- * bind to sliders slidestop, and grid click.
750
- */
751
- _onSelectHandler: function() {
752
- var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
753
- var inputEl = this.$input ? this.$input[0] : null;
754
- if (onSelect && inputEl) {
755
- onSelect.apply(inputEl, [this.formattedDateTime, this]);
756
- }
757
- },
758
-
759
- /*
760
- * update our input with the new date time..
761
- */
762
- _updateDateTime: function(dp_inst) {
763
- dp_inst = this.inst || dp_inst;
764
- var dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
765
- dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
766
- formatCfg = $.datepicker._getFormatConfig(dp_inst),
767
- timeAvailable = dt !== null && this.timeDefined;
768
- this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
769
- var formattedDateTime = this.formattedDate;
770
-
771
- // if a slider was changed but datepicker doesn't have a value yet, set it
772
- if(dp_inst.lastVal==""){
773
- dp_inst.currentYear=dp_inst.selectedYear;
774
- dp_inst.currentMonth=dp_inst.selectedMonth;
775
- dp_inst.currentDay=dp_inst.selectedDay;
776
- }
777
-
778
- /*
779
- * remove following lines to force every changes in date picker to change the input value
780
- * Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
781
- * If the user manually empty the value in the input field, the date picker will never change selected value.
782
- */
783
- //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
784
- // return;
785
- //}
786
-
787
- if (this._defaults.timeOnly === true) {
788
- formattedDateTime = this.formattedTime;
789
- } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
790
- formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
791
- }
792
-
793
- this.formattedDateTime = formattedDateTime;
794
-
795
- if (!this._defaults.showTimepicker) {
796
- this.$input.val(this.formattedDate);
797
- } else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
798
- this.$altInput.val(this.formattedTime);
799
- this.$input.val(this.formattedDate);
800
- } else if (this.$altInput) {
801
- this.$input.val(formattedDateTime);
802
- var altFormattedDateTime = '',
803
- altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
804
- altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
805
-
806
- if (this._defaults.altFormat) altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
807
- else altFormattedDateTime = this.formattedDate;
808
- if (altFormattedDateTime) altFormattedDateTime += altSeparator;
809
- if (this._defaults.altTimeFormat) altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
810
- else altFormattedDateTime += this.formattedTime + altTimeSuffix;
811
- this.$altInput.val(altFormattedDateTime);
812
- } else {
813
- this.$input.val(formattedDateTime);
814
- }
815
-
816
- this.$input.trigger("change");
817
- },
818
-
819
- _onFocus: function() {
820
- if (!this.$input.val() && this._defaults.defaultValue) {
821
- this.$input.val(this._defaults.defaultValue);
822
- var inst = $.datepicker._getInst(this.$input.get(0)),
823
- tp_inst = $.datepicker._get(inst, 'timepicker');
824
- if (tp_inst) {
825
- if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
826
- try {
827
- $.datepicker._updateDatepicker(inst);
828
- } catch (err) {
829
- $.timepicker.log(err);
830
- }
831
- }
832
- }
833
- }
834
- },
835
-
836
- /*
837
- * Small abstraction to control types
838
- * We can add more, just be sure to follow the pattern: create, options, value
839
- */
840
- _controls: {
841
- // slider methods
842
- slider: {
843
- create: function(tp_inst, obj, unit, val, min, max, step){
844
- var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
845
- return obj.prop('slide', null).slider({
846
- orientation: "horizontal",
847
- value: rtl? val*-1 : val,
848
- min: rtl? max*-1 : min,
849
- max: rtl? min*-1 : max,
850
- step: step,
851
- slide: function(event, ui) {
852
- tp_inst.control.value(tp_inst, $(this), unit, rtl? ui.value*-1:ui.value);
853
- tp_inst._onTimeChange();
854
- },
855
- stop: function(event, ui) {
856
- tp_inst._onSelectHandler();
857
- }
858
- });
859
- },
860
- options: function(tp_inst, obj, unit, opts, val){
861
- if(tp_inst._defaults.isRTL){
862
- if(typeof(opts) == 'string'){
863
- if(opts == 'min' || opts == 'max'){
864
- if(val !== undefined)
865
- return obj.slider(opts, val*-1);
866
- return Math.abs(obj.slider(opts));
867
- }
868
- return obj.slider(opts);
869
- }
870
- var min = opts.min,
871
- max = opts.max;
872
- opts.min = opts.max = null;
873
- if(min !== undefined)
874
- opts.max = min * -1;
875
- if(max !== undefined)
876
- opts.min = max * -1;
877
- return obj.slider(opts);
878
- }
879
- if(typeof(opts) == 'string' && val !== undefined)
880
- return obj.slider(opts, val);
881
- return obj.slider(opts);
882
- },
883
- value: function(tp_inst, obj, unit, val){
884
- if(tp_inst._defaults.isRTL){
885
- if(val !== undefined)
886
- return obj.slider('value', val*-1);
887
- return Math.abs(obj.slider('value'));
888
- }
889
- if(val !== undefined)
890
- return obj.slider('value', val);
891
- return obj.slider('value');
892
- }
893
- },
894
- // select methods
895
- select: {
896
- create: function(tp_inst, obj, unit, val, min, max, step){
897
- var sel = '<select class="ui-timepicker-select" data-unit="'+ unit +'" data-min="'+ min +'" data-max="'+ max +'" data-step="'+ step +'">',
898
- ul = tp_inst._defaults.timeFormat.indexOf('t') !== -1? 'toLowerCase':'toUpperCase',
899
- m = 0;
900
-
901
- for(var i=min; i<=max; i+=step){
902
- sel += '<option value="'+ i +'"'+ (i==val? ' selected':'') +'>';
903
- if(unit == 'hour' && useAmpm(tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat))
904
- sel += $.datepicker.formatTime("hh TT", {hour:i}, tp_inst._defaults);
905
- else if(unit == 'millisec' || i >= 10) sel += i;
906
- else sel += '0'+ i.toString();
907
- sel += '</option>';
908
- }
909
- sel += '</select>';
910
-
911
- obj.children('select').remove();
912
-
913
- $(sel).appendTo(obj).change(function(e){
914
- tp_inst._onTimeChange();
915
- tp_inst._onSelectHandler();
916
- });
917
-
918
- return obj;
919
- },
920
- options: function(tp_inst, obj, unit, opts, val){
921
- var o = {},
922
- $t = obj.children('select');
923
- if(typeof(opts) == 'string'){
924
- if(val === undefined)
925
- return $t.data(opts);
926
- o[opts] = val;
927
- }
928
- else o = opts;
929
- return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
930
- },
931
- value: function(tp_inst, obj, unit, val){
932
- var $t = obj.children('select');
933
- if(val !== undefined)
934
- return $t.val(val);
935
- return $t.val();
936
- }
937
- }
938
- } // end _controls
939
-
940
- });
941
-
942
- $.fn.extend({
943
- /*
944
- * shorthand just to use timepicker..
945
- */
946
- timepicker: function(o) {
947
- o = o || {};
948
- var tmp_args = Array.prototype.slice.call(arguments);
949
-
950
- if (typeof o == 'object') {
951
- tmp_args[0] = $.extend(o, {
952
- timeOnly: true
953
- });
954
- }
955
-
956
- return $(this).each(function() {
957
- $.fn.datetimepicker.apply($(this), tmp_args);
958
- });
959
- },
960
-
961
- /*
962
- * extend timepicker to datepicker
963
- */
964
- datetimepicker: function(o) {
965
- o = o || {};
966
- var tmp_args = arguments;
967
-
968
- if (typeof(o) == 'string') {
969
- if (o == 'getDate') {
970
- return $.fn.datepicker.apply($(this[0]), tmp_args);
971
- } else {
972
- return this.each(function() {
973
- var $t = $(this);
974
- $t.datepicker.apply($t, tmp_args);
975
- });
976
- }
977
- } else {
978
- return this.each(function() {
979
- var $t = $(this);
980
- $t.datepicker($.timepicker._newInst($t, o)._defaults);
981
- });
982
- }
983
- }
984
- });
985
-
986
- /*
987
- * Public Utility to parse date and time
988
- */
989
- $.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
990
- var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
991
- if (parseRes.timeObj) {
992
- var t = parseRes.timeObj;
993
- parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
994
- }
995
-
996
- return parseRes.date;
997
- };
998
-
999
- /*
1000
- * Public utility to parse time
1001
- */
1002
- $.datepicker.parseTime = function(timeFormat, timeString, options) {
1003
- var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
1004
-
1005
- // Strict parse requires the timeString to match the timeFormat exactly
1006
- var strictParse = function(f, s, o){
1007
-
1008
- // pattern for standard and localized AM/PM markers
1009
- var getPatternAmpm = function(amNames, pmNames) {
1010
- var markers = [];
1011
- if (amNames) {
1012
- $.merge(markers, amNames);
1013
- }
1014
- if (pmNames) {
1015
- $.merge(markers, pmNames);
1016
- }
1017
- markers = $.map(markers, function(val) {
1018
- return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
1019
- });
1020
- return '(' + markers.join('|') + ')?';
1021
- };
1022
-
1023
- // figure out position of time elements.. cause js cant do named captures
1024
- var getFormatPositions = function(timeFormat) {
1025
- var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z|'.*?')/g),
1026
- orders = {
1027
- h: -1,
1028
- m: -1,
1029
- s: -1,
1030
- l: -1,
1031
- t: -1,
1032
- z: -1
1033
- };
1034
-
1035
- if (finds) {
1036
- for (var i = 0; i < finds.length; i++) {
1037
- if (orders[finds[i].toString().charAt(0)] == -1) {
1038
- orders[finds[i].toString().charAt(0)] = i + 1;
1039
- }
1040
- }
1041
- }
1042
- return orders;
1043
- };
1044
-
1045
- var regstr = '^' + f.toString()
1046
- .replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function (match) {
1047
- var ml = match.length;
1048
- switch (match.charAt(0).toLowerCase()) {
1049
- case 'h': return ml === 1? '(\\d?\\d)':'(\\d{'+ml+'})';
1050
- case 'm': return ml === 1? '(\\d?\\d)':'(\\d{'+ml+'})';
1051
- case 's': return ml === 1? '(\\d?\\d)':'(\\d{'+ml+'})';
1052
- case 'l': return '(\\d?\\d?\\d)';
1053
- case 'z': return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
1054
- case 't': return getPatternAmpm(o.amNames, o.pmNames);
1055
- default: // literal escaped in quotes
1056
- return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
1057
- }
1058
- })
1059
- .replace(/\s/g, '\\s?') +
1060
- o.timeSuffix + '$',
1061
- order = getFormatPositions(f),
1062
- ampm = '',
1063
- treg;
1064
-
1065
- treg = s.match(new RegExp(regstr, 'i'));
1066
-
1067
- var resTime = {
1068
- hour: 0,
1069
- minute: 0,
1070
- second: 0,
1071
- millisec: 0
1072
- };
1073
-
1074
- if (treg) {
1075
- if (order.t !== -1) {
1076
- if (treg[order.t] === undefined || treg[order.t].length === 0) {
1077
- ampm = '';
1078
- resTime.ampm = '';
1079
- } else {
1080
- ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
1081
- resTime.ampm = o[ampm == 'AM' ? 'amNames' : 'pmNames'][0];
1082
- }
1083
- }
1084
-
1085
- if (order.h !== -1) {
1086
- if (ampm == 'AM' && treg[order.h] == '12') {
1087
- resTime.hour = 0; // 12am = 0 hour
1088
- } else {
1089
- if (ampm == 'PM' && treg[order.h] != '12') {
1090
- resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
1091
- } else {
1092
- resTime.hour = Number(treg[order.h]);
1093
- }
1094
- }
1095
- }
1096
-
1097
- if (order.m !== -1) {
1098
- resTime.minute = Number(treg[order.m]);
1099
- }
1100
- if (order.s !== -1) {
1101
- resTime.second = Number(treg[order.s]);
1102
- }
1103
- if (order.l !== -1) {
1104
- resTime.millisec = Number(treg[order.l]);
1105
- }
1106
- if (order.z !== -1 && treg[order.z] !== undefined) {
1107
- var tz = treg[order.z].toUpperCase();
1108
- switch (tz.length) {
1109
- case 1:
1110
- // Z
1111
- tz = o.timezoneIso8601 ? 'Z' : '+0000';
1112
- break;
1113
- case 5:
1114
- // +hhmm
1115
- if (o.timezoneIso8601) {
1116
- tz = tz.substring(1) == '0000' ? 'Z' : tz.substring(0, 3) + ':' + tz.substring(3);
1117
- }
1118
- break;
1119
- case 6:
1120
- // +hh:mm
1121
- if (!o.timezoneIso8601) {
1122
- tz = tz == 'Z' || tz.substring(1) == '00:00' ? '+0000' : tz.replace(/:/, '');
1123
- } else {
1124
- if (tz.substring(1) == '00:00') {
1125
- tz = 'Z';
1126
- }
1127
- }
1128
- break;
1129
- }
1130
- resTime.timezone = tz;
1131
- }
1132
-
1133
-
1134
- return resTime;
1135
- }
1136
- return false;
1137
- };// end strictParse
1138
-
1139
- // First try JS Date, if that fails, use strictParse
1140
- var looseParse = function(f,s,o){
1141
- try{
1142
- var d = new Date('2012-01-01 '+ s);
1143
- if(isNaN(d.getTime())){
1144
- d = new Date('2012-01-01T'+ s);
1145
- if(isNaN(d.getTime())){
1146
- d = new Date('01/01/2012 '+ s);
1147
- if(isNaN(d.getTime())){
1148
- throw "Unable to parse time with native Date: "+ s;
1149
- }
1150
- }
1151
- }
1152
-
1153
- return {
1154
- hour: d.getHours(),
1155
- minute: d.getMinutes(),
1156
- second: d.getSeconds(),
1157
- millisec: d.getMilliseconds(),
1158
- timezone: $.timepicker.timeZoneOffsetString(d)
1159
- };
1160
- }
1161
- catch(err){
1162
- try{
1163
- return strictParse(f,s,o);
1164
- }
1165
- catch(err2){
1166
- $.timepicker.log("Unable to parse \ntimeString: "+ s +"\ntimeFormat: "+ f);
1167
- }
1168
- }
1169
- return false;
1170
- }; // end looseParse
1171
-
1172
- if(typeof o.parse === "function"){
1173
- return o.parse(timeFormat, timeString, o)
1174
- }
1175
- if(o.parse === 'loose'){
1176
- return looseParse(timeFormat, timeString, o);
1177
- }
1178
- return strictParse(timeFormat, timeString, o);
1179
- };
1180
-
1181
- /*
1182
- * Public utility to format the time
1183
- * format = string format of the time
1184
- * time = a {}, not a Date() for timezones
1185
- * options = essentially the regional[].. amNames, pmNames, ampm
1186
- */
1187
- $.datepicker.formatTime = function(format, time, options) {
1188
- options = options || {};
1189
- options = $.extend({}, $.timepicker._defaults, options);
1190
- time = $.extend({
1191
- hour: 0,
1192
- minute: 0,
1193
- second: 0,
1194
- millisec: 0,
1195
- timezone: '+0000'
1196
- }, time);
1197
-
1198
- var tmptime = format,
1199
- ampmName = options.amNames[0],
1200
- hour = parseInt(time.hour, 10);
1201
-
1202
- if (hour > 11) {
1203
- ampmName = options.pmNames[0];
1204
- }
1205
-
1206
- tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[lz]|('.*?'|".*?"))/g, function(match) {
1207
- switch (match) {
1208
- case 'HH':
1209
- return ('0' + hour).slice(-2);
1210
- case 'H':
1211
- return hour;
1212
- case 'hh':
1213
- return ('0' + convert24to12(hour)).slice(-2);
1214
- case 'h':
1215
- return convert24to12(hour);
1216
- case 'mm':
1217
- return ('0' + time.minute).slice(-2);
1218
- case 'm':
1219
- return time.minute;
1220
- case 'ss':
1221
- return ('0' + time.second).slice(-2);
1222
- case 's':
1223
- return time.second;
1224
- case 'l':
1225
- return ('00' + time.millisec).slice(-3);
1226
- case 'z':
1227
- return time.timezone === null? options.defaultTimezone : time.timezone;
1228
- case 'T':
1229
- return ampmName.charAt(0).toUpperCase();
1230
- case 'TT':
1231
- return ampmName.toUpperCase();
1232
- case 't':
1233
- return ampmName.charAt(0).toLowerCase();
1234
- case 'tt':
1235
- return ampmName.toLowerCase();
1236
- default:
1237
- return match.replace(/\'/g, "") || "'";
1238
- }
1239
- });
1240
-
1241
- tmptime = $.trim(tmptime);
1242
- return tmptime;
1243
- };
1244
-
1245
- /*
1246
- * the bad hack :/ override datepicker so it doesnt close on select
1247
- // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
1248
- */
1249
- $.datepicker._base_selectDate = $.datepicker._selectDate;
1250
- $.datepicker._selectDate = function(id, dateStr) {
1251
- var inst = this._getInst($(id)[0]),
1252
- tp_inst = this._get(inst, 'timepicker');
1253
-
1254
- if (tp_inst) {
1255
- tp_inst._limitMinMaxDateTime(inst, true);
1256
- inst.inline = inst.stay_open = true;
1257
- //This way the onSelect handler called from calendarpicker get the full dateTime
1258
- this._base_selectDate(id, dateStr);
1259
- inst.inline = inst.stay_open = false;
1260
- this._notifyChange(inst);
1261
- this._updateDatepicker(inst);
1262
- } else {
1263
- this._base_selectDate(id, dateStr);
1264
- }
1265
- };
1266
-
1267
- /*
1268
- * second bad hack :/ override datepicker so it triggers an event when changing the input field
1269
- * and does not redraw the datepicker on every selectDate event
1270
- */
1271
- $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
1272
- $.datepicker._updateDatepicker = function(inst) {
1273
-
1274
- // don't popup the datepicker if there is another instance already opened
1275
- var input = inst.input[0];
1276
- if ($.datepicker._curInst && $.datepicker._curInst != inst && $.datepicker._datepickerShowing && $.datepicker._lastInput != input) {
1277
- return;
1278
- }
1279
-
1280
- if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
1281
-
1282
- this._base_updateDatepicker(inst);
1283
-
1284
- // Reload the time control when changing something in the input text field.
1285
- var tp_inst = this._get(inst, 'timepicker');
1286
- if (tp_inst) {
1287
- tp_inst._addTimePicker(inst);
1288
-
1289
- // if (tp_inst._defaults.useLocalTimezone) { //checks daylight saving with the new date.
1290
- // var date = new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 12);
1291
- // selectLocalTimeZone(tp_inst, date);
1292
- // tp_inst._onTimeChange();
1293
- // }
1294
- }
1295
- }
1296
- };
1297
-
1298
- /*
1299
- * third bad hack :/ override datepicker so it allows spaces and colon in the input field
1300
- */
1301
- $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
1302
- $.datepicker._doKeyPress = function(event) {
1303
- var inst = $.datepicker._getInst(event.target),
1304
- tp_inst = $.datepicker._get(inst, 'timepicker');
1305
-
1306
- if (tp_inst) {
1307
- if ($.datepicker._get(inst, 'constrainInput')) {
1308
- var ampm = useAmpm(tp_inst._defaults.timeFormat),
1309
- dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
1310
- datetimeChars = tp_inst._defaults.timeFormat.toString()
1311
- .replace(/[hms]/g, '')
1312
- .replace(/TT/g, ampm ? 'APM' : '')
1313
- .replace(/Tt/g, ampm ? 'AaPpMm' : '')
1314
- .replace(/tT/g, ampm ? 'AaPpMm' : '')
1315
- .replace(/T/g, ampm ? 'AP' : '')
1316
- .replace(/tt/g, ampm ? 'apm' : '')
1317
- .replace(/t/g, ampm ? 'ap' : '') +
1318
- " " + tp_inst._defaults.separator +
1319
- tp_inst._defaults.timeSuffix +
1320
- (tp_inst._defaults.showTimezone ? tp_inst._defaults.timezoneList.join('') : '') +
1321
- (tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
1322
- dateChars,
1323
- chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
1324
- return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
1325
- }
1326
- }
1327
-
1328
- return $.datepicker._base_doKeyPress(event);
1329
- };
1330
-
1331
- /*
1332
- * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
1333
- */
1334
- $.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
1335
- /* Update any alternate field to synchronise with the main field. */
1336
- $.datepicker._updateAlternate = function(inst) {
1337
- var tp_inst = this._get(inst, 'timepicker');
1338
- if(tp_inst){
1339
- var altField = tp_inst._defaults.altField;
1340
- if (altField) { // update alternate field too
1341
- var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
1342
- date = this._getDate(inst),
1343
- formatCfg = $.datepicker._getFormatConfig(inst),
1344
- altFormattedDateTime = '',
1345
- altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
1346
- altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
1347
- altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
1348
-
1349
- altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
1350
- if(!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null){
1351
- if(tp_inst._defaults.altFormat)
1352
- altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;
1353
- else altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
1354
- }
1355
- $(altField).val(altFormattedDateTime);
1356
- }
1357
- }
1358
- else{
1359
- $.datepicker._base_updateAlternate(inst);
1360
- }
1361
- };
1362
-
1363
- /*
1364
- * Override key up event to sync manual input changes.
1365
- */
1366
- $.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
1367
- $.datepicker._doKeyUp = function(event) {
1368
- var inst = $.datepicker._getInst(event.target),
1369
- tp_inst = $.datepicker._get(inst, 'timepicker');
1370
-
1371
- if (tp_inst) {
1372
- if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
1373
- try {
1374
- $.datepicker._updateDatepicker(inst);
1375
- } catch (err) {
1376
- $.timepicker.log(err);
1377
- }
1378
- }
1379
- }
1380
-
1381
- return $.datepicker._base_doKeyUp(event);
1382
- };
1383
-
1384
- /*
1385
- * override "Today" button to also grab the time.
1386
- */
1387
- $.datepicker._base_gotoToday = $.datepicker._gotoToday;
1388
- $.datepicker._gotoToday = function(id) {
1389
- var inst = this._getInst($(id)[0]),
1390
- $dp = inst.dpDiv;
1391
- this._base_gotoToday(id);
1392
- var tp_inst = this._get(inst, 'timepicker');
1393
- selectLocalTimeZone(tp_inst);
1394
- var now = new Date();
1395
- this._setTime(inst, now);
1396
- $('.ui-datepicker-today', $dp).click();
1397
- };
1398
-
1399
- /*
1400
- * Disable & enable the Time in the datetimepicker
1401
- */
1402
- $.datepicker._disableTimepickerDatepicker = function(target) {
1403
- var inst = this._getInst(target);
1404
- if (!inst) {
1405
- return;
1406
- }
1407
-
1408
- var tp_inst = this._get(inst, 'timepicker');
1409
- $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
1410
- if (tp_inst) {
1411
- tp_inst._defaults.showTimepicker = false;
1412
- tp_inst._updateDateTime(inst);
1413
- }
1414
- };
1415
-
1416
- $.datepicker._enableTimepickerDatepicker = function(target) {
1417
- var inst = this._getInst(target);
1418
- if (!inst) {
1419
- return;
1420
- }
1421
-
1422
- var tp_inst = this._get(inst, 'timepicker');
1423
- $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
1424
- if (tp_inst) {
1425
- tp_inst._defaults.showTimepicker = true;
1426
- tp_inst._addTimePicker(inst); // Could be disabled on page load
1427
- tp_inst._updateDateTime(inst);
1428
- }
1429
- };
1430
-
1431
- /*
1432
- * Create our own set time function
1433
- */
1434
- $.datepicker._setTime = function(inst, date) {
1435
- var tp_inst = this._get(inst, 'timepicker');
1436
- if (tp_inst) {
1437
- var defaults = tp_inst._defaults;
1438
-
1439
- // calling _setTime with no date sets time to defaults
1440
- tp_inst.hour = date ? date.getHours() : defaults.hour;
1441
- tp_inst.minute = date ? date.getMinutes() : defaults.minute;
1442
- tp_inst.second = date ? date.getSeconds() : defaults.second;
1443
- tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
1444
-
1445
- //check if within min/max times..
1446
- tp_inst._limitMinMaxDateTime(inst, true);
1447
-
1448
- tp_inst._onTimeChange();
1449
- tp_inst._updateDateTime(inst);
1450
- }
1451
- };
1452
-
1453
- /*
1454
- * Create new public method to set only time, callable as $().datepicker('setTime', date)
1455
- */
1456
- $.datepicker._setTimeDatepicker = function(target, date, withDate) {
1457
- var inst = this._getInst(target);
1458
- if (!inst) {
1459
- return;
1460
- }
1461
-
1462
- var tp_inst = this._get(inst, 'timepicker');
1463
-
1464
- if (tp_inst) {
1465
- this._setDateFromField(inst);
1466
- var tp_date;
1467
- if (date) {
1468
- if (typeof date == "string") {
1469
- tp_inst._parseTime(date, withDate);
1470
- tp_date = new Date();
1471
- tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
1472
- } else {
1473
- tp_date = new Date(date.getTime());
1474
- }
1475
- if (tp_date.toString() == 'Invalid Date') {
1476
- tp_date = undefined;
1477
- }
1478
- this._setTime(inst, tp_date);
1479
- }
1480
- }
1481
-
1482
- };
1483
-
1484
- /*
1485
- * override setDate() to allow setting time too within Date object
1486
- */
1487
- $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
1488
- $.datepicker._setDateDatepicker = function(target, date) {
1489
- var inst = this._getInst(target);
1490
- if (!inst) {
1491
- return;
1492
- }
1493
-
1494
- var tp_date = (date instanceof Date) ? new Date(date.getTime()) : date;
1495
-
1496
- this._updateDatepicker(inst);
1497
- this._base_setDateDatepicker.apply(this, arguments);
1498
- this._setTimeDatepicker(target, tp_date, true);
1499
- };
1500
-
1501
- /*
1502
- * override getDate() to allow getting time too within Date object
1503
- */
1504
- $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
1505
- $.datepicker._getDateDatepicker = function(target, noDefault) {
1506
- var inst = this._getInst(target);
1507
- if (!inst) {
1508
- return;
1509
- }
1510
-
1511
- var tp_inst = this._get(inst, 'timepicker');
1512
-
1513
- if (tp_inst) {
1514
- // if it hasn't yet been defined, grab from field
1515
- if(inst.lastVal === undefined){
1516
- this._setDateFromField(inst, noDefault);
1517
- }
1518
-
1519
- var date = this._getDate(inst);
1520
- if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
1521
- date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
1522
- }
1523
- return date;
1524
- }
1525
- return this._base_getDateDatepicker(target, noDefault);
1526
- };
1527
-
1528
- /*
1529
- * override parseDate() because UI 1.8.14 throws an error about "Extra characters"
1530
- * An option in datapicker to ignore extra format characters would be nicer.
1531
- */
1532
- $.datepicker._base_parseDate = $.datepicker.parseDate;
1533
- $.datepicker.parseDate = function(format, value, settings) {
1534
- var date;
1535
- try {
1536
- date = this._base_parseDate(format, value, settings);
1537
- } catch (err) {
1538
- // Hack! The error message ends with a colon, a space, and
1539
- // the "extra" characters. We rely on that instead of
1540
- // attempting to perfectly reproduce the parsing algorithm.
1541
- date = this._base_parseDate(format, value.substring(0,value.length-(err.length-err.indexOf(':')-2)), settings);
1542
- $.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
1543
- }
1544
- return date;
1545
- };
1546
-
1547
- /*
1548
- * override formatDate to set date with time to the input
1549
- */
1550
- $.datepicker._base_formatDate = $.datepicker._formatDate;
1551
- $.datepicker._formatDate = function(inst, day, month, year) {
1552
- var tp_inst = this._get(inst, 'timepicker');
1553
- if (tp_inst) {
1554
- tp_inst._updateDateTime(inst);
1555
- return tp_inst.$input.val();
1556
- }
1557
- return this._base_formatDate(inst);
1558
- };
1559
-
1560
- /*
1561
- * override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
1562
- */
1563
- $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
1564
- $.datepicker._optionDatepicker = function(target, name, value) {
1565
- var inst = this._getInst(target),
1566
- name_clone;
1567
- if (!inst) {
1568
- return null;
1569
- }
1570
-
1571
- var tp_inst = this._get(inst, 'timepicker');
1572
- if (tp_inst) {
1573
- var min = null,
1574
- max = null,
1575
- onselect = null,
1576
- overrides = tp_inst._defaults.evnts,
1577
- fns = {},
1578
- prop;
1579
- if (typeof name == 'string') { // if min/max was set with the string
1580
- if (name === 'minDate' || name === 'minDateTime') {
1581
- min = value;
1582
- } else if (name === 'maxDate' || name === 'maxDateTime') {
1583
- max = value;
1584
- } else if (name === 'onSelect') {
1585
- onselect = value;
1586
- } else if (overrides.hasOwnProperty(name)) {
1587
- if (typeof (value) === 'undefined') {
1588
- return overrides[name];
1589
- }
1590
- fns[name] = value;
1591
- name_clone = {}; //empty results in exiting function after overrides updated
1592
- }
1593
- } else if (typeof name == 'object') { //if min/max was set with the JSON
1594
- if (name.minDate) {
1595
- min = name.minDate;
1596
- } else if (name.minDateTime) {
1597
- min = name.minDateTime;
1598
- } else if (name.maxDate) {
1599
- max = name.maxDate;
1600
- } else if (name.maxDateTime) {
1601
- max = name.maxDateTime;
1602
- }
1603
- for (prop in overrides) {
1604
- if (overrides.hasOwnProperty(prop) && name[prop]) {
1605
- fns[prop] = name[prop];
1606
- }
1607
- }
1608
- }
1609
- for (prop in fns) {
1610
- if (fns.hasOwnProperty(prop)) {
1611
- overrides[prop] = fns[prop];
1612
- if (!name_clone) { name_clone = $.extend({}, name);}
1613
- delete name_clone[prop];
1614
- }
1615
- }
1616
- if (name_clone && isEmptyObject(name_clone)) { return; }
1617
- if (min) { //if min was set
1618
- if (min === 0) {
1619
- min = new Date();
1620
- } else {
1621
- min = new Date(min);
1622
- }
1623
- tp_inst._defaults.minDate = min;
1624
- tp_inst._defaults.minDateTime = min;
1625
- } else if (max) { //if max was set
1626
- if (max === 0) {
1627
- max = new Date();
1628
- } else {
1629
- max = new Date(max);
1630
- }
1631
- tp_inst._defaults.maxDate = max;
1632
- tp_inst._defaults.maxDateTime = max;
1633
- } else if (onselect) {
1634
- tp_inst._defaults.onSelect = onselect;
1635
- }
1636
- }
1637
- if (value === undefined) {
1638
- return this._base_optionDatepicker.call($.datepicker, target, name);
1639
- }
1640
- return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
1641
- };
1642
- /*
1643
- * jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
1644
- * it will return false for all objects
1645
- */
1646
- var isEmptyObject = function(obj) {
1647
- var prop;
1648
- for (prop in obj) {
1649
- if (obj.hasOwnProperty(obj)) {
1650
- return false;
1651
- }
1652
- }
1653
- return true;
1654
- };
1655
-
1656
- /*
1657
- * jQuery extend now ignores nulls!
1658
- */
1659
- var extendRemove = function(target, props) {
1660
- $.extend(target, props);
1661
- for (var name in props) {
1662
- if (props[name] === null || props[name] === undefined) {
1663
- target[name] = props[name];
1664
- }
1665
- }
1666
- return target;
1667
- };
1668
-
1669
- /*
1670
- * Determine by the time format if should use ampm
1671
- * Returns true if should use ampm, false if not
1672
- */
1673
- var useAmpm = function(timeFormat){
1674
- return (timeFormat.indexOf('t') !== -1 && timeFormat.indexOf('h') !== -1);
1675
- };
1676
-
1677
- /*
1678
- * Converts 24 hour format into 12 hour
1679
- * Returns 12 hour without leading 0
1680
- */
1681
- var convert24to12 = function(hour) {
1682
- if (hour > 12) {
1683
- hour = hour - 12;
1684
- }
1685
-
1686
- if (hour == 0) {
1687
- hour = 12;
1688
- }
1689
-
1690
- return String(hour);
1691
- };
1692
-
1693
- /*
1694
- * Splits datetime string into date ans time substrings.
1695
- * Throws exception when date can't be parsed
1696
- * Returns [dateString, timeString]
1697
- */
1698
- var splitDateTime = function(dateFormat, dateTimeString, dateSettings, timeSettings) {
1699
- try {
1700
- // The idea is to get the number separator occurances in datetime and the time format requested (since time has
1701
- // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
1702
- var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.timepicker._defaults.separator,
1703
- format = timeSettings && timeSettings.timeFormat ? timeSettings.timeFormat : $.timepicker._defaults.timeFormat,
1704
- timeParts = format.split(separator), // how many occurances of separator may be in our format?
1705
- timePartsLen = timeParts.length,
1706
- allParts = dateTimeString.split(separator),
1707
- allPartsLen = allParts.length;
1708
-
1709
- if (allPartsLen > 1) {
1710
- return [
1711
- allParts.splice(0,allPartsLen-timePartsLen).join(separator),
1712
- allParts.splice(0,timePartsLen).join(separator)
1713
- ];
1714
- }
1715
-
1716
- } catch (err) {
1717
- $.timepicker.log('Could not split the date from the time. Please check the following datetimepicker options' +
1718
- "\nthrown error: " + err +
1719
- "\ndateTimeString" + dateTimeString +
1720
- "\ndateFormat = " + dateFormat +
1721
- "\nseparator = " + timeSettings.separator +
1722
- "\ntimeFormat = " + timeSettings.timeFormat);
1723
-
1724
- if (err.indexOf(":") >= 0) {
1725
- // Hack! The error message ends with a colon, a space, and
1726
- // the "extra" characters. We rely on that instead of
1727
- // attempting to perfectly reproduce the parsing algorithm.
1728
- var dateStringLength = dateTimeString.length - (err.length - err.indexOf(':') - 2),
1729
- timeString = dateTimeString.substring(dateStringLength);
1730
-
1731
- return [$.trim(dateTimeString.substring(0, dateStringLength)), $.trim(dateTimeString.substring(dateStringLength))];
1732
-
1733
- } else {
1734
- throw err;
1735
- }
1736
- }
1737
- return [dateTimeString, ''];
1738
- };
1739
-
1740
- /*
1741
- * Internal function to parse datetime interval
1742
- * Returns: {date: Date, timeObj: Object}, where
1743
- * date - parsed date without time (type Date)
1744
- * timeObj = {hour: , minute: , second: , millisec: } - parsed time. Optional
1745
- */
1746
- var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
1747
- var date;
1748
- var splitRes = splitDateTime(dateFormat, dateTimeString, dateSettings, timeSettings);
1749
- date = $.datepicker._base_parseDate(dateFormat, splitRes[0], dateSettings);
1750
- if (splitRes[1] !== '') {
1751
- var timeString = splitRes[1],
1752
- parsedTime = $.datepicker.parseTime(timeFormat, timeString, timeSettings);
1753
-
1754
- if (parsedTime === null) {
1755
- throw 'Wrong time format';
1756
- }
1757
- return {
1758
- date: date,
1759
- timeObj: parsedTime
1760
- };
1761
- } else {
1762
- return {
1763
- date: date
1764
- };
1765
- }
1766
- };
1767
-
1768
- /*
1769
- * Internal function to set timezone_select to the local timezone
1770
- */
1771
- var selectLocalTimeZone = function(tp_inst, date) {
1772
- if (tp_inst && tp_inst.timezone_select) {
1773
- tp_inst._defaults.useLocalTimezone = true;
1774
- var now = typeof date !== 'undefined' ? date : new Date();
1775
- var tzoffset = $.timepicker.timeZoneOffsetString(now);
1776
- if (tp_inst._defaults.timezoneIso8601) {
1777
- tzoffset = tzoffset.substring(0, 3) + ':' + tzoffset.substring(3);
1778
- }
1779
- tp_inst.timezone_select.val(tzoffset);
1780
- }
1781
- };
1782
-
1783
- /*
1784
- * Create a Singleton Insance
1785
- */
1786
- $.timepicker = new Timepicker();
1787
-
1788
- /**
1789
- * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
1790
- * @param date
1791
- * @return string
1792
- */
1793
- $.timepicker.timeZoneOffsetString = function(date) {
1794
- var off = date.getTimezoneOffset() * -1,
1795
- minutes = off % 60,
1796
- hours = (off - minutes) / 60;
1797
- return (off >= 0 ? '+' : '-') + ('0' + (hours * 101).toString()).slice(-2) + ('0' + (minutes * 101).toString()).slice(-2);
1798
- };
1799
-
1800
- /**
1801
- * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
1802
- * enforce date range limits.
1803
- * n.b. The input value must be correctly formatted (reformatting is not supported)
1804
- * @param Element startTime
1805
- * @param Element endTime
1806
- * @param obj options Options for the timepicker() call
1807
- * @return jQuery
1808
- */
1809
- $.timepicker.timeRange = function(startTime, endTime, options) {
1810
- return $.timepicker.handleRange('timepicker', startTime, endTime, options);
1811
- };
1812
-
1813
- /**
1814
- * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
1815
- * enforce date range limits.
1816
- * @param Element startTime
1817
- * @param Element endTime
1818
- * @param obj options Options for the `timepicker()` call. Also supports `reformat`,
1819
- * a boolean value that can be used to reformat the input values to the `dateFormat`.
1820
- * @param string method Can be used to specify the type of picker to be added
1821
- * @return jQuery
1822
- */
1823
- $.timepicker.dateTimeRange = function(startTime, endTime, options) {
1824
- $.timepicker.dateRange(startTime, endTime, options, 'datetimepicker');
1825
- };
1826
-
1827
- /**
1828
- * Calls `method` on the `startTime` and `endTime` elements, and configures them to
1829
- * enforce date range limits.
1830
- * @param Element startTime
1831
- * @param Element endTime
1832
- * @param obj options Options for the `timepicker()` call. Also supports `reformat`,
1833
- * a boolean value that can be used to reformat the input values to the `dateFormat`.
1834
- * @param string method Can be used to specify the type of picker to be added
1835
- * @return jQuery
1836
- */
1837
- $.timepicker.dateRange = function(startTime, endTime, options, method) {
1838
- method = method || 'datepicker';
1839
- $.timepicker.handleRange(method, startTime, endTime, options);
1840
- };
1841
-
1842
- /**
1843
- * Calls `method` on the `startTime` and `endTime` elements, and configures them to
1844
- * enforce date range limits.
1845
- * @param string method Can be used to specify the type of picker to be added
1846
- * @param Element startTime
1847
- * @param Element endTime
1848
- * @param obj options Options for the `timepicker()` call. Also supports `reformat`,
1849
- * a boolean value that can be used to reformat the input values to the `dateFormat`.
1850
- * @return jQuery
1851
- */
1852
- $.timepicker.handleRange = function(method, startTime, endTime, options) {
1853
- $.fn[method].call(startTime, $.extend({
1854
- onClose: function(dateText, inst) {
1855
- checkDates(this, endTime, dateText);
1856
- },
1857
- onSelect: function(selectedDateTime) {
1858
- selected(this, endTime, 'minDate');
1859
- }
1860
- }, options, options.start));
1861
- $.fn[method].call(endTime, $.extend({
1862
- onClose: function(dateText, inst) {
1863
- checkDates(this, startTime, dateText);
1864
- },
1865
- onSelect: function(selectedDateTime) {
1866
- selected(this, startTime, 'maxDate');
1867
- }
1868
- }, options, options.end));
1869
- // timepicker doesn't provide access to its 'timeFormat' option,
1870
- // nor could I get datepicker.formatTime() to behave with times, so I
1871
- // have disabled reformatting for timepicker
1872
- if (method != 'timepicker' && options.reformat) {
1873
- $([startTime, endTime]).each(function() {
1874
- var format = $(this)[method].call($(this), 'option', 'dateFormat'),
1875
- date = new Date($(this).val());
1876
- if ($(this).val() && date) {
1877
- $(this).val($.datepicker.formatDate(format, date));
1878
- }
1879
- });
1880
- }
1881
- checkDates(startTime, endTime, startTime.val());
1882
-
1883
- function checkDates(changed, other, dateText) {
1884
- if (other.val() && (new Date(startTime.val()) > new Date(endTime.val()))) {
1885
- other.val(dateText);
1886
- }
1887
- }
1888
- selected(startTime, endTime, 'minDate');
1889
- selected(endTime, startTime, 'maxDate');
1890
-
1891
- function selected(changed, other, option) {
1892
- if (!$(changed).val()) {
1893
- return;
1894
- }
1895
- var date = $(changed)[method].call($(changed), 'getDate');
1896
- // timepicker doesn't implement 'getDate' and returns a jQuery
1897
- if (date.getTime) {
1898
- $(other)[method].call($(other), 'option', option, date);
1899
- }
1900
- }
1901
- return $([startTime.get(0), endTime.get(0)]);
1902
- };
1903
-
1904
- /**
1905
- * Log error or data to the console during error or debugging
1906
- * @param Object err pass any type object to log to the console during error or debugging
1907
- * @return void
1908
- */
1909
- $.timepicker.log = function(err){
1910
- if(window.console)
1911
- console.log(err);
1912
- };
1913
-
1914
- /*
1915
- * Keep up with the version
1916
- */
1917
- $.timepicker.version = "1.2";
1918
-
1919
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/jquery.smallipop-0.4.0.min.js DELETED
@@ -1,9 +0,0 @@
1
- /*!
2
- Smallipop (02/05/2013)
3
- Copyright (c) 2011-2013 Small Improvements (http://www.small-improvements.com)
4
-
5
- Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
6
-
7
- @author Sebastian Helzle (sebastian@helzle.net)
8
- */
9
- (function(b){var a;b.smallipop=a={version:"0.4.0",defaults:{autoscrollPadding:200,contentAnimationSpeed:150,cssAnimations:{enabled:false,show:"animated fadeIn",hide:"animated fadeOut"},funcEase:"easeInOutQuad",handleInputs:true,hideDelay:500,hideTrigger:false,hideOnPopupClick:true,hideOnTriggerClick:true,infoClass:"smallipopHint",invertAnimation:false,popupOffset:31,popupYOffset:0,popupDistance:20,popupDelay:100,popupAnimationSpeed:200,preferredPosition:"top",referencedSelector:null,theme:"default",touchSupport:true,triggerAnimationSpeed:150,triggerOnClick:false,onAfterHide:null,onAfterShow:null,onBeforeHide:null,onBeforeShow:null,onTourClose:null,onTourNext:null,onTourPrev:null,windowPadding:30},currentTour:null,lastId:1,nextInstanceId:1,lastScrollCheck:0,labels:{prev:"Back",next:"Next",close:"Close",of:"of"},instances:{},scrollTimer:null,templates:{popup:b.trim(' <div class="smallipop-instance"> <div class="sipContent"/> <div class="sipArrowBorder"/> <div class="sipArrow"/> </div>')},tours:{},_hideSmallipop:function(p){var s,i,m,d,g,c,q,o,h,j,r,f,n,l,k;o=(p!=null?p.target:void 0)?b(p.target):p;n=a.instances;k=[];for(c in n){d=n[c];g=d.data();if(!(q=g.shown)){continue}if(g.isTour&&!d.is(o)){continue}h=b(".smallipop"+q);j=((l=h.data("smallipop"))!=null?l.options:void 0)||a.defaults;m=!j.hideOnTriggerClick&&o.is(h);i=!j.hideOnPopupClick&&d.find(o).length;if(o&&h.length&&(p!=null?p.type:void 0)==="click"&&(m||i)){continue}if(q&&j.hideTrigger){h.stop(true).fadeTo(j.triggerAnimationSpeed,1)}d.data({hideDelayTimer:null,beingShown:false});if(j.cssAnimations.enabled){d.removeClass(j.cssAnimations.show).addClass(j.cssAnimations.hide).data("shown","");if(j.onAfterHide){k.push(window.setTimeout(j.onAfterHide,j.popupAnimationSpeed))}else{k.push(void 0)}}else{s=j.invertAnimation?-1:1;r=g.xDistance*s;f=g.yDistance*s;k.push(d.stop(true).animate({top:"-="+r+"px",left:"+="+f+"px",opacity:0},j.popupAnimationSpeed,j.funcEase,function(){var e;e=b(this);if(!e.data("beingShown")){e.css("display","none").data("shown","")}return typeof j.onAfterHide==="function"?j.onAfterHide():void 0}))}}return k},_showSmallipop:function(f){var c,d;c=b(this).data("smallipop");if(c.popupInstance.data("shown")!==c.id&&((d=!c.type)==="checkbox"||d==="radio")){if(f!=null){f.preventDefault()}}return a._triggerMouseover.call(this)},_onTouchDevice:function(){return typeof Modernizr!=="undefined"&&Modernizr!==null?Modernizr.touch:void 0},_killTimers:function(c){clearTimeout(c.data("hideDelayTimer"));return clearTimeout(c.data("showDelayTimer"))},_refreshPosition:function(){var E,q,n,h,i,c,D,o,B,p,l,m,k,A,s,C,H,F,I,g,x,z,w,j,e,v,y,u,G,r,t,f,d;t=a.instances;d=[];for(A in t){c=t[A];o=c.data();z=o.shown;if(!z){continue}w=b(".smallipop"+z);i=w.data("smallipop").options;c.removeClass(function(J,K){return((K!=null?K.match(/sip\w+/g):void 0)||[]).join(" ")});c.addClass(i.theme);j=b(window);u=G=i.popupDistance;r=i.popupYOffset;q=c.data("position")==="fixed";n=w.offset();k=c.outerHeight();H=c.outerWidth();D=H/2;v=j.width();e=j.height();y=i.windowPadding;g=w.outerWidth();I=w.outerHeight();x=n.top-j.scrollTop();s=n.left+g/2;C=n.top-k+r;F=k+i.popupDistance-r;m=x-F;B=e-x-I-F;p=n.left-H-i.popupOffset;l=v-n.left-g-H;if((f=i.preferredPosition)==="left"||f==="right"){u=0;C+=I/2+k/2;if((i.preferredPosition==="left"&&p>y)||l<y){c.addClass("sipPositionedLeft");s=n.left-H-i.popupOffset;G=-G}else{c.addClass("sipPositionedRight");s=n.left+g+i.popupOffset}}else{G=0;if(s+D>v-y){s-=D*2-i.popupOffset;c.addClass("sipAlignLeft")}else{if(s-D<y){s-=i.popupOffset;c.addClass("sipAlignRight")}else{s-=D}}if((i.preferredPosition==="bottom"&&B>y)||m<y){C+=k+I-2*r;u=-u;r=0;c.addClass("sipAlignBottom")}}if(i.hideTrigger){w.stop(true).fadeTo(i.triggerAnimationSpeed,0)}h=0;E=o.beingShown&&!i.cssAnimations.enabled;if(!E){C-=u;s+=G;u=0;G=0;h=1}if(q){s-=j.scrollLeft();C-=j.scrollTop()}c.data({xDistance:u,yDistance:G}).css({top:C,left:s,display:"block",opacity:h});d.push(a._fadeInPopup(c,{top:"-="+u+"px",left:"+="+G+"px",opacity:1}))}return d},_fadeInPopup:function(d,c){var e,f;e=((f=a._getTrigger(d.data("shown")).data("smallipop"))!=null?f.options:void 0)||a.defaults;if(e.cssAnimations.enabled){d.addClass(e.cssAnimations.show);return window.setTimeout(function(){return a._fadeInPopupFinished(d,e)},e.popupAnimationSpeed)}else{return d.stop(true).animate(c,e.popupAnimationSpeed,e.funcEase,function(){return a._fadeInPopupFinished(d,e)})}},_fadeInPopupFinished:function(d,e){var c;c=d.data();if(c.beingShown){d.data("beingShown",false);return typeof e.onAfterShow==="function"?e.onAfterShow(a._getTrigger(c.shown)):void 0}},_getTrigger:function(c){return b(".smallipop"+c)},_showPopup:function(e,h){var j,i,d,c,f,g;if(h==null){h=""}g=e.data("smallipop");d=g.popupInstance;if(!d.data("triggerHovered")){return}f=d.data("shown");if(f){j=a._getTrigger(f);if(j.length){i=j.data("smallipop").options||a.defaults;if(i.hideTrigger){j.stop(true).fadeTo(i.fadeSpeed,1)}}}c=h||g.hint;if(g.options.referencedContent&&!h){c=b(g.options.referencedContent).html()||c}d.data({beingShown:true,shown:g.id}).find(".sipContent").html(c);d.data("position","").css("position","absolute");if(this._isElementFixed(e)){d.data("position","fixed").css("position","fixed")}if(g.id!==f){d.attr("class","smallipop-instance")}return a._refreshPosition()},_isElementFixed:function(c){var d;d=c;while(d.length&&d[0].nodeName!=="HTML"){if(d.css("position")==="fixed"){return true}d=d.parent()}return false},_triggerMouseover:function(){var h,c,e,d,g,f;d=c=b(this);h=d.hasClass("sipInitialized");if(!h){d=a._getTrigger(c.data("shown"))}if(!d.length){return}g=d.data("smallipop");c=g.popupInstance.data((h?"triggerHovered":"hovered"),true);a._killTimers(c);e=c.data("shown");if(e!==g.id||c.css("opacity")===0){if(typeof(f=g.options).onBeforeShow==="function"){f.onBeforeShow(d)}return c.data("showDelayTimer",setTimeout(function(){return a._showPopup(d)},g.options.popupDelay))}},_triggerMouseout:function(){var h,d,c,e,g,f;e=d=b(this);h=e.hasClass("sipInitialized");if(!h){e=a._getTrigger(d.data("shown"))}if(!e.length){return}g=e.data("smallipop");d=g.popupInstance.data((h?"triggerHovered":"hovered"),false);a._killTimers(d);c=d.data();if(!(c.hovered||c.triggerHovered)){if(typeof(f=g.options).onBeforeHide==="function"){f.onBeforeHide(e)}return d.data("hideDelayTimer",setTimeout(function(){return a._hideSmallipop(d)},g.options.hideDelay))}},_onWindowScroll:function(c){clearTimeout(a.scrollTimer);return a.scrollTimer=setTimeout(a._refreshPosition,250)},setContent:function(e,g){var d,c,f;if(!(e!=null?e.length:void 0)){return}f=e.data("smallipop");d=f.tourTitle;if(d){c=f.popupInstance.find(".smallipop-tour-content")}else{c=f.popupInstance.find(".sipContent")}if(c.html()!==g){return c.stop(true).fadeTo(f.options.contentAnimationSpeed,0,function(){b(this).html(g).fadeTo(f.options.contentAnimationSpeed,1);return a._refreshPosition()})}},_runTour:function(d){var g,e,c,f,j,h;f=d.data("smallipop");c=f!=null?f.tourTitle:void 0;if(!(c&&a.tours[c])){return}a.tours[c].sort(function(k,i){return k.index-i.index});a.currentTour=c;g=a.tours[c];for(e=j=0,h=g.length-1;0<=h?j<=h:j>=h;e=0<=h?++j:--j){if(g[e].id===f.id){return a._tourShow(c,e)}}},_tourShow:function(j,g){var d,e,h,i,l,k,f,c;i=a.tours[j];if(!i){return}f=i[g].trigger;c=f.data("smallipop");k=g>0?'<a href="#" class="smallipop-tour-prev">'+a.labels.prev+"</a>":"";l=g<i.length-1?'<a href="#" class="smallipop-tour-next">'+a.labels.next+"</a>":"";d=g===i.length-1?'<a href="#" class="smallipop-tour-close">'+a.labels.close+"</a>":"";e='<a href="#" class="smallipop-tour-close-icon">&Chi;</a>';h=' <div class="smallipop-tour-content">'+c.hint+"</div> "+e+' <div class="smallipop-tour-footer"> <div class="smallipop-tour-progress"> '+(g+1)+" "+a.labels.of+" "+i.length+" </div> "+k+" "+l+" "+d+' <br style="clear:both;"/> </div>';a._killTimers(c.popupInstance);c.popupInstance.data("triggerHovered",true);return a._showWhenVisible(f,h)},_showWhenVisible:function(c,e){var g,d,f,h;d=c.offset().top;g=d-b(document).scrollTop();h=b(window).height();f=c.data("smallipop").options;if(!this._isElementFixed(c)&&(g<f.autoscrollPadding||g>h-f.autoscrollPadding)){return b("html, body").animate({scrollTop:d-h/2},800,"swing",function(){return a._showPopup(c,e)})}else{return a._showPopup(c,e)}},_tourNext:function(j){var l,h,c,k,m,f,g,d;if(j!=null){j.preventDefault()}l=a.tours[a.currentTour];if(!l){return}c=l[0].popupInstance;k=c.data("shown")||l[0].id;for(h=f=0,g=l.length-2;0<=g?f<=g:f>=g;h=0<=g?++f:--f){if(!(l[h].id===k)){continue}if((d=l[h].trigger.data("smallipop"))!=null){if(typeof(m=d.options).onTourNext==="function"){m.onTourNext(l[h+1].trigger)}}return a._tourShow(a.currentTour,h+1)}},_tourPrev:function(j){var l,h,c,k,m,f,g,d;if(j!=null){j.preventDefault()}l=a.tours[a.currentTour];if(!l){return}c=l[0].popupInstance;k=c.data("shown")||l[0].id;for(h=f=1,g=l.length-1;1<=g?f<=g:f>=g;h=1<=g?++f:--f){if(!(l[h].id===k)){continue}if((d=l[h].trigger.data("smallipop"))!=null){if(typeof(m=d.options).onTourPrev==="function"){m.onTourPrev(l[h-1].trigger)}}return a._tourShow(a.currentTour,h-1)}},_tourClose:function(g){var c,d,f;if(g!=null){g.preventDefault()}c=b(g.target).closest(".smallipop-instance");if((f=a._getTrigger(c.data("shown")).data("smallipop"))!=null){if(typeof(d=f.options).onTourClose==="function"){d.onTourClose()}}return a._hideSmallipop(c)},_destroy:function(c){return c.each(function(){var e,d;d=b(this);e=d.data("smallipop");if(e){return d.unbind(".smallipop").data("smallipop",{}).removeClass("smallipop sipInitialized smallipop"+e.id+" "+e.options.theme)}})},_onWindowKeyUp:function(j){var f,g,h,i,c,d;h=(i=j!=null?j.target.tagName.toLowerCase():void 0)==="input"||i==="textarea";switch(j.which){case 27:c=a.instances;d=[];for(g in c){f=c[g];d.push(a._hideSmallipop(f))}return d;break;case 37:if(!h){return a._tourPrev()}break;case 39:if(!h){return a._tourNext()}}},_getInstance:function(e,d){var c;if(e==null){e="default"}if(d==null){d=false}if(a.instances[e]){return a.instances[e]}c=b(a.templates.popup).css("opacity",0).attr("id","smallipop"+(a.nextInstanceId++)).addClass("smallipop-instance").data({xDistance:0,yDistance:0,isTour:d}).bind({"mouseover.smallipop":a._triggerMouseover,"mouseout.smallipop":a._triggerMouseout});b("body").append(c);if(d){c.delegate(".smallipop-tour-prev","click.smallipop",a._tourPrev).delegate(".smallipop-tour-next","click.smallipop",a._tourNext).delegate(".smallipop-tour-close, .smallipop-tour-close-icon","click.smallipop",a._tourClose)}else{c.delegate("a","click.smallipop",a._hideSmallipop)}if(a.nextInstanceId===2){b(document).bind("click.smallipop touchend.smallipop",a._hideSmallipop);b(window).bind({"resize.smallipop":a._refreshPosition,"scroll.smallipop":a._onWindowScroll,keyup:a._onWindowKeyUp})}return a.instances[e]=c}};if(!b.easing.easeInOutQuad){b.easing.easeInOutQuad=function(f,g,e,i,h){if((g/=h/2)<1){return i/2*g*g+e}else{return -i/2*((--g)*(g-2)-1)+e}}}return b.fn.smallipop=function(d,e){var c;if(d==null){d={}}if(e==null){e=""}if(typeof d==="string"){switch(d.toLowerCase()){case"show":a._showSmallipop.call(this.first().get(0));break;case"hide":a._hideSmallipop(this.first().get(0));break;case"destroy":a._destroy(this);break;case"tour":a._runTour(this.first());break;case"update":a.setContent(this.first(),e)}return this}d=b.extend({},a.defaults,d);if((typeof Modernizr!=="undefined"&&Modernizr!==null?Modernizr.cssanimations:void 0)===false){d.cssAnimations.enabled=false}c=a._getInstance();return this.each(function(){var l,i,r,n,g,s,h,k,f,o,j,m,p,q;s=b(this);h=s[0].tagName.toLowerCase();p=s.attr("type");f=s.data();r=e||s.find("."+d.infoClass).html()||s.attr("title");if(r&&!s.hasClass("sipInitialized")){i=a.lastId++;o={};m=c;j=b.extend(true,{},d);for(n in f){q=f[n];if(!(n.indexOf("smallipop")>=0)){continue}g=n.replace("smallipop","");g=g.substr(0,1).toLowerCase()+g.substr(1);j[g]=q}l=j.handleInputs&&(h==="input"||h==="select"||h==="textarea");if(l){j.hideOnTriggerClick=false;o["focus.smallipop"]=a._triggerMouseover;o["blur.smallipop"]=a._triggerMouseout}else{o["mouseout.smallipop"]=a._triggerMouseout}if(j.triggerOnClick||(j.touchSupport&&a._onTouchDevice())){o["click.smallipop"]=a._showSmallipop}else{o["click.smallipop"]=a._triggerMouseout;o["mouseover.smallipop"]=a._triggerMouseover}if(j.tourIndex){k=j.tourTitle||"defaultTour";o={};j.hideOnTriggerClick=false;j.hideOnPopupClick=false;m=a._getInstance(k,true);if(!a.tours[k]){a.tours[k]=[]}a.tours[k].push({index:j.tourIndex||0,id:i,trigger:s,popupInstance:m})}s.addClass("sipInitialized smallipop"+i).attr("title","").data("smallipop",{id:i,hint:r,options:j,tagName:h,type:p,tourTitle:k,popupInstance:m}).bind(o);if(!j.hideOnTriggerClick){return s.delegate("a","click.smallipop",a._hideSmallipop)}}})}})(jQuery);
 
 
 
 
 
 
 
 
 
assets/js/jquery.validate.min.js DELETED
@@ -1,4 +0,0 @@
1
- /*! jQuery Validation Plugin - v1.11.0 - 2/4/2013
2
- * https://github.com/jzaefferer/jquery-validation
3
- * Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */
4
- (function(e){e.extend(e.fn,{validate:function(t){if(!this.length){t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.");return}var n=e.data(this[0],"validator");return n?n:(this.attr("novalidate","novalidate"),n=new e.validator(t,this[0]),e.data(this[0],"validator",n),n.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){n.settings.submitHandler&&(n.submitButton=t.target),e(t.target).hasClass("cancel")&&(n.cancelSubmit=!0)}),this.submit(function(t){function r(){var r;return n.settings.submitHandler?(n.submitButton&&(r=e("<input type='hidden'/>").attr("name",n.submitButton.name).val(n.submitButton.value).appendTo(n.currentForm)),n.settings.submitHandler.call(n,n.currentForm,t),n.submitButton&&r.remove(),!1):!0}return n.settings.debug&&t.preventDefault(),n.cancelSubmit?(n.cancelSubmit=!1,r()):n.form()?n.pendingRequest?(n.formSubmitted=!0,!1):r():(n.focusInvalid(),!1)})),n)},valid:function(){if(e(this[0]).is("form"))return this.validate().form();var t=!0,n=e(this[0].form).validate();return this.each(function(){t&=n.element(this)}),t},removeAttrs:function(t){var n={},r=this;return e.each(t.split(/\s/),function(e,t){n[t]=r.attr(t),r.removeAttr(t)}),n},rules:function(t,n){var r=this[0];if(t){var i=e.data(r.form,"validator").settings,s=i.rules,o=e.validator.staticRules(r);switch(t){case"add":e.extend(o,e.validator.normalizeRule(n)),s[r.name]=o,n.messages&&(i.messages[r.name]=e.extend(i.messages[r.name],n.messages));break;case"remove":if(!n)return delete s[r.name],o;var u={};return e.each(n.split(/\s/),function(e,t){u[t]=o[t],delete o[t]}),u}}var a=e.validator.normalizeRules(e.extend({},e.validator.classRules(r),e.validator.attributeRules(r),e.validator.dataRules(r),e.validator.staticRules(r)),r);if(a.required){var f=a.required;delete a.required,a=e.extend({required:f},a)}return a}}),e.extend(e.expr[":"],{blank:function(t){return!e.trim(""+t.value)},filled:function(t){return!!e.trim(""+t.value)},unchecked:function(e){return!e.checked}}),e.validator=function(t,n){this.settings=e.extend(!0,{},e.validator.defaults,t),this.currentForm=n,this.init()},e.validator.format=function(t,n){return arguments.length===1?function(){var n=e.makeArray(arguments);return n.unshift(t),e.validator.format.apply(this,n)}:(arguments.length>2&&n.constructor!==Array&&(n=e.makeArray(arguments).slice(1)),n.constructor!==Array&&(n=[n]),e.each(n,function(e,n){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return n})}),t)},e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e,t){this.lastActive=e,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(e)).hide())},onfocusout:function(e,t){!this.checkable(e)&&(e.name in this.submitted||!this.optional(e))&&this.element(e)},onkeyup:function(e,t){if(t.which===9&&this.elementValue(e)==="")return;(e.name in this.submitted||e===this.lastElement)&&this.element(e)},onclick:function(e,t){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).addClass(n).removeClass(r):e(t).addClass(n).removeClass(r)},unhighlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).removeClass(n).addClass(r):e(t).removeClass(n).addClass(r)}},setDefaults:function(t){e.extend(e.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function r(t){var n=e.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");n.settings[r]&&n.settings[r].call(n,this[0],t)}this.labelContainer=e(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm),this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var t=this.groups={};e.each(this.settings.groups,function(n,r){typeof r=="string"&&(r=r.split(/\s/)),e.each(r,function(e,r){t[r]=n})});var n=this.settings.rules;e.each(n,function(t,r){n[t]=e.validator.normalizeRule(r)}),e(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",r).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",r),this.settings.invalidHandler&&e(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),e.extend(this.submitted,this.errorMap),this.invalid=e.extend({},this.errorMap),this.valid()||e(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t)),this.lastElement=t,this.prepareElement(t),this.currentElements=e(t);var n=this.check(t)!==!1;return n?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),n},showErrors:function(t){if(t){e.extend(this.errorMap,t),this.errorList=[];for(var n in t)this.errorList.push({message:t[n],element:this.findByName(n)[0]});this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){e.fn.resetForm&&e(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t=0;for(var n in e)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&e.grep(this.errorList,function(e){return e.element.name===t.name}).length===1&&t},elements:function(){var t=this,n={};return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in n||!t.objectLength(e(this).rules())?!1:(n[this.name]=!0,!0)})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return e(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=e([]),this.toHide=e([]),this.currentElements=e([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(t){var n=e(t).attr("type"),r=e(t).val();return n==="radio"||n==="checkbox"?e("input[name='"+e(t).attr("name")+"']:checked").val():typeof r=="string"?r.replace(/\r/g,""):r},check:function(t){t=this.validationTargetFor(this.clean(t));var n=e(t).rules(),r=!1,i=this.elementValue(t),s;for(var o in n){var u={method:o,parameters:n[o]};try{s=e.validator.methods[o].call(this,i,t,u.parameters);if(s==="dependency-mismatch"){r=!0;continue}r=!1;if(s==="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!s)return this.formatAndAdd(t,u),!1}catch(a){throw this.settings.debug&&window.console&&console.log("Exception occured when checking element "+t.id+", check the '"+u.method+"' method.",a),a}}if(r)return;return this.objectLength(n)&&this.successList.push(t),!0},customDataMessage:function(t,n){return e(t).data("msg-"+n.toLowerCase())||t.attributes&&e(t).attr("data-msg-"+n.toLowerCase())},customMessage:function(e,t){var n=this.settings.messages[e];return n&&(n.constructor===String?n:n[t])},findDefined:function(){for(var e=0;e<arguments.length;e++)if(arguments[e]!==undefined)return arguments[e];return undefined},defaultMessage:function(t,n){return this.findDefined(this.customMessage(t.name,n),this.customDataMessage(t,n),!this.settings.ignoreTitle&&t.title||undefined,e.validator.messages[n],"<strong>Warning: No message defined for "+t.name+"</strong>")},formatAndAdd:function(t,n){var r=this.defaultMessage(t,n.method),i=/\$?\{(\d+)\}/g;typeof r=="function"?r=r.call(this,n.parameters,t):i.test(r)&&(r=e.validator.format(r.replace(i,"{$1}"),n.parameters)),this.errorList.push({message:r,element:t}),this.errorMap[t.name]=r,this.submitted[t.name]=r},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t;for(e=0;this.errorList[e];e++){var n=this.errorList[e];this.settings.highlight&&this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass),this.showLabel(n.element,n.message)}this.errorList.length&&(this.toShow=this.toShow.add(this.containers));if(this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return e(this.errorList).map(function(){return this.element})},showLabel:function(t,n){var r=this.errorsFor(t);r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(n)):(r=e("<"+this.settings.errorElement+">").attr("for",this.idOrName(t)).addClass(this.settings.errorClass).html(n||""),this.settings.wrapper&&(r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(r).length||(this.settings.errorPlacement?this.settings.errorPlacement(r,e(t)):r.insertAfter(t))),!n&&this.settings.success&&(r.text(""),typeof this.settings.success=="string"?r.addClass(this.settings.success):this.settings.success(r,t)),this.toShow=this.toShow.add(r)},errorsFor:function(t){var n=this.idOrName(t);return this.errors().filter(function(){return e(this).attr("for")===n})},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name).not(this.settings.ignore)[0]),e},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name='"+t+"']")},getLength:function(t,n){switch(n.nodeName.toLowerCase()){case"select":return e("option:selected",n).length;case"input":if(this.checkable(n))return this.findByName(n.name).filter(":checked").length}return t.length},depend:function(e,t){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,t):!0},dependTypes:{"boolean":function(e,t){return e},string:function(t,n){return!!e(t,n.form).length},"function":function(e,t){return e(t)}},optional:function(t){var n=this.elementValue(t);return!e.validator.methods.required.call(this,n,t)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,this.pending[e.name]=!0)},stopRequest:function(t,n){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],n&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(e(this.currentForm).submit(),this.formSubmitted=!1):!n&&this.pendingRequest===0&&this.formSubmitted&&(e(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,n){t.constructor===String?this.classRuleSettings[t]=n:e.extend(this.classRuleSettings,t)},classRules:function(t){var n={},r=e(t).attr("class");return r&&e.each(r.split(" "),function(){this in e.validator.classRuleSettings&&e.extend(n,e.validator.classRuleSettings[this])}),n},attributeRules:function(t){var n={},r=e(t);for(var i in e.validator.methods){var s;i==="required"?(s=r.get(0).getAttribute(i),s===""&&(s=!0),s=!!s):s=r.attr(i),s?n[i]=s:r[0].getAttribute("type")===i&&(n[i]=!0)}return n.maxlength&&/-1|2147483647|524288/.test(n.maxlength)&&delete n.maxlength,n},dataRules:function(t){var n,r,i={},s=e(t);for(n in e.validator.methods)r=s.data("rule-"+n.toLowerCase()),r!==undefined&&(i[n]=r);return i},staticRules:function(t){var n={},r=e.data(t.form,"validator");return r.settings.rules&&(n=e.validator.normalizeRule(r.settings.rules[t.name])||{}),n},normalizeRules:function(t,n){return e.each(t,function(r,i){if(i===!1){delete t[r];return}if(i.param||i.depends){var s=!0;switch(typeof i.depends){case"string":s=!!e(i.depends,n.form).length;break;case"function":s=i.depends.call(n,n)}s?t[r]=i.param!==undefined?i.param:!0:delete t[r]}}),e.each(t,function(r,i){t[r]=e.isFunction(i)?i(n):i}),e.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),e.each(["rangelength"],function(){var n;t[this]&&(e.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:typeof t[this]=="string"&&(n=t[this].split(/[\s,]+/),t[this]=[Number(n[0]),Number(n[1])]))}),e.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if(typeof t=="string"){var n={};e.each(t.split(/\s/),function(){n[this]=!0}),t=n}return t},addMethod:function(t,n,r){e.validator.methods[t]=n,e.validator.messages[t]=r!==undefined?r:e.validator.messages[t],n.length<3&&e.validator.addClassRules(t,e.validator.normalizeRule(t))},methods:{required:function(t,n,r){if(!this.depend(r,n))return"dependency-mismatch";if(n.nodeName.toLowerCase()==="select"){var i=e(n).val();return i&&i.length>0}return this.checkable(n)?this.getLength(t,n)>0:e.trim(t).length>0},remote:function(t,n,r){if(this.optional(n))return"dependency-mismatch";var i=this.previousValue(n);this.settings.messages[n.name]||(this.settings.messages[n.name]={}),i.originalMessage=this.settings.messages[n.name].remote,this.settings.messages[n.name].remote=i.message,r=typeof r=="string"&&{url:r}||r;if(i.old===t)return i.valid;i.old=t;var s=this;this.startRequest(n);var o={};return o[n.name]=t,e.ajax(e.extend(!0,{url:r,mode:"abort",port:"validate"+n.name,dataType:"json",data:o,success:function(r){s.settings.messages[n.name].remote=i.originalMessage;var o=r===!0||r==="true";if(o){var u=s.formSubmitted;s.prepareElement(n),s.formSubmitted=u,s.successList.push(n),delete s.invalid[n.name],s.showErrors()}else{var a={},f=r||s.defaultMessage(n,"remote");a[n.name]=i.message=e.isFunction(f)?f(t):f,s.invalid[n.name]=!0,s.showErrors(a)}i.valid=o,s.stopRequest(n,o)}},r)),"pending"},minlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r},maxlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i<=r},rangelength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r[0]&&i<=r[1]},min:function(e,t,n){return this.optional(t)||e>=n},max:function(e,t,n){return this.optional(t)||e<=n},range:function(e,t,n){return this.optional(t)||e>=n[0]&&e<=n[1]},email:function(e,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e)},url:function(e,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test((new Date(e)).toString())},dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(e)},number:function(e,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(e))return!1;var n=0,r=0,i=!1;e=e.replace(/\D/g,"");for(var s=e.length-1;s>=0;s--){var o=e.charAt(s);r=parseInt(o,10),i&&(r*=2)>9&&(r-=9),n+=r,i=!i}return n%10===0},equalTo:function(t,n,r){var i=e(r);return this.settings.onfocusout&&i.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){e(n).valid()}),t===i.val()}}}),e.format=e.validator.format})(jQuery),function(e){var t={};if(e.ajaxPrefilter)e.ajaxPrefilter(function(e,n,r){var i=e.port;e.mode==="abort"&&(t[i]&&t[i].abort(),t[i]=r)});else{var n=e.ajax;e.ajax=function(r){var i=("mode"in r?r:e.ajaxSettings).mode,s=("port"in r?r:e.ajaxSettings).port;return i==="abort"?(t[s]&&t[s].abort(),t[s]=n.apply(this,arguments)):n.apply(this,arguments)}}}(jQuery),function(e){e.extend(e.fn,{validateDelegate:function(t,n,r){return this.bind(n,function(n){var i=e(n.target);if(i.is(t))return r.apply(i,arguments)})}})}(jQuery);
 
 
 
 
assets/js/subscriptions.js DELETED
@@ -1,306 +0,0 @@
1
- (function($) {
2
-
3
- var subscription = {
4
-
5
- init: function() {
6
-
7
- $('input#wpuf-recuring-pay').on('click', this.showSubscriptionRecurring );
8
-
9
- $('input#wpuf-trial-status').on('click', this.showSubscriptionPack );
10
-
11
- $('.wpuf-coupon-info-wrap').on( 'click','a.wpuf-apply-coupon', this.couponApply );
12
-
13
- $('.wpuf-coupon-info-wrap').on( 'click','a.wpuf-copon-show', this.couponShow );
14
-
15
- $('.wpuf-coupon-info-wrap').on( 'click','a.wpuf-copon-cancel', this.couponCancel );
16
-
17
- $('.wpuf-assing-pack-btn').on( 'click', this.showPackDropdown );
18
-
19
- $('.wpuf-delete-pack-btn').on( 'click', this.deletePack );
20
-
21
- $('.wpuf-disabled-link').click( this.packAlert );
22
-
23
- //on change enable expiration check status
24
- this.changeExpirationFieldVisibility(':checkbox#wpuf-enable_post_expiration');
25
-
26
- $('.wpuf-metabox-post_expiration').on('change',':checkbox#wpuf-enable_post_expiration',this.changeExpirationFieldVisibility);
27
- //on change expiration type drop down
28
- //this.setTimeExpiration('select#wpuf-expiration_time_type');
29
- $('.wpuf-metabox-post_expiration').on('change','select#wpuf-expiration_time_type',this.setTimeExpiration);
30
-
31
- },
32
-
33
- packAlert : function () {
34
- alert( 'Please Cancel Your Currently Active Pack first ! ' );
35
- },
36
-
37
- showPackDropdown: function(e) {
38
- e.preventDefault();
39
- var self = $(this),
40
- wrap = self.parents('.wpuf-user-subscription'),
41
- sub_dropdown = wrap.find('.wpuf-pack-dropdown'),
42
- sub_details = wrap.find('.wpuf-user-sub-info'),
43
- cancel_btn = wrap.find('.wpuf-cancel-pack'),
44
- add_btn = wrap.find('.wpuf-add-pack');
45
-
46
- if ( sub_dropdown.attr( 'disabled' ) === 'disabled' ) {
47
- sub_dropdown.show().removeAttr('disabled');
48
- sub_details.hide().attr('disabled', true );
49
- cancel_btn.show();
50
- add_btn.hide();
51
- } else {
52
- sub_details.show().removeAttr('disabled');
53
- sub_dropdown.hide().attr('disabled', true );
54
- cancel_btn.hide();
55
- add_btn.show();
56
- }
57
-
58
- },
59
-
60
- deletePack: function(e){
61
- var userid = $(e.target).attr('data-userid');
62
- $.post(
63
- ajaxurl,
64
- {
65
- 'action' : 'wpuf_delete_user_package',
66
- 'userid' : userid
67
- },
68
- function(data){
69
- if(data){
70
- $('.wpuf-user-sub-info').remove();
71
- $(e.target).remove();
72
- }
73
- }
74
- );
75
-
76
- },
77
-
78
- couponCancel: function(e) {
79
-
80
- e.preventDefault();
81
-
82
- var self = $(this),
83
-
84
- data = {
85
-
86
- action: 'coupon_cancel',
87
-
88
- _wpnonce: wpuf_frontend.nonce,
89
-
90
- pack_id: self.data('pack_id')
91
-
92
- },
93
-
94
- coupon_field = self.parents('.wpuf-coupon-info-wrap').find('input.wpuf-coupon-field');
95
-
96
-
97
-
98
- coupon_field.addClass('wpuf-coupon-field-spinner');
99
-
100
- $.post( wpuf_frontend.ajaxurl, data, function( res ) {
101
-
102
- coupon_field.removeClass('wpuf-coupon-field-spinner');
103
-
104
- if ( res.success ) {
105
-
106
- $('.wpuf-pack-inner' ).html( res.data.append_data );
107
-
108
- $('.wpuf-coupon-id-field').val('');
109
-
110
- var coupon_wrap = self.closest('.wpuf-copon-wrap');
111
-
112
- coupon_wrap.hide();
113
-
114
- coupon_wrap.siblings('.wpuf-copon-show').show();
115
-
116
- }
117
-
118
- });
119
-
120
-
121
-
122
- },
123
-
124
-
125
-
126
- couponShow: function(e) {
127
-
128
- e.preventDefault();
129
-
130
- var self = $(this);
131
-
132
- self.hide();
133
-
134
- self.parents('.wpuf-coupon-info-wrap').find('.wpuf-copon-wrap').show();
135
-
136
- },
137
-
138
-
139
-
140
- couponApply: function(e) {
141
-
142
- e.preventDefault();
143
-
144
- var self = $(this),
145
-
146
- coupon_field = self.parents('.wpuf-coupon-info-wrap').find('input.wpuf-coupon-field'),
147
-
148
- coupon = coupon_field.val();
149
-
150
- if ( coupon === '' ) {
151
-
152
- return;
153
-
154
- }
155
-
156
- var data = {
157
-
158
- action: 'coupon_apply',
159
-
160
- _wpnonce: wpuf_frontend.nonce,
161
-
162
- coupon: coupon,
163
-
164
- pack_id: self.data('pack_id')
165
-
166
- };
167
-
168
-
169
-
170
- if ( self.attr('disabled') === 'disabled' ) {
171
-
172
- //return;
173
-
174
- }
175
-
176
- self.attr( 'disabled', true );
177
-
178
- coupon_field.addClass('wpuf-coupon-field-spinner');
179
-
180
-
181
-
182
- $.post( wpuf_frontend.ajaxurl, data, function( res ) {
183
-
184
- coupon_field.removeClass('wpuf-coupon-field-spinner');
185
-
186
- if ( res.success ) {
187
-
188
-
189
-
190
- $('.wpuf-pack-inner' ).html( res.data.append_data );
191
-
192
- $('.wpuf-coupon-id-field').val( res.data.coupon_id );
193
-
194
- if ( res.data.amount <= 0 ) {
195
-
196
- $('.wpuf-nullamount-hide').hide();
197
-
198
- }
199
-
200
- } else {
201
-
202
- $('.wpuf-subscription-error').html(res.data.message);
203
-
204
- }
205
-
206
- });
207
-
208
- },
209
-
210
-
211
-
212
- showSubscriptionRecurring: function() {
213
-
214
-
215
-
216
- var self = $(this),
217
-
218
- wrap = self.parents('table.form-table'),
219
-
220
- pack_child = wrap.find('.wpuf-recurring-child'),
221
-
222
- trial_checkbox = wrap.find( 'input#wpuf-trial-status'),
223
-
224
- trial_child = wrap.find('.wpuf-trial-child'),
225
-
226
- expire_field = wrap.find('.wpuf-subcription-expire');
227
-
228
-
229
-
230
- if ( self.is(':checked') ) {
231
-
232
- if ( trial_checkbox.is(':checked') ) {
233
-
234
- trial_child.show();
235
-
236
- }
237
-
238
- pack_child.show();
239
-
240
- expire_field.hide();
241
-
242
- } else {
243
-
244
- trial_child.hide();
245
-
246
- pack_child.hide();
247
-
248
- expire_field.show();
249
-
250
- }
251
-
252
- },
253
-
254
-
255
-
256
- showSubscriptionPack: function() {
257
-
258
- var self = $(this),
259
-
260
- pack_status = self.closest('table.form-table').find('.wpuf-trial-child');
261
-
262
- if ( self.is(':checked') ) {
263
-
264
- pack_status.show();
265
-
266
- } else {
267
-
268
- pack_status.hide();
269
-
270
- }
271
-
272
- },
273
-
274
- setTimeExpiration: function(e){
275
- var timeArray = {
276
- 'day' : 30,
277
- 'month' : 12,
278
- 'year': 100
279
- };
280
- $('#wpuf-expiration_time_value').html('');
281
- var timeVal = e.target?$(e.target).val():$(e).val();
282
- for(var time = 1; time <= timeArray[timeVal]; time++){
283
- $('#wpuf-expiration_time_value').append('<option>'+ time +'</option>');
284
- }
285
- },
286
-
287
- changeExpirationFieldVisibility : function(e){
288
-
289
- var checkbox_obj = e.target? $(e.target) : $(e);
290
-
291
- if ( checkbox_obj.is(':checked') ) {
292
- $('.wpuf_expiration_field').show();
293
- } else {
294
- $('.wpuf_expiration_field').hide();
295
- }
296
- }
297
-
298
- };
299
-
300
- if ( typeof datepicker === 'function') {
301
- $('.wpuf-date-picker').datepicker({ dateFormat: "yy-mm-dd" });
302
- }
303
-
304
- subscription.init();
305
-
306
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/upload.js DELETED
@@ -1,214 +0,0 @@
1
- ;(function($) {
2
-
3
- /**
4
- * Upload handler helper
5
- *
6
- * @param string {browse_button} browse_button ID of the pickfile
7
- * @param string {container} container ID of the wrapper
8
- * @param int {max} maximum number of file uplaods
9
- * @param string {type}
10
- */
11
- window.WPUF_Uploader = function (browse_button, container, max, type, allowed_type, max_file_size) {
12
- this.removed_files = [],
13
- this.container = container;
14
- this.browse_button = browse_button;
15
- this.max = max || 1;
16
- this.count = $('#' + container).find('.wpuf-attachment-list > li').length; //count how many items are there
17
- this.perFileCount = 0; //file count on each upload
18
-
19
- //if no element found on the page, bail out
20
- if( !$('#'+browse_button).length ) {
21
- return;
22
- }
23
-
24
- //instantiate the uploader
25
- this.uploader = new plupload.Uploader({
26
- runtimes: 'html5,html4',
27
- browse_button: browse_button,
28
- container: container,
29
- multipart: true,
30
- multipart_params: {
31
- action: 'wpuf_file_upload',
32
- form_id: $( '#' + browse_button ).data('form_id')
33
- },
34
- max_file_count : 2,
35
- multiple_queues: false,
36
- multi_selection: ( ( browse_button == 'wpuf-avatar-pickfiles' || browse_button == 'wpuf-featured_image-pickfiles' ) ? false : true ),
37
- urlstream_upload: true,
38
- file_data_name: 'wpuf_file',
39
- max_file_size: max_file_size + 'kb',
40
- url: wpuf_frontend_upload.plupload.url + '&type=' + type,
41
- flash_swf_url: wpuf_frontend_upload.flash_swf_url,
42
- filters: [{
43
- title: 'Allowed Files',
44
- extensions: allowed_type
45
- }]
46
- });
47
-
48
- //attach event handlers
49
- this.uploader.bind('Init', $.proxy(this, 'init'));
50
- this.uploader.bind('FilesAdded', $.proxy(this, 'added'));
51
- this.uploader.bind('QueueChanged', $.proxy(this, 'upload'));
52
- this.uploader.bind('UploadProgress', $.proxy(this, 'progress'));
53
- this.uploader.bind('Error', $.proxy(this, 'error'));
54
- this.uploader.bind('FileUploaded', $.proxy(this, 'uploaded'));
55
-
56
- this.uploader.init();
57
-
58
- $('#' + container).on('click', 'a.attachment-delete', $.proxy(this.removeAttachment, this));
59
- };
60
-
61
- WPUF_Uploader.prototype = {
62
-
63
- init: function (up, params) {
64
- this.showHide();
65
- $('#' + this.container).prepend('<div class="wpuf-file-warning"></div>');
66
- },
67
-
68
- showHide: function () {
69
-
70
- if ( this.count >= this.max) {
71
-
72
- if ( this.count > this.max ) {
73
- $('#' + this.container + ' .wpuf-file-warning').html( wpuf_frontend_upload.warning );
74
- } else {
75
- $('#' + this.container + ' .wpuf-file-warning').html( wpuf_frontend_upload.warning );
76
- }
77
-
78
- $('#' + this.container).find('.file-selector').hide();
79
-
80
- return;
81
- };
82
- $('#' + this.container + ' .wpuf-file-warning').html( '' );
83
- $('#' + this.container).find('.file-selector').show();
84
- },
85
-
86
- added: function (up, files) {
87
- var $container = $('#' + this.container).find('.wpuf-attachment-upload-filelist');
88
-
89
- this.showHide();
90
-
91
- $.each(files, function(i, file) {
92
- $container.append(
93
- '<div class="upload-item" id="' + file.id + '"><div class="progress progress-striped active"><div class="bar"></div></div><div class="filename original">' +
94
- file.name + ' (' + plupload.formatSize(file.size) + ') <b></b>' +
95
- '</div></div>');
96
- });
97
-
98
- up.refresh(); // Reposition Flash/Silverlight
99
- up.start();
100
- },
101
-
102
- upload: function (uploader) {
103
-
104
-
105
- this.count = uploader.files.length - this.removed_files.length ;
106
- this.showHide();
107
-
108
-
109
- },
110
-
111
- progress: function (up, file) {
112
- var item = $('#' + file.id);
113
-
114
- $('.bar', item).css({ width: file.percent + '%' });
115
- $('.percent', item).html( file.percent + '%' );
116
- },
117
-
118
- error: function (up, error) {
119
- $('#' + this.container).find('#' + error.file.id).remove();
120
-
121
- var msg = '';
122
- switch (error.code) {
123
- case -600:
124
- msg = wpuf_frontend_upload.plupload.size_error;
125
- break;
126
-
127
- case -601:
128
- msg = wpuf_frontend_upload.plupload.type_error;
129
- break;
130
-
131
- default:
132
- msg = 'Error #' + error.code + ': ' + error.message;
133
- break;
134
- }
135
-
136
- alert(msg);
137
-
138
- this.count -= 1;
139
- this.showHide();
140
- this.uploader.refresh();
141
- },
142
-
143
- uploaded: function (up, file, response) {
144
- // var res = $.parseJSON(response.response);
145
- var self = this;
146
-
147
- $('#' + file.id + " b").html("100%");
148
- $('#' + file.id).remove();
149
-
150
- if(response.response !== 'error') {
151
-
152
- this.perFileCount++;
153
- var $container = $('#' + this.container).find('.wpuf-attachment-list');
154
- $container.append(response.response);
155
-
156
- if ( this.perFileCount > this.max ) {
157
- var attach_id = $('.wpuf-image-wrap:last a.attachment-delete',$container).data('attach_id');
158
- self.removeExtraAttachment(attach_id);
159
- $('.wpuf-image-wrap',$container).last().remove();
160
- this.perFileCount--;
161
- }
162
-
163
- } else {
164
- alert(response.error);
165
-
166
- this.count -= 1;
167
- this.showHide();
168
- }
169
- },
170
-
171
- removeAttachment: function(e) {
172
- e.preventDefault();
173
-
174
- var self = this,
175
- el = $(e.currentTarget);
176
-
177
- if ( confirm(wpuf_frontend_upload.confirmMsg) ) {
178
- var data = {
179
- 'attach_id' : el.data('attach_id'),
180
- 'nonce' : wpuf_frontend_upload.nonce,
181
- 'action' : 'wpuf_file_del'
182
- };
183
- this.removed_files.push(data);
184
- jQuery.post(wpuf_frontend_upload.ajaxurl, data, function() {
185
- self.perFileCount--;
186
- el.parent().parent().remove();
187
-
188
- self.count -= 1;
189
- self.showHide();
190
- self.uploader.refresh();
191
- });
192
- }
193
- },
194
-
195
- removeExtraAttachment : function( attach_id ) {
196
-
197
-
198
- var self = this;
199
-
200
- var data = {
201
- 'attach_id' : attach_id,
202
- 'nonce' : wpuf_frontend_upload.nonce,
203
- 'action' : 'wpuf_file_del'
204
- };
205
- this.removed_files.push(data);
206
- jQuery.post(wpuf_frontend_upload.ajaxurl, data, function() {
207
- self.count -= 1;
208
- self.showHide();
209
- self.uploader.refresh();
210
- });
211
- }
212
-
213
- };
214
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/upload.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a){window.WPUF_Uploader=function(b,c,d,e,f,g){this.removed_files=[],this.container=c,this.browse_button=b,this.max=d||1,this.count=a("#"+c).find(".wpuf-attachment-list > li").length,this.perFileCount=0,a("#"+b).length&&(this.uploader=new plupload.Uploader({runtimes:"html5,html4",browse_button:b,container:c,multipart:!0,multipart_params:{action:"wpuf_file_upload",form_id:a("#"+b).data("form_id")},max_file_count:2,multiple_queues:!1,multi_selection:"wpuf-avatar-pickfiles"!=b&&"wpuf-featured_image-pickfiles"!=b,urlstream_upload:!0,file_data_name:"wpuf_file",max_file_size:g+"kb",url:wpuf_frontend_upload.plupload.url+"&type="+e,flash_swf_url:wpuf_frontend_upload.flash_swf_url,filters:[{title:"Allowed Files",extensions:f}]}),this.uploader.bind("Init",a.proxy(this,"init")),this.uploader.bind("FilesAdded",a.proxy(this,"added")),this.uploader.bind("QueueChanged",a.proxy(this,"upload")),this.uploader.bind("UploadProgress",a.proxy(this,"progress")),this.uploader.bind("Error",a.proxy(this,"error")),this.uploader.bind("FileUploaded",a.proxy(this,"uploaded")),this.uploader.init(),a("#"+c).on("click","a.attachment-delete",a.proxy(this.removeAttachment,this)))},WPUF_Uploader.prototype={init:function(b,c){this.showHide(),a("#"+this.container).prepend('<div class="wpuf-file-warning"></div>')},showHide:function(){if(this.count>=this.max)return this.count,this.max,a("#"+this.container+" .wpuf-file-warning").html(wpuf_frontend_upload.warning),void a("#"+this.container).find(".file-selector").hide();a("#"+this.container+" .wpuf-file-warning").html(""),a("#"+this.container).find(".file-selector").show()},added:function(b,c){var d=a("#"+this.container).find(".wpuf-attachment-upload-filelist");this.showHide(),a.each(c,function(a,b){d.append('<div class="upload-item" id="'+b.id+'"><div class="progress progress-striped active"><div class="bar"></div></div><div class="filename original">'+b.name+" ("+plupload.formatSize(b.size)+") <b></b></div></div>")}),b.refresh(),b.start()},upload:function(a){this.count=a.files.length-this.removed_files.length,this.showHide()},progress:function(b,c){var d=a("#"+c.id);a(".bar",d).css({width:c.percent+"%"}),a(".percent",d).html(c.percent+"%")},error:function(b,c){a("#"+this.container).find("#"+c.file.id).remove();var d="";switch(c.code){case-600:d=wpuf_frontend_upload.plupload.size_error;break;case-601:d=wpuf_frontend_upload.plupload.type_error;break;default:d="Error #"+c.code+": "+c.message}alert(d),this.count-=1,this.showHide(),this.uploader.refresh()},uploaded:function(b,c,d){var e=this;if(a("#"+c.id+" b").html("100%"),a("#"+c.id).remove(),"error"!==d.response){this.perFileCount++;var f=a("#"+this.container).find(".wpuf-attachment-list");if(f.append(d.response),this.perFileCount>this.max){var g=a(".wpuf-image-wrap:last a.attachment-delete",f).data("attach_id");e.removeExtraAttachment(g),a(".wpuf-image-wrap",f).last().remove(),this.perFileCount--}}else alert(d.error),this.count-=1,this.showHide()},removeAttachment:function(b){b.preventDefault();var c=this,d=a(b.currentTarget);if(confirm(wpuf_frontend_upload.confirmMsg)){var e={attach_id:d.data("attach_id"),nonce:wpuf_frontend_upload.nonce,action:"wpuf_file_del"};this.removed_files.push(e),jQuery.post(wpuf_frontend_upload.ajaxurl,e,function(){c.perFileCount--,d.parent().parent().remove(),c.count-=1,c.showHide(),c.uploader.refresh()})}},removeExtraAttachment:function(a){var b=this,c={attach_id:a,nonce:wpuf_frontend_upload.nonce,action:"wpuf_file_del"};this.removed_files.push(c),jQuery.post(wpuf_frontend_upload.ajaxurl,c,function(){b.count-=1,b.showHide(),b.uploader.refresh()})}}}(jQuery);
 
assets/js/wpuf-form-builder-components.js DELETED
@@ -1,1068 +0,0 @@
1
- ;(function($) {
2
- 'use strict';
3
-
4
- Vue.component('builder-stage', {
5
- template: '#tmpl-wpuf-builder-stage',
6
-
7
- mixins: wpuf_form_builder_mixins(wpuf_mixins.builder_stage),
8
-
9
- computed: {
10
- form_fields: function () {
11
- return this.$store.state.form_fields;
12
- },
13
-
14
- field_settings: function () {
15
- return this.$store.state.field_settings;
16
- },
17
-
18
- hidden_fields: function () {
19
- return this.$store.state.form_fields.filter(function (item) {
20
- return 'hidden' === item.input_type;
21
- });
22
- },
23
-
24
- editing_form_id: function () {
25
- return this.$store.state.editing_field_id;
26
- },
27
-
28
- pro_link: function () {
29
- return wpuf_form_builder.pro_link;
30
- }
31
- },
32
-
33
- mounted: function () {
34
- var self = this;
35
-
36
- // bind jquery ui sortable
37
- $('#form-preview-stage .wpuf-form.sortable-list').sortable({
38
- placeholder: 'form-preview-stage-dropzone',
39
- items: '.field-items',
40
- handle: '.control-buttons .move',
41
- scroll: true,
42
- update: function (e, ui) {
43
- var item = ui.item[0],
44
- data = item.dataset,
45
- source = data.source,
46
- toIndex = parseInt($(ui.item).index()),
47
- payload = {
48
- toIndex: toIndex
49
- };
50
-
51
- if ('panel' === source) {
52
- // prepare the payload to add new form element
53
- var field_template = ui.item[0].dataset.formField,
54
- field = $.extend(true, {}, self.field_settings[field_template].field_props);
55
-
56
- // add a random integer id
57
- field.id = self.get_random_id();
58
-
59
- // add meta key
60
- if ('yes' === field.is_meta && !field.name) {
61
- field.name = field.label.replace(/\W/g, '_').toLowerCase() + '_' + field.id;
62
- }
63
-
64
- payload.field = field;
65
-
66
- // add new form element
67
- self.$store.commit('add_form_field_element', payload);
68
-
69
- // remove button from stage
70
- $(this).find('.button.ui-draggable.ui-draggable-handle').remove();
71
-
72
- } else if ('stage' === source) {
73
- payload.fromIndex = parseInt(data.index);
74
-
75
- self.$store.commit('swap_form_field_elements', payload);
76
- }
77
-
78
- }
79
- });
80
- },
81
-
82
- methods: {
83
- open_field_settings: function(field_id) {
84
- this.$store.commit('open_field_settings', field_id);
85
- },
86
-
87
- clone_field: function(field_id, index) {
88
- var payload = {
89
- field_id: field_id,
90
- index: index,
91
- new_id: this.get_random_id()
92
- };
93
-
94
- // single instance checking
95
- var field = _.find(this.$store.state.form_fields, function (item) {
96
- return parseInt(item.id) === parseInt(payload.field_id);
97
- });
98
-
99
- // check if these are already inserted
100
- if ( this.isSingleInstance( field.template ) && this.containsField( field.template ) ) {
101
- swal({
102
- title: "Oops...",
103
- text: "You already have this field in the form"
104
- });
105
- return;
106
- }
107
-
108
- this.$store.commit('clone_form_field_element', payload);
109
- },
110
-
111
- delete_field: function(index) {
112
- var self = this;
113
-
114
- self.warn({
115
- text: self.i18n.delete_field_warn_msg,
116
- confirmButtonText: self.i18n.yes_delete_it,
117
- cancelButtonText: self.i18n.no_cancel_it,
118
- }, function (is_confirm) {
119
- if (is_confirm) {
120
- self.$store.commit('delete_form_field_element', index);
121
- }
122
- });
123
- },
124
-
125
- delete_hidden_field: function (field_id) {
126
- var i = 0;
127
-
128
- for (i = 0; i < this.form_fields.length; i++) {
129
- if (parseInt(field_id) === parseInt(this.form_fields[i].id)) {
130
- this.delete_field(i);
131
- }
132
- }
133
- },
134
-
135
- is_pro_feature: function (template) {
136
- return (this.field_settings[template] && this.field_settings[template].pro_feature) ? true : false;
137
- },
138
-
139
- is_template_available: function (field) {
140
- var template = field.template;
141
-
142
- if (this.field_settings[template]) {
143
- if (this.is_pro_feature(template)) {
144
- return false;
145
- }
146
-
147
- return true;
148
- }
149
-
150
- // for example see 'mixin_builder_stage' mixin's 'is_taxonomy_template_available' method
151
- if (_.isFunction(this['is_' + template + '_template_available'])) {
152
- return this['is_' + template + '_template_available'].call(this, field);
153
- }
154
-
155
- return false;
156
- },
157
-
158
- is_full_width: function (template) {
159
- if (this.field_settings[template] && this.field_settings[template].is_full_width) {
160
- return true;
161
- }
162
-
163
- return false;
164
- },
165
-
166
- get_field_name: function (template) {
167
- return this.field_settings[template].title;
168
- }
169
- }
170
- });
171
-
172
- Vue.component('field-checkbox', {
173
- template: '#tmpl-wpuf-field-checkbox',
174
-
175
- mixins: [
176
- wpuf_mixins.option_field_mixin
177
- ],
178
-
179
- computed: {
180
- value: {
181
- get: function () {
182
- var value = this.editing_form_field[this.option_field.name];
183
-
184
- if (this.option_field.is_single_opt) {
185
- var option = Object.keys(this.option_field.options)[0];
186
-
187
- if (value === option) {
188
- return true;
189
-
190
- } else {
191
- return false;
192
- }
193
- }
194
-
195
- return this.editing_form_field[this.option_field.name];
196
- },
197
-
198
- set: function (value) {
199
- if (this.option_field.is_single_opt) {
200
- value = value ? Object.keys(this.option_field.options)[0] : '';
201
- }
202
-
203
-
204
- this.$store.commit('update_editing_form_field', {
205
- editing_field_id: this.editing_form_field.id,
206
- field_name: this.option_field.name,
207
- value: value
208
- });
209
- }
210
- }
211
- }
212
- });
213
-
214
- Vue.component('field-html_help_text', {
215
- template: '#tmpl-wpuf-field-html_help_text',
216
-
217
- mixins: [
218
- wpuf_mixins.option_field_mixin
219
- ],
220
- });
221
-
222
- /**
223
- * Common settings component for option based fields
224
- * like select, multiselect, checkbox, radio
225
- */
226
- Vue.component('field-option-data', {
227
- template: '#tmpl-wpuf-field-option-data',
228
-
229
- mixins: [
230
- wpuf_mixins.option_field_mixin
231
- ],
232
-
233
- data: function () {
234
- return {
235
- show_value: false,
236
- options: [],
237
- selected: [],
238
-
239
- };
240
- },
241
-
242
- computed: {
243
- field_options: function () {
244
- return this.editing_form_field.options;
245
- },
246
-
247
- field_selected: function () {
248
- return this.editing_form_field.selected;
249
- }
250
- },
251
-
252
- mounted: function () {
253
- var self = this;
254
-
255
- this.set_options();
256
-
257
- $(this.$el).find('.option-field-option-chooser').sortable({
258
- items: '.option-field-option',
259
- handle: '.sort-handler',
260
- update: function (e, ui) {
261
- var item = ui.item[0],
262
- data = item.dataset,
263
- toIndex = parseInt($(ui.item).index()),
264
- fromIndex = parseInt(data.index);
265
-
266
- self.options.swap(fromIndex, toIndex);
267
- }
268
- });
269
- },
270
-
271
- methods: {
272
- set_options: function () {
273
- var self = this;
274
- var field_options = $.extend(true, {}, this.editing_form_field.options);
275
-
276
- _.each(field_options, function (label, value) {
277
- self.options.push({label: label, value: value, id: self.get_random_id()});
278
- });
279
-
280
- if (this.option_field.is_multiple && !_.isArray(this.field_selected)) {
281
- this.selected = [this.field_selected];
282
- } else {
283
- this.selected = this.field_selected;
284
- }
285
- },
286
-
287
- // in case of select or radio buttons, user should deselect default value
288
- clear_selection: function (e, label) {
289
- if (label === this.selected) {
290
- this.selected = '';
291
- $(e.target).prop('checked', false);
292
- }
293
- },
294
-
295
- add_option: function () {
296
- var count = this.options.length,
297
- new_opt = this.i18n.option + ' - ' + (count + 1);
298
-
299
- this.options.push({
300
- label: new_opt , value: new_opt, id: this.get_random_id()
301
- });
302
- },
303
-
304
- delete_option: function (index) {
305
- if (this.options.length === 1) {
306
- this.warn({
307
- text: this.i18n.last_choice_warn_msg,
308
- showCancelButton: false,
309
- confirmButtonColor: "#46b450",
310
- });
311
-
312
- return;
313
- }
314
-
315
- this.options.splice(index, 1);
316
- },
317
-
318
- set_option_label: function (index, label) {
319
- this.options[index].value = label.toLocaleLowerCase().replace(' ', '_');
320
- }
321
- },
322
-
323
- watch: {
324
- options: {
325
- deep: true,
326
- handler: function (new_opts) {
327
- var options = {},
328
- i = 0;
329
-
330
- for (i = 0; i < new_opts.length; i++) {
331
- options[new_opts[i].value] = new_opts[i].label;
332
- }
333
-
334
- this.update_value('options', options);
335
- }
336
- },
337
-
338
- selected: function (new_val) {
339
- this.update_value('selected', new_val);
340
- }
341
- }
342
- });
343
-
344
- Vue.component('field-option-pro-feature-alert', {
345
- template: '#tmpl-wpuf-field-option-pro-feature-alert',
346
-
347
- mixins: [
348
- wpuf_mixins.option_field_mixin
349
- ],
350
-
351
- computed: {
352
- pro_link: function () {
353
- return wpuf_form_builder.pro_link;
354
- }
355
- }
356
- });
357
-
358
- /**
359
- * Sidebar field options panel
360
- */
361
- Vue.component('field-options', {
362
- template: '#tmpl-wpuf-field-options',
363
-
364
- mixins: wpuf_form_builder_mixins(wpuf_mixins.field_options),
365
-
366
- data: function() {
367
- return {
368
- show_basic_settings: true,
369
- show_advanced_settings: false
370
- };
371
- },
372
-
373
- computed: {
374
- editing_field_id: function () {
375
- this.show_basic_settings = true;
376
- this.show_advanced_settings = false;
377
-
378
- return parseInt(this.$store.state.editing_field_id);
379
- },
380
-
381
- editing_form_field: function () {
382
- var self = this;
383
- return _.find(this.$store.state.form_fields, function (item) {
384
- return parseInt(item.id) === parseInt(self.editing_field_id);
385
- });
386
- },
387
-
388
- settings: function() {
389
- var settings = [],
390
- template = this.editing_form_field.template;
391
-
392
- if (_.isFunction(this['settings_' + template])) {
393
- settings = this['settings_' + template].call(this, this.editing_form_field);
394
- } else {
395
- settings = this.$store.state.field_settings[template].settings;
396
- }
397
-
398
- return _.sortBy(settings, function (item) {
399
- return parseInt(item.priority);
400
- });
401
- },
402
-
403
- basic_settings: function () {
404
- return this.settings.filter(function (item) {
405
- return 'basic' === item.section;
406
- });
407
- },
408
-
409
- advanced_settings: function () {
410
- return this.settings.filter(function (item) {
411
- return 'advanced' === item.section;
412
- });
413
- },
414
-
415
- form_field_type_title: function() {
416
- var template = this.editing_form_field.template;
417
-
418
- if (_.isFunction(this['form_field_' + template + '_title'])) {
419
- return this['form_field_' + template + '_title'].call(this, this.editing_form_field);
420
- }
421
-
422
- return this.$store.state.field_settings[template].title;
423
- }
424
- }
425
- });
426
-
427
- Vue.component('field-radio', {
428
- template: '#tmpl-wpuf-field-radio',
429
-
430
- mixins: [
431
- wpuf_mixins.option_field_mixin
432
- ],
433
-
434
- computed: {
435
- value: {
436
- get: function () {
437
- return this.editing_form_field[this.option_field.name];
438
- },
439
-
440
- set: function (value) {
441
- this.$store.commit('update_editing_form_field', {
442
- editing_field_id: this.editing_form_field.id,
443
- field_name: this.option_field.name,
444
- value: value
445
- });
446
- }
447
- }
448
- }
449
- });
450
-
451
- Vue.component('field-select', {
452
- template: '#tmpl-wpuf-field-select',
453
-
454
- mixins: [
455
- wpuf_mixins.option_field_mixin
456
- ],
457
-
458
- computed: {
459
- value: {
460
- get: function () {
461
- return this.editing_form_field[this.option_field.name];
462
- },
463
-
464
- set: function (value) {
465
- this.$store.commit('update_editing_form_field', {
466
- editing_field_id: this.editing_form_field.id,
467
- field_name: this.option_field.name,
468
- value: value
469
- });
470
- }
471
- }
472
- }
473
- });
474
-
475
- Vue.component('field-text', {
476
- template: '#tmpl-wpuf-field-text',
477
-
478
- mixins: [
479
- wpuf_mixins.option_field_mixin
480
- ],
481
-
482
- computed: {
483
- value: {
484
- get: function () {
485
- return this.editing_form_field[this.option_field.name];
486
- },
487
-
488
- set: function (value) {
489
- this.update_value(this.option_field.name, value);
490
- }
491
- }
492
- },
493
-
494
- methods: {
495
- on_focusout: function (e) {
496
- wpuf_form_builder.event_hub.$emit('field-text-focusout', e, this);
497
- },
498
- on_keyup: function (e) {
499
- wpuf_form_builder.event_hub.$emit('field-text-keyup', e, this);
500
- }
501
- }
502
- });
503
-
504
- Vue.component('field-text-meta', {
505
- template: '#tmpl-wpuf-field-text-meta',
506
-
507
- mixins: [
508
- wpuf_mixins.option_field_mixin
509
- ],
510
-
511
- computed: {
512
- value: {
513
- get: function () {
514
- return this.editing_form_field[this.option_field.name];
515
- },
516
-
517
- set: function (value) {
518
- this.update_value(this.option_field.name, value);
519
- }
520
- }
521
- },
522
-
523
- created: function () {
524
- if ('yes' === this.editing_form_field.is_meta) {
525
- if (!this.value) {
526
- this.value = this.editing_form_field.label.replace(/\W/g, '_').toLowerCase();
527
- }
528
-
529
- wpuf_form_builder.event_hub.$on('field-text-keyup', this.meta_key_autocomplete);
530
- }
531
- },
532
-
533
- methods: {
534
- meta_key_autocomplete: function (e, label_vm) {
535
- if (
536
- 'label' === label_vm.option_field.name &&
537
- parseInt(this.editing_form_field.id) === parseInt(label_vm.editing_form_field.id)
538
- ) {
539
- this.value = label_vm.value.replace(/\W/g, '_').toLowerCase();
540
- }
541
- }
542
- }
543
- });
544
-
545
- Vue.component('field-textarea', {
546
- template: '#tmpl-wpuf-field-textarea',
547
-
548
- mixins: [
549
- wpuf_mixins.option_field_mixin
550
- ],
551
-
552
- computed: {
553
- value: {
554
- get: function () {
555
- return this.editing_form_field[this.option_field.name];
556
- },
557
-
558
- set: function (value) {
559
- this.update_value(this.option_field.name, value);
560
- }
561
- }
562
- },
563
- });
564
-
565
- /**
566
- * Field template: Checkbox
567
- */
568
- Vue.component('form-checkbox_field', {
569
- template: '#tmpl-wpuf-form-checkbox_field',
570
-
571
- mixins: [
572
- wpuf_mixins.form_field_mixin
573
- ]
574
- });
575
-
576
- /**
577
- * Field template: Hidden
578
- */
579
- Vue.component('form-custom_hidden_field', {
580
- template: '#tmpl-wpuf-form-custom_hidden_field',
581
-
582
- mixins: [
583
- wpuf_mixins.form_field_mixin
584
- ]
585
- });
586
-
587
- /**
588
- * Field template: Custom HTML
589
- */
590
- Vue.component('form-custom_html', {
591
- template: '#tmpl-wpuf-form-custom_html',
592
-
593
- mixins: [
594
- wpuf_mixins.form_field_mixin
595
- ],
596
-
597
- data: function () {
598
- return {
599
- raw_html: '<p>from data</p>'
600
- };
601
- }
602
- });
603
-
604
- /**
605
- * Field template: Dropdown/Select
606
- */
607
- Vue.component('form-dropdown_field', {
608
- template: '#tmpl-wpuf-form-dropdown_field',
609
-
610
- mixins: [
611
- wpuf_mixins.form_field_mixin
612
- ]
613
- });
614
-
615
- /**
616
- * Field template: Email
617
- */
618
- Vue.component('form-email_address', {
619
- template: '#tmpl-wpuf-form-email_address',
620
-
621
- mixins: [
622
- wpuf_mixins.form_field_mixin
623
- ]
624
- });
625
-
626
- /**
627
- * Field template: Featured Image
628
- */
629
- Vue.component('form-featured_image', {
630
- template: '#tmpl-wpuf-form-featured_image',
631
-
632
- mixins: [
633
- wpuf_mixins.form_field_mixin
634
- ]
635
- });
636
-
637
- /**
638
- * Sidebar form fields panel
639
- */
640
- Vue.component('form-fields', {
641
- template: '#tmpl-wpuf-form-fields',
642
-
643
- mixins: wpuf_form_builder_mixins(wpuf_mixins.form_fields),
644
-
645
- computed: {
646
- panel_sections: function () {
647
- return this.$store.state.panel_sections;
648
- },
649
-
650
- field_settings: function () {
651
- return this.$store.state.field_settings;
652
- },
653
-
654
- form_fields: function () {
655
- return this.$store.state.form_fields;
656
- }
657
- },
658
-
659
- mounted: function () {
660
- // bind jquery ui draggable
661
- $(this.$el).find('.panel-form-field-buttons .button').draggable({
662
- connectToSortable: '#form-preview-stage .wpuf-form',
663
- helper: 'clone',
664
- revert: 'invalid',
665
- cancel: '.button-faded',
666
- }).disableSelection();
667
- },
668
-
669
- methods: {
670
- panel_toggle: function (index) {
671
- this.$store.commit('panel_toggle', index);
672
- },
673
-
674
- add_form_field: function (field_template) {
675
- var payload = {
676
- toIndex: this.$store.state.form_fields.length,
677
- };
678
-
679
- // check if these are already inserted
680
- if ( this.isSingleInstance( field_template ) && this.containsField( field_template ) ) {
681
- swal({
682
- title: "Oops...",
683
- text: "You already have this field in the form"
684
- });
685
- return;
686
- }
687
-
688
- var field = $.extend(true, {}, this.$store.state.field_settings[field_template].field_props);
689
-
690
- field.id = this.get_random_id();
691
-
692
- if (!field.name && field.label) {
693
- field.name = field.label.replace(/\W/g, '_').toLowerCase();
694
-
695
- var same_template_fields = this.form_fields.filter(function (form_field) {
696
- return (form_field.template === field.template);
697
- });
698
-
699
- if (same_template_fields.length) {
700
- field.name += '_' + same_template_fields.length;
701
- }
702
- }
703
-
704
- payload.field = field;
705
-
706
- // add new form element
707
- this.$store.commit('add_form_field_element', payload);
708
- },
709
-
710
- is_pro_feature: function (field) {
711
- return this.field_settings[field].pro_feature;
712
- },
713
-
714
- alert_pro_feature: function (field) {
715
- var title = this.field_settings[field].title;
716
-
717
- swal({
718
- title: '<i class="fa fa-lock"></i> ' + title + ' <br>' + this.i18n.is_a_pro_feature,
719
- text: this.i18n.pro_feature_msg,
720
- type: '',
721
- html: true,
722
- showCancelButton: true,
723
- cancelButtonText: this.i18n.close,
724
- confirmButtonColor: '#46b450',
725
- confirmButtonText: this.i18n.upgrade_to_pro
726
- }, function (is_confirm) {
727
- if (is_confirm) {
728
- window.open(wpuf_form_builder.pro_link, '_blank');
729
- }
730
- });
731
- },
732
-
733
- alert_invalidate_msg: function (field) {
734
- var validator = this.field_settings[field].validator;
735
-
736
- if (validator && validator.msg) {
737
- this.warn({
738
- title: validator.msg_title || '',
739
- text: validator.msg,
740
- html: true,
741
- type: 'warning',
742
- showCancelButton: false,
743
- confirmButtonColor: '#46b450',
744
- confirmButtonText: this.i18n.ok
745
- });
746
- }
747
- },
748
-
749
- get_invalidate_btn_class: function (field) {
750
- return this.field_settings[field].validator.button_class;
751
- }
752
- }
753
- });
754
-
755
- /**
756
- * Field template: Image Upload
757
- */
758
- Vue.component('form-image_upload', {
759
- template: '#tmpl-wpuf-form-image_upload',
760
-
761
- mixins: [
762
- wpuf_mixins.form_field_mixin
763
- ]
764
- });
765
-
766
- /**
767
- * Field template: Multi-Select
768
- */
769
- Vue.component('form-multiple_select', {
770
- template: '#tmpl-wpuf-form-multiple_select',
771
-
772
- mixins: [
773
- wpuf_mixins.form_field_mixin
774
- ]
775
- });
776
-
777
- /**
778
- * Field Template: Post Content
779
- */
780
- Vue.component('form-post_content', {
781
- template: '#tmpl-wpuf-form-post_content',
782
-
783
- mixins: [
784
- wpuf_mixins.form_field_mixin
785
- ]
786
- });
787
-
788
- /**
789
- * Field Template: Post Excerpt
790
- */
791
- Vue.component('form-post_excerpt', {
792
- template: '#tmpl-wpuf-form-post_excerpt',
793
-
794
- mixins: [
795
- wpuf_mixins.form_field_mixin
796
- ]
797
- });
798
-
799
- /**
800
- * Field template: post_tags
801
- */
802
- Vue.component('form-post_tags', {
803
- template: '#tmpl-wpuf-form-post_tags',
804
-
805
- mixins: [
806
- wpuf_mixins.form_field_mixin
807
- ]
808
- });
809
-
810
- /**
811
- * Field template: Post Title
812
- */
813
- Vue.component('form-post_title', {
814
- template: '#tmpl-wpuf-form-post_title',
815
-
816
- mixins: [
817
- wpuf_mixins.form_field_mixin
818
- ]
819
- });
820
-
821
- /**
822
- * Field template: Radio
823
- */
824
- Vue.component('form-radio_field', {
825
- template: '#tmpl-wpuf-form-radio_field',
826
-
827
- mixins: [
828
- wpuf_mixins.form_field_mixin
829
- ]
830
- });
831
-
832
- /**
833
- * Field template: Section Break
834
- */
835
- Vue.component('form-section_break', {
836
- template: '#tmpl-wpuf-form-section_break',
837
-
838
- mixins: [
839
- wpuf_mixins.form_field_mixin
840
- ]
841
- });
842
-
843
- /**
844
- * Field template: taxonomy
845
- */
846
- Vue.component('form-taxonomy', {
847
- template: '#tmpl-wpuf-form-taxonomy',
848
-
849
- mixins: [
850
- wpuf_mixins.form_field_mixin
851
- ],
852
-
853
- computed: {
854
- terms: function () {
855
- var i;
856
-
857
- for (i in wpuf_form_builder.wp_post_types) {
858
- var taxonomies = wpuf_form_builder.wp_post_types[i];
859
-
860
- if (taxonomies.hasOwnProperty(this.field.name)) {
861
- var tax_field = taxonomies[this.field.name];
862
-
863
- if (tax_field.terms) {
864
- return tax_field.terms;
865
- }
866
- }
867
- }
868
-
869
- return [];
870
- },
871
-
872
- sorted_terms: function () {
873
- var self = this;
874
- var terms = $.extend(true, [], this.terms);
875
-
876
- // selection type and terms
877
- if (this.field.exclude_type && this.field.exclude) {
878
- var filter_ids = this.field.exclude.split(',').map(function (id) {
879
- id = id.trim();
880
- id = parseInt(id);
881
- return id;
882
- }).filter(function (id) {
883
- return isFinite(id);
884
- });
885
-
886
- terms = terms.filter(function (term) {
887
-
888
- switch(self.field.exclude_type) {
889
- case 'exclude':
890
- return _.indexOf(filter_ids, term.term_id) < 0;
891
-
892
- case 'include':
893
- return _.indexOf(filter_ids, term.term_id) >= 0;
894
-
895
- case 'child_of':
896
- return _.indexOf(filter_ids, parseInt(term.parent)) >= 0;
897
- }
898
- });
899
- }
900
-
901
- // order
902
- terms = _.sortBy(terms, function (term) {
903
- return term[self.field.orderby];
904
- });
905
-
906
- if ('DESC' === this.field.order) {
907
- terms = terms.reverse();
908
- }
909
-
910
- var parent_terms = terms.filter(function (term) {
911
- return !term.parent;
912
- });
913
-
914
- parent_terms.map(function (parent) {
915
- parent.children = self.get_child_terms(parent.term_id, terms);
916
- });
917
-
918
- return parent_terms.length ? parent_terms : terms;
919
- }
920
- },
921
-
922
- methods: {
923
- get_child_terms: function (parent_id, terms) {
924
- var self = this;
925
-
926
- var child_terms = terms.filter(function (term) {
927
- return parseInt(term.parent) === parseInt(parent_id);
928
- });
929
-
930
- child_terms.map(function (child) {
931
- child.children = self.get_child_terms(child.term_id, terms);
932
- });
933
-
934
- return child_terms;
935
- },
936
-
937
- get_term_dropdown_options: function () {
938
- var self = this,
939
- options = '';
940
-
941
- _.each(self.sorted_terms, function (term) {
942
- options += self.get_term_dropdown_options_children(term, 0);
943
- });
944
-
945
- return options;
946
- },
947
-
948
- get_term_dropdown_options_children: function (term, level) {
949
- var self = this,
950
- option = '';
951
-
952
- var indent = '',
953
- i = 0;
954
-
955
- for (i = 0; i < level; i++) {
956
- indent += '&nbsp;&nbsp;';
957
- }
958
-
959
- option += '<option value="' + term.id + '">' + indent + term.name + '</option>';
960
-
961
- if (term.children.length) {
962
- _.each(term.children, function (child_term) {
963
- option += self.get_term_dropdown_options_children(child_term, (level + 1));
964
- });
965
- }
966
-
967
- return option;
968
- },
969
-
970
- get_term_checklist: function () {
971
- var self = this,
972
- checklist = '';
973
-
974
-
975
- checklist += '<ul class="wpuf-category-checklist">';
976
-
977
- _.each(this.sorted_terms, function (term) {
978
- checklist += self.get_term_checklist_li(term);
979
- });
980
-
981
- checklist += '</ul>';
982
-
983
- return checklist;
984
- },
985
-
986
- get_term_checklist_li: function (term) {
987
- var self = this,
988
- li = '';
989
-
990
- li += '<li><label class="selectit"><input type="checkbox"> ' + term.name + '</label></li>';
991
-
992
- if (term.children.length) {
993
- li += '<ul class="children">';
994
-
995
- _.each(term.children, function (child_term) {
996
- li += self.get_term_checklist_li(child_term);
997
- });
998
-
999
- li += '</ul>';
1000
- }
1001
-
1002
- return li;
1003
- }
1004
- }
1005
- });
1006
-
1007
- /**
1008
- * Field template: Text
1009
- */
1010
- Vue.component('form-text_field', {
1011
- template: '#tmpl-wpuf-form-text_field',
1012
-
1013
- mixins: [
1014
- wpuf_mixins.form_field_mixin
1015
- ]
1016
- });
1017
-
1018
- Vue.component('form-textarea_field', {
1019
- template: '#tmpl-wpuf-form-textarea_field',
1020
-
1021
- mixins: [
1022
- wpuf_mixins.form_field_mixin
1023
- ]
1024
- });
1025
-
1026
- /**
1027
- * Field template: Website URL
1028
- */
1029
- Vue.component('form-website_url', {
1030
- template: '#tmpl-wpuf-form-website_url',
1031
-
1032
- mixins: [
1033
- wpuf_mixins.form_field_mixin
1034
- ]
1035
- });
1036
-
1037
- Vue.component('help-text', {
1038
- template: '#tmpl-wpuf-help-text',
1039
-
1040
- props: {
1041
- text: {
1042
- type: String,
1043
- default: ''
1044
- }
1045
- },
1046
-
1047
- mounted: function () {
1048
- $(".wpuf-tooltip").tooltip();
1049
- }
1050
- });
1051
-
1052
- Vue.component('text-editor', {
1053
- template: '#tmpl-wpuf-text-editor',
1054
-
1055
- props: ['rich'],
1056
-
1057
- computed: {
1058
- site_url: function () {
1059
- return wpuf_form_builder.site_url;
1060
- },
1061
-
1062
- is_full: function () {
1063
- return 'yes' === this.rich;
1064
- }
1065
- }
1066
- });
1067
-
1068
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/wpuf-form-builder-mixins.js DELETED
@@ -1,184 +0,0 @@
1
- ;(function($) {
2
- 'use strict';
3
-
4
- /**
5
- * Mixin for form fields like
6
- * form-text_field, form-field_textarea etc
7
- */
8
- wpuf_mixins.form_field_mixin = {
9
- props: {
10
- field: {
11
- type: Object,
12
- default: {}
13
- }
14
- },
15
-
16
- computed: {
17
- form_id: function () {
18
- return this.$store.state.post.ID;
19
- },
20
-
21
- has_options: function () {
22
- if (!this.field.hasOwnProperty('options')) {
23
- return false;
24
- }
25
-
26
- return !!Object.keys(this.field.options).length;
27
- }
28
- },
29
-
30
- methods: {
31
- class_names: function(type_class) {
32
- return [
33
- type_class,
34
- this.required_class(),
35
- 'wpuf_' + this.field.name + '_' + this.form_id
36
- ];
37
- },
38
-
39
- required_class: function () {
40
- return ('yes' === this.required) ? 'required' : '';
41
- },
42
-
43
- is_selected: function (label) {
44
- if (_.isArray(this.field.selected)) {
45
- if (_.indexOf(this.field.selected, label) >= 0) {
46
- return true;
47
- }
48
-
49
- } else if (label === this.field.selected) {
50
- return true;
51
- }
52
-
53
- return false;
54
- }
55
- }
56
- };
57
-
58
- /**
59
- * Global mixin
60
- */
61
- Vue.mixin({
62
- computed: {
63
- i18n: function () {
64
- return wpuf_form_builder.i18n;
65
- }
66
- },
67
-
68
- methods: {
69
- get_random_id: function() {
70
- var min = 999999,
71
- max = 9999999999;
72
-
73
- return Math.floor(Math.random() * (max - min + 1)) + min;
74
- },
75
-
76
- warn: function (settings, callback) {
77
- settings = $.extend(true, {
78
- title: '',
79
- text: '',
80
- type: 'warning',
81
- showCancelButton: true,
82
- confirmButtonColor: '#d54e21',
83
- confirmButtonText: this.i18n.ok,
84
- cancelButtonText: this.i18n.cancel,
85
- }, settings);
86
-
87
- swal(settings, callback);
88
- },
89
-
90
- is_failed_to_validate: function (template) {
91
- var validator = this.field_settings[template] ? this.field_settings[template].validator : false;
92
-
93
- if (validator && validator.callback && !this[validator.callback]()) {
94
- return true;
95
- }
96
-
97
- return false;
98
- },
99
-
100
- containsField: function(field_name) {
101
- var i = 0;
102
-
103
- for (i = 0; i < this.$store.state.form_fields.length; i++) {
104
- if (this.$store.state.form_fields[i].name === field_name) {
105
- return true;
106
- }
107
- }
108
-
109
- return false;
110
- },
111
-
112
- isSingleInstance: function(field_name) {
113
- var singleInstance = ['post_title', 'post_content', 'post_excerpt', 'featured_image',
114
- 'user_login', 'first_name', 'last_name', 'nickname', 'user_email', 'user_url',
115
- 'user_bio', 'password', 'user_avatar'];
116
-
117
- if ( $.inArray(field_name, singleInstance) >= 0 ) {
118
- return true;
119
- }
120
-
121
- return false;
122
- }
123
- }
124
- });
125
-
126
- /**
127
- * Mixin for option fields like
128
- * field-text, field-text-meta, field-radio etc
129
- */
130
- wpuf_mixins.option_field_mixin = {
131
- props: {
132
- option_field: {
133
- type: Object,
134
- default: {}
135
- },
136
-
137
- editing_form_field: {
138
- type: Object,
139
- default: {}
140
- }
141
- },
142
-
143
- computed: {
144
- // show/hide on basis of depenedent settings
145
- met_dependencies: function () {
146
- // no 'dependencies' key
147
- if (!this.option_field.hasOwnProperty('dependencies')) {
148
- return true;
149
- }
150
-
151
- var deps = Object.keys(this.option_field.dependencies),
152
- i = 0;
153
-
154
- // has 'dependencies' key, but no property is set
155
- if (!deps.length) {
156
- return true;
157
- }
158
-
159
- // check if dependencies met
160
- for (i = 0; i < deps.length; i++) {
161
- var required_dep_value = this.option_field.dependencies[ deps[i] ],
162
- editing_field_value = this.editing_form_field[ deps[i] ];
163
-
164
- if (required_dep_value !== editing_field_value) {
165
- return false;
166
- }
167
- }
168
-
169
- return true;
170
- }
171
- },
172
-
173
- methods: {
174
- update_value: function(property, value) {
175
- this.$store.commit('update_editing_form_field', {
176
- editing_field_id: this.editing_form_field.id,
177
- field_name: property,
178
- value: value
179
- });
180
- },
181
- }
182
- };
183
-
184
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/wpuf-form-builder-wpuf-forms.js DELETED
@@ -1,134 +0,0 @@
1
- ;(function($) {
2
- 'use strict';
3
-
4
- /**
5
- * Only proceed if current page is a 'Post Forms' form builder page
6
- */
7
- if (!$('#wpuf-form-builder.wpuf-form-builder-post').length) {
8
- return;
9
- }
10
-
11
- window.wpuf_forms_mixin_root = {
12
- data: function () {
13
- return {
14
- validation_error_msg: wpuf_form_builder.i18n.any_of_three_needed
15
- };
16
- },
17
-
18
- methods: {
19
- // wpuf_forms must have either 'post_title', 'post_content' or 'post_excerpt'
20
- // field template
21
- validate_form_before_submit: function () {
22
- var is_valid = false;
23
-
24
- _.each(this.form_fields, function (form_field) {
25
- if (_.indexOf(['post_title', 'post_content', 'post_excerpt'], form_field.template) >= 0) {
26
- is_valid = true;
27
- return;
28
- }
29
- });
30
-
31
- return is_valid;
32
- }
33
- }
34
- };
35
-
36
- window.wpuf_forms_mixin_builder_stage = {
37
- data: function () {
38
- return {
39
- post_form_settings: {
40
- submit_text: '',
41
- draft_post: false,
42
- }
43
- };
44
- },
45
-
46
- mounted: function () {
47
- var self = this;
48
-
49
- // submit button text
50
- this.post_form_settings.submit_text = $('[name="wpuf_settings[submit_text]"]').val();
51
-
52
- $('[name="wpuf_settings[submit_text]"]').on('change', function () {
53
- self.post_form_settings.submit_text = $(this).val();
54
- });
55
-
56
- // draft post text
57
- this.post_form_settings.draft_post = $('[type="checkbox"][name="wpuf_settings[draft_post]"]').is(':checked') ? true : false;
58
- $('[type="checkbox"][name="wpuf_settings[draft_post]"]').on('change', function () {
59
- self.post_form_settings.draft_post = $(this).is(':checked') ? true : false;
60
- });
61
-
62
- // set taxonomies according to selected post type
63
- var post_type_dropdown = $('select[name="wpuf_settings[post_type]"]'),
64
- post_type = post_type_dropdown.val();
65
-
66
- this.set_taxonomies(post_type);
67
-
68
- post_type_dropdown.on('change', function () {
69
- self.set_taxonomies($(this).val());
70
- });
71
- },
72
-
73
- methods: {
74
- set_taxonomies: function (post_type) {
75
- var self = this,
76
- taxonomies = wpuf_form_builder.wp_post_types[post_type],
77
- tax_names = taxonomies ? Object.keys(taxonomies) : [];
78
-
79
- self.$store.commit('set_panel_section_fields', {
80
- id: 'taxonomies',
81
- fields: tax_names
82
- });
83
-
84
- // Bind jquery ui draggable. But first destory any previous binding
85
- Vue.nextTick(function () {
86
- var buttons = $('#panel-form-field-buttons-taxonomies .button');
87
-
88
- buttons.each(function () {
89
- if ($(this).draggable('instance')) {
90
- $(this).draggable('destroy');
91
- }
92
- });
93
-
94
- buttons.draggable({
95
- connectToSortable: '#form-preview-stage .wpuf-form',
96
- helper: 'clone',
97
- revert: 'invalid',
98
- cancel: '.button-faded',
99
- }).disableSelection();
100
- });
101
- },
102
-
103
- // executed in 'builder-stage' component by 'is_template_available' method
104
- is_post_tags_template_available: function () {
105
- return true;
106
- },
107
-
108
- // executed in 'builder-stage' component by 'is_template_available' method
109
- is_taxonomy_template_available: function (field) {
110
- return this.field_settings[field.name] ? true : false;
111
- }
112
- }
113
- };
114
-
115
- window.wpuf_forms_mixin_field_options = {
116
- methods: {
117
- form_field_post_tags_title: function () {
118
- return this.$store.state.field_settings.post_tag.title;
119
- },
120
-
121
- form_field_taxonomy_title: function (form_field) {
122
- return this.$store.state.field_settings[form_field.name].title;
123
- },
124
-
125
- settings_post_tags: function () {
126
- return this.$store.state.field_settings.post_tag.settings;
127
- },
128
-
129
- settings_taxonomy: function (form_field) {
130
- return this.$store.state.field_settings[form_field.name].settings;
131
- }
132
- }
133
- };
134
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/wpuf-form-builder.js DELETED
@@ -1,427 +0,0 @@
1
- ;(function($) {
2
- 'use strict';
3
-
4
- /**
5
- * Only proceed if current page is a form builder page
6
- */
7
- if (!$('#wpuf-form-builder').length) {
8
- return;
9
- }
10
-
11
- if (!Array.prototype.hasOwnProperty('swap')) {
12
- Array.prototype.swap = function (from, to) {
13
- this.splice(to, 0, this.splice(from, 1)[0]);
14
- };
15
- }
16
-
17
- // check if an element is visible in browser viewport
18
- function is_element_in_viewport (el) {
19
- if (typeof jQuery === "function" && el instanceof jQuery) {
20
- el = el[0];
21
- }
22
-
23
- var rect = el.getBoundingClientRect();
24
-
25
- return (
26
- rect.top >= 0 &&
27
- rect.left >= 0 &&
28
- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
29
- rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
30
- );
31
- }
32
-
33
- /**
34
- * Vuex Store data
35
- */
36
- var wpuf_form_builder_store = new Vuex.Store({
37
- state: {
38
- post: wpuf_form_builder.post,
39
- form_fields: wpuf_form_builder.form_fields,
40
- panel_sections: wpuf_form_builder.panel_sections,
41
- field_settings: wpuf_form_builder.field_settings,
42
- current_panel: 'form-fields',
43
- editing_field_id: 0, // editing form field id
44
- },
45
-
46
- mutations: {
47
- set_form_fields: function (state, form_fields) {
48
- Vue.set(state, 'form_fields', form_fields);
49
- },
50
-
51
- // set the current panel
52
- set_current_panel: function (state, panel) {
53
- if ('field-options' !== state.current_panel &&
54
- 'field-options' === panel &&
55
- state.form_fields.length
56
- ) {
57
- state.editing_field_id = state.form_fields[0].id;
58
- }
59
-
60
- state.current_panel = panel;
61
-
62
- // reset editing field id
63
- if ('form-fields' === panel) {
64
- state.editing_field_id = 0;
65
- }
66
- },
67
-
68
- // add show property to every panel section
69
- panel_add_show_prop: function (state) {
70
- state.panel_sections.map(function (section, index) {
71
- if (!section.hasOwnProperty('show')) {
72
- Vue.set(state.panel_sections[index], 'show', true);
73
- }
74
- });
75
- },
76
-
77
- // toggle panel sections
78
- panel_toggle: function (state, index) {
79
- state.panel_sections[index].show = !state.panel_sections[index].show;
80
- },
81
-
82
- // open field settings panel
83
- open_field_settings: function (state, field_id) {
84
- var field = state.form_fields.filter(function(item) {
85
- return parseInt(field_id) === parseInt(item.id);
86
- });
87
-
88
- if ('field-options' === state.current_panel && field[0].id === state.editing_field_id) {
89
- return;
90
- }
91
-
92
- if (field.length) {
93
- state.editing_field_id = 0;
94
- state.current_panel = 'field-options';
95
-
96
- setTimeout(function () {
97
- state.editing_field_id = field[0].id;
98
- }, 400);
99
- }
100
- },
101
-
102
- update_editing_form_field: function (state, payload) {
103
- var editing_field = _.find(state.form_fields, function (item) {
104
- return parseInt(item.id) === parseInt(payload.editing_field_id);
105
- });
106
-
107
- editing_field[payload.field_name] = payload.value;
108
- },
109
-
110
- // add new form field element
111
- add_form_field_element: function (state, payload) {
112
- state.form_fields.splice(payload.toIndex, 0, payload.field);
113
-
114
- // bring newly added element into viewport
115
- Vue.nextTick(function () {
116
- var el = $('#form-preview-stage .wpuf-form .field-items').eq(payload.toIndex);
117
-
118
- if (el && !is_element_in_viewport(el.get(0))) {
119
- $('#builder-stage section').scrollTo(el, 800, {offset: -50});
120
- }
121
- });
122
- },
123
-
124
- // sorting inside stage
125
- swap_form_field_elements: function (state, payload) {
126
- state.form_fields.swap(payload.fromIndex, payload.toIndex);
127
- },
128
-
129
- clone_form_field_element: function (state, payload) {
130
- var field = _.find(state.form_fields, function (item) {
131
- return parseInt(item.id) === parseInt(payload.field_id);
132
- });
133
-
134
- var clone = $.extend(true, {}, field),
135
- index = parseInt(payload.index) + 1;
136
-
137
- clone.id = payload.new_id;
138
- clone.name = clone.name + '_copy';
139
-
140
- state.form_fields.splice(index, 0, clone);
141
- },
142
-
143
- // delete a field
144
- delete_form_field_element: function (state, index) {
145
- state.current_panel = 'form-fields';
146
- state.form_fields.splice(index, 1);
147
- },
148
-
149
- // set fields for a panel section
150
- set_panel_section_fields: function (state, payload) {
151
- var section = _.find(state.panel_sections, function (item) {
152
- return item.id === payload.id;
153
- });
154
-
155
- section.fields = payload.fields;
156
- }
157
- }
158
- });
159
-
160
- /**
161
- * The main form builder vue instance
162
- */
163
- new Vue({
164
- el: '#wpuf-form-builder',
165
-
166
- mixins: wpuf_form_builder_mixins(wpuf_mixins.root),
167
-
168
- store: wpuf_form_builder_store,
169
-
170
- data: {
171
- is_form_saving: false,
172
- is_form_saved: false,
173
- is_form_switcher: false,
174
- post_title_editing: false,
175
- },
176
-
177
- computed: {
178
- current_panel: function () {
179
- return this.$store.state.current_panel;
180
- },
181
-
182
- post: function () {
183
- return this.$store.state.post;
184
- },
185
-
186
- form_fields_count: function () {
187
- return this.$store.state.form_fields.length;
188
- },
189
-
190
- form_fields: function () {
191
- return this.$store.state.form_fields;
192
- }
193
- },
194
-
195
- created: function () {
196
- this.$store.commit('panel_add_show_prop');
197
-
198
- /**
199
- * This is the event hub we'll use in every
200
- * component to communicate between them
201
- */
202
- wpuf_form_builder.event_hub = new Vue();
203
- },
204
-
205
- mounted: function () {
206
- // primary nav tabs and their contents
207
- this.bind_tab_on_click($('#wpuf-form-builder > fieldset > .nav-tab-wrapper > a'), '#wpuf-form-builder');
208
-
209
- // secondary settings tabs and their contents
210
- var settings_tabs = $('#wpuf-form-builder-settings .nav-tab'),
211
- settings_tab_contents = $('#wpuf-form-builder-settings .tab-contents .group');
212
-
213
- settings_tabs.first().addClass('nav-tab-active');
214
- settings_tab_contents.first().addClass('active');
215
-
216
- this.bind_tab_on_click(settings_tabs, '#wpuf-form-builder-settings');
217
-
218
- var clipboard = new window.Clipboard('.form-id');
219
- $(".form-id").tooltip();
220
-
221
- var self = this;
222
-
223
- clipboard.on('success', function(e) {
224
- // Show copied tooltip
225
- $(e.trigger)
226
- .attr('data-original-title', 'Copied!')
227
- .tooltip('show');
228
-
229
- // Reset the copied tooltip
230
- setTimeout(function() {
231
- $(e.trigger).tooltip('hide')
232
- .attr('data-original-title', self.i18n.copy_shortcode);
233
- }, 1000);
234
-
235
- e.clearSelection();
236
- });
237
-
238
- window.onbeforeunload = function () {
239
- if (!self.is_form_saved) {
240
- return self.i18n.unsaved_changes;
241
- }
242
- };
243
- },
244
-
245
- methods: {
246
- // tabs and their contents
247
- bind_tab_on_click: function (tabs, scope) {
248
- tabs.on('click', function (e) {
249
- e.preventDefault();
250
-
251
- var button = $(this),
252
- tab_contents = $(scope + ' > fieldset > .tab-contents'),
253
- group_id = button.attr('href');
254
-
255
- button.addClass('nav-tab-active').siblings('.nav-tab-active').removeClass('nav-tab-active');
256
-
257
- tab_contents.children().removeClass('active');
258
- $(group_id).addClass('active');
259
- });
260
- },
261
-
262
- // switch form
263
- switch_form: function () {
264
- this.is_form_switcher = (this.is_form_switcher) ? false : true;
265
- },
266
-
267
- // set current sidebar panel
268
- set_current_panel: function (panel) {
269
- this.$store.commit('set_current_panel', panel);
270
- },
271
-
272
- // save form builder data
273
- save_form_builder: function () {
274
- var self = this;
275
-
276
- if (_.isFunction(this.validate_form_before_submit) && !this.validate_form_before_submit()) {
277
-
278
- this.warn({
279
- text: this.validation_error_msg
280
- });
281
-
282
- return;
283
- }
284
-
285
- self.is_form_saving = true;
286
- self.set_current_panel('form-fields');
287
-
288
- wp.ajax.send('wpuf_form_builder_save_form', {
289
- data: {
290
- form_data: $('#wpuf-form-builder').serialize(),
291
- form_fields: JSON.stringify(self.form_fields)
292
- },
293
-
294
- success: function (response) {
295
- if (response.form_fields) {
296
- self.$store.commit('set_form_fields', response.form_fields);
297
- }
298
-
299
- self.is_form_saving = false;
300
- self.is_form_saved = true;
301
-
302
- toastr.success(self.i18n.saved_form_data);
303
- },
304
-
305
- error: function () {
306
- self.is_form_saving = false;
307
- }
308
- });
309
- }
310
- }
311
- });
312
-
313
- var SettingsTab = {
314
- init: function() {
315
- $(function() {
316
- $('.wpuf-ms-color').wpColorPicker();
317
- });
318
-
319
- $('#wpuf-metabox-settings').on('change', 'select[name="wpuf_settings[redirect_to]"]', this.settingsRedirect);
320
- $('#wpuf-metabox-settings-update').on('change', 'select[name="wpuf_settings[edit_redirect_to]"]', this.settingsRedirect);
321
- $('select[name="wpuf_settings[redirect_to]"]').change();
322
- $('select[name="wpuf_settings[edit_redirect_to]"]').change();
323
-
324
- // Form settings: Guest post
325
- $('#wpuf-metabox-settings').on('change', 'input[type=checkbox][name="wpuf_settings[guest_post]"]', this.settingsGuest);
326
- $('input[type=checkbox][name="wpuf_settings[guest_post]"]').trigger('change');
327
-
328
- // From settings: User details
329
- $('#wpuf-metabox-settings').on('change', 'input[type=checkbox][name="wpuf_settings[guest_details]"]', this.settingsGuestDetails);
330
-
331
- this.changeMultistepVisibility($('.wpuf_enable_multistep_section :input[type="checkbox"]'));
332
- var self = this;
333
- $('.wpuf_enable_multistep_section :input[type="checkbox"]').click(function() {
334
- self.changeMultistepVisibility($(this));
335
- });
336
- },
337
-
338
- settingsGuest: function (e) {
339
- e.preventDefault();
340
-
341
- var table = $(this).closest('table');
342
-
343
- if ( $(this).is(':checked') ) {
344
- table.find('tr.show-if-guest').show();
345
- table.find('tr.show-if-not-guest').hide();
346
-
347
- $('input[type=checkbox][name="wpuf_settings[guest_details]"]').trigger('change');
348
-
349
- } else {
350
- table.find('tr.show-if-guest').hide();
351
- table.find('tr.show-if-not-guest').show();
352
- }
353
- },
354
-
355
- settingsGuestDetails: function (e) {
356
- e.preventDefault();
357
-
358
- var table = $(this).closest('table');
359
-
360
- if ( $(this).is(':checked') ) {
361
- table.find('tr.show-if-details').show();
362
- } else {
363
- table.find('tr.show-if-details').hide();
364
- }
365
- },
366
-
367
- settingsRedirect: function(e) {
368
- e.preventDefault();
369
-
370
- var $self = $(this),
371
- $table = $self.closest('table'),
372
- value = $self.val();
373
-
374
- switch( value ) {
375
- case 'post':
376
- $table.find('tr.wpuf-page-id, tr.wpuf-url, tr.wpuf-same-page').hide();
377
- break;
378
-
379
- case 'page':
380
- $table.find('tr.wpuf-page-id').show();
381
- $table.find('tr.wpuf-same-page').hide();
382
- $table.find('tr.wpuf-url').hide();
383
- break;
384
-
385
- case 'url':
386
- $table.find('tr.wpuf-page-id').hide();
387
- $table.find('tr.wpuf-same-page').hide();
388
- $table.find('tr.wpuf-url').show();
389
- break;
390
-
391
- case 'same':
392
- $table.find('tr.wpuf-page-id').hide();
393
- $table.find('tr.wpuf-url').hide();
394
- $table.find('tr.wpuf-same-page').show();
395
- break;
396
- }
397
- },
398
-
399
- changeMultistepVisibility: function(target) {
400
- if (target.is(':checked')) {
401
- $('.wpuf_multistep_content').show();
402
- } else {
403
- $('.wpuf_multistep_content').hide();
404
- }
405
- }
406
- };
407
-
408
- // on DOM ready
409
- $(function() {
410
- resizeBuilderContainer();
411
-
412
- $("#collapse-menu").click(function () {
413
- resizeBuilderContainer();
414
- });
415
-
416
- function resizeBuilderContainer() {
417
- if ($(document.body).hasClass('folded')) {
418
- $("#wpuf-form-builder").css("width", "calc(100% - 80px)");
419
- } else {
420
- $("#wpuf-form-builder").css("width", "calc(100% - 200px)");
421
- }
422
- }
423
-
424
- SettingsTab.init();
425
- });
426
-
427
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/clipboard/clipboard.js DELETED
@@ -1,778 +0,0 @@
1
- /*!
2
- * clipboard.js v1.6.0
3
- * https://zenorocha.github.io/clipboard.js
4
- *
5
- * Licensed MIT © Zeno Rocha
6
- */
7
- (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
8
- var DOCUMENT_NODE_TYPE = 9;
9
-
10
- /**
11
- * A polyfill for Element.matches()
12
- */
13
- if (Element && !Element.prototype.matches) {
14
- var proto = Element.prototype;
15
-
16
- proto.matches = proto.matchesSelector ||
17
- proto.mozMatchesSelector ||
18
- proto.msMatchesSelector ||
19
- proto.oMatchesSelector ||
20
- proto.webkitMatchesSelector;
21
- }
22
-
23
- /**
24
- * Finds the closest parent that matches a selector.
25
- *
26
- * @param {Element} element
27
- * @param {String} selector
28
- * @return {Function}
29
- */
30
- function closest (element, selector) {
31
- while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
32
- if (element.matches(selector)) return element;
33
- element = element.parentNode;
34
- }
35
- }
36
-
37
- module.exports = closest;
38
-
39
- },{}],2:[function(require,module,exports){
40
- var closest = require('./closest');
41
-
42
- /**
43
- * Delegates event to a selector.
44
- *
45
- * @param {Element} element
46
- * @param {String} selector
47
- * @param {String} type
48
- * @param {Function} callback
49
- * @param {Boolean} useCapture
50
- * @return {Object}
51
- */
52
- function delegate(element, selector, type, callback, useCapture) {
53
- var listenerFn = listener.apply(this, arguments);
54
-
55
- element.addEventListener(type, listenerFn, useCapture);
56
-
57
- return {
58
- destroy: function() {
59
- element.removeEventListener(type, listenerFn, useCapture);
60
- }
61
- }
62
- }
63
-
64
- /**
65
- * Finds closest match and invokes callback.
66
- *
67
- * @param {Element} element
68
- * @param {String} selector
69
- * @param {String} type
70
- * @param {Function} callback
71
- * @return {Function}
72
- */
73
- function listener(element, selector, type, callback) {
74
- return function(e) {
75
- e.delegateTarget = closest(e.target, selector);
76
-
77
- if (e.delegateTarget) {
78
- callback.call(element, e);
79
- }
80
- }
81
- }
82
-
83
- module.exports = delegate;
84
-
85
- },{"./closest":1}],3:[function(require,module,exports){
86
- /**
87
- * Check if argument is a HTML element.
88
- *
89
- * @param {Object} value
90
- * @return {Boolean}
91
- */
92
- exports.node = function(value) {
93
- return value !== undefined
94
- && value instanceof HTMLElement
95
- && value.nodeType === 1;
96
- };
97
-
98
- /**
99
- * Check if argument is a list of HTML elements.
100
- *
101
- * @param {Object} value
102
- * @return {Boolean}
103
- */
104
- exports.nodeList = function(value) {
105
- var type = Object.prototype.toString.call(value);
106
-
107
- return value !== undefined
108
- && (type === '[object NodeList]' || type === '[object HTMLCollection]')
109
- && ('length' in value)
110
- && (value.length === 0 || exports.node(value[0]));
111
- };
112
-
113
- /**
114
- * Check if argument is a string.
115
- *
116
- * @param {Object} value
117
- * @return {Boolean}
118
- */
119
- exports.string = function(value) {
120
- return typeof value === 'string'
121
- || value instanceof String;
122
- };
123
-
124
- /**
125
- * Check if argument is a function.
126
- *
127
- * @param {Object} value
128
- * @return {Boolean}
129
- */
130
- exports.fn = function(value) {
131
- var type = Object.prototype.toString.call(value);
132
-
133
- return type === '[object Function]';
134
- };
135
-
136
- },{}],4:[function(require,module,exports){
137
- var is = require('./is');
138
- var delegate = require('delegate');
139
-
140
- /**
141
- * Validates all params and calls the right
142
- * listener function based on its target type.
143
- *
144
- * @param {String|HTMLElement|HTMLCollection|NodeList} target
145
- * @param {String} type
146
- * @param {Function} callback
147
- * @return {Object}
148
- */
149
- function listen(target, type, callback) {
150
- if (!target && !type && !callback) {
151
- throw new Error('Missing required arguments');
152
- }
153
-
154
- if (!is.string(type)) {
155
- throw new TypeError('Second argument must be a String');
156
- }
157
-
158
- if (!is.fn(callback)) {
159
- throw new TypeError('Third argument must be a Function');
160
- }
161
-
162
- if (is.node(target)) {
163
- return listenNode(target, type, callback);
164
- }
165
- else if (is.nodeList(target)) {
166
- return listenNodeList(target, type, callback);
167
- }
168
- else if (is.string(target)) {
169
- return listenSelector(target, type, callback);
170
- }
171
- else {
172
- throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
173
- }
174
- }
175
-
176
- /**
177
- * Adds an event listener to a HTML element
178
- * and returns a remove listener function.
179
- *
180
- * @param {HTMLElement} node
181
- * @param {String} type
182
- * @param {Function} callback
183
- * @return {Object}
184
- */
185
- function listenNode(node, type, callback) {
186
- node.addEventListener(type, callback);
187
-
188
- return {
189
- destroy: function() {
190
- node.removeEventListener(type, callback);
191
- }
192
- }
193
- }
194
-
195
- /**
196
- * Add an event listener to a list of HTML elements
197
- * and returns a remove listener function.
198
- *
199
- * @param {NodeList|HTMLCollection} nodeList
200
- * @param {String} type
201
- * @param {Function} callback
202
- * @return {Object}
203
- */
204
- function listenNodeList(nodeList, type, callback) {
205
- Array.prototype.forEach.call(nodeList, function(node) {
206
- node.addEventListener(type, callback);
207
- });
208
-
209
- return {
210
- destroy: function() {
211
- Array.prototype.forEach.call(nodeList, function(node) {
212
- node.removeEventListener(type, callback);
213
- });
214
- }
215
- }
216
- }
217
-
218
- /**
219
- * Add an event listener to a selector
220
- * and returns a remove listener function.
221
- *
222
- * @param {String} selector
223
- * @param {String} type
224
- * @param {Function} callback
225
- * @return {Object}
226
- */
227
- function listenSelector(selector, type, callback) {
228
- return delegate(document.body, selector, type, callback);
229
- }
230
-
231
- module.exports = listen;
232
-
233
- },{"./is":3,"delegate":2}],5:[function(require,module,exports){
234
- function select(element) {
235
- var selectedText;
236
-
237
- if (element.nodeName === 'SELECT') {
238
- element.focus();
239
-
240
- selectedText = element.value;
241
- }
242
- else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
243
- var isReadOnly = element.hasAttribute('readonly');
244
-
245
- if (!isReadOnly) {
246
- element.setAttribute('readonly', '');
247
- }
248
-
249
- element.select();
250
- element.setSelectionRange(0, element.value.length);
251
-
252
- if (!isReadOnly) {
253
- element.removeAttribute('readonly');
254
- }
255
-
256
- selectedText = element.value;
257
- }
258
- else {
259
- if (element.hasAttribute('contenteditable')) {
260
- element.focus();
261
- }
262
-
263
- var selection = window.getSelection();
264
- var range = document.createRange();
265
-
266
- range.selectNodeContents(element);
267
- selection.removeAllRanges();
268
- selection.addRange(range);
269
-
270
- selectedText = selection.toString();
271
- }
272
-
273
- return selectedText;
274
- }
275
-
276
- module.exports = select;
277
-
278
- },{}],6:[function(require,module,exports){
279
- function E () {
280
- // Keep this empty so it's easier to inherit from
281
- // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
282
- }
283
-
284
- E.prototype = {
285
- on: function (name, callback, ctx) {
286
- var e = this.e || (this.e = {});
287
-
288
- (e[name] || (e[name] = [])).push({
289
- fn: callback,
290
- ctx: ctx
291
- });
292
-
293
- return this;
294
- },
295
-
296
- once: function (name, callback, ctx) {
297
- var self = this;
298
- function listener () {
299
- self.off(name, listener);
300
- callback.apply(ctx, arguments);
301
- };
302
-
303
- listener._ = callback
304
- return this.on(name, listener, ctx);
305
- },
306
-
307
- emit: function (name) {
308
- var data = [].slice.call(arguments, 1);
309
- var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
310
- var i = 0;
311
- var len = evtArr.length;
312
-
313
- for (i; i < len; i++) {
314
- evtArr[i].fn.apply(evtArr[i].ctx, data);
315
- }
316
-
317
- return this;
318
- },
319
-
320
- off: function (name, callback) {
321
- var e = this.e || (this.e = {});
322
- var evts = e[name];
323
- var liveEvents = [];
324
-
325
- if (evts && callback) {
326
- for (var i = 0, len = evts.length; i < len; i++) {
327
- if (evts[i].fn !== callback && evts[i].fn._ !== callback)
328
- liveEvents.push(evts[i]);
329
- }
330
- }
331
-
332
- // Remove event from queue to prevent memory leak
333
- // Suggested by https://github.com/lazd
334
- // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
335
-
336
- (liveEvents.length)
337
- ? e[name] = liveEvents
338
- : delete e[name];
339
-
340
- return this;
341
- }
342
- };
343
-
344
- module.exports = E;
345
-
346
- },{}],7:[function(require,module,exports){
347
- (function (global, factory) {
348
- if (typeof define === "function" && define.amd) {
349
- define(['module', 'select'], factory);
350
- } else if (typeof exports !== "undefined") {
351
- factory(module, require('select'));
352
- } else {
353
- var mod = {
354
- exports: {}
355
- };
356
- factory(mod, global.select);
357
- global.clipboardAction = mod.exports;
358
- }
359
- })(this, function (module, _select) {
360
- 'use strict';
361
-
362
- var _select2 = _interopRequireDefault(_select);
363
-
364
- function _interopRequireDefault(obj) {
365
- return obj && obj.__esModule ? obj : {
366
- default: obj
367
- };
368
- }
369
-
370
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
371
- return typeof obj;
372
- } : function (obj) {
373
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
374
- };
375
-
376
- function _classCallCheck(instance, Constructor) {
377
- if (!(instance instanceof Constructor)) {
378
- throw new TypeError("Cannot call a class as a function");
379
- }
380
- }
381
-
382
- var _createClass = function () {
383
- function defineProperties(target, props) {
384
- for (var i = 0; i < props.length; i++) {
385
- var descriptor = props[i];
386
- descriptor.enumerable = descriptor.enumerable || false;
387
- descriptor.configurable = true;
388
- if ("value" in descriptor) descriptor.writable = true;
389
- Object.defineProperty(target, descriptor.key, descriptor);
390
- }
391
- }
392
-
393
- return function (Constructor, protoProps, staticProps) {
394
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
395
- if (staticProps) defineProperties(Constructor, staticProps);
396
- return Constructor;
397
- };
398
- }();
399
-
400
- var ClipboardAction = function () {
401
- /**
402
- * @param {Object} options
403
- */
404
- function ClipboardAction(options) {
405
- _classCallCheck(this, ClipboardAction);
406
-
407
- this.resolveOptions(options);
408
- this.initSelection();
409
- }
410
-
411
- /**
412
- * Defines base properties passed from constructor.
413
- * @param {Object} options
414
- */
415
-
416
-
417
- _createClass(ClipboardAction, [{
418
- key: 'resolveOptions',
419
- value: function resolveOptions() {
420
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
421
-
422
- this.action = options.action;
423
- this.emitter = options.emitter;
424
- this.target = options.target;
425
- this.text = options.text;
426
- this.trigger = options.trigger;
427
-
428
- this.selectedText = '';
429
- }
430
- }, {
431
- key: 'initSelection',
432
- value: function initSelection() {
433
- if (this.text) {
434
- this.selectFake();
435
- } else if (this.target) {
436
- this.selectTarget();
437
- }
438
- }
439
- }, {
440
- key: 'selectFake',
441
- value: function selectFake() {
442
- var _this = this;
443
-
444
- var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
445
-
446
- this.removeFake();
447
-
448
- this.fakeHandlerCallback = function () {
449
- return _this.removeFake();
450
- };
451
- this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
452
-
453
- this.fakeElem = document.createElement('textarea');
454
- // Prevent zooming on iOS
455
- this.fakeElem.style.fontSize = '12pt';
456
- // Reset box model
457
- this.fakeElem.style.border = '0';
458
- this.fakeElem.style.padding = '0';
459
- this.fakeElem.style.margin = '0';
460
- // Move element out of screen horizontally
461
- this.fakeElem.style.position = 'absolute';
462
- this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
463
- // Move element to the same position vertically
464
- var yPosition = window.pageYOffset || document.documentElement.scrollTop;
465
- this.fakeElem.style.top = yPosition + 'px';
466
-
467
- this.fakeElem.setAttribute('readonly', '');
468
- this.fakeElem.value = this.text;
469
-
470
- document.body.appendChild(this.fakeElem);
471
-
472
- this.selectedText = (0, _select2.default)(this.fakeElem);
473
- this.copyText();
474
- }
475
- }, {
476
- key: 'removeFake',
477
- value: function removeFake() {
478
- if (this.fakeHandler) {
479
- document.body.removeEventListener('click', this.fakeHandlerCallback);
480
- this.fakeHandler = null;
481
- this.fakeHandlerCallback = null;
482
- }
483
-
484
- if (this.fakeElem) {
485
- document.body.removeChild(this.fakeElem);
486
- this.fakeElem = null;
487
- }
488
- }
489
- }, {
490
- key: 'selectTarget',
491
- value: function selectTarget() {
492
- this.selectedText = (0, _select2.default)(this.target);
493
- this.copyText();
494
- }
495
- }, {
496
- key: 'copyText',
497
- value: function copyText() {
498
- var succeeded = void 0;
499
-
500
- try {
501
- succeeded = document.execCommand(this.action);
502
- } catch (err) {
503
- succeeded = false;
504
- }
505
-
506
- this.handleResult(succeeded);
507
- }
508
- }, {
509
- key: 'handleResult',
510
- value: function handleResult(succeeded) {
511
- this.emitter.emit(succeeded ? 'success' : 'error', {
512
- action: this.action,
513
- text: this.selectedText,
514
- trigger: this.trigger,
515
- clearSelection: this.clearSelection.bind(this)
516
- });
517
- }
518
- }, {
519
- key: 'clearSelection',
520
- value: function clearSelection() {
521
- if (this.target) {
522
- this.target.blur();
523
- }
524
-
525
- window.getSelection().removeAllRanges();
526
- }
527
- }, {
528
- key: 'destroy',
529
- value: function destroy() {
530
- this.removeFake();
531
- }
532
- }, {
533
- key: 'action',
534
- set: function set() {
535
- var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
536
-
537
- this._action = action;
538
-
539
- if (this._action !== 'copy' && this._action !== 'cut') {
540
- throw new Error('Invalid "action" value, use either "copy" or "cut"');
541
- }
542
- },
543
- get: function get() {
544
- return this._action;
545
- }
546
- }, {
547
- key: 'target',
548
- set: function set(target) {
549
- if (target !== undefined) {
550
- if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
551
- if (this.action === 'copy' && target.hasAttribute('disabled')) {
552
- throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
553
- }
554
-
555
- if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
556
- throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
557
- }
558
-
559
- this._target = target;
560
- } else {
561
- throw new Error('Invalid "target" value, use a valid Element');
562
- }
563
- }
564
- },
565
- get: function get() {
566
- return this._target;
567
- }
568
- }]);
569
-
570
- return ClipboardAction;
571
- }();
572
-
573
- module.exports = ClipboardAction;
574
- });
575
-
576
- },{"select":5}],8:[function(require,module,exports){
577
- (function (global, factory) {
578
- if (typeof define === "function" && define.amd) {
579
- define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory);
580
- } else if (typeof exports !== "undefined") {
581
- factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));
582
- } else {
583
- var mod = {
584
- exports: {}
585
- };
586
- factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);
587
- global.clipboard = mod.exports;
588
- }
589
- })(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {
590
- 'use strict';
591
-
592
- var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
593
-
594
- var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
595
-
596
- var _goodListener2 = _interopRequireDefault(_goodListener);
597
-
598
- function _interopRequireDefault(obj) {
599
- return obj && obj.__esModule ? obj : {
600
- default: obj
601
- };
602
- }
603
-
604
- function _classCallCheck(instance, Constructor) {
605
- if (!(instance instanceof Constructor)) {
606
- throw new TypeError("Cannot call a class as a function");
607
- }
608
- }
609
-
610
- var _createClass = function () {
611
- function defineProperties(target, props) {
612
- for (var i = 0; i < props.length; i++) {
613
- var descriptor = props[i];
614
- descriptor.enumerable = descriptor.enumerable || false;
615
- descriptor.configurable = true;
616
- if ("value" in descriptor) descriptor.writable = true;
617
- Object.defineProperty(target, descriptor.key, descriptor);
618
- }
619
- }
620
-
621
- return function (Constructor, protoProps, staticProps) {
622
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
623
- if (staticProps) defineProperties(Constructor, staticProps);
624
- return Constructor;
625
- };
626
- }();
627
-
628
- function _possibleConstructorReturn(self, call) {
629
- if (!self) {
630
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
631
- }
632
-
633
- return call && (typeof call === "object" || typeof call === "function") ? call : self;
634
- }
635
-
636
- function _inherits(subClass, superClass) {
637
- if (typeof superClass !== "function" && superClass !== null) {
638
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
639
- }
640
-
641
- subClass.prototype = Object.create(superClass && superClass.prototype, {
642
- constructor: {
643
- value: subClass,
644
- enumerable: false,
645
- writable: true,
646
- configurable: true
647
- }
648
- });
649
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
650
- }
651
-
652
- var Clipboard = function (_Emitter) {
653
- _inherits(Clipboard, _Emitter);
654
-
655
- /**
656
- * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
657
- * @param {Object} options
658
- */
659
- function Clipboard(trigger, options) {
660
- _classCallCheck(this, Clipboard);
661
-
662
- var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
663
-
664
- _this.resolveOptions(options);
665
- _this.listenClick(trigger);
666
- return _this;
667
- }
668
-
669
- /**
670
- * Defines if attributes would be resolved using internal setter functions
671
- * or custom functions that were passed in the constructor.
672
- * @param {Object} options
673
- */
674
-
675
-
676
- _createClass(Clipboard, [{
677
- key: 'resolveOptions',
678
- value: function resolveOptions() {
679
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
680
-
681
- this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
682
- this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
683
- this.text = typeof options.text === 'function' ? options.text : this.defaultText;
684
- }
685
- }, {
686
- key: 'listenClick',
687
- value: function listenClick(trigger) {
688
- var _this2 = this;
689
-
690
- this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
691
- return _this2.onClick(e);
692
- });
693
- }
694
- }, {
695
- key: 'onClick',
696
- value: function onClick(e) {
697
- var trigger = e.delegateTarget || e.currentTarget;
698
-
699
- if (this.clipboardAction) {
700
- this.clipboardAction = null;
701
- }
702
-
703
- this.clipboardAction = new _clipboardAction2.default({
704
- action: this.action(trigger),
705
- target: this.target(trigger),
706
- text: this.text(trigger),
707
- trigger: trigger,
708
- emitter: this
709
- });
710
- }
711
- }, {
712
- key: 'defaultAction',
713
- value: function defaultAction(trigger) {
714
- return getAttributeValue('action', trigger);
715
- }
716
- }, {
717
- key: 'defaultTarget',
718
- value: function defaultTarget(trigger) {
719
- var selector = getAttributeValue('target', trigger);
720
-
721
- if (selector) {
722
- return document.querySelector(selector);
723
- }
724
- }
725
- }, {
726
- key: 'defaultText',
727
- value: function defaultText(trigger) {
728
- return getAttributeValue('text', trigger);
729
- }
730
- }, {
731
- key: 'destroy',
732
- value: function destroy() {
733
- this.listener.destroy();
734
-
735
- if (this.clipboardAction) {
736
- this.clipboardAction.destroy();
737
- this.clipboardAction = null;
738
- }
739
- }
740
- }], [{
741
- key: 'isSupported',
742
- value: function isSupported() {
743
- var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
744
-
745
- var actions = typeof action === 'string' ? [action] : action;
746
- var support = !!document.queryCommandSupported;
747
-
748
- actions.forEach(function (action) {
749
- support = support && !!document.queryCommandSupported(action);
750
- });
751
-
752
- return support;
753
- }
754
- }]);
755
-
756
- return Clipboard;
757
- }(_tinyEmitter2.default);
758
-
759
- /**
760
- * Helper function to retrieve attribute value.
761
- * @param {String} suffix
762
- * @param {Element} element
763
- */
764
- function getAttributeValue(suffix, element) {
765
- var attribute = 'data-clipboard-' + suffix;
766
-
767
- if (!element.hasAttribute(attribute)) {
768
- return;
769
- }
770
-
771
- return element.getAttribute(attribute);
772
- }
773
-
774
- module.exports = Clipboard;
775
- });
776
-
777
- },{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)
778
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/vendor/clipboard/clipboard.min.js DELETED
@@ -1,7 +0,0 @@
1
- /*!
2
- * clipboard.js v1.6.0
3
- * https://zenorocha.github.io/clipboard.js
4
- *
5
- * Licensed MIT © Zeno Rocha
6
- */
7
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Clipboard=e()}}(function(){var e,t,n;return function e(t,n,o){function i(a,c){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var s=n[a]={exports:{}};t[a][0].call(s.exports,function(e){var n=t[a][1][e];return i(n?n:e)},s,s.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(e,t,n){function o(e,t){for(;e&&e.nodeType!==i;){if(e.matches(t))return e;e=e.parentNode}}var i=9;if(Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=o},{}],2:[function(e,t,n){function o(e,t,n,o,r){var a=i.apply(this,arguments);return e.addEventListener(n,a,r),{destroy:function(){e.removeEventListener(n,a,r)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}var r=e("./closest");t.exports=o},{"./closest":1}],3:[function(e,t,n){n.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===t||"[object HTMLCollection]"===t)&&"length"in e&&(0===e.length||n.node(e[0]))},n.string=function(e){return"string"==typeof e||e instanceof String},n.fn=function(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t}},{}],4:[function(e,t,n){function o(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!c.string(t))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(e))return i(e,t,n);if(c.nodeList(e))return r(e,t,n);if(c.string(e))return a(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function r(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function a(e,t,n){return l(document.body,e,t,n)}var c=e("./is"),l=e("delegate");t.exports=o},{"./is":3,delegate:2}],5:[function(e,t,n){function o(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(e),o.removeAllRanges(),o.addRange(i),t=o.toString()}return t}t.exports=o},{}],6:[function(e,t,n){function o(){}o.prototype={on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function o(){i.off(e,o),t.apply(n,arguments)}var i=this;return o._=t,this.on(e,o,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),o=n[e],i=[];if(o&&t)for(var r=0,a=o.length;r<a;r++)o[r].fn!==t&&o[r].fn._!==t&&i.push(o[r]);return i.length?n[e]=i:delete n[e],this}},t.exports=o},{}],7:[function(t,n,o){!function(i,r){if("function"==typeof e&&e.amd)e(["module","select"],r);else if("undefined"!=typeof o)r(n,t("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(t),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=function(){function e(t){o(this,e),this.resolveOptions(t),this.initSelection()}return a(e,[{key:"resolveOptions",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function e(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function e(){var t=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function e(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function e(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function e(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function e(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function e(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function e(){this.removeFake()}},{key:"action",set:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function e(){return this._action}},{key:"target",set:function e(t){if(void 0!==t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function e(){return this._target}}]),e}();e.exports=c})},{select:5}],8:[function(t,n,o){!function(i,r){if("function"==typeof e&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(e,t,n,o){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var u=i(t),s=i(n),f=i(o),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),h=function(e){function t(e,n){r(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.resolveOptions(n),o.listenClick(e),o}return c(t,e),d(t,[{key:"resolveOptions",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText}},{key:"listenClick",value:function e(t){var n=this;this.listener=(0,f.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function e(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new u.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})}},{key:"defaultAction",value:function e(t){return l("action",t)}},{key:"defaultTarget",value:function e(t){var n=l("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function e(t){return l("text",t)}},{key:"destroy",value:function e(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof t?[t]:t,o=!!document.queryCommandSupported;return n.forEach(function(e){o=o&&!!document.queryCommandSupported(e)}),o}}]),t}(s.default);e.exports=h})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});
 
 
 
 
 
 
 
assets/vendor/vue/vue.js CHANGED
@@ -1,12 +1,12 @@
1
  /*!
2
- * Vue.js v2.1.8
3
- * (c) 2014-2016 Evan You
4
  * Released under the MIT License.
5
  */
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
- typeof define === 'function' && define.amd ? define(factory) :
9
- (global.Vue = factory());
10
  }(this, (function () { 'use strict';
11
 
12
  /* */
@@ -27,8 +27,8 @@ function _toString (val) {
27
  * If the conversion fails, return original string.
28
  */
29
  function toNumber (val) {
30
- var n = parseFloat(val, 10);
31
- return (n || n === 0) ? n : val
32
  }
33
 
34
  /**
@@ -57,7 +57,7 @@ var isBuiltInTag = makeMap('slot,component', true);
57
  /**
58
  * Remove an item from an array
59
  */
60
- function remove$1 (arr, item) {
61
  if (arr.length) {
62
  var index = arr.indexOf(item);
63
  if (index > -1) {
@@ -93,7 +93,7 @@ function cached (fn) {
93
  }
94
 
95
  /**
96
- * Camelize a hyphen-delmited string.
97
  */
98
  var camelizeRE = /-(\w)/g;
99
  var camelize = cached(function (str) {
@@ -121,7 +121,7 @@ var hyphenate = cached(function (str) {
121
  /**
122
  * Simple bind, faster than native
123
  */
124
- function bind$1 (fn, ctx) {
125
  function boundFn (a) {
126
  var l = arguments.length;
127
  return l
@@ -222,7 +222,12 @@ function looseEqual (a, b) {
222
  var isObjectA = isObject(a);
223
  var isObjectB = isObject(b);
224
  if (isObjectA && isObjectB) {
225
- return JSON.stringify(a) === JSON.stringify(b)
 
 
 
 
 
226
  } else if (!isObjectA && !isObjectB) {
227
  return String(a) === String(b)
228
  } else {
@@ -237,6 +242,19 @@ function looseIndexOf (arr, val) {
237
  return -1
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  /* */
241
 
242
  var config = {
@@ -250,11 +268,21 @@ var config = {
250
  */
251
  silent: false,
252
 
 
 
 
 
 
253
  /**
254
  * Whether to enable devtools
255
  */
256
  devtools: "development" !== 'production',
257
 
 
 
 
 
 
258
  /**
259
  * Error handler for watcher errors
260
  */
@@ -331,6 +359,8 @@ var config = {
331
 
332
  /* */
333
 
 
 
334
  /**
335
  * Check if a string starts with $ or _
336
  */
@@ -358,15 +388,14 @@ var bailRE = /[^\w.$]/;
358
  function parsePath (path) {
359
  if (bailRE.test(path)) {
360
  return
361
- } else {
362
- var segments = path.split('.');
363
- return function (obj) {
364
- for (var i = 0; i < segments.length; i++) {
365
- if (!obj) { return }
366
- obj = obj[segments[i]];
367
- }
368
- return obj
369
  }
 
370
  }
371
  }
372
 
@@ -384,6 +413,7 @@ var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
384
  var isEdge = UA && UA.indexOf('edge/') > 0;
385
  var isAndroid = UA && UA.indexOf('android') > 0;
386
  var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
 
387
 
388
  // this needs to be lazy-evaled because vue may be required before
389
  // vue-server-renderer can set VUE_ENV
@@ -410,6 +440,10 @@ function isNative (Ctor) {
410
  return /native code/.test(Ctor.toString())
411
  }
412
 
 
 
 
 
413
  /**
414
  * Defer a task to execute it asynchronously.
415
  */
@@ -515,10 +549,15 @@ if (typeof Set !== 'undefined' && isNative(Set)) {
515
  }
516
 
517
  var warn = noop;
 
518
  var formatComponentName;
519
 
520
  {
521
  var hasConsole = typeof console !== 'undefined';
 
 
 
 
522
 
523
  warn = function (msg, vm) {
524
  if (hasConsole && (!config.silent)) {
@@ -528,21 +567,38 @@ var formatComponentName;
528
  }
529
  };
530
 
531
- formatComponentName = function (vm) {
 
 
 
 
 
 
 
 
532
  if (vm.$root === vm) {
533
- return 'root instance'
534
  }
535
- var name = vm._isVue
536
- ? vm.$options.name || vm.$options._componentTag
537
- : vm.name;
 
 
 
 
 
 
 
 
 
538
  return (
539
- (name ? ("component <" + name + ">") : "anonymous component") +
540
- (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
541
  )
542
  };
543
 
544
  var formatLocation = function (str) {
545
- if (str === 'anonymous component') {
546
  str += " - use the \"name\" option for better debugging messages.";
547
  }
548
  return ("\n(found in " + str + ")")
@@ -568,7 +624,7 @@ Dep.prototype.addSub = function addSub (sub) {
568
  };
569
 
570
  Dep.prototype.removeSub = function removeSub (sub) {
571
- remove$1(this.subs, sub);
572
  };
573
 
574
  Dep.prototype.depend = function depend () {
@@ -578,7 +634,7 @@ Dep.prototype.depend = function depend () {
578
  };
579
 
580
  Dep.prototype.notify = function notify () {
581
- // stablize the subscriber list first
582
  var subs = this.subs.slice();
583
  for (var i = 0, l = subs.length; i < l; i++) {
584
  subs[i].update();
@@ -821,27 +877,27 @@ function defineReactive$$1 (
821
  * triggers change notification if the property doesn't
822
  * already exist.
823
  */
824
- function set$1 (obj, key, val) {
825
- if (Array.isArray(obj)) {
826
- obj.length = Math.max(obj.length, key);
827
- obj.splice(key, 1, val);
828
  return val
829
  }
830
- if (hasOwn(obj, key)) {
831
- obj[key] = val;
832
- return
833
  }
834
- var ob = obj.__ob__;
835
- if (obj._isVue || (ob && ob.vmCount)) {
836
  "development" !== 'production' && warn(
837
  'Avoid adding reactive properties to a Vue instance or its root $data ' +
838
  'at runtime - declare it upfront in the data option.'
839
  );
840
- return
841
  }
842
  if (!ob) {
843
- obj[key] = val;
844
- return
845
  }
846
  defineReactive$$1(ob.value, key, val);
847
  ob.dep.notify();
@@ -851,19 +907,23 @@ function set$1 (obj, key, val) {
851
  /**
852
  * Delete a property and trigger change if necessary.
853
  */
854
- function del (obj, key) {
855
- var ob = obj.__ob__;
856
- if (obj._isVue || (ob && ob.vmCount)) {
 
 
 
 
857
  "development" !== 'production' && warn(
858
  'Avoid deleting properties on a Vue instance or its root $data ' +
859
  '- just set it to null.'
860
  );
861
  return
862
  }
863
- if (!hasOwn(obj, key)) {
864
  return
865
  }
866
- delete obj[key];
867
  if (!ob) {
868
  return
869
  }
@@ -920,7 +980,7 @@ function mergeData (to, from) {
920
  toVal = to[key];
921
  fromVal = from[key];
922
  if (!hasOwn(to, key)) {
923
- set$1(to, key, fromVal);
924
  } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
925
  mergeData(toVal, fromVal);
926
  }
@@ -983,7 +1043,7 @@ strats.data = function (
983
  };
984
 
985
  /**
986
- * Hooks and param attributes are merged as arrays.
987
  */
988
  function mergeHook (
989
  parentVal,
@@ -1028,7 +1088,7 @@ config._assetTypes.forEach(function (type) {
1028
  */
1029
  strats.watch = function (parentVal, childVal) {
1030
  /* istanbul ignore if */
1031
- if (!childVal) { return parentVal }
1032
  if (!parentVal) { return childVal }
1033
  var ret = {};
1034
  extend(ret, parentVal);
@@ -1051,7 +1111,7 @@ strats.watch = function (parentVal, childVal) {
1051
  strats.props =
1052
  strats.methods =
1053
  strats.computed = function (parentVal, childVal) {
1054
- if (!childVal) { return parentVal }
1055
  if (!parentVal) { return childVal }
1056
  var ret = Object.create(null);
1057
  extend(ret, parentVal);
@@ -1254,8 +1314,8 @@ function getPropDefaultValue (vm, prop, key) {
1254
  }
1255
  var def = prop.default;
1256
  // warn against non-factory defaults for Object & Array
1257
- if (isObject(def)) {
1258
- "development" !== 'production' && warn(
1259
  'Invalid default value for prop "' + key + '": ' +
1260
  'Props with type Object/Array must use a factory function ' +
1261
  'to return the default value.',
@@ -1266,11 +1326,12 @@ function getPropDefaultValue (vm, prop, key) {
1266
  // return previous default value to avoid unnecessary watcher trigger
1267
  if (vm && vm.$options.propsData &&
1268
  vm.$options.propsData[key] === undefined &&
1269
- vm[key] !== undefined) {
1270
- return vm[key]
1271
  }
1272
  // call factory function for non-Function types
1273
- return typeof def === 'function' && prop.type !== Function
 
1274
  ? def.call(vm)
1275
  : def
1276
  }
@@ -1378,54 +1439,21 @@ function isType (type, fn) {
1378
  return false
1379
  }
1380
 
1381
-
1382
-
1383
- var util = Object.freeze({
1384
- defineReactive: defineReactive$$1,
1385
- _toString: _toString,
1386
- toNumber: toNumber,
1387
- makeMap: makeMap,
1388
- isBuiltInTag: isBuiltInTag,
1389
- remove: remove$1,
1390
- hasOwn: hasOwn,
1391
- isPrimitive: isPrimitive,
1392
- cached: cached,
1393
- camelize: camelize,
1394
- capitalize: capitalize,
1395
- hyphenate: hyphenate,
1396
- bind: bind$1,
1397
- toArray: toArray,
1398
- extend: extend,
1399
- isObject: isObject,
1400
- isPlainObject: isPlainObject,
1401
- toObject: toObject,
1402
- noop: noop,
1403
- no: no,
1404
- identity: identity,
1405
- genStaticKeys: genStaticKeys,
1406
- looseEqual: looseEqual,
1407
- looseIndexOf: looseIndexOf,
1408
- isReserved: isReserved,
1409
- def: def,
1410
- parsePath: parsePath,
1411
- hasProto: hasProto,
1412
- inBrowser: inBrowser,
1413
- UA: UA,
1414
- isIE: isIE,
1415
- isIE9: isIE9,
1416
- isEdge: isEdge,
1417
- isAndroid: isAndroid,
1418
- isIOS: isIOS,
1419
- isServerRendering: isServerRendering,
1420
- devtools: devtools,
1421
- nextTick: nextTick,
1422
- get _Set () { return _Set; },
1423
- mergeOptions: mergeOptions,
1424
- resolveAsset: resolveAsset,
1425
- get warn () { return warn; },
1426
- get formatComponentName () { return formatComponentName; },
1427
- validateProp: validateProp
1428
- });
1429
 
1430
  /* not type checking this file because flow doesn't play well with Proxy */
1431
 
@@ -1501,1327 +1529,1561 @@ var initProxy;
1501
  };
1502
  }
1503
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1504
  /* */
1505
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1506
 
1507
- var queue = [];
1508
- var has$1 = {};
1509
- var circular = {};
1510
- var waiting = false;
1511
- var flushing = false;
1512
- var index = 0;
1513
 
1514
- /**
1515
- * Reset the scheduler's state.
1516
- */
1517
- function resetSchedulerState () {
1518
- queue.length = 0;
1519
- has$1 = {};
1520
- {
1521
- circular = {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1522
  }
1523
- waiting = flushing = false;
1524
  }
1525
 
1526
- /**
1527
- * Flush both queues and run the watchers.
1528
- */
1529
- function flushSchedulerQueue () {
1530
- flushing = true;
1531
 
1532
- // Sort queue before flush.
1533
- // This ensures that:
1534
- // 1. Components are updated from parent to child. (because parent is always
1535
- // created before the child)
1536
- // 2. A component's user watchers are run before its render watcher (because
1537
- // user watchers are created before the render watcher)
1538
- // 3. If a component is destroyed during a parent component's watcher run,
1539
- // its watchers can be skipped.
1540
- queue.sort(function (a, b) { return a.id - b.id; });
 
 
1541
 
1542
- // do not cache length because more watchers might be pushed
1543
- // as we run existing watchers
1544
- for (index = 0; index < queue.length; index++) {
1545
- var watcher = queue[index];
1546
- var id = watcher.id;
1547
- has$1[id] = null;
1548
- watcher.run();
1549
- // in dev build, check and stop circular updates.
1550
- if ("development" !== 'production' && has$1[id] != null) {
1551
- circular[id] = (circular[id] || 0) + 1;
1552
- if (circular[id] > config._maxUpdateCount) {
1553
- warn(
1554
- 'You may have an infinite update loop ' + (
1555
- watcher.user
1556
- ? ("in watcher with expression \"" + (watcher.expression) + "\"")
1557
- : "in a component render function."
1558
- ),
1559
- watcher.vm
1560
- );
1561
- break
1562
  }
 
 
 
1563
  }
1564
  }
1565
-
1566
- // devtool hook
1567
- /* istanbul ignore if */
1568
- if (devtools && config.devtools) {
1569
- devtools.emit('flush');
1570
- }
1571
-
1572
- resetSchedulerState();
1573
  }
1574
 
1575
- /**
1576
- * Push a watcher into the watcher queue.
1577
- * Jobs with duplicate IDs will be skipped unless it's
1578
- * pushed when the queue is being flushed.
1579
- */
1580
- function queueWatcher (watcher) {
1581
- var id = watcher.id;
1582
- if (has$1[id] == null) {
1583
- has$1[id] = true;
1584
- if (!flushing) {
1585
- queue.push(watcher);
1586
- } else {
1587
- // if already flushing, splice the watcher based on its id
1588
- // if already past its id, it will be run next immediately.
1589
- var i = queue.length - 1;
1590
- while (i >= 0 && queue[i].id > watcher.id) {
1591
- i--;
 
 
 
1592
  }
1593
- queue.splice(Math.max(i, index) + 1, 0, watcher);
 
 
 
1594
  }
1595
- // queue the flush
1596
- if (!waiting) {
1597
- waiting = true;
1598
- nextTick(flushSchedulerQueue);
 
1599
  }
1600
  }
1601
  }
1602
 
1603
  /* */
1604
 
1605
- var uid$2 = 0;
 
 
1606
 
1607
- /**
1608
- * A watcher parses an expression, collects dependencies,
1609
- * and fires callback when the expression value changes.
1610
- * This is used for both the $watch() api and directives.
1611
- */
1612
- var Watcher = function Watcher (
1613
- vm,
1614
- expOrFn,
1615
- cb,
1616
- options
1617
- ) {
1618
- this.vm = vm;
1619
- vm._watchers.push(this);
1620
- // options
1621
- if (options) {
1622
- this.deep = !!options.deep;
1623
- this.user = !!options.user;
1624
- this.lazy = !!options.lazy;
1625
- this.sync = !!options.sync;
1626
  } else {
1627
- this.deep = this.user = this.lazy = this.sync = false;
 
 
 
 
 
 
 
 
1628
  }
1629
- this.cb = cb;
1630
- this.id = ++uid$2; // uid for batching
1631
- this.active = true;
1632
- this.dirty = this.lazy; // for lazy watchers
1633
- this.deps = [];
1634
- this.newDeps = [];
1635
- this.depIds = new _Set();
1636
- this.newDepIds = new _Set();
1637
- this.expression = expOrFn.toString();
1638
- // parse expression for getter
1639
- if (typeof expOrFn === 'function') {
1640
- this.getter = expOrFn;
1641
- } else {
1642
- this.getter = parsePath(expOrFn);
1643
- if (!this.getter) {
1644
- this.getter = function () {};
1645
- "development" !== 'production' && warn(
1646
- "Failed watching path: \"" + expOrFn + "\" " +
1647
- 'Watcher only accepts simple dot-delimited paths. ' +
1648
- 'For full control, use a function instead.',
1649
- vm
1650
- );
1651
- }
1652
- }
1653
- this.value = this.lazy
1654
- ? undefined
1655
- : this.get();
1656
- };
1657
 
1658
- /**
1659
- * Evaluate the getter, and re-collect dependencies.
1660
- */
1661
- Watcher.prototype.get = function get () {
1662
- pushTarget(this);
1663
- var value = this.getter.call(this.vm, this.vm);
1664
- // "touch" every property so they are all tracked as
1665
- // dependencies for deep watching
1666
- if (this.deep) {
1667
- traverse(value);
1668
- }
1669
- popTarget();
1670
- this.cleanupDeps();
1671
- return value
1672
- };
1673
 
1674
- /**
1675
- * Add a dependency to this directive.
1676
- */
1677
- Watcher.prototype.addDep = function addDep (dep) {
1678
- var id = dep.id;
1679
- if (!this.newDepIds.has(id)) {
1680
- this.newDepIds.add(id);
1681
- this.newDeps.push(dep);
1682
- if (!this.depIds.has(id)) {
1683
- dep.addSub(this);
1684
- }
1685
- }
1686
- };
1687
 
1688
- /**
1689
- * Clean up for dependency collection.
1690
- */
1691
- Watcher.prototype.cleanupDeps = function cleanupDeps () {
1692
- var this$1 = this;
 
1693
 
1694
- var i = this.deps.length;
1695
- while (i--) {
1696
- var dep = this$1.deps[i];
1697
- if (!this$1.newDepIds.has(dep.id)) {
1698
- dep.removeSub(this$1);
 
 
 
 
1699
  }
1700
  }
1701
- var tmp = this.depIds;
1702
- this.depIds = this.newDepIds;
1703
- this.newDepIds = tmp;
1704
- this.newDepIds.clear();
1705
- tmp = this.deps;
1706
- this.deps = this.newDeps;
1707
- this.newDeps = tmp;
1708
- this.newDeps.length = 0;
1709
- };
1710
 
1711
- /**
1712
- * Subscriber interface.
1713
- * Will be called when a dependency changes.
1714
- */
1715
- Watcher.prototype.update = function update () {
1716
- /* istanbul ignore else */
1717
- if (this.lazy) {
1718
- this.dirty = true;
1719
- } else if (this.sync) {
1720
- this.run();
1721
- } else {
1722
- queueWatcher(this);
1723
- }
1724
- };
1725
 
1726
- /**
1727
- * Scheduler job interface.
1728
- * Will be called by the scheduler.
1729
- */
1730
- Watcher.prototype.run = function run () {
1731
- if (this.active) {
1732
- var value = this.get();
1733
- if (
1734
- value !== this.value ||
1735
- // Deep watchers and watchers on Object/Arrays should fire even
1736
- // when the value is the same, because the value may
1737
- // have mutated.
1738
- isObject(value) ||
1739
- this.deep
1740
- ) {
1741
- // set new value
1742
- var oldValue = this.value;
1743
- this.value = value;
1744
- if (this.user) {
1745
- try {
1746
- this.cb.call(this.vm, value, oldValue);
1747
- } catch (e) {
1748
- /* istanbul ignore else */
1749
- if (config.errorHandler) {
1750
- config.errorHandler.call(null, e, this.vm);
1751
- } else {
1752
- "development" !== 'production' && warn(
1753
- ("Error in watcher \"" + (this.expression) + "\""),
1754
- this.vm
1755
- );
1756
- throw e
1757
- }
1758
- }
1759
  } else {
1760
- this.cb.call(this.vm, value, oldValue);
 
 
 
 
1761
  }
1762
  }
1763
  }
1764
- };
1765
-
1766
- /**
1767
- * Evaluate the value of the watcher.
1768
- * This only gets called for lazy watchers.
1769
- */
1770
- Watcher.prototype.evaluate = function evaluate () {
1771
- this.value = this.get();
1772
- this.dirty = false;
1773
- };
1774
 
1775
- /**
1776
- * Depend on all deps collected by this watcher.
1777
- */
1778
- Watcher.prototype.depend = function depend () {
1779
- var this$1 = this;
1780
 
1781
- var i = this.deps.length;
1782
- while (i--) {
1783
- this$1.deps[i].depend();
1784
- }
1785
- };
1786
 
1787
- /**
1788
- * Remove self from all dependencies' subscriber list.
1789
- */
1790
- Watcher.prototype.teardown = function teardown () {
1791
- var this$1 = this;
1792
 
1793
- if (this.active) {
1794
- // remove self from vm's watcher list
1795
- // this is a somewhat expensive operation so we skip it
1796
- // if the vm is being destroyed.
1797
- if (!this.vm._isBeingDestroyed) {
1798
- remove$1(this.vm._watchers, this);
1799
- }
1800
- var i = this.deps.length;
1801
- while (i--) {
1802
- this$1.deps[i].removeSub(this$1);
1803
- }
1804
- this.active = false;
1805
  }
1806
- };
1807
-
1808
- /**
1809
- * Recursively traverse an object to evoke all converted
1810
- * getters, so that every nested property inside the object
1811
- * is collected as a "deep" dependency.
1812
- */
1813
- var seenObjects = new _Set();
1814
- function traverse (val) {
1815
- seenObjects.clear();
1816
- _traverse(val, seenObjects);
1817
  }
1818
 
1819
- function _traverse (val, seen) {
1820
- var i, keys;
1821
- var isA = Array.isArray(val);
1822
- if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
1823
- return
1824
- }
1825
- if (val.__ob__) {
1826
- var depId = val.__ob__.dep.id;
1827
- if (seen.has(depId)) {
1828
- return
1829
- }
1830
- seen.add(depId);
1831
- }
1832
- if (isA) {
1833
- i = val.length;
1834
- while (i--) { _traverse(val[i], seen); }
1835
  } else {
1836
- keys = Object.keys(val);
1837
- i = keys.length;
1838
- while (i--) { _traverse(val[keys[i]], seen); }
1839
  }
1840
  }
1841
 
1842
- /* */
 
 
1843
 
1844
- function initState (vm) {
1845
- vm._watchers = [];
1846
- var opts = vm.$options;
1847
- if (opts.props) { initProps(vm, opts.props); }
1848
- if (opts.methods) { initMethods(vm, opts.methods); }
1849
- if (opts.data) {
1850
- initData(vm);
1851
- } else {
1852
- observe(vm._data = {}, true /* asRootData */);
1853
- }
1854
- if (opts.computed) { initComputed(vm, opts.computed); }
1855
- if (opts.watch) { initWatch(vm, opts.watch); }
1856
  }
1857
 
1858
- var isReservedProp = { key: 1, ref: 1, slot: 1 };
 
 
 
1859
 
1860
- function initProps (vm, props) {
1861
- var propsData = vm.$options.propsData || {};
1862
- var keys = vm.$options._propKeys = Object.keys(props);
1863
- var isRoot = !vm.$parent;
1864
- // root instance props should be converted
1865
- observerState.shouldConvert = isRoot;
1866
- var loop = function ( i ) {
1867
- var key = keys[i];
1868
- /* istanbul ignore else */
1869
- {
1870
- if (isReservedProp[key]) {
1871
- warn(
1872
- ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
1873
- vm
1874
- );
1875
  }
1876
- defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
1877
- if (vm.$parent && !observerState.isSettingProps) {
1878
- warn(
1879
- "Avoid mutating a prop directly since the value will be " +
1880
- "overwritten whenever the parent component re-renders. " +
1881
- "Instead, use a data or computed property based on the prop's " +
1882
- "value. Prop being mutated: \"" + key + "\"",
1883
- vm
1884
- );
1885
- }
1886
- });
1887
  }
 
1888
  };
1889
 
1890
- for (var i = 0; i < keys.length; i++) loop( i );
1891
- observerState.shouldConvert = true;
1892
- }
1893
-
1894
- function initData (vm) {
1895
- var data = vm.$options.data;
1896
- data = vm._data = typeof data === 'function'
1897
- ? data.call(vm)
1898
- : data || {};
1899
- if (!isPlainObject(data)) {
1900
- data = {};
1901
- "development" !== 'production' && warn(
1902
- 'data functions should return an object:\n' +
1903
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
1904
- vm
1905
- );
1906
- }
1907
- // proxy data on instance
1908
- var keys = Object.keys(data);
1909
- var props = vm.$options.props;
1910
- var i = keys.length;
1911
- while (i--) {
1912
- if (props && hasOwn(props, keys[i])) {
1913
- "development" !== 'production' && warn(
1914
- "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
1915
- "Use prop default value instead.",
1916
- vm
1917
- );
1918
- } else {
1919
- proxy(vm, keys[i]);
1920
  }
1921
- }
1922
- // observe data
1923
- observe(data, true /* asRootData */);
1924
- }
1925
 
1926
- var computedSharedDefinition = {
1927
- enumerable: true,
1928
- configurable: true,
1929
- get: noop,
1930
- set: noop
1931
- };
1932
 
1933
- function initComputed (vm, computed) {
1934
- for (var key in computed) {
1935
- /* istanbul ignore if */
1936
- if ("development" !== 'production' && key in vm) {
1937
- warn(
1938
- "existing instance property \"" + key + "\" will be " +
1939
- "overwritten by a computed property with the same name.",
1940
- vm
1941
- );
1942
  }
1943
- var userDef = computed[key];
1944
- if (typeof userDef === 'function') {
1945
- computedSharedDefinition.get = makeComputedGetter(userDef, vm);
1946
- computedSharedDefinition.set = noop;
1947
- } else {
1948
- computedSharedDefinition.get = userDef.get
1949
- ? userDef.cache !== false
1950
- ? makeComputedGetter(userDef.get, vm)
1951
- : bind$1(userDef.get, vm)
1952
- : noop;
1953
- computedSharedDefinition.set = userDef.set
1954
- ? bind$1(userDef.set, vm)
1955
- : noop;
1956
  }
1957
- Object.defineProperty(vm, key, computedSharedDefinition);
1958
- }
1959
- }
1960
-
1961
- function makeComputedGetter (getter, owner) {
1962
- var watcher = new Watcher(owner, getter, noop, {
1963
- lazy: true
1964
- });
1965
- return function computedGetter () {
1966
- if (watcher.dirty) {
1967
- watcher.evaluate();
1968
  }
1969
- if (Dep.target) {
1970
- watcher.depend();
 
1971
  }
1972
- return watcher.value
1973
- }
1974
- }
 
 
 
 
 
 
 
 
 
1975
 
1976
- function initMethods (vm, methods) {
1977
- for (var key in methods) {
1978
- vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
1979
- if ("development" !== 'production' && methods[key] == null) {
1980
- warn(
1981
- "method \"" + key + "\" has an undefined value in the component definition. " +
1982
- "Did you reference the function correctly?",
1983
- vm
1984
- );
1985
  }
1986
- }
 
1987
  }
1988
 
1989
- function initWatch (vm, watch) {
1990
- for (var key in watch) {
1991
- var handler = watch[key];
1992
- if (Array.isArray(handler)) {
1993
- for (var i = 0; i < handler.length; i++) {
1994
- createWatcher(vm, key, handler[i]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1995
  }
1996
  } else {
1997
- createWatcher(vm, key, handler);
1998
  }
1999
  }
 
 
 
 
 
2000
  }
2001
 
2002
- function createWatcher (vm, key, handler) {
2003
- var options;
2004
- if (isPlainObject(handler)) {
2005
- options = handler;
2006
- handler = handler.handler;
2007
- }
2008
- if (typeof handler === 'string') {
2009
- handler = vm[handler];
2010
- }
2011
- vm.$watch(key, handler, options);
2012
  }
2013
 
2014
- function stateMixin (Vue) {
2015
- // flow somehow has problems with directly declared definition object
2016
- // when using Object.defineProperty, so we have to procedurally build up
2017
- // the object here.
2018
- var dataDef = {};
2019
- dataDef.get = function () {
2020
- return this._data
2021
- };
2022
- {
2023
- dataDef.set = function (newData) {
2024
- warn(
2025
- 'Avoid replacing instance root $data. ' +
2026
- 'Use nested data properties instead.',
2027
- this
2028
- );
2029
- };
2030
  }
2031
- Object.defineProperty(Vue.prototype, '$data', dataDef);
 
2032
 
2033
- Vue.prototype.$set = set$1;
2034
- Vue.prototype.$delete = del;
2035
 
2036
- Vue.prototype.$watch = function (
2037
- expOrFn,
2038
- cb,
2039
- options
2040
- ) {
2041
- var vm = this;
2042
- options = options || {};
2043
- options.user = true;
2044
- var watcher = new Watcher(vm, expOrFn, cb, options);
2045
- if (options.immediate) {
2046
- cb.call(vm, watcher.value);
2047
- }
2048
- return function unwatchFn () {
2049
- watcher.teardown();
2050
- }
2051
- };
2052
- }
2053
 
2054
- function proxy (vm, key) {
2055
- if (!isReserved(key)) {
2056
- Object.defineProperty(vm, key, {
2057
- configurable: true,
2058
- enumerable: true,
2059
- get: function proxyGetter () {
2060
- return vm._data[key]
2061
- },
2062
- set: function proxySetter (val) {
2063
- vm._data[key] = val;
2064
- }
2065
- });
2066
  }
2067
- }
2068
 
2069
- /* */
 
2070
 
2071
- var VNode = function VNode (
2072
- tag,
2073
- data,
2074
- children,
2075
- text,
2076
- elm,
2077
- context,
2078
- componentOptions
2079
- ) {
2080
- this.tag = tag;
2081
- this.data = data;
2082
- this.children = children;
2083
- this.text = text;
2084
- this.elm = elm;
2085
- this.ns = undefined;
2086
- this.context = context;
2087
- this.functionalContext = undefined;
2088
- this.key = data && data.key;
2089
- this.componentOptions = componentOptions;
2090
- this.child = undefined;
2091
- this.parent = undefined;
2092
- this.raw = false;
2093
- this.isStatic = false;
2094
- this.isRootInsert = true;
2095
- this.isComment = false;
2096
- this.isCloned = false;
2097
- this.isOnce = false;
2098
- };
2099
-
2100
- var createEmptyVNode = function () {
2101
- var node = new VNode();
2102
- node.text = '';
2103
- node.isComment = true;
2104
- return node
2105
- };
2106
-
2107
- function createTextVNode (val) {
2108
- return new VNode(undefined, undefined, undefined, String(val))
2109
- }
2110
 
2111
- // optimized shallow clone
2112
- // used for static nodes and slot nodes because they may be reused across
2113
- // multiple renders, cloning them avoids errors when DOM manipulations rely
2114
- // on their elm reference.
2115
- function cloneVNode (vnode) {
2116
- var cloned = new VNode(
2117
- vnode.tag,
2118
- vnode.data,
2119
- vnode.children,
2120
- vnode.text,
2121
- vnode.elm,
2122
- vnode.context,
2123
- vnode.componentOptions
2124
- );
2125
- cloned.ns = vnode.ns;
2126
- cloned.isStatic = vnode.isStatic;
2127
- cloned.key = vnode.key;
2128
- cloned.isCloned = true;
2129
- return cloned
2130
  }
2131
 
2132
- function cloneVNodes (vnodes) {
2133
- var res = new Array(vnodes.length);
2134
- for (var i = 0; i < vnodes.length; i++) {
2135
- res[i] = cloneVNode(vnodes[i]);
2136
- }
2137
- return res
2138
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2139
 
2140
- /* */
 
 
 
 
 
2141
 
2142
- function mergeVNodeHook (def, hookKey, hook, key) {
2143
- key = key + hookKey;
2144
- var injectedHash = def.__injected || (def.__injected = {});
2145
- if (!injectedHash[key]) {
2146
- injectedHash[key] = true;
2147
- var oldHook = def[hookKey];
2148
- if (oldHook) {
2149
- def[hookKey] = function () {
2150
- oldHook.apply(this, arguments);
2151
- hook.apply(this, arguments);
2152
- };
2153
- } else {
2154
- def[hookKey] = hook;
2155
  }
2156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2157
  }
2158
 
2159
- /* */
2160
-
2161
- function updateListeners (
2162
- on,
2163
- oldOn,
2164
- add,
2165
- remove$$1,
2166
- vm
2167
  ) {
2168
- var name, cur, old, fn, event, capture, once;
2169
- for (name in on) {
2170
- cur = on[name];
2171
- old = oldOn[name];
2172
- if (!cur) {
2173
- "development" !== 'production' && warn(
2174
- "Invalid handler for event \"" + name + "\": got " + String(cur),
2175
- vm
2176
- );
2177
- } else if (!old) {
2178
- once = name.charAt(0) === '~'; // Prefixed last, checked first
2179
- event = once ? name.slice(1) : name;
2180
- capture = event.charAt(0) === '!';
2181
- event = capture ? event.slice(1) : event;
2182
- if (Array.isArray(cur)) {
2183
- add(event, (cur.invoker = arrInvoker(cur)), once, capture);
2184
- } else {
2185
- if (!cur.invoker) {
2186
- fn = cur;
2187
- cur = on[name] = {};
2188
- cur.fn = fn;
2189
- cur.invoker = fnInvoker(cur);
2190
- }
2191
- add(event, cur.invoker, once, capture);
2192
- }
2193
- } else if (cur !== old) {
2194
- if (Array.isArray(old)) {
2195
- old.length = cur.length;
2196
- for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }
2197
- on[name] = old;
2198
  } else {
2199
- old.fn = cur;
2200
- on[name] = old;
 
 
2201
  }
2202
  }
2203
  }
2204
- for (name in oldOn) {
2205
- if (!on[name]) {
2206
- once = name.charAt(0) === '~'; // Prefixed last, checked first
2207
- event = once ? name.slice(1) : name;
2208
- capture = event.charAt(0) === '!';
2209
- event = capture ? event.slice(1) : event;
2210
- remove$$1(event, oldOn[name].invoker, capture);
2211
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2212
  }
 
2213
  }
2214
 
2215
- function arrInvoker (arr) {
2216
- return function (ev) {
2217
- var arguments$1 = arguments;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2218
 
2219
- var single = arguments.length === 1;
2220
- for (var i = 0; i < arr.length; i++) {
2221
- single ? arr[i](ev) : arr[i].apply(null, arguments$1);
 
 
 
 
 
 
 
 
 
 
 
 
2222
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
2223
  }
2224
  }
2225
 
2226
- function fnInvoker (o) {
2227
- return function (ev) {
2228
- var single = arguments.length === 1;
2229
- single ? o.fn(ev) : o.fn.apply(null, arguments);
2230
  }
 
2231
  }
2232
 
2233
- /* */
2234
-
2235
- // The template compiler attempts to minimize the need for normalization by
2236
- // statically analyzing the template at compile time.
2237
- //
2238
- // For plain HTML markup, normalization can be completely skipped because the
2239
- // generated render function is guaranteed to return Array<VNode>. There are
2240
- // two cases where extra normalization is needed:
 
 
 
 
 
 
 
 
 
2241
 
2242
- // 1. When the children contains components - because a functional component
2243
- // may return an Array instead of a single root. In this case, just a simple
2244
- // nomralization is needed - if any child is an Array, we flatten the whole
2245
- // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
2246
- // because functional components already normalize their own children.
2247
- function simpleNormalizeChildren (children) {
2248
- for (var i = 0; i < children.length; i++) {
2249
- if (Array.isArray(children[i])) {
2250
- return Array.prototype.concat.apply([], children)
2251
  }
2252
  }
2253
- return children
 
 
 
 
 
 
2254
  }
2255
 
2256
- // 2. When the children contains constrcuts that always generated nested Arrays,
2257
- // e.g. <template>, <slot>, v-for, or when the children is provided by user
2258
- // with hand-written render functions / JSX. In such cases a full normalization
2259
- // is needed to cater to all possible types of children values.
2260
- function normalizeChildren (children) {
2261
- return isPrimitive(children)
2262
- ? [createTextVNode(children)]
2263
- : Array.isArray(children)
2264
- ? normalizeArrayChildren(children)
2265
- : undefined
2266
- }
2267
-
2268
- function normalizeArrayChildren (children, nestedIndex) {
2269
- var res = [];
2270
- var i, c, last;
2271
- for (i = 0; i < children.length; i++) {
2272
- c = children[i];
2273
- if (c == null || typeof c === 'boolean') { continue }
2274
- last = res[res.length - 1];
2275
- // nested
2276
- if (Array.isArray(c)) {
2277
- res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
2278
- } else if (isPrimitive(c)) {
2279
- if (last && last.text) {
2280
- last.text += String(c);
2281
- } else if (c !== '') {
2282
- // convert primitive to vnode
2283
- res.push(createTextVNode(c));
2284
- }
2285
- } else {
2286
- if (c.text && last && last.text) {
2287
- res[res.length - 1] = createTextVNode(last.text + c.text);
2288
- } else {
2289
- // default key for nested array children (likely generated by v-for)
2290
- if (c.tag && c.key == null && nestedIndex != null) {
2291
- c.key = "__vlist" + nestedIndex + "_" + i + "__";
2292
- }
2293
- res.push(c);
2294
- }
2295
- }
2296
- }
2297
- return res
2298
- }
2299
-
2300
- /* */
2301
-
2302
- function getFirstComponentChild (children) {
2303
- return children && children.filter(function (c) { return c && c.componentOptions; })[0]
2304
  }
2305
 
2306
  /* */
2307
 
2308
- function initEvents (vm) {
2309
- vm._events = Object.create(null);
2310
- vm._hasHookEvent = false;
2311
- // init parent attached events
2312
- var listeners = vm.$options._parentListeners;
2313
- if (listeners) {
2314
- updateComponentListeners(vm, listeners);
2315
- }
2316
- }
2317
 
2318
- var target;
 
 
 
 
 
2319
 
2320
- function add$1 (event, fn, once) {
2321
- if (once) {
2322
- target.$once(event, fn);
2323
- } else {
2324
- target.$on(event, fn);
 
 
 
2325
  }
 
2326
  }
2327
 
2328
- function remove$2 (event, fn) {
2329
- target.$off(event, fn);
2330
- }
 
 
 
2331
 
2332
- function updateComponentListeners (
2333
- vm,
2334
- listeners,
2335
- oldListeners
2336
- ) {
2337
- target = vm;
2338
- updateListeners(listeners, oldListeners || {}, add$1, remove$2, vm);
2339
- }
 
2340
 
2341
- function eventsMixin (Vue) {
2342
- var hookRE = /^hook:/;
2343
- Vue.prototype.$on = function (event, fn) {
2344
- var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
2345
- // optimize hook:event cost by using a boolean flag marked at registration
2346
- // instead of a hash lookup
2347
- if (hookRE.test(event)) {
2348
- vm._hasHookEvent = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
2349
  }
2350
- return vm
2351
- };
2352
 
2353
- Vue.prototype.$once = function (event, fn) {
2354
- var vm = this;
2355
- function on () {
2356
- vm.$off(event, on);
2357
- fn.apply(vm, arguments);
 
 
2358
  }
2359
- on.fn = fn;
2360
- vm.$on(event, on);
2361
- return vm
2362
- };
2363
 
2364
- Vue.prototype.$off = function (event, fn) {
2365
- var vm = this;
2366
- // all
2367
- if (!arguments.length) {
2368
- vm._events = Object.create(null);
2369
- return vm
2370
- }
2371
- // specific event
2372
- var cbs = vm._events[event];
2373
- if (!cbs) {
2374
- return vm
2375
- }
2376
- if (arguments.length === 1) {
2377
- vm._events[event] = null;
2378
- return vm
2379
- }
2380
- // specific handler
2381
- var cb;
2382
- var i = cbs.length;
2383
- while (i--) {
2384
- cb = cbs[i];
2385
- if (cb === fn || cb.fn === fn) {
2386
- cbs.splice(i, 1);
2387
- break
2388
- }
2389
- }
2390
- return vm
2391
- };
2392
 
2393
- Vue.prototype.$emit = function (event) {
2394
- var vm = this;
2395
- var cbs = vm._events[event];
2396
- if (cbs) {
2397
- cbs = cbs.length > 1 ? toArray(cbs) : cbs;
2398
- var args = toArray(arguments, 1);
2399
- for (var i = 0, l = cbs.length; i < l; i++) {
2400
- cbs[i].apply(vm, args);
 
 
 
 
 
 
 
 
 
 
 
 
2401
  }
 
2402
  }
2403
- return vm
2404
- };
 
 
 
 
2405
  }
2406
 
2407
  /* */
2408
 
2409
- var activeInstance = null;
2410
-
2411
- function initLifecycle (vm) {
2412
- var options = vm.$options;
2413
 
2414
- // locate first non-abstract parent
2415
- var parent = options.parent;
2416
- if (parent && !options.abstract) {
2417
- while (parent.$options.abstract && parent.$parent) {
2418
- parent = parent.$parent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2419
  }
2420
- parent.$children.push(vm);
2421
  }
 
 
 
 
2422
 
2423
- vm.$parent = parent;
2424
- vm.$root = parent ? parent.$root : vm;
2425
-
2426
- vm.$children = [];
2427
- vm.$refs = {};
2428
-
2429
- vm._watcher = null;
2430
- vm._inactive = false;
2431
- vm._isMounted = false;
2432
- vm._isDestroyed = false;
2433
- vm._isBeingDestroyed = false;
2434
- }
2435
-
2436
- function lifecycleMixin (Vue) {
2437
- Vue.prototype._mount = function (
2438
- el,
2439
- hydrating
2440
- ) {
2441
- var vm = this;
2442
- vm.$el = el;
2443
- if (!vm.$options.render) {
2444
- vm.$options.render = createEmptyVNode;
2445
- {
2446
- /* istanbul ignore if */
2447
- if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
2448
- warn(
2449
- 'You are using the runtime-only build of Vue where the template ' +
2450
- 'option is not available. Either pre-compile the templates into ' +
2451
- 'render functions, or use the compiler-included build.',
2452
- vm
2453
- );
2454
- } else {
2455
- warn(
2456
- 'Failed to mount component: template or render function not defined.',
2457
- vm
2458
- );
2459
- }
2460
- }
2461
- }
2462
- callHook(vm, 'beforeMount');
2463
- vm._watcher = new Watcher(vm, function () {
2464
- vm._update(vm._render(), hydrating);
2465
- }, noop);
2466
- hydrating = false;
2467
- // manually mounted instance, call mounted on self
2468
- // mounted is called for render-created child components in its inserted hook
2469
- if (vm.$vnode == null) {
2470
- vm._isMounted = true;
2471
- callHook(vm, 'mounted');
2472
  }
2473
- return vm
2474
- };
 
 
 
 
 
 
 
 
 
 
2475
 
2476
- Vue.prototype._update = function (vnode, hydrating) {
2477
- var vm = this;
2478
- if (vm._isMounted) {
2479
- callHook(vm, 'beforeUpdate');
2480
- }
2481
- var prevEl = vm.$el;
2482
- var prevVnode = vm._vnode;
2483
- var prevActiveInstance = activeInstance;
2484
- activeInstance = vm;
2485
- vm._vnode = vnode;
2486
- // Vue.prototype.__patch__ is injected in entry points
2487
- // based on the rendering backend used.
2488
- if (!prevVnode) {
2489
- // initial render
2490
- vm.$el = vm.__patch__(
2491
- vm.$el, vnode, hydrating, false /* removeOnly */,
2492
- vm.$options._parentElm,
2493
- vm.$options._refElm
2494
- );
2495
- } else {
2496
- // updates
2497
- vm.$el = vm.__patch__(prevVnode, vnode);
2498
- }
2499
- activeInstance = prevActiveInstance;
2500
- // update __vue__ reference
2501
- if (prevEl) {
2502
- prevEl.__vue__ = null;
2503
- }
2504
- if (vm.$el) {
2505
- vm.$el.__vue__ = vm;
2506
- }
2507
- // if parent is an HOC, update its $el as well
2508
- if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
2509
- vm.$parent.$el = vm.$el;
2510
- }
2511
- if (vm._isMounted) {
2512
- callHook(vm, 'updated');
2513
  }
2514
- };
 
2515
 
2516
- Vue.prototype._updateFromParent = function (
2517
- propsData,
2518
- listeners,
2519
- parentVnode,
2520
- renderChildren
2521
- ) {
2522
- var vm = this;
2523
- var hasChildren = !!(vm.$options._renderChildren || renderChildren);
2524
- vm.$options._parentVnode = parentVnode;
2525
- vm.$vnode = parentVnode; // update vm's placeholder node without re-render
2526
- if (vm._vnode) { // update child tree's parent
2527
- vm._vnode.parent = parentVnode;
2528
- }
2529
- vm.$options._renderChildren = renderChildren;
2530
- // update props
2531
- if (propsData && vm.$options.props) {
2532
- observerState.shouldConvert = false;
2533
- {
2534
- observerState.isSettingProps = true;
2535
- }
2536
- var propKeys = vm.$options._propKeys || [];
2537
- for (var i = 0; i < propKeys.length; i++) {
2538
- var key = propKeys[i];
2539
- vm[key] = validateProp(key, vm.$options.props, propsData, vm);
2540
- }
2541
- observerState.shouldConvert = true;
2542
- {
2543
- observerState.isSettingProps = false;
2544
- }
2545
- vm.$options.propsData = propsData;
2546
- }
2547
- // update listeners
2548
- if (listeners) {
2549
- var oldListeners = vm.$options._parentListeners;
2550
- vm.$options._parentListeners = listeners;
2551
- updateComponentListeners(vm, listeners, oldListeners);
2552
- }
2553
- // resolve slots + force update if has children
2554
- if (hasChildren) {
2555
- vm.$slots = resolveSlots(renderChildren, parentVnode.context);
2556
- vm.$forceUpdate();
2557
- }
2558
- };
2559
 
2560
- Vue.prototype.$forceUpdate = function () {
2561
- var vm = this;
2562
- if (vm._watcher) {
2563
- vm._watcher.update();
 
2564
  }
2565
- };
 
 
 
 
 
 
 
 
 
2566
 
2567
- Vue.prototype.$destroy = function () {
2568
- var vm = this;
2569
- if (vm._isBeingDestroyed) {
2570
- return
2571
- }
2572
- callHook(vm, 'beforeDestroy');
2573
- vm._isBeingDestroyed = true;
2574
- // remove self from parent
2575
- var parent = vm.$parent;
2576
- if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
2577
- remove$1(parent.$children, vm);
2578
- }
2579
- // teardown watchers
2580
- if (vm._watcher) {
2581
- vm._watcher.teardown();
2582
- }
2583
- var i = vm._watchers.length;
2584
- while (i--) {
2585
- vm._watchers[i].teardown();
2586
- }
2587
- // remove reference from data ob
2588
- // frozen object may not have observer.
2589
- if (vm._data.__ob__) {
2590
- vm._data.__ob__.vmCount--;
2591
- }
2592
- // call the last hook...
2593
- vm._isDestroyed = true;
2594
- callHook(vm, 'destroyed');
2595
- // turn off all instance listeners.
2596
- vm.$off();
2597
- // remove __vue__ reference
2598
- if (vm.$el) {
2599
- vm.$el.__vue__ = null;
2600
- }
2601
- // invoke destroy hooks on current rendered tree
2602
- vm.__patch__(vm._vnode, null);
2603
- };
2604
- }
2605
 
2606
- function callHook (vm, hook) {
2607
- var handlers = vm.$options[hook];
2608
- if (handlers) {
2609
- for (var i = 0, j = handlers.length; i < j; i++) {
2610
- handlers[i].call(vm);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2611
  }
2612
  }
2613
- if (vm._hasHookEvent) {
2614
- vm.$emit('hook:' + hook);
2615
- }
2616
- }
2617
 
2618
- /* */
 
 
 
 
 
 
 
2619
 
2620
- var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
2621
- var hooksToMerge = Object.keys(hooks);
 
 
 
2622
 
2623
- function createComponent (
2624
- Ctor,
2625
- data,
2626
- context,
2627
- children,
2628
- tag
2629
- ) {
2630
- if (!Ctor) {
2631
- return
2632
  }
 
2633
 
2634
- var baseCtor = context.$options._base;
2635
- if (isObject(Ctor)) {
2636
- Ctor = baseCtor.extend(Ctor);
2637
- }
 
2638
 
2639
- if (typeof Ctor !== 'function') {
2640
- {
2641
- warn(("Invalid Component definition: " + (String(Ctor))), context);
 
 
 
2642
  }
2643
- return
2644
- }
2645
-
2646
- // async component
2647
- if (!Ctor.cid) {
2648
- if (Ctor.resolved) {
2649
- Ctor = Ctor.resolved;
2650
- } else {
2651
- Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
2652
- // it's ok to queue this on every render because
2653
- // $forceUpdate is buffered by the scheduler.
2654
- context.$forceUpdate();
2655
- });
2656
- if (!Ctor) {
2657
- // return nothing if this is indeed an async component
2658
- // wait for the callback to trigger parent update.
2659
- return
2660
- }
2661
  }
 
2662
  }
 
2663
 
2664
- // resolve constructor options in case global mixins are applied after
2665
- // component constructor creation
2666
- resolveConstructorOptions(Ctor);
 
 
 
 
 
 
 
2667
 
2668
- data = data || {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2669
 
2670
- // extract props
2671
- var propsData = extractProps(data, Ctor);
2672
 
2673
- // functional component
2674
- if (Ctor.options.functional) {
2675
- return createFunctionalComponent(Ctor, propsData, data, context, children)
2676
- }
 
 
2677
 
2678
- // extract listeners, since these needs to be treated as
2679
- // child component listeners instead of DOM listeners
2680
- var listeners = data.on;
2681
- // replace with listeners with .native modifier
2682
- data.on = data.nativeOn;
 
 
 
 
2683
 
2684
- if (Ctor.options.abstract) {
2685
- // abstract components do not keep anything
2686
- // other than props & listeners
2687
- data = {};
 
 
 
 
 
2688
  }
 
 
 
2689
 
2690
- // merge component management hooks onto the placeholder node
2691
- mergeHooks(data);
2692
 
2693
- // return a placeholder vnode
2694
- var name = Ctor.options.name || tag;
2695
- var vnode = new VNode(
2696
- ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
2697
- data, undefined, undefined, undefined, context,
2698
- { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
2699
- );
2700
- return vnode
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2701
  }
2702
 
2703
- function createFunctionalComponent (
2704
- Ctor,
2705
- propsData,
2706
- data,
2707
- context,
2708
- children
2709
- ) {
2710
- var props = {};
2711
- var propOptions = Ctor.options.props;
2712
- if (propOptions) {
2713
- for (var key in propOptions) {
2714
- props[key] = validateProp(key, propOptions, propsData);
2715
- }
2716
  }
2717
- // ensure the createElement function in functional components
2718
- // gets a unique context - this is necessary for correct named slot check
2719
- var _context = Object.create(context);
2720
- var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
2721
- var vnode = Ctor.options.render.call(nul
1
  /*!
2
+ * Vue.js v2.2.4
3
+ * (c) 2014-2017 Evan You
4
  * Released under the MIT License.
5
  */
6
  (function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
+ typeof define === 'function' && define.amd ? define(factory) :
9
+ (global.Vue = factory());
10
  }(this, (function () { 'use strict';
11
 
12
  /* */
27
  * If the conversion fails, return original string.
28
  */
29
  function toNumber (val) {
30
+ var n = parseFloat(val);
31
+ return isNaN(n) ? val : n
32
  }
33
 
34
  /**
57
  /**
58
  * Remove an item from an array
59
  */
60
+ function remove (arr, item) {
61
  if (arr.length) {
62
  var index = arr.indexOf(item);
63
  if (index > -1) {
93
  }
94
 
95
  /**
96
+ * Camelize a hyphen-delimited string.
97
  */
98
  var camelizeRE = /-(\w)/g;
99
  var camelize = cached(function (str) {
121
  /**
122
  * Simple bind, faster than native
123
  */
124
+ function bind (fn, ctx) {
125
  function boundFn (a) {
126
  var l = arguments.length;
127
  return l
222
  var isObjectA = isObject(a);
223
  var isObjectB = isObject(b);
224
  if (isObjectA && isObjectB) {
225
+ try {
226
+ return JSON.stringify(a) === JSON.stringify(b)
227
+ } catch (e) {
228
+ // possible circular reference
229
+ return a === b
230
+ }
231
  } else if (!isObjectA && !isObjectB) {
232
  return String(a) === String(b)
233
  } else {
242
  return -1
243
  }
244
 
245
+ /**
246
+ * Ensure a function is called only once.
247
+ */
248
+ function once (fn) {
249
+ var called = false;
250
+ return function () {
251
+ if (!called) {
252
+ called = true;
253
+ fn();
254
+ }
255
+ }
256
+ }
257
+
258
  /* */
259
 
260
  var config = {
268
  */
269
  silent: false,
270
 
271
+ /**
272
+ * Show production mode tip message on boot?
273
+ */
274
+ productionTip: "development" !== 'production',
275
+
276
  /**
277
  * Whether to enable devtools
278
  */
279
  devtools: "development" !== 'production',
280
 
281
+ /**
282
+ * Whether to record perf
283
+ */
284
+ performance: false,
285
+
286
  /**
287
  * Error handler for watcher errors
288
  */
359
 
360
  /* */
361
 
362
+ var emptyObject = Object.freeze({});
363
+
364
  /**
365
  * Check if a string starts with $ or _
366
  */
388
  function parsePath (path) {
389
  if (bailRE.test(path)) {
390
  return
391
+ }
392
+ var segments = path.split('.');
393
+ return function (obj) {
394
+ for (var i = 0; i < segments.length; i++) {
395
+ if (!obj) { return }
396
+ obj = obj[segments[i]];
 
 
397
  }
398
+ return obj
399
  }
400
  }
401
 
413
  var isEdge = UA && UA.indexOf('edge/') > 0;
414
  var isAndroid = UA && UA.indexOf('android') > 0;
415
  var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
416
+ var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
417
 
418
  // this needs to be lazy-evaled because vue may be required before
419
  // vue-server-renderer can set VUE_ENV
440
  return /native code/.test(Ctor.toString())
441
  }
442
 
443
+ var hasSymbol =
444
+ typeof Symbol !== 'undefined' && isNative(Symbol) &&
445
+ typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
446
+
447
  /**
448
  * Defer a task to execute it asynchronously.
449
  */
549
  }
550
 
551
  var warn = noop;
552
+ var tip = noop;
553
  var formatComponentName;
554
 
555
  {
556
  var hasConsole = typeof console !== 'undefined';
557
+ var classifyRE = /(?:^|[-_])(\w)/g;
558
+ var classify = function (str) { return str
559
+ .replace(classifyRE, function (c) { return c.toUpperCase(); })
560
+ .replace(/[-_]/g, ''); };
561
 
562
  warn = function (msg, vm) {
563
  if (hasConsole && (!config.silent)) {
567
  }
568
  };
569
 
570
+ tip = function (msg, vm) {
571
+ if (hasConsole && (!config.silent)) {
572
+ console.warn("[Vue tip]: " + msg + " " + (
573
+ vm ? formatLocation(formatComponentName(vm)) : ''
574
+ ));
575
+ }
576
+ };
577
+
578
+ formatComponentName = function (vm, includeFile) {
579
  if (vm.$root === vm) {
580
+ return '<Root>'
581
  }
582
+ var name = typeof vm === 'function' && vm.options
583
+ ? vm.options.name
584
+ : vm._isVue
585
+ ? vm.$options.name || vm.$options._componentTag
586
+ : vm.name;
587
+
588
+ var file = vm._isVue && vm.$options.__file;
589
+ if (!name && file) {
590
+ var match = file.match(/([^/\\]+)\.vue$/);
591
+ name = match && match[1];
592
+ }
593
+
594
  return (
595
+ (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
596
+ (file && includeFile !== false ? (" at " + file) : '')
597
  )
598
  };
599
 
600
  var formatLocation = function (str) {
601
+ if (str === "<Anonymous>") {
602
  str += " - use the \"name\" option for better debugging messages.";
603
  }
604
  return ("\n(found in " + str + ")")
624
  };
625
 
626
  Dep.prototype.removeSub = function removeSub (sub) {
627
+ remove(this.subs, sub);
628
  };
629
 
630
  Dep.prototype.depend = function depend () {
634
  };
635
 
636
  Dep.prototype.notify = function notify () {
637
+ // stabilize the subscriber list first
638
  var subs = this.subs.slice();
639
  for (var i = 0, l = subs.length; i < l; i++) {
640
  subs[i].update();
877
  * triggers change notification if the property doesn't
878
  * already exist.
879
  */
880
+ function set (target, key, val) {
881
+ if (Array.isArray(target)) {
882
+ target.length = Math.max(target.length, key);
883
+ target.splice(key, 1, val);
884
  return val
885
  }
886
+ if (hasOwn(target, key)) {
887
+ target[key] = val;
888
+ return val
889
  }
890
+ var ob = target.__ob__;
891
+ if (target._isVue || (ob && ob.vmCount)) {
892
  "development" !== 'production' && warn(
893
  'Avoid adding reactive properties to a Vue instance or its root $data ' +
894
  'at runtime - declare it upfront in the data option.'
895
  );
896
+ return val
897
  }
898
  if (!ob) {
899
+ target[key] = val;
900
+ return val
901
  }
902
  defineReactive$$1(ob.value, key, val);
903
  ob.dep.notify();
907
  /**
908
  * Delete a property and trigger change if necessary.
909
  */
910
+ function del (target, key) {
911
+ if (Array.isArray(target)) {
912
+ target.splice(key, 1);
913
+ return
914
+ }
915
+ var ob = target.__ob__;
916
+ if (target._isVue || (ob && ob.vmCount)) {
917
  "development" !== 'production' && warn(
918
  'Avoid deleting properties on a Vue instance or its root $data ' +
919
  '- just set it to null.'
920
  );
921
  return
922
  }
923
+ if (!hasOwn(target, key)) {
924
  return
925
  }
926
+ delete target[key];
927
  if (!ob) {
928
  return
929
  }
980
  toVal = to[key];
981
  fromVal = from[key];
982
  if (!hasOwn(to, key)) {
983
+ set(to, key, fromVal);
984
  } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
985
  mergeData(toVal, fromVal);
986
  }
1043
  };
1044
 
1045
  /**
1046
+ * Hooks and props are merged as arrays.
1047
  */
1048
  function mergeHook (
1049
  parentVal,
1088
  */
1089
  strats.watch = function (parentVal, childVal) {
1090
  /* istanbul ignore if */
1091
+ if (!childVal) { return Object.create(parentVal || null) }
1092
  if (!parentVal) { return childVal }
1093
  var ret = {};
1094
  extend(ret, parentVal);
1111
  strats.props =
1112
  strats.methods =
1113
  strats.computed = function (parentVal, childVal) {
1114
+ if (!childVal) { return Object.create(parentVal || null) }
1115
  if (!parentVal) { return childVal }
1116
  var ret = Object.create(null);
1117
  extend(ret, parentVal);
1314
  }
1315
  var def = prop.default;
1316
  // warn against non-factory defaults for Object & Array
1317
+ if ("development" !== 'production' && isObject(def)) {
1318
+ warn(
1319
  'Invalid default value for prop "' + key + '": ' +
1320
  'Props with type Object/Array must use a factory function ' +
1321
  'to return the default value.',
1326
  // return previous default value to avoid unnecessary watcher trigger
1327
  if (vm && vm.$options.propsData &&
1328
  vm.$options.propsData[key] === undefined &&
1329
+ vm._props[key] !== undefined) {
1330
+ return vm._props[key]
1331
  }
1332
  // call factory function for non-Function types
1333
+ // a value is Function if its prototype is function even across different execution context
1334
+ return typeof def === 'function' && getType(prop.type) !== 'Function'
1335
  ? def.call(vm)
1336
  : def
1337
  }
1439
  return false
1440
  }
1441
 
1442
+ function handleError (err, vm, info) {
1443
+ if (config.errorHandler) {
1444
+ config.errorHandler.call(null, err, vm, info);
1445
+ } else {
1446
+ {
1447
+ warn(("Error in " + info + ":"), vm);
1448
+ }
1449
+ /* istanbul ignore else */
1450
+ if (inBrowser && typeof console !== 'undefined') {
1451
+ console.error(err);
1452
+ } else {
1453
+ throw err
1454
+ }
1455
+ }
1456
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1457
 
1458
  /* not type checking this file because flow doesn't play well with Proxy */
1459
 
1529
  };
1530
  }
1531
 
1532
+ var mark;
1533
+ var measure;
1534
+
1535
+ {
1536
+ var perf = inBrowser && window.performance;
1537
+ /* istanbul ignore if */
1538
+ if (
1539
+ perf &&
1540
+ perf.mark &&
1541
+ perf.measure &&
1542
+ perf.clearMarks &&
1543
+ perf.clearMeasures
1544
+ ) {
1545
+ mark = function (tag) { return perf.mark(tag); };
1546
+ measure = function (name, startTag, endTag) {
1547
+ perf.measure(name, startTag, endTag);
1548
+ perf.clearMarks(startTag);
1549
+ perf.clearMarks(endTag);
1550
+ perf.clearMeasures(name);
1551
+ };
1552
+ }
1553
+ }
1554
+
1555
  /* */
1556
 
1557
+ var VNode = function VNode (
1558
+ tag,
1559
+ data,
1560
+ children,
1561
+ text,
1562
+ elm,
1563
+ context,
1564
+ componentOptions
1565
+ ) {
1566
+ this.tag = tag;
1567
+ this.data = data;
1568
+ this.children = children;
1569
+ this.text = text;
1570
+ this.elm = elm;
1571
+ this.ns = undefined;
1572
+ this.context = context;
1573
+ this.functionalContext = undefined;
1574
+ this.key = data && data.key;
1575
+ this.componentOptions = componentOptions;
1576
+ this.componentInstance = undefined;
1577
+ this.parent = undefined;
1578
+ this.raw = false;
1579
+ this.isStatic = false;
1580
+ this.isRootInsert = true;
1581
+ this.isComment = false;
1582
+ this.isCloned = false;
1583
+ this.isOnce = false;
1584
+ };
1585
 
1586
+ var prototypeAccessors = { child: {} };
 
 
 
 
 
1587
 
1588
+ // DEPRECATED: alias for componentInstance for backwards compat.
1589
+ /* istanbul ignore next */
1590
+ prototypeAccessors.child.get = function () {
1591
+ return this.componentInstance
1592
+ };
1593
+
1594
+ Object.defineProperties( VNode.prototype, prototypeAccessors );
1595
+
1596
+ var createEmptyVNode = function () {
1597
+ var node = new VNode();
1598
+ node.text = '';
1599
+ node.isComment = true;
1600
+ return node
1601
+ };
1602
+
1603
+ function createTextVNode (val) {
1604
+ return new VNode(undefined, undefined, undefined, String(val))
1605
+ }
1606
+
1607
+ // optimized shallow clone
1608
+ // used for static nodes and slot nodes because they may be reused across
1609
+ // multiple renders, cloning them avoids errors when DOM manipulations rely
1610
+ // on their elm reference.
1611
+ function cloneVNode (vnode) {
1612
+ var cloned = new VNode(
1613
+ vnode.tag,
1614
+ vnode.data,
1615
+ vnode.children,
1616
+ vnode.text,
1617
+ vnode.elm,
1618
+ vnode.context,
1619
+ vnode.componentOptions
1620
+ );
1621
+ cloned.ns = vnode.ns;
1622
+ cloned.isStatic = vnode.isStatic;
1623
+ cloned.key = vnode.key;
1624
+ cloned.isCloned = true;
1625
+ return cloned
1626
+ }
1627
+
1628
+ function cloneVNodes (vnodes) {
1629
+ var len = vnodes.length;
1630
+ var res = new Array(len);
1631
+ for (var i = 0; i < len; i++) {
1632
+ res[i] = cloneVNode(vnodes[i]);
1633
  }
1634
+ return res
1635
  }
1636
 
1637
+ /* */
 
 
 
 
1638
 
1639
+ var normalizeEvent = cached(function (name) {
1640
+ var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
1641
+ name = once$$1 ? name.slice(1) : name;
1642
+ var capture = name.charAt(0) === '!';
1643
+ name = capture ? name.slice(1) : name;
1644
+ return {
1645
+ name: name,
1646
+ once: once$$1,
1647
+ capture: capture
1648
+ }
1649
+ });
1650
 
1651
+ function createFnInvoker (fns) {
1652
+ function invoker () {
1653
+ var arguments$1 = arguments;
1654
+
1655
+ var fns = invoker.fns;
1656
+ if (Array.isArray(fns)) {
1657
+ for (var i = 0; i < fns.length; i++) {
1658
+ fns[i].apply(null, arguments$1);
 
 
 
 
 
 
 
 
 
 
 
 
1659
  }
1660
+ } else {
1661
+ // return handler return value for single handlers
1662
+ return fns.apply(null, arguments)
1663
  }
1664
  }
1665
+ invoker.fns = fns;
1666
+ return invoker
 
 
 
 
 
 
1667
  }
1668
 
1669
+ function updateListeners (
1670
+ on,
1671
+ oldOn,
1672
+ add,
1673
+ remove$$1,
1674
+ vm
1675
+ ) {
1676
+ var name, cur, old, event;
1677
+ for (name in on) {
1678
+ cur = on[name];
1679
+ old = oldOn[name];
1680
+ event = normalizeEvent(name);
1681
+ if (!cur) {
1682
+ "development" !== 'production' && warn(
1683
+ "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
1684
+ vm
1685
+ );
1686
+ } else if (!old) {
1687
+ if (!cur.fns) {
1688
+ cur = on[name] = createFnInvoker(cur);
1689
  }
1690
+ add(event.name, cur, event.once, event.capture);
1691
+ } else if (cur !== old) {
1692
+ old.fns = cur;
1693
+ on[name] = old;
1694
  }
1695
+ }
1696
+ for (name in oldOn) {
1697
+ if (!on[name]) {
1698
+ event = normalizeEvent(name);
1699
+ remove$$1(event.name, oldOn[name], event.capture);
1700
  }
1701
  }
1702
  }
1703
 
1704
  /* */
1705
 
1706
+ function mergeVNodeHook (def, hookKey, hook) {
1707
+ var invoker;
1708
+ var oldHook = def[hookKey];
1709
 
1710
+ function wrappedHook () {
1711
+ hook.apply(this, arguments);
1712
+ // important: remove merged hook to ensure it's called only once
1713
+ // and prevent memory leak
1714
+ remove(invoker.fns, wrappedHook);
1715
+ }
1716
+
1717
+ if (!oldHook) {
1718
+ // no existing hook
1719
+ invoker = createFnInvoker([wrappedHook]);
 
 
 
 
 
 
 
 
 
1720
  } else {
1721
+ /* istanbul ignore if */
1722
+ if (oldHook.fns && oldHook.merged) {
1723
+ // already a merged invoker
1724
+ invoker = oldHook;
1725
+ invoker.fns.push(wrappedHook);
1726
+ } else {
1727
+ // existing plain hook
1728
+ invoker = createFnInvoker([oldHook, wrappedHook]);
1729
+ }
1730
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1731
 
1732
+ invoker.merged = true;
1733
+ def[hookKey] = invoker;
1734
+ }
 
 
 
 
 
 
 
 
 
 
 
 
1735
 
1736
+ /* */
 
 
 
 
 
 
 
 
 
 
 
 
1737
 
1738
+ // The template compiler attempts to minimize the need for normalization by
1739
+ // statically analyzing the template at compile time.
1740
+ //
1741
+ // For plain HTML markup, normalization can be completely skipped because the
1742
+ // generated render function is guaranteed to return Array<VNode>. There are
1743
+ // two cases where extra normalization is needed:
1744
 
1745
+ // 1. When the children contains components - because a functional component
1746
+ // may return an Array instead of a single root. In this case, just a simple
1747
+ // normalization is needed - if any child is an Array, we flatten the whole
1748
+ // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
1749
+ // because functional components already normalize their own children.
1750
+ function simpleNormalizeChildren (children) {
1751
+ for (var i = 0; i < children.length; i++) {
1752
+ if (Array.isArray(children[i])) {
1753
+ return Array.prototype.concat.apply([], children)
1754
  }
1755
  }
1756
+ return children
1757
+ }
 
 
 
 
 
 
 
1758
 
1759
+ // 2. When the children contains constructs that always generated nested Arrays,
1760
+ // e.g. <template>, <slot>, v-for, or when the children is provided by user
1761
+ // with hand-written render functions / JSX. In such cases a full normalization
1762
+ // is needed to cater to all possible types of children values.
1763
+ function normalizeChildren (children) {
1764
+ return isPrimitive(children)
1765
+ ? [createTextVNode(children)]
1766
+ : Array.isArray(children)
1767
+ ? normalizeArrayChildren(children)
1768
+ : undefined
1769
+ }
 
 
 
1770
 
1771
+ function normalizeArrayChildren (children, nestedIndex) {
1772
+ var res = [];
1773
+ var i, c, last;
1774
+ for (i = 0; i < children.length; i++) {
1775
+ c = children[i];
1776
+ if (c == null || typeof c === 'boolean') { continue }
1777
+ last = res[res.length - 1];
1778
+ // nested
1779
+ if (Array.isArray(c)) {
1780
+ res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
1781
+ } else if (isPrimitive(c)) {
1782
+ if (last && last.text) {
1783
+ last.text += String(c);
1784
+ } else if (c !== '') {
1785
+ // convert primitive to vnode
1786
+ res.push(createTextVNode(c));
1787
+ }
1788
+ } else {
1789
+ if (c.text && last && last.text) {
1790
+ res[res.length - 1] = createTextVNode(last.text + c.text);
 
 
 
 
 
 
 
 
 
 
 
 
 
1791
  } else {
1792
+ // default key for nested array children (likely generated by v-for)
1793
+ if (c.tag && c.key == null && nestedIndex != null) {
1794
+ c.key = "__vlist" + nestedIndex + "_" + i + "__";
1795
+ }
1796
+ res.push(c);
1797
  }
1798
  }
1799
  }
1800
+ return res
1801
+ }
 
 
 
 
 
 
 
 
1802
 
1803
+ /* */
 
 
 
 
1804
 
1805
+ function getFirstComponentChild (children) {
1806
+ return children && children.filter(function (c) { return c && c.componentOptions; })[0]
1807
+ }
 
 
1808
 
1809
+ /* */
 
 
 
 
1810
 
1811
+ function initEvents (vm) {
1812
+ vm._events = Object.create(null);
1813
+ vm._hasHookEvent = false;
1814
+ // init parent attached events
1815
+ var listeners = vm.$options._parentListeners;
1816
+ if (listeners) {
1817
+ updateComponentListeners(vm, listeners);
 
 
 
 
 
1818
  }
 
 
 
 
 
 
 
 
 
 
 
1819
  }
1820
 
1821
+ var target;
1822
+
1823
+ function add (event, fn, once$$1) {
1824
+ if (once$$1) {
1825
+ target.$once(event, fn);
 
 
 
 
 
 
 
 
 
 
 
1826
  } else {
1827
+ target.$on(event, fn);
 
 
1828
  }
1829
  }
1830
 
1831
+ function remove$1 (event, fn) {
1832
+ target.$off(event, fn);
1833
+ }
1834
 
1835
+ function updateComponentListeners (
1836
+ vm,
1837
+ listeners,
1838
+ oldListeners
1839
+ ) {
1840
+ target = vm;
1841
+ updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
 
 
 
 
 
1842
  }
1843
 
1844
+ function eventsMixin (Vue) {
1845
+ var hookRE = /^hook:/;
1846
+ Vue.prototype.$on = function (event, fn) {
1847
+ var this$1 = this;
1848
 
1849
+ var vm = this;
1850
+ if (Array.isArray(event)) {
1851
+ for (var i = 0, l = event.length; i < l; i++) {
1852
+ this$1.$on(event[i], fn);
1853
+ }
1854
+ } else {
1855
+ (vm._events[event] || (vm._events[event] = [])).push(fn);
1856
+ // optimize hook:event cost by using a boolean flag marked at registration
1857
+ // instead of a hash lookup
1858
+ if (hookRE.test(event)) {
1859
+ vm._hasHookEvent = true;
 
 
 
 
1860
  }
 
 
 
 
 
 
 
 
 
 
 
1861
  }
1862
+ return vm
1863
  };
1864
 
1865
+ Vue.prototype.$once = function (event, fn) {
1866
+ var vm = this;
1867
+ function on () {
1868
+ vm.$off(event, on);
1869
+ fn.apply(vm, arguments);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1870
  }
1871
+ on.fn = fn;
1872
+ vm.$on(event, on);
1873
+ return vm
1874
+ };
1875
 
1876
+ Vue.prototype.$off = function (event, fn) {
1877
+ var this$1 = this;
 
 
 
 
1878
 
1879
+ var vm = this;
1880
+ // all
1881
+ if (!arguments.length) {
1882
+ vm._events = Object.create(null);
1883
+ return vm
 
 
 
 
1884
  }
1885
+ // array of events
1886
+ if (Array.isArray(event)) {
1887
+ for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
1888
+ this$1.$off(event[i$1], fn);
1889
+ }
1890
+ return vm
 
 
 
 
 
 
 
1891
  }
1892
+ // specific event
1893
+ var cbs = vm._events[event];
1894
+ if (!cbs) {
1895
+ return vm
 
 
 
 
 
 
 
1896
  }
1897
+ if (arguments.length === 1) {
1898
+ vm._events[event] = null;
1899
+ return vm
1900
  }
1901
+ // specific handler
1902
+ var cb;
1903
+ var i = cbs.length;
1904
+ while (i--) {
1905
+ cb = cbs[i];
1906
+ if (cb === fn || cb.fn === fn) {
1907
+ cbs.splice(i, 1);
1908
+ break
1909
+ }
1910
+ }
1911
+ return vm
1912
+ };
1913
 
1914
+ Vue.prototype.$emit = function (event) {
1915
+ var vm = this;
1916
+ var cbs = vm._events[event];
1917
+ if (cbs) {
1918
+ cbs = cbs.length > 1 ? toArray(cbs) : cbs;
1919
+ var args = toArray(arguments, 1);
1920
+ for (var i = 0, l = cbs.length; i < l; i++) {
1921
+ cbs[i].apply(vm, args);
1922
+ }
1923
  }
1924
+ return vm
1925
+ };
1926
  }
1927
 
1928
+ /* */
1929
+
1930
+ /**
1931
+ * Runtime helper for resolving raw children VNodes into a slot object.
1932
+ */
1933
+ function resolveSlots (
1934
+ children,
1935
+ context
1936
+ ) {
1937
+ var slots = {};
1938
+ if (!children) {
1939
+ return slots
1940
+ }
1941
+ var defaultSlot = [];
1942
+ var name, child;
1943
+ for (var i = 0, l = children.length; i < l; i++) {
1944
+ child = children[i];
1945
+ // named slots should only be respected if the vnode was rendered in the
1946
+ // same context.
1947
+ if ((child.context === context || child.functionalContext === context) &&
1948
+ child.data && (name = child.data.slot)) {
1949
+ var slot = (slots[name] || (slots[name] = []));
1950
+ if (child.tag === 'template') {
1951
+ slot.push.apply(slot, child.children);
1952
+ } else {
1953
+ slot.push(child);
1954
  }
1955
  } else {
1956
+ defaultSlot.push(child);
1957
  }
1958
  }
1959
+ // ignore whitespace
1960
+ if (!defaultSlot.every(isWhitespace)) {
1961
+ slots.default = defaultSlot;
1962
+ }
1963
+ return slots
1964
  }
1965
 
1966
+ function isWhitespace (node) {
1967
+ return node.isComment || node.text === ' '
 
 
 
 
 
 
 
 
1968
  }
1969
 
1970
+ function resolveScopedSlots (
1971
+ fns
1972
+ ) {
1973
+ var res = {};
1974
+ for (var i = 0; i < fns.length; i++) {
1975
+ res[fns[i][0]] = fns[i][1];
 
 
 
 
 
 
 
 
 
 
1976
  }
1977
+ return res
1978
+ }
1979
 
1980
+ /* */
 
1981
 
1982
+ var activeInstance = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1983
 
1984
+ function initLifecycle (vm) {
1985
+ var options = vm.$options;
1986
+
1987
+ // locate first non-abstract parent
1988
+ var parent = options.parent;
1989
+ if (parent && !options.abstract) {
1990
+ while (parent.$options.abstract && parent.$parent) {
1991
+ parent = parent.$parent;
1992
+ }
1993
+ parent.$children.push(vm);
 
 
1994
  }
 
1995
 
1996
+ vm.$parent = parent;
1997
+ vm.$root = parent ? parent.$root : vm;
1998
 
1999
+ vm.$children = [];
2000
+ vm.$refs = {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2001
 
2002
+ vm._watcher = null;
2003
+ vm._inactive = null;
2004
+ vm._directInactive = false;
2005
+ vm._isMounted = false;
2006
+ vm._isDestroyed = false;
2007
+ vm._isBeingDestroyed = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
2008
  }
2009
 
2010
+ function lifecycleMixin (Vue) {
2011
+ Vue.prototype._update = function (vnode, hydrating) {
2012
+ var vm = this;
2013
+ if (vm._isMounted) {
2014
+ callHook(vm, 'beforeUpdate');
2015
+ }
2016
+ var prevEl = vm.$el;
2017
+ var prevVnode = vm._vnode;
2018
+ var prevActiveInstance = activeInstance;
2019
+ activeInstance = vm;
2020
+ vm._vnode = vnode;
2021
+ // Vue.prototype.__patch__ is injected in entry points
2022
+ // based on the rendering backend used.
2023
+ if (!prevVnode) {
2024
+ // initial render
2025
+ vm.$el = vm.__patch__(
2026
+ vm.$el, vnode, hydrating, false /* removeOnly */,
2027
+ vm.$options._parentElm,
2028
+ vm.$options._refElm
2029
+ );
2030
+ } else {
2031
+ // updates
2032
+ vm.$el = vm.__patch__(prevVnode, vnode);
2033
+ }
2034
+ activeInstance = prevActiveInstance;
2035
+ // update __vue__ reference
2036
+ if (prevEl) {
2037
+ prevEl.__vue__ = null;
2038
+ }
2039
+ if (vm.$el) {
2040
+ vm.$el.__vue__ = vm;
2041
+ }
2042
+ // if parent is an HOC, update its $el as well
2043
+ if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
2044
+ vm.$parent.$el = vm.$el;
2045
+ }
2046
+ // updated hook is called by the scheduler to ensure that children are
2047
+ // updated in a parent's updated hook.
2048
+ };
2049
 
2050
+ Vue.prototype.$forceUpdate = function () {
2051
+ var vm = this;
2052
+ if (vm._watcher) {
2053
+ vm._watcher.update();
2054
+ }
2055
+ };
2056
 
2057
+ Vue.prototype.$destroy = function () {
2058
+ var vm = this;
2059
+ if (vm._isBeingDestroyed) {
2060
+ return
 
 
 
 
 
 
 
 
 
2061
  }
2062
+ callHook(vm, 'beforeDestroy');
2063
+ vm._isBeingDestroyed = true;
2064
+ // remove self from parent
2065
+ var parent = vm.$parent;
2066
+ if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
2067
+ remove(parent.$children, vm);
2068
+ }
2069
+ // teardown watchers
2070
+ if (vm._watcher) {
2071
+ vm._watcher.teardown();
2072
+ }
2073
+ var i = vm._watchers.length;
2074
+ while (i--) {
2075
+ vm._watchers[i].teardown();
2076
+ }
2077
+ // remove reference from data ob
2078
+ // frozen object may not have observer.
2079
+ if (vm._data.__ob__) {
2080
+ vm._data.__ob__.vmCount--;
2081
+ }
2082
+ // call the last hook...
2083
+ vm._isDestroyed = true;
2084
+ callHook(vm, 'destroyed');
2085
+ // turn off all instance listeners.
2086
+ vm.$off();
2087
+ // remove __vue__ reference
2088
+ if (vm.$el) {
2089
+ vm.$el.__vue__ = null;
2090
+ }
2091
+ // invoke destroy hooks on current rendered tree
2092
+ vm.__patch__(vm._vnode, null);
2093
+ };
2094
  }
2095
 
2096
+ function mountComponent (
2097
+ vm,
2098
+ el,
2099
+ hydrating
 
 
 
 
2100
  ) {
2101
+ vm.$el = el;
2102
+ if (!vm.$options.render) {
2103
+ vm.$options.render = createEmptyVNode;
2104
+ {
2105
+ /* istanbul ignore if */
2106
+ if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
2107
+ vm.$options.el || el) {
2108
+ warn(
2109
+ 'You are using the runtime-only build of Vue where the template ' +
2110
+ 'compiler is not available. Either pre-compile the templates into ' +
2111
+ 'render functions, or use the compiler-included build.',
2112
+ vm
2113
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2114
  } else {
2115
+ warn(
2116
+ 'Failed to mount component: template or render function not defined.',
2117
+ vm
2118
+ );
2119
  }
2120
  }
2121
  }
2122
+ callHook(vm, 'beforeMount');
2123
+
2124
+ var updateComponent;
2125
+ /* istanbul ignore if */
2126
+ if ("development" !== 'production' && config.performance && mark) {
2127
+ updateComponent = function () {
2128
+ var name = vm._name;
2129
+ var id = vm._uid;
2130
+ var startTag = "vue-perf-start:" + id;
2131
+ var endTag = "vue-perf-end:" + id;
2132
+
2133
+ mark(startTag);
2134
+ var vnode = vm._render();
2135
+ mark(endTag);
2136
+ measure((name + " render"), startTag, endTag);
2137
+
2138
+ mark(startTag);
2139
+ vm._update(vnode, hydrating);
2140
+ mark(endTag);
2141
+ measure((name + " patch"), startTag, endTag);
2142
+ };
2143
+ } else {
2144
+ updateComponent = function () {
2145
+ vm._update(vm._render(), hydrating);
2146
+ };
2147
+ }
2148
+
2149
+ vm._watcher = new Watcher(vm, updateComponent, noop);
2150
+ hydrating = false;
2151
+
2152
+ // manually mounted instance, call mounted on self
2153
+ // mounted is called for render-created child components in its inserted hook
2154
+ if (vm.$vnode == null) {
2155
+ vm._isMounted = true;
2156
+ callHook(vm, 'mounted');
2157
  }
2158
+ return vm
2159
  }
2160
 
2161
+ function updateChildComponent (
2162
+ vm,
2163
+ propsData,
2164
+ listeners,
2165
+ parentVnode,
2166
+ renderChildren
2167
+ ) {
2168
+ // determine whether component has slot children
2169
+ // we need to do this before overwriting $options._renderChildren
2170
+ var hasChildren = !!(
2171
+ renderChildren || // has new static slots
2172
+ vm.$options._renderChildren || // has old static slots
2173
+ parentVnode.data.scopedSlots || // has new scoped slots
2174
+ vm.$scopedSlots !== emptyObject // has old scoped slots
2175
+ );
2176
+
2177
+ vm.$options._parentVnode = parentVnode;
2178
+ vm.$vnode = parentVnode; // update vm's placeholder node without re-render
2179
+ if (vm._vnode) { // update child tree's parent
2180
+ vm._vnode.parent = parentVnode;
2181
+ }
2182
+ vm.$options._renderChildren = renderChildren;
2183
 
2184
+ // update props
2185
+ if (propsData && vm.$options.props) {
2186
+ observerState.shouldConvert = false;
2187
+ {
2188
+ observerState.isSettingProps = true;
2189
+ }
2190
+ var props = vm._props;
2191
+ var propKeys = vm.$options._propKeys || [];
2192
+ for (var i = 0; i < propKeys.length; i++) {
2193
+ var key = propKeys[i];
2194
+ props[key] = validateProp(key, vm.$options.props, propsData, vm);
2195
+ }
2196
+ observerState.shouldConvert = true;
2197
+ {
2198
+ observerState.isSettingProps = false;
2199
  }
2200
+ // keep a copy of raw propsData
2201
+ vm.$options.propsData = propsData;
2202
+ }
2203
+ // update listeners
2204
+ if (listeners) {
2205
+ var oldListeners = vm.$options._parentListeners;
2206
+ vm.$options._parentListeners = listeners;
2207
+ updateComponentListeners(vm, listeners, oldListeners);
2208
+ }
2209
+ // resolve slots + force update if has children
2210
+ if (hasChildren) {
2211
+ vm.$slots = resolveSlots(renderChildren, parentVnode.context);
2212
+ vm.$forceUpdate();
2213
  }
2214
  }
2215
 
2216
+ function isInInactiveTree (vm) {
2217
+ while (vm && (vm = vm.$parent)) {
2218
+ if (vm._inactive) { return true }
 
2219
  }
2220
+ return false
2221
  }
2222
 
2223
+ function activateChildComponent (vm, direct) {
2224
+ if (direct) {
2225
+ vm._directInactive = false;
2226
+ if (isInInactiveTree(vm)) {
2227
+ return
2228
+ }
2229
+ } else if (vm._directInactive) {
2230
+ return
2231
+ }
2232
+ if (vm._inactive || vm._inactive == null) {
2233
+ vm._inactive = false;
2234
+ for (var i = 0; i < vm.$children.length; i++) {
2235
+ activateChildComponent(vm.$children[i]);
2236
+ }
2237
+ callHook(vm, 'activated');
2238
+ }
2239
+ }
2240
 
2241
+ function deactivateChildComponent (vm, direct) {
2242
+ if (direct) {
2243
+ vm._directInactive = true;
2244
+ if (isInInactiveTree(vm)) {
2245
+ return
 
 
 
 
2246
  }
2247
  }
2248
+ if (!vm._inactive) {
2249
+ vm._inactive = true;
2250
+ for (var i = 0; i < vm.$children.length; i++) {
2251
+ deactivateChildComponent(vm.$children[i]);
2252
+ }
2253
+ callHook(vm, 'deactivated');
2254
+ }
2255
  }
2256
 
2257
+ function callHook (vm, hook) {
2258
+ var handlers = vm.$options[hook];
2259
+ if (handlers) {
2260
+ for (var i = 0, j = handlers.length; i < j; i++) {
2261
+ try {
2262
+ handlers[i].call(vm);
2263
+ } catch (e) {
2264
+ handleError(e, vm, (hook + " hook"));
2265
+ }
2266
+ }
2267
+ }
2268
+ if (vm._hasHookEvent) {
2269
+ vm.$emit('hook:' + hook);
2270
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2271
  }
2272
 
2273
  /* */
2274
 
 
 
 
 
 
 
 
 
 
2275
 
2276
+ var queue = [];
2277
+ var has = {};
2278
+ var circular = {};
2279
+ var waiting = false;
2280
+ var flushing = false;
2281
+ var index = 0;
2282
 
2283
+ /**
2284
+ * Reset the scheduler's state.
2285
+ */
2286
+ function resetSchedulerState () {
2287
+ queue.length = 0;
2288
+ has = {};
2289
+ {
2290
+ circular = {};
2291
  }
2292
+ waiting = flushing = false;
2293
  }
2294
 
2295
+ /**
2296
+ * Flush both queues and run the watchers.
2297
+ */
2298
+ function flushSchedulerQueue () {
2299
+ flushing = true;
2300
+ var watcher, id, vm;
2301
 
2302
+ // Sort queue before flush.
2303
+ // This ensures that:
2304
+ // 1. Components are updated from parent to child. (because parent is always
2305
+ // created before the child)
2306
+ // 2. A component's user watchers are run before its render watcher (because
2307
+ // user watchers are created before the render watcher)
2308
+ // 3. If a component is destroyed during a parent component's watcher run,
2309
+ // its watchers can be skipped.
2310
+ queue.sort(function (a, b) { return a.id - b.id; });
2311
 
2312
+ // do not cache length because more watchers might be pushed
2313
+ // as we run existing watchers
2314
+ for (index = 0; index < queue.length; index++) {
2315
+ watcher = queue[index];
2316
+ id = watcher.id;
2317
+ has[id] = null;
2318
+ watcher.run();
2319
+ // in dev build, check and stop circular updates.
2320
+ if ("development" !== 'production' && has[id] != null) {
2321
+ circular[id] = (circular[id] || 0) + 1;
2322
+ if (circular[id] > config._maxUpdateCount) {
2323
+ warn(
2324
+ 'You may have an infinite update loop ' + (
2325
+ watcher.user
2326
+ ? ("in watcher with expression \"" + (watcher.expression) + "\"")
2327
+ : "in a component render function."
2328
+ ),
2329
+ watcher.vm
2330
+ );
2331
+ break
2332
+ }
2333
  }
2334
+ }
 
2335
 
2336
+ // call updated hooks
2337
+ index = queue.length;
2338
+ while (index--) {
2339
+ watcher = queue[index];
2340
+ vm = watcher.vm;
2341
+ if (vm._watcher === watcher && vm._isMounted) {
2342
+ callHook(vm, 'updated');
2343
  }
2344
+ }
 
 
 
2345
 
2346
+ // devtool hook
2347
+ /* istanbul ignore if */
2348
+ if (devtools && config.devtools) {
2349
+ devtools.emit('flush');
2350
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2351
 
2352
+ resetSchedulerState();
2353
+ }
2354
+
2355
+ /**
2356
+ * Push a watcher into the watcher queue.
2357
+ * Jobs with duplicate IDs will be skipped unless it's
2358
+ * pushed when the queue is being flushed.
2359
+ */
2360
+ function queueWatcher (watcher) {
2361
+ var id = watcher.id;
2362
+ if (has[id] == null) {
2363
+ has[id] = true;
2364
+ if (!flushing) {
2365
+ queue.push(watcher);
2366
+ } else {
2367
+ // if already flushing, splice the watcher based on its id
2368
+ // if already past its id, it will be run next immediately.
2369
+ var i = queue.length - 1;
2370
+ while (i >= 0 && queue[i].id > watcher.id) {
2371
+ i--;
2372
  }
2373
+ queue.splice(Math.max(i, index) + 1, 0, watcher);
2374
  }
2375
+ // queue the flush
2376
+ if (!waiting) {
2377
+ waiting = true;
2378
+ nextTick(flushSchedulerQueue);
2379
+ }
2380
+ }
2381
  }
2382
 
2383
  /* */
2384
 
2385
+ var uid$2 = 0;
 
 
 
2386
 
2387
+ /**
2388
+ * A watcher parses an expression, collects dependencies,
2389
+ * and fires callback when the expression value changes.
2390
+ * This is used for both the $watch() api and directives.
2391
+ */
2392
+ var Watcher = function Watcher (
2393
+ vm,
2394
+ expOrFn,
2395
+ cb,
2396
+ options
2397
+ ) {
2398
+ this.vm = vm;
2399
+ vm._watchers.push(this);
2400
+ // options
2401
+ if (options) {
2402
+ this.deep = !!options.deep;
2403
+ this.user = !!options.user;
2404
+ this.lazy = !!options.lazy;
2405
+ this.sync = !!options.sync;
2406
+ } else {
2407
+ this.deep = this.user = this.lazy = this.sync = false;
2408
+ }
2409
+ this.cb = cb;
2410
+ this.id = ++uid$2; // uid for batching
2411
+ this.active = true;
2412
+ this.dirty = this.lazy; // for lazy watchers
2413
+ this.deps = [];
2414
+ this.newDeps = [];
2415
+ this.depIds = new _Set();
2416
+ this.newDepIds = new _Set();
2417
+ this.expression = expOrFn.toString();
2418
+ // parse expression for getter
2419
+ if (typeof expOrFn === 'function') {
2420
+ this.getter = expOrFn;
2421
+ } else {
2422
+ this.getter = parsePath(expOrFn);
2423
+ if (!this.getter) {
2424
+ this.getter = function () {};
2425
+ "development" !== 'production' && warn(
2426
+ "Failed watching path: \"" + expOrFn + "\" " +
2427
+ 'Watcher only accepts simple dot-delimited paths. ' +
2428
+ 'For full control, use a function instead.',
2429
+ vm
2430
+ );
2431
  }
 
2432
  }
2433
+ this.value = this.lazy
2434
+ ? undefined
2435
+ : this.get();
2436
+ };
2437
 
2438
+ /**
2439
+ * Evaluate the getter, and re-collect dependencies.
2440
+ */
2441
+ Watcher.prototype.get = function get () {
2442
+ pushTarget(this);
2443
+ var value;
2444
+ var vm = this.vm;
2445
+ if (this.user) {
2446
+ try {
2447
+ value = this.getter.call(vm, vm);
2448
+ } catch (e) {
2449
+ handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2450
  }
2451
+ } else {
2452
+ value = this.getter.call(vm, vm);
2453
+ }
2454
+ // "touch" every property so they are all tracked as
2455
+ // dependencies for deep watching
2456
+ if (this.deep) {
2457
+ traverse(value);
2458
+ }
2459
+ popTarget();
2460
+ this.cleanupDeps();
2461
+ return value
2462
+ };
2463
 
2464
+ /**
2465
+ * Add a dependency to this directive.
2466
+ */
2467
+ Watcher.prototype.addDep = function addDep (dep) {
2468
+ var id = dep.id;
2469
+ if (!this.newDepIds.has(id)) {
2470
+ this.newDepIds.add(id);
2471
+ this.newDeps.push(dep);
2472
+ if (!this.depIds.has(id)) {
2473
+ dep.addSub(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2474
  }
2475
+ }
2476
+ };
2477
 
2478
+ /**
2479
+ * Clean up for dependency collection.
2480
+ */
2481
+ Watcher.prototype.cleanupDeps = function cleanupDeps () {
2482
+ var this$1 = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2483
 
2484
+ var i = this.deps.length;
2485
+ while (i--) {
2486
+ var dep = this$1.deps[i];
2487
+ if (!this$1.newDepIds.has(dep.id)) {
2488
+ dep.removeSub(this$1);
2489
  }
2490
+ }
2491
+ var tmp = this.depIds;
2492
+ this.depIds = this.newDepIds;
2493
+ this.newDepIds = tmp;
2494
+ this.newDepIds.clear();
2495
+ tmp = this.deps;
2496
+ this.deps = this.newDeps;
2497
+ this.newDeps = tmp;
2498
+ this.newDeps.length = 0;
2499
+ };
2500
 
2501
+ /**
2502
+ * Subscriber interface.
2503
+ * Will be called when a dependency changes.
2504
+ */
2505
+ Watcher.prototype.update = function update () {
2506
+ /* istanbul ignore else */
2507
+ if (this.lazy) {
2508
+ this.dirty = true;
2509
+ } else if (this.sync) {
2510
+ this.run();
2511
+ } else {
2512
+ queueWatcher(this);
2513
+ }
2514
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2515
 
2516
+ /**
2517
+ * Scheduler job interface.
2518
+ * Will be called by the scheduler.
2519
+ */
2520
+ Watcher.prototype.run = function run () {
2521
+ if (this.active) {
2522
+ var value = this.get();
2523
+ if (
2524
+ value !== this.value ||
2525
+ // Deep watchers and watchers on Object/Arrays should fire even
2526
+ // when the value is the same, because the value may
2527
+ // have mutated.
2528
+ isObject(value) ||
2529
+ this.deep
2530
+ ) {
2531
+ // set new value
2532
+ var oldValue = this.value;
2533
+ this.value = value;
2534
+ if (this.user) {
2535
+ try {
2536
+ this.cb.call(this.vm, value, oldValue);
2537
+ } catch (e) {
2538
+ handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
2539
+ }
2540
+ } else {
2541
+ this.cb.call(this.vm, value, oldValue);
2542
+ }
2543
  }
2544
  }
2545
+ };
 
 
 
2546
 
2547
+ /**
2548
+ * Evaluate the value of the watcher.
2549
+ * This only gets called for lazy watchers.
2550
+ */
2551
+ Watcher.prototype.evaluate = function evaluate () {
2552
+ this.value = this.get();
2553
+ this.dirty = false;
2554
+ };
2555
 
2556
+ /**
2557
+ * Depend on all deps collected by this watcher.
2558
+ */
2559
+ Watcher.prototype.depend = function depend () {
2560
+ var this$1 = this;
2561
 
2562
+ var i = this.deps.length;
2563
+ while (i--) {
2564
+ this$1.deps[i].depend();
 
 
 
 
 
 
2565
  }
2566
+ };
2567
 
2568
+ /**
2569
+ * Remove self from all dependencies' subscriber list.
2570
+ */
2571
+ Watcher.prototype.teardown = function teardown () {
2572
+ var this$1 = this;
2573
 
2574
+ if (this.active) {
2575
+ // remove self from vm's watcher list
2576
+ // this is a somewhat expensive operation so we skip it
2577
+ // if the vm is being destroyed.
2578
+ if (!this.vm._isBeingDestroyed) {
2579
+ remove(this.vm._watchers, this);
2580
  }
2581
+ var i = this.deps.length;
2582
+ while (i--) {
2583
+ this$1.deps[i].removeSub(this$1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2584
  }
2585
+ this.active = false;
2586
  }
2587
+ };
2588
 
2589
+ /**
2590
+ * Recursively traverse an object to evoke all converted
2591
+ * getters, so that every nested property inside the object
2592
+ * is collected as a "deep" dependency.
2593
+ */
2594
+ var seenObjects = new _Set();
2595
+ function traverse (val) {
2596
+ seenObjects.clear();
2597
+ _traverse(val, seenObjects);
2598
+ }
2599
 
2600
+ function _traverse (val, seen) {
2601
+ var i, keys;
2602
+ var isA = Array.isArray(val);
2603
+ if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
2604
+ return
2605
+ }
2606
+ if (val.__ob__) {
2607
+ var depId = val.__ob__.dep.id;
2608
+ if (seen.has(depId)) {
2609
+ return
2610
+ }
2611
+ seen.add(depId);
2612
+ }
2613
+ if (isA) {
2614
+ i = val.length;
2615
+ while (i--) { _traverse(val[i], seen); }
2616
+ } else {
2617
+ keys = Object.keys(val);
2618
+ i = keys.length;
2619
+ while (i--) { _traverse(val[keys[i]], seen); }
2620
+ }
2621
+ }
2622
 
2623
+ /* */
 
2624
 
2625
+ var sharedPropertyDefinition = {
2626
+ enumerable: true,
2627
+ configurable: true,
2628
+ get: noop,
2629
+ set: noop
2630
+ };
2631
 
2632
+ function proxy (target, sourceKey, key) {
2633
+ sharedPropertyDefinition.get = function proxyGetter () {
2634
+ return this[sourceKey][key]
2635
+ };
2636
+ sharedPropertyDefinition.set = function proxySetter (val) {
2637
+ this[sourceKey][key] = val;
2638
+ };
2639
+ Object.defineProperty(target, key, sharedPropertyDefinition);
2640
+ }
2641
 
2642
+ function initState (vm) {
2643
+ vm._watchers = [];
2644
+ var opts = vm.$options;
2645
+ if (opts.props) { initProps(vm, opts.props); }
2646
+ if (opts.methods) { initMethods(vm, opts.methods); }
2647
+ if (opts.data) {
2648
+ initData(vm);
2649
+ } else {
2650
+ observe(vm._data = {}, true /* asRootData */);
2651
  }
2652
+ if (opts.computed) { initComputed(vm, opts.computed); }
2653
+ if (opts.watch) { initWatch(vm, opts.watch); }
2654
+ }
2655
 
2656
+ var isReservedProp = { key: 1, ref: 1, slot: 1 };
 
2657
 
2658
+ function initProps (vm, propsOptions) {
2659
+ var propsData = vm.$options.propsData || {};
2660
+ var props = vm._props = {};
2661
+ // cache prop keys so that future props updates can iterate using Array
2662
+ // instead of dynamic object key enumeration.
2663
+ var keys = vm.$options._propKeys = [];
2664
+ var isRoot = !vm.$parent;
2665
+ // root instance props should be converted
2666
+ observerState.shouldConvert = isRoot;
2667
+ var loop = function ( key ) {
2668
+ keys.push(key);
2669
+ var value = validateProp(key, propsOptions, propsData, vm);
2670
+ /* istanbul ignore else */
2671
+ {
2672
+ if (isReservedProp[key]) {
2673
+ warn(
2674
+ ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
2675
+ vm
2676
+ );
2677
+ }
2678
+ defineReactive$$1(props, key, value, function () {
2679
+ if (vm.$parent && !observerState.isSettingProps) {
2680
+ warn(
2681
+ "Avoid mutating a prop directly since the value will be " +
2682
+ "overwritten whenever the parent component re-renders. " +
2683
+ "Instead, use a data or computed property based on the prop's " +
2684
+ "value. Prop being mutated: \"" + key + "\"",
2685
+ vm
2686
+ );
2687
+ }
2688
+ });
2689
+ }
2690
+ // static props are already proxied on the component's prototype
2691
+ // during Vue.extend(). We only need to proxy props defined at
2692
+ // instantiation here.
2693
+ if (!(key in vm)) {
2694
+ proxy(vm, "_props", key);
2695
+ }
2696
+ };
2697
+
2698
+ for (var key in propsOptions) loop( key );
2699
+ observerState.shouldConvert = true;
2700
  }
2701
 
2702
+ function initData (vm) {
2703
+ var data = vm.$options.data;
2704
+ data = vm._data = typeof data === 'function'
2705
+ ? data.call(vm)
2706
+ : data || {};
2707
+ if (!isPlainObject(data)) {
2708
+ data = {};
2709
+ "development" !== 'production' && warn(
2710
+ 'data functions should return an object:\n' +
2711
+ 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
2712
+ vm
2713
+ );
 
2714
  }