├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── Gulpfile.js ├── LICENSE.txt ├── README.md ├── acf-address.php ├── codeception.yml ├── composer.json ├── config ├── application.php └── environments │ └── development.php ├── package.json ├── phpunit.xml ├── ruleset.xml ├── src ├── app │ ├── mu-plugins │ │ ├── bedrock-autoloader.php │ │ └── register-theme-directory.php │ ├── plugins │ │ └── acf-address │ │ │ ├── ACFAddressPluginHelper.php │ │ │ ├── Helper.php │ │ │ ├── acf-address-v4.php │ │ │ ├── acf-address-v5.php │ │ │ ├── acf-address.php │ │ │ ├── bootstrap.php │ │ │ ├── defaults.json │ │ │ ├── dist │ │ │ ├── .gitkeep │ │ │ ├── address_jquery.b35eeab0e320fe5f625c.js │ │ │ ├── address_jquery.b35eeab0e320fe5f625c.js.map │ │ │ ├── input.b35eeab0e320fe5f625c.css │ │ │ ├── input.b35eeab0e320fe5f625c.css.map │ │ │ ├── input.b35eeab0e320fe5f625c.js │ │ │ ├── input.b35eeab0e320fe5f625c.js.map │ │ │ ├── manifest.json │ │ │ ├── render_field.b35eeab0e320fe5f625c.css │ │ │ ├── render_field.b35eeab0e320fe5f625c.css.map │ │ │ ├── render_field.b35eeab0e320fe5f625c.js │ │ │ ├── render_field.b35eeab0e320fe5f625c.js.map │ │ │ ├── render_field_options.b35eeab0e320fe5f625c.css │ │ │ ├── render_field_options.b35eeab0e320fe5f625c.css.map │ │ │ ├── render_field_options.b35eeab0e320fe5f625c.js │ │ │ └── render_field_options.b35eeab0e320fe5f625c.js.map │ │ │ ├── js │ │ │ ├── address.jquery.js │ │ │ ├── defaults.service.js │ │ │ ├── input.js │ │ │ ├── render_field.js │ │ │ └── render_field_options.js │ │ │ └── scss │ │ │ ├── input.scss │ │ │ ├── render_field.scss │ │ │ └── render_field_options.scss │ └── themes │ │ └── .gitkeep ├── index.php └── wp-config.php ├── tests ├── FunctionalTestCase.php ├── TestCase.php ├── TestTest.php ├── _bootstrap.php ├── _data │ └── dump.sql ├── _output │ └── .gitignore ├── _support │ ├── AcceptanceTester.php │ ├── FunctionalTester.php │ ├── Helper │ │ ├── Acceptance.php │ │ ├── Functional.php │ │ ├── Session.php │ │ └── Unit.php │ ├── UnitTester.php │ └── _generated │ │ ├── AcceptanceTesterActions.php │ │ ├── FunctionalTesterActions.php │ │ └── UnitTesterActions.php ├── acceptance.suite.yml ├── acceptance │ ├── CreateNewCustomFieldCept.php │ ├── CreateNewFieldCept.php │ ├── EditFieldCept.php │ ├── LoginCept.php │ ├── WelcomeCept.php │ └── _bootstrap.php ├── bootstrap.php ├── fixtures │ └── dump.sql ├── functional.suite.yml ├── functional │ └── _bootstrap.php ├── unit.suite.yml └── unit │ └── _bootstrap.php └── webpack.make.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"], 3 | "plugins": [ 4 | "transform-react-jsx" 5 | ] 6 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | **/dist/* 2 | **/node_modules/* 3 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "rackt", 3 | "rules": { 4 | "valid-jsdoc": 2, 5 | "no-var": 1 6 | }, 7 | "env": { 8 | "jquery": true 9 | }, 10 | "plugins": [ 11 | "react" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | /vendor 4 | /node_modules 5 | 6 | # ignore composer.lock 7 | composer.lock 8 | 9 | src/app/themes/* 10 | !src/app/themes/.gitkeep 11 | src/app/plugins/* 12 | !src/app/plugins/acf-address 13 | 14 | src/wp/* 15 | 16 | .env 17 | 18 | tests/_output/* 19 | -------------------------------------------------------------------------------- /Gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('dotenv').config() 3 | 4 | const gulp = require('gulp') 5 | const gulpsync = require('gulp-sync')(gulp) 6 | const gutil = require('gulp-util') 7 | const dbTask = require('gulp-db') 8 | const mysqldump = require('mysqldump') 9 | const gmcfp = require('gulp-mysql-command-file-processor') 10 | const livereload = require('gulp-livereload') 11 | const webpack = require('webpack') 12 | const del = require('del') 13 | const fs = require('fs') 14 | 15 | const ACF_ADDRESS_ROOT = process.env.ACF_ADDRESS_ROOT 16 | 17 | /* ------------------------- Gulp Tasks -------------------------------- */ 18 | 19 | /** 20 | * Gulp 21 | * default task: `gulp` 22 | * alias for `gulp build` 23 | */ 24 | gulp.task('default', [ 'build' ]) 25 | 26 | /** 27 | * Gulp watch `gulp watch` 28 | * Watch Files For Changes and recompile on change. 29 | */ 30 | gulp.task('watch', [ 'webpack:build-dev', 'webpack:watch-dev' ]) 31 | 32 | 33 | gulp.task('webpack:watch-dev', () => { 34 | livereload.listen() 35 | gulp.watch(`./${ACF_ADDRESS_ROOT}/**/*.php`, [ 'livereload' ]) 36 | gulp.watch(`./${ACF_ADDRESS_ROOT}/js/*.js`, [ 'webpack:build-dev' ]) 37 | gulp.watch(`./${ACF_ADDRESS_ROOT}/scss/*.scss`, [ 'webpack:build-dev' ]) 38 | }) 39 | 40 | gulp.task('livereload', (cb) => { 41 | livereload.reload() 42 | cb() 43 | }) 44 | 45 | gulp.task('build', gulpsync.sync([ 'clean:dist', [ 'webpack:build' ] ])) 46 | 47 | gulp.task('clean:dist', () => { 48 | return del([ 49 | `${ACF_ADDRESS_ROOT}/dist/*` 50 | ]) 51 | }) 52 | 53 | gulp.task('webpack:build', (cb) => { 54 | let webpackConfig = Object.create(require('./webpack.make')({ 55 | BUILD: true, 56 | TEST: false 57 | }, ACF_ADDRESS_ROOT)) 58 | let compiler = webpack(webpackConfig) 59 | 60 | compiler.run((err, stats) => { 61 | if(err) throw new gutil.PluginError('webpack:build', err) 62 | gutil.log('[webpack:build]', stats.toString({ 63 | colors: true 64 | })) 65 | cb() 66 | }) 67 | 68 | }) 69 | 70 | let webpackDevConfig = Object.create(require('./webpack.make')({ 71 | BUILD: false, 72 | TEST: false 73 | }, ACF_ADDRESS_ROOT)) 74 | // create a single instance of the compiler to allow caching 75 | let devCompiler = webpack(webpackDevConfig) 76 | 77 | gulp.task('webpack:build-dev', (cb) => { 78 | // run webpack 79 | devCompiler.run((err, stats) => { 80 | if(err) throw new gutil.PluginError('webpack:build-dev', err) 81 | gutil.log('[webpack:build-dev]', stats.toString({ 82 | colors: true 83 | })) 84 | livereload.reload() 85 | cb() 86 | }) 87 | }) 88 | 89 | /* ------------------------- Gulp Deploy Tasks -------------------------------- */ 90 | 91 | /** 92 | * Gulp Database Init `gulp db:init` 93 | * Initializes your local database with test database. 94 | */ 95 | gulp.task('db:init', gulpsync.sync([ 'db:drop', 'db:create', 'db:populate' ])) 96 | 97 | let dbConfig = { 98 | host: process.env.DB_HOST, 99 | user: process.env.DB_USER, 100 | password: process.env.DB_PASSWORD, 101 | database: process.env.DB_NAME, 102 | port: process.env.DB_PORT || 3306 103 | } 104 | 105 | let dbManager = dbTask(Object.assign({}, dbConfig, { dialect: 'mysql', database: null })) 106 | 107 | gulp.task('db:create', dbManager.create(process.env.DB_NAME)) 108 | 109 | gulp.task('db:drop', dbManager.drop(process.env.DB_NAME)) 110 | 111 | gulp.task('db:populate', cb => { 112 | gulp.src('./tests/_data/dump.sql') 113 | .pipe(gmcfp(dbConfig.user, dbConfig.password, dbConfig.host, dbConfig.port, dbConfig.database)) 114 | .pipe(gulp.dest('./tests/fixtures')) 115 | 116 | cb() 117 | }) 118 | 119 | /** 120 | * This is a helper task that updates tests/_data/dump.sql 121 | */ 122 | gulp.task('dump:local', (cb) => { 123 | let config = Object.assign({}, dbConfig, { dest:'./tests/_data/dump.sql' }) 124 | mysqldump(config, err => { 125 | if(err) throw new Error(err) 126 | process.exit(0) 127 | }) 128 | 129 | cb() 130 | }) 131 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | ACF Address Field - An Advanced Custom Fields plugin 2 | 3 | Copyright 2016 by the contributors 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | This program incorporates work covered by the following copyright and 20 | permission notices: 21 | 22 | Advanced Custom Fields - Address Field add-on is (c) 2012, CAMPUS CRUSADE FOR CHRIST 23 | 24 | Wherever third party code has been used, credit has been given in the code's 25 | comments. 26 | 27 | Advanced Custom Fields - Address Field add-on is released under the BSD 3-Clause License 28 | 29 | and 30 | 31 | Advanced Custom Fields Pro is (c) ????, Elliot Condon 32 | 33 | Advanced Custom Fields Pro is released GPLv2 or later 34 | 35 | and 36 | 37 | WordPress - Web publishing software 38 | 39 | Copyright 2003-2010 by the contributors 40 | 41 | WordPress is released under the GPL 42 | 43 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 44 | 45 | GNU GENERAL PUBLIC LICENSE 46 | Version 2, June 1991 47 | 48 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 49 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 50 | Everyone is permitted to copy and distribute verbatim copies 51 | of this license document, but changing it is not allowed. 52 | 53 | Preamble 54 | 55 | The licenses for most software are designed to take away your 56 | freedom to share and change it. By contrast, the GNU General Public 57 | License is intended to guarantee your freedom to share and change free 58 | software--to make sure the software is free for all its users. This 59 | General Public License applies to most of the Free Software 60 | Foundation's software and to any other program whose authors commit to 61 | using it. (Some other Free Software Foundation software is covered by 62 | the GNU Lesser General Public License instead.) You can apply it to 63 | your programs, too. 64 | 65 | When we speak of free software, we are referring to freedom, not 66 | price. Our General Public Licenses are designed to make sure that you 67 | have the freedom to distribute copies of free software (and charge for 68 | this service if you wish), that you receive source code or can get it 69 | if you want it, that you can change the software or use pieces of it 70 | in new free programs; and that you know you can do these things. 71 | 72 | To protect your rights, we need to make restrictions that forbid 73 | anyone to deny you these rights or to ask you to surrender the rights. 74 | These restrictions translate to certain responsibilities for you if you 75 | distribute copies of the software, or if you modify it. 76 | 77 | For example, if you distribute copies of such a program, whether 78 | gratis or for a fee, you must give the recipients all the rights that 79 | you have. You must make sure that they, too, receive or can get the 80 | source code. And you must show them these terms so they know their 81 | rights. 82 | 83 | We protect your rights with two steps: (1) copyright the software, and 84 | (2) offer you this license which gives you legal permission to copy, 85 | distribute and/or modify the software. 86 | 87 | Also, for each author's protection and ours, we want to make certain 88 | that everyone understands that there is no warranty for this free 89 | software. If the software is modified by someone else and passed on, we 90 | want its recipients to know that what they have is not the original, so 91 | that any problems introduced by others will not reflect on the original 92 | authors' reputations. 93 | 94 | Finally, any free program is threatened constantly by software 95 | patents. We wish to avoid the danger that redistributors of a free 96 | program will individually obtain patent licenses, in effect making the 97 | program proprietary. To prevent this, we have made it clear that any 98 | patent must be licensed for everyone's free use or not licensed at all. 99 | 100 | The precise terms and conditions for copying, distribution and 101 | modification follow. 102 | 103 | GNU GENERAL PUBLIC LICENSE 104 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 105 | 106 | 0. This License applies to any program or other work which contains 107 | a notice placed by the copyright holder saying it may be distributed 108 | under the terms of this General Public License. The "Program", below, 109 | refers to any such program or work, and a "work based on the Program" 110 | means either the Program or any derivative work under copyright law: 111 | that is to say, a work containing the Program or a portion of it, 112 | either verbatim or with modifications and/or translated into another 113 | language. (Hereinafter, translation is included without limitation in 114 | the term "modification".) Each licensee is addressed as "you". 115 | 116 | Activities other than copying, distribution and modification are not 117 | covered by this License; they are outside its scope. The act of 118 | running the Program is not restricted, and the output from the Program 119 | is covered only if its contents constitute a work based on the 120 | Program (independent of having been made by running the Program). 121 | Whether that is true depends on what the Program does. 122 | 123 | 1. You may copy and distribute verbatim copies of the Program's 124 | source code as you receive it, in any medium, provided that you 125 | conspicuously and appropriately publish on each copy an appropriate 126 | copyright notice and disclaimer of warranty; keep intact all the 127 | notices that refer to this License and to the absence of any warranty; 128 | and give any other recipients of the Program a copy of this License 129 | along with the Program. 130 | 131 | You may charge a fee for the physical act of transferring a copy, and 132 | you may at your option offer warranty protection in exchange for a fee. 133 | 134 | 2. You may modify your copy or copies of the Program or any portion 135 | of it, thus forming a work based on the Program, and copy and 136 | distribute such modifications or work under the terms of Section 1 137 | above, provided that you also meet all of these conditions: 138 | 139 | a) You must cause the modified files to carry prominent notices 140 | stating that you changed the files and the date of any change. 141 | 142 | b) You must cause any work that you distribute or publish, that in 143 | whole or in part contains or is derived from the Program or any 144 | part thereof, to be licensed as a whole at no charge to all third 145 | parties under the terms of this License. 146 | 147 | c) If the modified program normally reads commands interactively 148 | when run, you must cause it, when started running for such 149 | interactive use in the most ordinary way, to print or display an 150 | announcement including an appropriate copyright notice and a 151 | notice that there is no warranty (or else, saying that you provide 152 | a warranty) and that users may redistribute the program under 153 | these conditions, and telling the user how to view a copy of this 154 | License. (Exception: if the Program itself is interactive but 155 | does not normally print such an announcement, your work based on 156 | the Program is not required to print an announcement.) 157 | 158 | These requirements apply to the modified work as a whole. If 159 | identifiable sections of that work are not derived from the Program, 160 | and can be reasonably considered independent and separate works in 161 | themselves, then this License, and its terms, do not apply to those 162 | sections when you distribute them as separate works. But when you 163 | distribute the same sections as part of a whole which is a work based 164 | on the Program, the distribution of the whole must be on the terms of 165 | this License, whose permissions for other licensees extend to the 166 | entire whole, and thus to each and every part regardless of who wrote it. 167 | 168 | Thus, it is not the intent of this section to claim rights or contest 169 | your rights to work written entirely by you; rather, the intent is to 170 | exercise the right to control the distribution of derivative or 171 | collective works based on the Program. 172 | 173 | In addition, mere aggregation of another work not based on the Program 174 | with the Program (or with a work based on the Program) on a volume of 175 | a storage or distribution medium does not bring the other work under 176 | the scope of this License. 177 | 178 | 3. You may copy and distribute the Program (or a work based on it, 179 | under Section 2) in object code or executable form under the terms of 180 | Sections 1 and 2 above provided that you also do one of the following: 181 | 182 | a) Accompany it with the complete corresponding machine-readable 183 | source code, which must be distributed under the terms of Sections 184 | 1 and 2 above on a medium customarily used for software interchange; or, 185 | 186 | b) Accompany it with a written offer, valid for at least three 187 | years, to give any third party, for a charge no more than your 188 | cost of physically performing source distribution, a complete 189 | machine-readable copy of the corresponding source code, to be 190 | distributed under the terms of Sections 1 and 2 above on a medium 191 | customarily used for software interchange; or, 192 | 193 | c) Accompany it with the information you received as to the offer 194 | to distribute corresponding source code. (This alternative is 195 | allowed only for noncommercial distribution and only if you 196 | received the program in object code or executable form with such 197 | an offer, in accord with Subsection b above.) 198 | 199 | The source code for a work means the preferred form of the work for 200 | making modifications to it. For an executable work, complete source 201 | code means all the source code for all modules it contains, plus any 202 | associated interface definition files, plus the scripts used to 203 | control compilation and installation of the executable. However, as a 204 | special exception, the source code distributed need not include 205 | anything that is normally distributed (in either source or binary 206 | form) with the major components (compiler, kernel, and so on) of the 207 | operating system on which the executable runs, unless that component 208 | itself accompanies the executable. 209 | 210 | If distribution of executable or object code is made by offering 211 | access to copy from a designated place, then offering equivalent 212 | access to copy the source code from the same place counts as 213 | distribution of the source code, even though third parties are not 214 | compelled to copy the source along with the object code. 215 | 216 | 4. You may not copy, modify, sublicense, or distribute the Program 217 | except as expressly provided under this License. Any attempt 218 | otherwise to copy, modify, sublicense or distribute the Program is 219 | void, and will automatically terminate your rights under this License. 220 | However, parties who have received copies, or rights, from you under 221 | this License will not have their licenses terminated so long as such 222 | parties remain in full compliance. 223 | 224 | 5. You are not required to accept this License, since you have not 225 | signed it. However, nothing else grants you permission to modify or 226 | distribute the Program or its derivative works. These actions are 227 | prohibited by law if you do not accept this License. Therefore, by 228 | modifying or distributing the Program (or any work based on the 229 | Program), you indicate your acceptance of this License to do so, and 230 | all its terms and conditions for copying, distributing or modifying 231 | the Program or works based on it. 232 | 233 | 6. Each time you redistribute the Program (or any work based on the 234 | Program), the recipient automatically receives a license from the 235 | original licensor to copy, distribute or modify the Program subject to 236 | these terms and conditions. You may not impose any further 237 | restrictions on the recipients' exercise of the rights granted herein. 238 | You are not responsible for enforcing compliance by third parties to 239 | this License. 240 | 241 | 7. If, as a consequence of a court judgment or allegation of patent 242 | infringement or for any other reason (not limited to patent issues), 243 | conditions are imposed on you (whether by court order, agreement or 244 | otherwise) that contradict the conditions of this License, they do not 245 | excuse you from the conditions of this License. If you cannot 246 | distribute so as to satisfy simultaneously your obligations under this 247 | License and any other pertinent obligations, then as a consequence you 248 | may not distribute the Program at all. For example, if a patent 249 | license would not permit royalty-free redistribution of the Program by 250 | all those who receive copies directly or indirectly through you, then 251 | the only way you could satisfy both it and this License would be to 252 | refrain entirely from distribution of the Program. 253 | 254 | If any portion of this section is held invalid or unenforceable under 255 | any particular circumstance, the balance of the section is intended to 256 | apply and the section as a whole is intended to apply in other 257 | circumstances. 258 | 259 | It is not the purpose of this section to induce you to infringe any 260 | patents or other property right claims or to contest validity of any 261 | such claims; this section has the sole purpose of protecting the 262 | integrity of the free software distribution system, which is 263 | implemented by public license practices. Many people have made 264 | generous contributions to the wide range of software distributed 265 | through that system in reliance on consistent application of that 266 | system; it is up to the author/donor to decide if he or she is willing 267 | to distribute software through any other system and a licensee cannot 268 | impose that choice. 269 | 270 | This section is intended to make thoroughly clear what is believed to 271 | be a consequence of the rest of this License. 272 | 273 | 8. If the distribution and/or use of the Program is restricted in 274 | certain countries either by patents or by copyrighted interfaces, the 275 | original copyright holder who places the Program under this License 276 | may add an explicit geographical distribution limitation excluding 277 | those countries, so that distribution is permitted only in or among 278 | countries not thus excluded. In such case, this License incorporates 279 | the limitation as if written in the body of this License. 280 | 281 | 9. The Free Software Foundation may publish revised and/or new versions 282 | of the General Public License from time to time. Such new versions will 283 | be similar in spirit to the present version, but may differ in detail to 284 | address new problems or concerns. 285 | 286 | Each version is given a distinguishing version number. If the Program 287 | specifies a version number of this License which applies to it and "any 288 | later version", you have the option of following the terms and conditions 289 | either of that version or of any later version published by the Free 290 | Software Foundation. If the Program does not specify a version number of 291 | this License, you may choose any version ever published by the Free Software 292 | Foundation. 293 | 294 | 10. If you wish to incorporate parts of the Program into other free 295 | programs whose distribution conditions are different, write to the author 296 | to ask for permission. For software which is copyrighted by the Free 297 | Software Foundation, write to the Free Software Foundation; we sometimes 298 | make exceptions for this. Our decision will be guided by the two goals 299 | of preserving the free status of all derivatives of our free software and 300 | of promoting the sharing and reuse of software generally. 301 | 302 | NO WARRANTY 303 | 304 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 305 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 306 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 307 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 308 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 309 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 310 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 311 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 312 | REPAIR OR CORRECTION. 313 | 314 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 315 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 316 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 317 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 318 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 319 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 320 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 321 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 322 | POSSIBILITY OF SUCH DAMAGES. 323 | 324 | END OF TERMS AND CONDITIONS 325 | 326 | How to Apply These Terms to Your New Programs 327 | 328 | If you develop a new program, and you want it to be of the greatest 329 | possible use to the public, the best way to achieve this is to make it 330 | free software which everyone can redistribute and change under these terms. 331 | 332 | To do so, attach the following notices to the program. It is safest 333 | to attach them to the start of each source file to most effectively 334 | convey the exclusion of warranty; and each file should have at least 335 | the "copyright" line and a pointer to where the full notice is found. 336 | 337 | 338 | Copyright (C) 339 | 340 | This program is free software; you can redistribute it and/or modify 341 | it under the terms of the GNU General Public License as published by 342 | the Free Software Foundation; either version 2 of the License, or 343 | (at your option) any later version. 344 | 345 | This program is distributed in the hope that it will be useful, 346 | but WITHOUT ANY WARRANTY; without even the implied warranty of 347 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 348 | GNU General Public License for more details. 349 | 350 | You should have received a copy of the GNU General Public License along 351 | with this program; if not, write to the Free Software Foundation, Inc., 352 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 353 | 354 | Also add information on how to contact you by electronic and paper mail. 355 | 356 | If the program is interactive, make it output a short notice like this 357 | when it starts in an interactive mode: 358 | 359 | Gnomovision version 69, Copyright (C) year name of author 360 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 361 | This is free software, and you are welcome to redistribute it 362 | under certain conditions; type `show c' for details. 363 | 364 | The hypothetical commands `show w' and `show c' should show the appropriate 365 | parts of the General Public License. Of course, the commands you use may 366 | be called something other than `show w' and `show c'; they could even be 367 | mouse-clicks or menu items--whatever suits your program. 368 | 369 | You should also get your employer (if you work as a programmer) or your 370 | school, if any, to sign a "copyright disclaimer" for the program, if 371 | necessary. Here is a sample; alter the names: 372 | 373 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 374 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 375 | 376 | , 1 April 1989 377 | Ty Coon, President of Vice 378 | 379 | This General Public License does not permit incorporating your program into 380 | proprietary programs. If your program is a subroutine library, you may 381 | consider it more useful to permit linking proprietary applications with the 382 | library. If this is what you want to do, use the GNU Lesser General 383 | Public License instead of this License. 384 | 385 | WRITTEN OFFER 386 | 387 | The source code for any program binaries or compressed scripts that are 388 | included with ACF Address Field can be freely obtained at the following URL: 389 | 390 | https://github.com/strickdj/acf-field-address 391 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ACF Address Field 2 | 3 | An Advanced Custom Field. Adds an address field type. 4 | 5 | ----------------------- 6 | 7 | ## Compatibility 8 | 9 | This ACF field type is compatible with: 10 | 11 | * ACF 5.3.4 and up 12 | * ACF 4 (no longer supported) 13 | 14 | ## Installation 15 | 16 | ### via Composer 17 | 1. Add a line to your repositories array: 18 | `{ "type": "git", "url": "https://github.com/strickdj/acf-field-address" }` 19 | 2. Add a line to your require block: 20 | `"strickdj/acf-address": "dev-master"` 21 | 3. Run: `composer update` 22 | 23 | ### Manual 24 | 25 | 1. Copy the plugin folder into your `plugins` folder. 26 | 2. Activate the plugin via the plugins admin page. 27 | 3. Create a new field via ACF and select the Address type. 28 | 29 | ## Changelog 30 | 5.1.0 - Fixed bug preventing the creation of new Address fields. 31 | 32 | - Fixed bug rendering the field to html 33 | - Automated testing support 34 | - Build tools, gulp, webpack, es6, scss 35 | 36 | 5.0.6 - Now works properly with php >= 5.3 37 | 38 | 5.0.5 - Added composer support. 39 | 40 | 5.0.4 - Fixed problem with unicode characters 41 | 42 | 5.0.3 - Fixed issue with exported fields 43 | 44 | 5.0.2 - Added backwards compatibility with previously created fields. 45 | 46 | 5.0.1 - Switched the js files to minified ones. 47 | 48 | 5.0 - Refactored for ACF 5.0 49 | 50 | 4.0 - Refactored for AFC 4.0 and above 51 | -------------------------------------------------------------------------------- /acf-address.php: -------------------------------------------------------------------------------- 1 | =5.3.2", 36 | "composer/installers": "~1.0.12" 37 | }, 38 | "require-dev": { 39 | "codeception/codeception": "*", 40 | "simadmin/acf-mirror": "5.3.4", 41 | "strickdj/ACF-Address-Test-Theme": "dev-master", 42 | "johnpbloch/wordpress": "4.4.2", 43 | "vlucas/phpdotenv": "^2.0.1", 44 | "phpunit/phpunit": "*", 45 | "symfony/debug": "^3.0", 46 | "site5/phantoman": "^1.0", 47 | "jakoch/phantomjs-installer": "^2.1" 48 | }, 49 | "scripts": { 50 | "post-install-cmd": [ 51 | "PhantomInstaller\\Installer::installPhantomJS" 52 | ], 53 | "post-update-cmd": [ 54 | "PhantomInstaller\\Installer::installPhantomJS" 55 | ] 56 | }, 57 | "extra": { 58 | "installer-paths": { 59 | "src/app/plugins/{$name}/": ["type:wordpress-plugin"], 60 | "src/app/themes/{$name}/": ["type:wordpress-theme"] 61 | }, 62 | "wordpress-install-dir": "src/wp" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /config/application.php: -------------------------------------------------------------------------------- 1 | load(); 11 | $dotenv->required(['DB_NAME', 'DB_USER', 'DB_PASSWORD', 'WP_HOME', 'WP_SITEURL']); 12 | } 13 | 14 | /** 15 | * Set up our global environment constant and load its config first 16 | * Default: development 17 | */ 18 | define('WP_ENV', getenv('WP_ENV') ?: 'development'); 19 | 20 | $env_config = __DIR__ . '/environments/' . WP_ENV . '.php'; 21 | 22 | if (file_exists($env_config)) { 23 | require_once $env_config; 24 | } 25 | 26 | /** 27 | * URLs 28 | */ 29 | define('WP_HOME', getenv('WP_HOME')); 30 | define('WP_SITEURL', getenv('WP_SITEURL')); 31 | 32 | /** 33 | * Custom Content Directory 34 | */ 35 | define('CONTENT_DIR', '/app'); 36 | define('WP_CONTENT_DIR', $webroot_dir . CONTENT_DIR); 37 | define('WP_CONTENT_URL', WP_HOME . CONTENT_DIR); 38 | 39 | /** 40 | * DB settings 41 | */ 42 | define('DB_NAME', getenv('DB_NAME')); 43 | define('DB_USER', getenv('DB_USER')); 44 | define('DB_PASSWORD', getenv('DB_PASSWORD')); 45 | define('DB_HOST', getenv('DB_HOST') ?: 'localhost'); 46 | define('DB_CHARSET', 'utf8'); 47 | define('DB_COLLATE', ''); 48 | $table_prefix = getenv('DB_PREFIX') ?: 'wp_'; 49 | 50 | /** 51 | * Authentication Unique Keys and Salts 52 | */ 53 | define('AUTH_KEY', getenv('AUTH_KEY')); 54 | define('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY')); 55 | define('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY')); 56 | define('NONCE_KEY', getenv('NONCE_KEY')); 57 | define('AUTH_SALT', getenv('AUTH_SALT')); 58 | define('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT')); 59 | define('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT')); 60 | define('NONCE_SALT', getenv('NONCE_SALT')); 61 | 62 | /** 63 | * Custom Settings 64 | */ 65 | define('AUTOMATIC_UPDATER_DISABLED', true); 66 | define('DISABLE_WP_CRON', getenv('DISABLE_WP_CRON') ?: false); 67 | define('DISALLOW_FILE_EDIT', true); 68 | 69 | /** 70 | * Bootstrap WordPress 71 | */ 72 | if (!defined('ABSPATH')) { 73 | define('ABSPATH', $webroot_dir . '/wp/'); 74 | } 75 | -------------------------------------------------------------------------------- /config/environments/development.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simplexity Code Style 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/app/mu-plugins/bedrock-autoloader.php: -------------------------------------------------------------------------------- 1 | loadPlugins(); 36 | } 37 | 38 | /** 39 | * Run some checks then autoload our plugins. 40 | */ 41 | public function loadPlugins() { 42 | $this->checkCache(); 43 | $this->validatePlugins(); 44 | $this->countPlugins(); 45 | 46 | foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) { 47 | include_once(WPMU_PLUGIN_DIR . '/' . $plugin_file); 48 | } 49 | 50 | $this->pluginHooks(); 51 | } 52 | 53 | /** 54 | * Filter show_advanced_plugins to display the autoloaded plugins. 55 | */ 56 | public function showInAdmin($bool, $type) { 57 | $screen = get_current_screen(); 58 | $current = is_multisite() ? 'plugins-network' : 'plugins'; 59 | 60 | if ($screen->{'base'} != $current || $type != 'mustuse' || !current_user_can('activate_plugins')) { 61 | return $bool; 62 | } 63 | 64 | $this->updateCache(); // May as well update the transient cache whilst here. 65 | 66 | self::$auto_plugins = array_map(function ($auto_plugin) { 67 | $auto_plugin['Name'] .= ' *'; 68 | return $auto_plugin; 69 | }, self::$auto_plugins); 70 | 71 | $GLOBALS['plugins']['mustuse'] = array_unique(array_merge(self::$auto_plugins, self::$mu_plugins), SORT_REGULAR); 72 | 73 | return false; // Prevent WordPress overriding our work. 74 | } 75 | 76 | /** 77 | * This sets the cache or calls for an update 78 | */ 79 | private function checkCache() { 80 | $cache = get_site_option('bedrock_autoloader'); 81 | 82 | if ($cache === false) { 83 | return $this->updateCache(); 84 | } 85 | 86 | self::$cache = $cache; 87 | } 88 | 89 | /** 90 | * Get the plugins and mu-plugins from the mu-plugin path and remove duplicates. 91 | * Check cache against current plugins for newly activated plugins. 92 | * After that, we can update the cache. 93 | */ 94 | private function updateCache() { 95 | require_once(ABSPATH . 'wp-admin/includes/plugin.php'); 96 | 97 | self::$auto_plugins = get_plugins(self::$relative_path); 98 | self::$mu_plugins = get_mu_plugins(); 99 | $plugins = array_diff_key(self::$auto_plugins, self::$mu_plugins); 100 | $rebuild = !is_array(self::$cache['plugins']); 101 | self::$activated = ($rebuild) ? $plugins : array_diff_key($plugins, self::$cache['plugins']); 102 | self::$cache = array('plugins' => $plugins, 'count' => $this->countPlugins()); 103 | 104 | update_site_option('bedrock_autoloader', self::$cache); 105 | } 106 | 107 | /** 108 | * This accounts for the plugin hooks that would run if the plugins were 109 | * loaded as usual. Plugins are removed by deletion, so there's no way 110 | * to deactivate or uninstall. 111 | */ 112 | private function pluginHooks() { 113 | if (!is_array(self::$activated)) { return; } 114 | 115 | foreach (self::$activated as $plugin_file => $plugin_info) { 116 | do_action('activate_' . $plugin_file); 117 | } 118 | } 119 | 120 | /** 121 | * Check that the plugin file exists, if it doesn't update the cache. 122 | */ 123 | private function validatePlugins() { 124 | foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) { 125 | if (!file_exists(WPMU_PLUGIN_DIR . '/' . $plugin_file)) { 126 | $this->updateCache(); 127 | break; 128 | } 129 | } 130 | } 131 | 132 | /** 133 | * Count our plugins (but only once) by counting the top level folders in the 134 | * mu-plugins dir. If it's more or less than last time, update the cache. 135 | */ 136 | private function countPlugins() { 137 | if (isset(self::$count)) { return self::$count; } 138 | 139 | $count = count(glob(WPMU_PLUGIN_DIR . '/*/', GLOB_ONLYDIR | GLOB_NOSORT)); 140 | 141 | if (!isset(self::$cache['count']) || $count != self::$cache['count']) { 142 | self::$count = $count; 143 | $this->updateCache(); 144 | } 145 | 146 | return self::$count; 147 | } 148 | } 149 | 150 | new Autoloader(); 151 | -------------------------------------------------------------------------------- /src/app/mu-plugins/register-theme-directory.php: -------------------------------------------------------------------------------- 1 | get_assets_manifest_path())); 24 | } 25 | 26 | /** 27 | * @return string 28 | */ 29 | public function get_assets_manifest_path() { 30 | return ACF_ADDRESS_PLUGIN_PATH . 'dist/manifest.json'; 31 | } 32 | 33 | /** 34 | * @param $value 35 | * @param $field 36 | * 37 | * @return string 38 | */ 39 | public function valueToHtml( $value, $field ) { 40 | 41 | $html = ''; 42 | 43 | $layout = json_decode( $field['address_layout'] ); 44 | 45 | $options = json_decode( $field['address_options'] ); 46 | 47 | $value = array_filter($value); 48 | 49 | if(empty($value)) { 50 | return $html; 51 | } 52 | 53 | $html .= "
"; 54 | 55 | foreach ( $layout as $rowIndex => $row ) { 56 | 57 | if ( empty( $row ) ) { 58 | continue; 59 | } 60 | 61 | $html .= "
"; 62 | 63 | foreach ( $row as $colIndex => $item ) { 64 | 65 | $key = $item->id; 66 | 67 | $html .= sprintf( "", $options->{$key}->cssClass ); 68 | 69 | $html .= isset($value[ $key ]) ? $value[ $key ] : ''; 70 | 71 | if ( $options->{$key}->separator !== '' ) { 72 | $html .= $options->{$key}->separator; 73 | } 74 | 75 | $html .= " "; 76 | 77 | } 78 | 79 | $html .= "
"; 80 | 81 | } 82 | 83 | $html .= "
"; 84 | 85 | return $html; 86 | } 87 | 88 | /** 89 | * @param $value 90 | * 91 | * @return array|mixed 92 | */ 93 | public function valueToObject( $value ) { 94 | return json_decode( json_encode( $value ) ); 95 | } 96 | 97 | /** 98 | * @param $value 99 | * 100 | * @return mixed 101 | */ 102 | public function valueToArray( $value ) { 103 | return $value; 104 | } 105 | 106 | /** 107 | * @param $old_layout 108 | * @return array 109 | */ 110 | public function transform_layout( $old_layout ) { 111 | 112 | $map = array( 113 | 'address1' => 'street1', 114 | 'address2' => 'street2', 115 | 'address3' => 'street3', 116 | 'city' => 'city', 117 | 'state' => 'state', 118 | 'postal_code' => 'zip', 119 | 'country' => 'country', 120 | ); 121 | 122 | $labelMap = array( 123 | 'street1' => 'Street 1', 124 | 'street2' => 'Street 2', 125 | 'street3' => 'Street 3', 126 | 'city' => 'City', 127 | 'state' => 'State', 128 | 'zip' => 'Postal Code', 129 | 'country' => 'Country', 130 | ); 131 | 132 | $target = array(); 133 | 134 | $i = 0; 135 | foreach ( $old_layout as $row ) { 136 | 137 | foreach ( $row as $item ) { 138 | $o = new stdClass(); 139 | $o->id = $map[ $item ]; 140 | $o->label = $labelMap[ $map[ $item ] ]; 141 | $target[ $i ][] = $o; 142 | } 143 | 144 | $i ++; 145 | 146 | } 147 | 148 | if ( count( $target ) < 5 ) { 149 | 150 | while ( count( $target ) < 5 ) { 151 | $target[] = array(); 152 | } 153 | 154 | } 155 | 156 | return $target; 157 | 158 | } 159 | 160 | /** 161 | * @param $old_options 162 | * @return array|mixed|object 163 | */ 164 | public function transform_options( $old_options ) { 165 | 166 | $map = array( 167 | 'street1' => array( 168 | 'id' => 'street1', 169 | 'label' => $old_options['address1']['label'] ?: '', 170 | 'defaultValue' => $old_options['address1']['default_value'] ?: '', 171 | 'enabled' => $old_options['address1']['enabled'] ? true : false, 172 | 'cssClass' => $old_options['address1']['class'] ?: '', 173 | 'separator' => $old_options['address1']['separator'] ?: '', 174 | ), 175 | 'street2' => array( 176 | 'id' => 'street2', 177 | 'label' => $old_options['address2']['label'] ?: '', 178 | 'defaultValue' => $old_options['address2']['default_value'] ?: '', 179 | 'enabled' => $old_options['address2']['enabled'] ? true : false, 180 | 'cssClass' => $old_options['address2']['class'] ?: '', 181 | 'separator' => $old_options['address2']['separator'] ?: '', 182 | ), 183 | 'street3' => array( 184 | 'id' => 'street3', 185 | 'label' => $old_options['address3']['label'] ?: '', 186 | 'defaultValue' => $old_options['address3']['default_value'] ?: '', 187 | 'enabled' => $old_options['address3']['enabled'] ? true : false, 188 | 'cssClass' => $old_options['address3']['class'] ?: '', 189 | 'separator' => $old_options['address3']['separator'] ?: '', 190 | ), 191 | 'city' => array( 192 | 'id' => 'city', 193 | 'label' => $old_options['city']['label'] ?: '', 194 | 'defaultValue' => $old_options['city']['default_value'] ?: '', 195 | 'enabled' => $old_options['city']['enabled'] ? true : false, 196 | 'cssClass' => $old_options['city']['class'] ?: '', 197 | 'separator' => $old_options['city']['separator'] ?: '', 198 | ), 199 | 'state' => array( 200 | 'id' => 'state', 201 | 'label' => $old_options['state']['label'] ?: '', 202 | 'defaultValue' => $old_options['state']['default_value'] ?: '', 203 | 'enabled' => $old_options['state']['enabled'] ? true : false, 204 | 'cssClass' => $old_options['state']['class'] ?: '', 205 | 'separator' => $old_options['state']['separator'] ?: '', 206 | ), 207 | 'zip' => array( 208 | 'id' => 'zip', 209 | 'label' => $old_options['postal_code']['label'] ?: '', 210 | 'defaultValue' => $old_options['postal_code']['default_value'] ?: '', 211 | 'enabled' => $old_options['postal_code']['enabled'] ? true : false, 212 | 'cssClass' => $old_options['postal_code']['class'] ?: '', 213 | 'separator' => $old_options['postal_code']['separator'] ?: '', 214 | ), 215 | 'country' => array( 216 | 'id' => 'country', 217 | 'label' => $old_options['country']['label'] ?: '', 218 | 'defaultValue' => $old_options['country']['default_value'] ?: '', 219 | 'enabled' => $old_options['country']['enabled'] ? true : false, 220 | 'cssClass' => $old_options['country']['class'] ?: '', 221 | 'separator' => $old_options['country']['separator'] ?: '', 222 | ), 223 | ); 224 | 225 | return json_decode( json_encode( $map ) ); 226 | 227 | } 228 | 229 | } 230 | -------------------------------------------------------------------------------- /src/app/plugins/acf-address/Helper.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strickdj/acf-field-address/04a5879b74c48cc85a8606d3989d95e18ea6584b/src/app/plugins/acf-address/Helper.php -------------------------------------------------------------------------------- /src/app/plugins/acf-address/acf-address-v4.php: -------------------------------------------------------------------------------- 1 | name = 'address'; 50 | $this->label = __( 'Address' ); 51 | $this->category = __( "Basic", 'acf' ); // Basic, Content, Choice, etc 52 | $this->defaults = array( 53 | 'address1' => array( 54 | 'label' => 'Address 1', 55 | 'default_value' => '', 56 | 'enabled' => 1, 57 | 'class' => 'address1', 58 | 'separator' => '', 59 | ), 60 | 'address2' => array( 61 | 'label' => 'Address 2', 62 | 'default_value' => '', 63 | 'enabled' => 1, 64 | 'class' => 'address2', 65 | 'separator' => '', 66 | ), 67 | 'address3' => array( 68 | 'label' => 'Address 3', 69 | 'default_value' => '', 70 | 'enabled' => 1, 71 | 'class' => 'address3', 72 | 'separator' => '', 73 | ), 74 | 'city' => array( 75 | 'label' => 'City', 76 | 'default_value' => '', 77 | 'enabled' => 1, 78 | 'class' => 'city', 79 | 'separator' => ',', 80 | ), 81 | 'state' => array( 82 | 'label' => 'State', 83 | 'default_value' => '', 84 | 'enabled' => 1, 85 | 'class' => 'state', 86 | 'separator' => '', 87 | ), 88 | 'postal_code' => array( 89 | 'label' => 'Postal Code', 90 | 'default_value' => '', 91 | 'enabled' => 1, 92 | 'class' => 'postal_code', 93 | 'separator' => '', 94 | ), 95 | 'country' => array( 96 | 'label' => 'Country', 97 | 'default_value' => '', 98 | 'enabled' => 1, 99 | 'class' => 'country', 100 | 'separator' => '', 101 | ), 102 | // add default here to merge into your field. 103 | // This makes life easy when creating the field options as you don't need to use any if( isset('') ) logic. eg: 104 | //'preview_size' => 'thumbnail' 105 | ); 106 | 107 | 108 | // do not delete! 109 | parent::__construct(); 110 | 111 | 112 | // settings 113 | $this->settings = array( 114 | 'path' => apply_filters( 'acf/helpers/get_path', __FILE__ ), 115 | 'dir' => apply_filters( 'acf/helpers/get_dir', __FILE__ ), 116 | 'version' => '1.0.0' 117 | ); 118 | } 119 | 120 | /* 121 | * create_options() 122 | * 123 | * Create extra options for your field. This is rendered when editing a field. 124 | * The value of $field['name'] can be used (like bellow) to save extra data to the $field 125 | * 126 | * @type action 127 | * @since 3.6 128 | * @date 23/01/13 129 | * 130 | * @param $field - an array holding all the field's data 131 | */ 132 | function create_options( $field ) { 133 | // defaults 134 | $field = array_merge( $this->defaults, $field ); 135 | // key is needed in the field names to correctly save the data 136 | $key = $field['name']; 137 | $layout_defaults = array( 138 | 0 => array( 0 => 'address1' ), 139 | 1 => array( 0 => 'address2' ), 140 | 2 => array( 0 => 'address3' ), 141 | 3 => array( 0 => 'city', 1 => 'state', 2 => 'postal_code', 3 => 'country' ), 142 | ); 143 | $field['address_components'] = ( array_key_exists( 'address_components', $field ) && is_array( $field['address_components'] ) ) ? 144 | wp_parse_args( (array) $field['address_components'], $this->defaults ) : 145 | $this->defaults; 146 | $field['address_layout'] = ( array_key_exists( 'address_layout', $field ) && is_array( $field['address_layout'] ) ) ? 147 | (array) $field['address_layout'] : $layout_defaults; 148 | $components = $field['address_components']; 149 | $layout = $field['address_layout']; 150 | $missing = array_keys( $components ); 151 | // Create Field Options HTML 152 | ?> 153 | 154 | 155 | 156 | 157 | 158 |

159 | : 160 |
161 | : 162 |
163 | : 164 |
165 | : 166 |
167 | : 168 |
169 |

170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | $settings ) : ?> 195 | 196 | 197 | 207 | 217 | 227 | 237 | 247 | 248 | 249 | 250 |
198 | 'true_false', 201 | 'name' => "fields[{$key}][address_components][$name][enabled]", 202 | 'value' => $settings['enabled'], 203 | 'class' => 'address_enabled', 204 | ) ); 205 | ?> 206 | 208 | 'text', 211 | 'name' => "fields[{$key}][address_components][$name][label]", 212 | 'value' => $settings['label'], 213 | 'class' => 'address_label', 214 | ) ); 215 | ?> 216 | 218 | 'text', 221 | 'name' => "fields[{$key}][address_components][$name][default_value]", 222 | 'value' => $settings['default_value'], 223 | 'class' => 'address_default_value', 224 | ) ); 225 | ?> 226 | 228 | 'text', 231 | 'name' => "fields[{$key}][address_components][$name][class]", 232 | 'value' => $settings['class'], 233 | 'class' => 'address_class', 234 | ) ); 235 | ?> 236 | 238 | 'text', 241 | 'name' => "fields[{$key}][address_components][$name][separator]", 242 | 'value' => $settings['separator'], 243 | 'class' => 'address_separator', 244 | ) ); 245 | ?> 246 |
251 | 252 | 253 | 254 | 255 | 256 | 257 |

258 | 259 | 260 | 261 |
262 | 269 | 270 |
    271 | 284 |
  • 285 | 286 | " 288 | value=""/> 289 |
  • 290 | 294 |
295 | 300 | 301 |
    302 |
303 | 304 | 305 |
    306 | 307 |
  • 309 | 310 |
  • 311 | 312 |
313 |
314 | 315 | 316 | 317 | 356 | 357 | 451 | 452 | defaults, $field ); 471 | $components = $field['address_components']; 472 | $layout = $field['address_layout']; 473 | $values = (array) $field['value']; 474 | // perhaps use $field['preview_size'] to alter the markup? 475 | 476 | 477 | // create Field HTML 478 | ?> 479 | 480 | 519 | 520 |
521 | 524 |
525 | 528 | 534 | 535 |
536 | 537 |
538 |
539 | $settings ) { 557 | $defaults[ $name ] = $settings['default_value']; 558 | } 559 | $value = do_action( 'afc/load_value', $value, $post_id, $field ); 560 | $value = wp_parse_args( $value, $defaults ); 561 | } 562 | 563 | return $value; 564 | } 565 | 566 | function format_value_for_api( $value, $post_id, $field ) { 567 | $components = $field['address_components']; 568 | $layout = $field['address_layout']; 569 | $values = $this->load_value( $value, $post_id, $field ); 570 | $output = ''; 571 | foreach ( $layout as $layout_row ) { 572 | if ( empty( $layout_row ) ) { 573 | continue; 574 | } 575 | $output .= '
'; 576 | foreach ( $layout_row as $name ) { 577 | if ( empty( $name ) || ! $components[ $name ]['enabled'] ) { 578 | continue; 579 | } 580 | $output .= sprintf( 581 | '%1$s%3$s ', 582 | $values[ $name ], 583 | $components[ $name ]['class'] ? 'class="' . esc_attr( $components[ $name ]['class'] ) . '"' : '', 584 | $components[ $name ]['separator'] ? esc_html( $components[ $name ]['separator'] ) : '' 585 | ); 586 | } 587 | $output .= '
'; 588 | } 589 | 590 | return $output; 591 | } 592 | 593 | } 594 | 595 | // create field 596 | new acf_field_address(); 597 | ?> 598 | -------------------------------------------------------------------------------- /src/app/plugins/acf-address/acf-address-v5.php: -------------------------------------------------------------------------------- 1 | helper = $helper; 8 | 9 | $this->name = 'address'; 10 | 11 | $this->label = __( 'Address', 'acf-address' ); 12 | 13 | /* 14 | * category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME 15 | */ 16 | $this->category = 'basic'; 17 | 18 | /* 19 | * defaults (array) Array of default settings which are merged into the field object. These are used later in settings 20 | */ 21 | // todo fix this garbage 22 | $this->defaults = array( 23 | 'output_type' => 'html', 24 | 'address_layout' => '[[{"id":"street1","label":"Street 1"}],[{"id":"street2","label":"Street 2"}],[{"id":"street3","label":"Street 3"}],[{"id":"city","label":"City"},{"id":"state","label":"State"},{"id":"zip","label":"Postal Code"},{"id":"country","label":"Country"}],[]]', 25 | 'address_options' => '{"street1":{"id":"street1","label":"Street 1","defaultValue":"","enabled":true,"cssClass":"street1","separator":""},"street2":{"id":"street2","label":"Street 2","defaultValue":"","enabled":true,"cssClass":"street2","separator":""},"street3":{"id":"street3","label":"Street 3","defaultValue":"","enabled":true,"cssClass":"street3","separator":""},"city":{"id":"city","label":"City","defaultValue":"","enabled":true,"cssClass":"city","separator":","},"state":{"id":"state","label":"State","defaultValue":"","enabled":true,"cssClass":"state","separator":""},"zip":{"id":"zip","label":"Postal Code","defaultValue":"","enabled":true,"cssClass":"zip","separator":""},"country":{"id":"country","label":"Country","defaultValue":"","enabled":true,"cssClass":"country","separator":""}}' 26 | ); 27 | 28 | /* 29 | * l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via: 30 | * var message = acf._e('address', 'error'); 31 | */ 32 | $this->l10n = array( 33 | 'error' => __( 'Error! Please enter a higher value', 'acf-address' ), 34 | ); 35 | 36 | parent::__construct(); 37 | } 38 | 39 | /** 40 | * Create extra settings for your field. These are visible when editing a field 41 | * 42 | * @type action 43 | * @since 3.6 44 | * @date 23/01/13 45 | * 46 | * @param $field (array) the $field being edited 47 | * 48 | * @return void 49 | */ 50 | public function render_field_settings( $field ) { 51 | 52 | $fk = $this->getKey( $field ); 53 | 54 | acf_render_field_setting( $field, array( 55 | 'label' => __( 'Output Type', 'acf-address' ), 56 | 'instructions' => __( 'Choose the data type the field returns.', 'acf-address' ), 57 | 'type' => 'radio', 58 | 'name' => 'output_type', 59 | 'layout' => 'horizontal', 60 | 'choices' => array( 61 | 'html' => __( 'HTML', 'acf-address' ), 62 | 'array' => __( 'Array', 'acf-address' ), 63 | 'object' => __( 'Object', 'acf-address' ), 64 | ) 65 | ) ); 66 | 67 | // We cant use acf_render_field_setting for our super custom field edit screen 68 | ?> 69 | 70 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |

Set the options for this address.

82 | 83 | 84 | 85 |
88 | 89 | 90 | 91 | 145 | 146 |
153 | 154 | helper->get_assets_manifest(); 174 | 175 | $asset_path = $this->helper->get_assets_uri(); 176 | 177 | // todo render_field.css never gets used why? 178 | 179 | wp_register_script( 'acf_a_f_render_field', $asset_path . $manifest['render_field.js'] ); 180 | wp_enqueue_script( 'acf_a_f_render_field' ); 181 | 182 | if(array_key_exists('input.css', $manifest)) { 183 | wp_register_style( 'acf_a_f_input_styles', $asset_path . $manifest['input.css'] ); 184 | wp_enqueue_style( 'acf_a_f_input_styles' ); 185 | } 186 | 187 | } 188 | 189 | /** 190 | * field_group_admin_enqueue_scripts() 191 | * 192 | * This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited. 193 | * Use this action to add CSS + JavaScript to assist your render_field_options() action. 194 | * 195 | * @type action (admin_enqueue_scripts) 196 | * @since 3.6 197 | * @date 23/01/13 198 | * 199 | * @param n /a 200 | * 201 | * @return n/a 202 | */ 203 | function field_group_admin_enqueue_scripts() { 204 | 205 | $manifest = $this->helper->get_assets_manifest(); 206 | 207 | $asset_path = $this->helper->get_assets_uri(); 208 | 209 | if(array_key_exists('render_field_options.css', $manifest)) { 210 | wp_register_style( 'acf_a_f_render_field_options_styles', $asset_path . $manifest['render_field_options.css'] ); 211 | wp_enqueue_style( 'acf_a_f_render_field_options_styles' ); 212 | } 213 | 214 | wp_register_script( 'acf_a_f_address_field', $asset_path . $manifest['address_jquery.js'], array('jquery-ui-sortable') ); 215 | wp_register_script( 'acf_a_f_input', $asset_path . $manifest['input.js'] ); 216 | wp_register_script( 'acf_a_f_render_field_options', $asset_path . $manifest['render_field_options.js'] ); 217 | wp_enqueue_script( 'acf_a_f_address_field' ); 218 | wp_enqueue_script( 'acf_a_f_render_field_options' ); 219 | 220 | wp_localize_script('acf_a_f_address_field', 'acf_a_f_bundle_data', [ 221 | 'publicAssetsPath' => $this->helper->get_assets_uri() 222 | ]); 223 | 224 | } 225 | 226 | /** 227 | * load_field() 228 | * 229 | * This filter is applied to the $field after it is loaded from the database 230 | * 231 | * @type filter 232 | * @date 23/01/2013 233 | * @since 3.6.0 234 | * 235 | * @param $field (array) the field array holding all the field options 236 | * 237 | * @return $field 238 | */ 239 | public function load_field( $field ) { 240 | // detect old fields 241 | if ( array_key_exists( 'address_components', $field ) ) { 242 | $field['address_layout'] = $this->helper->transform_layout( $field['address_layout'] ); 243 | $field['address_options'] = $this->helper->transform_options( $field['address_components'] ); 244 | unset( $field['address_components'] ); 245 | } 246 | 247 | if ( is_array( $field['address_layout'] ) ) { 248 | $field['address_layout'] = $this->jsonEncode( $field['address_layout'] ); 249 | } 250 | if ( is_object( $field['address_options'] ) ) { 251 | $field['address_options'] = $this->jsonEncode( $field['address_options'] ); 252 | } 253 | 254 | return $field; 255 | } 256 | 257 | public function load_value($value, $post_id, $field) { 258 | $new_value = []; 259 | 260 | if(is_array($value)) { 261 | foreach($value as $k => $v) { 262 | switch($k) { 263 | case 'address1': 264 | $new_value['street1'] = $v; 265 | break; 266 | case 'address2': 267 | $new_value['street2'] = $v; 268 | break; 269 | case 'address3': 270 | $new_value['street3'] = $v; 271 | break; 272 | case 'postal_code': 273 | $new_value['zip'] = $v; 274 | break; 275 | default: 276 | $new_value[$k] = $v; 277 | } 278 | } 279 | } 280 | 281 | return $new_value; 282 | } 283 | 284 | /** 285 | * This function is for backwards compatibility with php version 5.3 286 | * @param $val 287 | * @return mixed|string|void 288 | */ 289 | private function jsonEncode($val) { 290 | return defined('JSON_UNESCAPED_UNICODE') ? json_encode($val, JSON_UNESCAPED_UNICODE) : json_encode($val); 291 | } 292 | 293 | 294 | /** 295 | * update_field() 296 | * 297 | * This filter is applied to the $field before it is saved to the database 298 | * 299 | * @type filter 300 | * @date 23/01/2013 301 | * @since 3.6.0 302 | * 303 | * @param $field (array) the field array holding all the field options 304 | * 305 | * @return $field 306 | */ 307 | function update_field( $field ) { 308 | $fieldKey = $this->getKey( $field ); 309 | 310 | if(!array_key_exists('acfAddressWidget', $_POST)) { 311 | // This branch is to accommodate importing exported fields. (json) 312 | // todo write test for this. 313 | $field['address_options'] = json_decode( $field['address_options'] ); 314 | $field['address_layout'] = json_decode( $field['address_layout'] ); 315 | } else { 316 | // This branch is to accommodate regular field updates through the ui via POST 317 | $field['address_options'] = json_decode( stripslashes( $_POST['acfAddressWidget'][ $fieldKey ]['address_options'] ) ); 318 | $field['address_layout'] = json_decode( stripslashes( $_POST['acfAddressWidget'][ $fieldKey ]['address_layout'] ) ); 319 | } 320 | 321 | return $field; 322 | } 323 | 324 | /** 325 | * format_value() 326 | * 327 | * This filter is applied to the $value after it is loaded from the db and before it is returned to the template 328 | * 329 | * @type filter 330 | * @since 3.6 331 | * @date 23/01/13 332 | * 333 | * @param mixed $value the value which was loaded from the database 334 | * @param mixed $post_id the $post_id from which the value was loaded 335 | * @param array $field the field array holding all the field options 336 | * 337 | * @return mixed $value 338 | */ 339 | public function format_value( $value, $post_id, $field ) { 340 | // bail early if no value 341 | if ( empty( $value ) ) { 342 | return $value; 343 | } 344 | 345 | switch ( $field['output_type'] ) { 346 | case 'array': 347 | return $this->helper->valueToArray( $value ); 348 | 349 | case 'html': 350 | return $this->helper->valueToHtml( $value, $field ); 351 | 352 | case 'object': 353 | return $this->helper->valueToObject( $value ); 354 | 355 | default: 356 | return $this->helper->valueToHtml( $value, $field ); 357 | } 358 | } 359 | 360 | // todo implement method validate_value 361 | 362 | } 363 | 364 | // create field 365 | new acf_field_address(new ACFAddressPluginHelper()); 366 | -------------------------------------------------------------------------------- /src/app/plugins/acf-address/acf-address.php: -------------------------------------------------------------------------------- 1 | true 44 | ]; 45 | 46 | if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { 47 | 48 | echo json_encode($defaults); 49 | } 50 | 51 | 52 | die(); 53 | } 54 | -------------------------------------------------------------------------------- /src/app/plugins/acf-address/defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "address_layout": [ 3 | [ 4 | { 5 | "id": "street1", 6 | "label": "Street 1" 7 | } 8 | ], 9 | [ 10 | { 11 | "id": "street2", 12 | "label": "Street 2" 13 | } 14 | ], 15 | [ 16 | { 17 | "id": "street3", 18 | "label": "Street 3" 19 | } 20 | ], 21 | [ 22 | { 23 | "id": "city", 24 | "label": "City" 25 | }, 26 | { 27 | "id": "state", 28 | "label": "State" 29 | }, 30 | { 31 | "id": "zip", 32 | "label": "Postal Code" 33 | }, 34 | { 35 | "id": "country", 36 | "label": "Country" 37 | } 38 | ], 39 | [ 40 | 41 | ] 42 | ], 43 | "address_options": { 44 | "street1": { 45 | "id": "street1", 46 | "label": "Street 1", 47 | "defaultValue": "", 48 | "enabled": true, 49 | "cssClass": "street1", 50 | "separator": "" 51 | }, 52 | "street2": { 53 | "id": "street2", 54 | "label": "Street 2", 55 | "defaultValue": "", 56 | "enabled": true, 57 | "cssClass": "street2", 58 | "separator": "" 59 | }, 60 | "street3": { 61 | "id": "street3", 62 | "label": "Street 3", 63 | "defaultValue": "", 64 | "enabled": true, 65 | "cssClass": "street3", 66 | "separator": "" 67 | }, 68 | "city": { 69 | "id": "city", 70 | "label": "City", 71 | "defaultValue": "", 72 | "enabled": true, 73 | "cssClass": "city", 74 | "separator": "," 75 | }, 76 | "state": { 77 | "id": "state", 78 | "label": "State", 79 | "defaultValue": "", 80 | "enabled": true, 81 | "cssClass": "state", 82 | "separator": "" 83 | }, 84 | "zip": { 85 | "id": "zip", 86 | "label": "Postal Code", 87 | "defaultValue": "", 88 | "enabled": true, 89 | "cssClass": "zip", 90 | "separator": "" 91 | }, 92 | "country": { 93 | "id": "country", 94 | "label": "Country", 95 | "defaultValue": "", 96 | "enabled": true, 97 | "cssClass": "country", 98 | "separator": "" 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strickdj/acf-field-address/04a5879b74c48cc85a8606d3989d95e18ea6584b/src/app/plugins/acf-address/dist/.gitkeep -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/address_jquery.b35eeab0e320fe5f625c.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(d){if(a[d])return a[d].exports;var l=a[d]={exports:{},id:d,loaded:!1};return e[d].call(l.exports,l,l.exports,t),l.loaded=!0,l.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}([function(e,t){"use strict";!function(e){var t=0,a=function(a,d){t+=1;var l={layout:[[{id:"street1",label:"Street 1"}],[{id:"street2",label:"Street 2"}],[{id:"street3",label:"Street 3"}],[{id:"city",label:"City"},{id:"state",label:"State"},{id:"zip",label:"Postal Code"},{id:"country",label:"Country"}],[]],rowClass:"acf-address-"+t+"-row",sortableElement:"li"},n=e.extend(l,a),r={$el:d,layout:n.layout,rowClass:n.rowClass,sortableElement:n.sortableElement,$inputElement:e('').prop("name","acfAddressWidget["+n.fieldKey+"][address_layout]").prop("value",JSON.stringify(n.layout)),$detachedEls:{}},s=function(){var t=[];r.$el.find("."+r.rowClass).each(function(a,d){var l=[];e(d).find(r.sortableElement).each(function(t,d){var n=e(d);l[t]={id:n.data().id,label:n.data().label};var r={col:t,row:a};n.data(r)}),t[a]=l}),r.$inputElement.attr("value",JSON.stringify(t))},i=function(t,a){var d=e.extend({stop:function(){s()}},a);return t.sortable(d).disableSelection()},o=function(t){var a=t.data.id,l=t.target.value;"label"===e(t.target).data("col")&&r.$el.find("li").each(function(t,n){d=e(n),d.data().id===a&&d.data("label",l).text(l)})},p=function(t){var a=t.data.id,l=e(t.target).data(),n=r.$el.find("."+r.rowClass).last();t.target.checked?r.$detachedEls.hasOwnProperty(a)?n.append(r.$detachedEls[a]):n.append(e("
  • ").data({id:l.id,label:l.label}).text(l.label)):r.$el.find("li").each(function(t,l){d=e(l),d.data().id===a&&(r.$detachedEls[a]=d,d.detach())}),s()},c=function(){r.$el.append(r.$inputElement),e(r.layout).each(function(a,d){var l=e("
      ").addClass(r.rowClass);r.$el.append(l),i(l,{connectWith:"."+r.rowClass}),e(d).each(function(a,d){l.append(e("
    • ").data(d).text(d.label).attr("id",d.id+"-li-movable-"+t))})})};return c(),{onBlur:o,onCheck:p}},d=function(a,d){function l(e){i.onBlur(e),r(e)}function n(e){i.onCheck(e),r(e)}function r(t){var a=o.$inputElement.data(),d=e(t.target).data("col");"change"===t.type?a.val[t.data.id][d]=t.target.checked:a.val[t.data.id][d]=t.target.value,o.$inputElement.data(a),o.$inputElement.prop("value",JSON.stringify(a.val))}var s={options:{street1:{id:"street1",label:"Street 1",defaultValue:"",enabled:!0,cssClass:"street1",separator:""},street2:{id:"street2",label:"Street 2",defaultValue:"",enabled:!0,cssClass:"street2",separator:""},street3:{id:"street3",label:"Street 3",defaultValue:"",enabled:!0,cssClass:"street3",separator:""},city:{id:"city",label:"City",defaultValue:"",enabled:!0,cssClass:"city",separator:","},state:{id:"state",label:"State",defaultValue:"",enabled:!0,cssClass:"state",separator:""},zip:{id:"zip",label:"Postal Code",defaultValue:"",enabled:!0,cssClass:"zip",separator:""},country:{id:"country",label:"Country",defaultValue:"",enabled:!0,cssClass:"country",separator:""}}},i=e.extend(s,a),o={$element:d,$inputElement:e('').data("val",i.options).prop("value",JSON.stringify(i.options)).prop("name","acfAddressWidget["+i.fieldKey+"][address_options]"),options:i.options,onBlur:l,onCheck:n},p=function(t,a,d){var l=e('').val(a).data(d);return"checkbox"===t&&l.prop("type","checkbox").prop("checked",a).on("change",d,o.onCheck),"text"===t&&l.prop("type","text").on("blur",d,o.onBlur),l},c=function(){o.$element.append(o.$inputElement);var a=e("
      "),d=e("").append(e("Enabled")).append(e("Label")).append(e("Default Value")).append(e("Css Class")).append(e("Separator"));a.append(d),e.each(o.options,function(d,l){var n=e(""),r=e("").append(p("checkbox",l.enabled,l).data("col","enabled").attr("id",l.id+"-"+t)),s=e("").append(p("text",l.label,l).data("col","label")),i=e("").append(p("text",l.defaultValue,l).data("col","defaultValue")),o=e("").append(p("text",l.cssClass,l).data("col","cssClass")),c=e("").append(p("text",l.separator,l).data("col","separator"));n.append(r).append(s).append(i).append(o).append(c),a.append(n)}),o.$element.append(a)};return c(),o.$element};e.fn.acfAddressWidget=function(t){var l=e(this),n=e.extend({},t);return l.each(function(t,l){var r=e(l);if(r.data("acfAddressWidgetized")!==!0){r.data("acfAddressWidgetized",!0);var s=e("
      ").attr("id","options-container"),i=e("
      ").attr("id","layout-container");r.append(s).append(i),n.fieldKey=r.data("field"),n.layout=window.acfAddressWidgetData.address_layout,n.options=window.acfAddressWidgetData.address_options;var o=a(n,i);n.onBlur=o.onBlur,n.onCheck=o.onCheck,d(n,s)}}),l}}(jQuery)}]); 2 | //# sourceMappingURL=address_jquery.b35eeab0e320fe5f625c.js.map -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/address_jquery.b35eeab0e320fe5f625c.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///address_jquery.b35eeab0e320fe5f625c.js","webpack:///webpack/bootstrap b35eeab0e320fe5f625c","webpack:///./src/app/plugins/acf-address/js/address.jquery.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","$","widgetCount","makeLayout","options","$el","defaults","layout","label","rowClass","sortableElement","settings","extend","gridInfo","$inputElement","prop","fieldKey","JSON","stringify","$detachedEls","setGridPositions","positions","find","each","rowIndex","row","r","col","item","$item","data","position","attr","makeSortable","stop","sortable","disableSelection","setSortableLabel","e","target","value","index","element","text","toggleSortable","targetData","$lastUl","last","checked","hasOwnProperty","append","detach","buildLayout","items","$ul","addClass","connectWith","obj","onBlur","onCheck","makeOptions","onBlurWithAfter","afterOnEvent","onCheckWithAfter","self","type","val","street1","defaultValue","enabled","cssClass","separator","street2","street3","city","state","zip","country","$element","makeInput","$input","on","init","$table","$head","$tr","$tdEnabled","$tdLabel","$tdDefault","$tdCssClass","$tdSeparator","fn","acfAddressWidget","$this","this","$optionsContainer","$layoutContainer","window","acfAddressWidgetData","address_layout","address_options","lc","jQuery"],"mappings":"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","file":"address_jquery.b35eeab0e320fe5f625c.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t(function ($) {\n\t\n\t //let defaults = require('./defaults.service')\n\t\n\t //defaults(window.jQuery)\n\t\n\t var widgetCount = 0;\n\t\n\t // factory function for creating widget closures\n\t var makeLayout = function makeLayout(options, $el) {\n\t\n\t // keeping track of multiple widgets\n\t widgetCount = widgetCount + 1;\n\t\n\t // Widget Defaults\n\t var defaults = {\n\t layout: [[{ id: 'street1', label: 'Street 1' }], [{ id: 'street2', label: 'Street 2' }], [{ id: 'street3', label: 'Street 3' }], [{ id: 'city', label: 'City' }, { id: 'state', label: 'State' }, { id: 'zip', label: 'Postal Code' }, { id: 'country', label: 'Country' }], []],\n\t rowClass: 'acf-address-' + widgetCount + '-row',\n\t sortableElement: 'li'\n\t };\n\t\n\t // merge defaults and passed arguments\n\t var settings = $.extend(defaults, options);\n\t\n\t var gridInfo = {\n\t $el: $el,\n\t layout: settings.layout,\n\t rowClass: settings.rowClass,\n\t sortableElement: settings.sortableElement,\n\t $inputElement: $('').prop('name', 'acfAddressWidget[' + settings.fieldKey + '][address_layout]').prop('value', JSON.stringify(settings.layout)),\n\t $detachedEls: {}\n\t };\n\t\n\t var setGridPositions = function setGridPositions() {\n\t\n\t var positions = [];\n\t\n\t gridInfo.$el.find('.' + gridInfo.rowClass).each(function (rowIndex, row) {\n\t\n\t var r = [];\n\t\n\t $(row).find(gridInfo.sortableElement).each(function (col, item) {\n\t\n\t var $item = $(item);\n\t\n\t r[col] = {\n\t id: $item.data().id,\n\t label: $item.data().label\n\t };\n\t\n\t // create a position object that holds the row and column values\n\t var position = {\n\t col: col,\n\t row: rowIndex\n\t };\n\t\n\t // set the data properties col and row to the corresponding values\n\t $item.data(position);\n\t });\n\t\n\t positions[rowIndex] = r;\n\t });\n\t\n\t gridInfo.$inputElement.attr('value', JSON.stringify(positions));\n\t };\n\t\n\t var makeSortable = function makeSortable($el, options) {\n\t\n\t var settings = $.extend({\n\t stop: function stop() {\n\t // takes parameters event, ui\n\t setGridPositions();\n\t }\n\t }, options);\n\t\n\t return $el.sortable(settings).disableSelection();\n\t };\n\t\n\t var setSortableLabel = function setSortableLabel(e) {\n\t var id = e.data.id,\n\t label = e.target.value;\n\t\n\t if ($(e.target).data('col') === 'label') {\n\t gridInfo.$el.find('li').each(function (index, element) {\n\t $el = $(element);\n\t if ($el.data().id === id) {\n\t $el.data('label', label).text(label);\n\t }\n\t });\n\t }\n\t };\n\t\n\t var toggleSortable = function toggleSortable(e) {\n\t\n\t var id = e.data.id,\n\t targetData = $(e.target).data(),\n\t $lastUl = gridInfo.$el.find('.' + gridInfo.rowClass).last();\n\t\n\t if (e.target.checked) {\n\t\n\t // check to see if its in the $detachedEls object\n\t if (gridInfo.$detachedEls.hasOwnProperty(id)) {\n\t // used the saved one\n\t $lastUl.append(gridInfo.$detachedEls[id]);\n\t } else {\n\t // create the element from scratch\n\t $lastUl.append($('
    • ').data({\n\t id: targetData.id,\n\t label: targetData.label\n\t }).text(targetData.label));\n\t }\n\t } else {\n\t\n\t gridInfo.$el.find('li').each(function (index, element) {\n\t $el = $(element);\n\t if ($el.data().id === id) {\n\t gridInfo.$detachedEls[id] = $el;\n\t $el.detach();\n\t }\n\t });\n\t }\n\t\n\t // update the layout input with changes\n\t setGridPositions();\n\t };\n\t\n\t var buildLayout = function buildLayout() {\n\t\n\t gridInfo.$el.append(gridInfo.$inputElement);\n\t\n\t $(gridInfo.layout).each(function (row, items) {\n\t var $ul = $('
        ').addClass(gridInfo.rowClass);\n\t gridInfo.$el.append($ul);\n\t\n\t makeSortable($ul, { connectWith: '.' + gridInfo.rowClass });\n\t\n\t $(items).each(function (col, obj) {\n\t $ul.append($('
      • ').data(obj).text(obj.label).attr('id', obj.id + '-li-movable-' + widgetCount));\n\t });\n\t });\n\t };\n\t\n\t buildLayout();\n\t\n\t // we need to return some functions\n\t return {\n\t onBlur: setSortableLabel,\n\t onCheck: toggleSortable\n\t };\n\t };\n\t\n\t var makeOptions = function makeOptions(options, $el) {\n\t\n\t // Widget Defaults\n\t var defaults = {\n\t options: {\n\t street1: {\n\t id: 'street1',\n\t label: 'Street 1',\n\t defaultValue: '',\n\t enabled: true,\n\t cssClass: 'street1',\n\t separator: ''\n\t },\n\t street2: {\n\t id: 'street2',\n\t label: 'Street 2',\n\t defaultValue: '',\n\t enabled: true,\n\t cssClass: 'street2',\n\t separator: ''\n\t },\n\t street3: {\n\t id: 'street3',\n\t label: 'Street 3',\n\t defaultValue: '',\n\t enabled: true,\n\t cssClass: 'street3',\n\t separator: ''\n\t },\n\t city: { id: 'city', label: 'City', defaultValue: '', enabled: true, cssClass: 'city', separator: ',' },\n\t state: { id: 'state', label: 'State', defaultValue: '', enabled: true, cssClass: 'state', separator: '' },\n\t zip: { id: 'zip', label: 'Postal Code', defaultValue: '', enabled: true, cssClass: 'zip', separator: '' },\n\t country: {\n\t id: 'country',\n\t label: 'Country',\n\t defaultValue: '',\n\t enabled: true,\n\t cssClass: 'country',\n\t separator: ''\n\t }\n\t }\n\t };\n\t\n\t // merge defaults and passed arguments\n\t var settings = $.extend(defaults, options);\n\t\n\t // Add some functionality to the event methods\n\t function onBlurWithAfter(e) {\n\t settings.onBlur(e);\n\t afterOnEvent(e);\n\t }\n\t\n\t function onCheckWithAfter(e) {\n\t settings.onCheck(e);\n\t afterOnEvent(e);\n\t }\n\t\n\t // closure scope so its absolutely clear\n\t var self = {\n\t $element: $el,\n\t $inputElement: $('').data('val', settings.options).prop('value', JSON.stringify(settings.options)).prop('name', 'acfAddressWidget[' + settings.fieldKey + '][address_options]'),\n\t options: settings.options,\n\t onBlur: onBlurWithAfter,\n\t onCheck: onCheckWithAfter\n\t };\n\t\n\t function afterOnEvent(e) {\n\t\n\t var data = self.$inputElement.data();\n\t\n\t var col = $(e.target).data('col');\n\t\n\t if (e.type === 'change') {\n\t data.val[e.data.id][col] = e.target.checked;\n\t } else {\n\t data.val[e.data.id][col] = e.target.value;\n\t }\n\t\n\t self.$inputElement.data(data);\n\t\n\t self.$inputElement.prop('value', JSON.stringify(data.val));\n\t }\n\t\n\t var makeInput = function makeInput(type, value, data) {\n\t var $input = $('').val(value).data(data);\n\t\n\t if (type === 'checkbox') {\n\t $input.prop('type', 'checkbox').prop('checked', value).on('change', data, self.onCheck);\n\t }\n\t if (type === 'text') {\n\t $input.prop('type', 'text').on('blur', data, self.onBlur);\n\t }\n\t\n\t return $input;\n\t };\n\t\n\t var init = function init() {\n\t\n\t self.$element.append(self.$inputElement);\n\t\n\t var $table = $('
        ');\n\t var $head = $('').append($('Enabled')).append($('Label')).append($('Default Value')).append($('Css Class')).append($('Separator'));\n\t\n\t $table.append($head);\n\t\n\t $.each(self.options, function (row, obj) {\n\t\n\t var $tr = $('');\n\t\n\t var $tdEnabled = $('').append(makeInput('checkbox', obj.enabled, obj).data('col', 'enabled').attr('id', obj.id + '-' + widgetCount));\n\t var $tdLabel = $('').append(makeInput('text', obj.label, obj).data('col', 'label'));\n\t var $tdDefault = $('').append(makeInput('text', obj.defaultValue, obj).data('col', 'defaultValue'));\n\t var $tdCssClass = $('').append(makeInput('text', obj.cssClass, obj).data('col', 'cssClass'));\n\t var $tdSeparator = $('').append(makeInput('text', obj.separator, obj).data('col', 'separator'));\n\t\n\t $tr.append($tdEnabled).append($tdLabel).append($tdDefault).append($tdCssClass).append($tdSeparator);\n\t\n\t $table.append($tr);\n\t });\n\t\n\t self.$element.append($table);\n\t };\n\t\n\t init();\n\t\n\t // in this case we will just return the jQuery object\n\t return self.$element;\n\t };\n\t\n\t $.fn.acfAddressWidget = function (options) {\n\t\n\t var $this = $(this);\n\t\n\t var settings = $.extend({}, options);\n\t\n\t // Call our instance closure\n\t // to handle multiple elements\n\t $this.each(function (index, element) {\n\t\n\t var $element = $(element);\n\t\n\t if ($element.data('acfAddressWidgetized') === true) {\n\t return;\n\t }\n\t\n\t $element.data('acfAddressWidgetized', true);\n\t\n\t var $optionsContainer = $('
        ').attr('id', 'options-container');\n\t var $layoutContainer = $('
        ').attr('id', 'layout-container');\n\t\n\t $element.append($optionsContainer).append($layoutContainer);\n\t\n\t settings.fieldKey = $element.data('field');\n\t\n\t settings.layout = window.acfAddressWidgetData.address_layout;\n\t\n\t settings.options = window.acfAddressWidgetData.address_options;\n\t\n\t var lc = makeLayout(settings, $layoutContainer);\n\t\n\t settings.onBlur = lc.onBlur;\n\t settings.onCheck = lc.onCheck;\n\t makeOptions(settings, $optionsContainer);\n\t });\n\t\n\t return $this;\n\t };\n\t})(jQuery);\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** address_jquery.b35eeab0e320fe5f625c.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap b35eeab0e320fe5f625c\n **/","(function ($) {\n\n //let defaults = require('./defaults.service')\n\n //defaults(window.jQuery)\n\n let widgetCount = 0\n\n // factory function for creating widget closures\n let makeLayout = function (options, $el) {\n\n // keeping track of multiple widgets\n widgetCount = widgetCount + 1\n\n // Widget Defaults\n let defaults = {\n layout: [\n [ { id: 'street1', label: 'Street 1' } ],\n [ { id: 'street2', label: 'Street 2' } ],\n [ { id: 'street3', label: 'Street 3' } ],\n [\n { id: 'city', label: 'City' },\n { id: 'state', label: 'State' },\n { id: 'zip', label: 'Postal Code' },\n { id: 'country', label: 'Country' }\n ],\n []\n ],\n rowClass: 'acf-address-' + widgetCount + '-row',\n sortableElement: 'li'\n }\n\n // merge defaults and passed arguments\n let settings = $.extend(defaults, options)\n\n let gridInfo = {\n $el: $el,\n layout: settings.layout,\n rowClass: settings.rowClass,\n sortableElement: settings.sortableElement,\n $inputElement: $('')\n .prop('name', 'acfAddressWidget[' + settings.fieldKey + '][address_layout]')\n .prop('value', JSON.stringify(settings.layout)),\n $detachedEls: {}\n }\n\n let setGridPositions = function () {\n\n let positions = []\n\n gridInfo.$el.find('.' + gridInfo.rowClass).each(function (rowIndex, row) {\n\n let r = []\n\n $(row).find(gridInfo.sortableElement).each(function (col, item) {\n\n let $item = $(item)\n\n r[col] = {\n id: $item.data().id,\n label: $item.data().label\n }\n\n // create a position object that holds the row and column values\n let position = {\n col: col,\n row: rowIndex\n }\n\n // set the data properties col and row to the corresponding values\n $item.data(position)\n\n })\n\n positions[rowIndex] = r\n\n })\n\n gridInfo.$inputElement.attr('value', JSON.stringify(positions))\n\n }\n\n let makeSortable = function ($el, options) {\n\n let settings = $.extend({\n stop: function () { // takes parameters event, ui\n setGridPositions()\n }\n }, options)\n\n return $el.sortable(settings).disableSelection()\n\n }\n\n\n let setSortableLabel = function (e) {\n let id = e.data.id,\n label = e.target.value\n\n if ($(e.target).data('col') === 'label') {\n gridInfo.$el.find('li').each(function (index, element) {\n $el = $(element)\n if ($el.data().id === id) {\n $el.data('label', label)\n .text(label)\n }\n })\n }\n }\n\n\n let toggleSortable = function (e) {\n\n let id = e.data.id,\n targetData = $(e.target).data(),\n $lastUl = gridInfo.$el.find('.' + gridInfo.rowClass).last()\n\n if (e.target.checked) {\n\n // check to see if its in the $detachedEls object\n if (gridInfo.$detachedEls.hasOwnProperty(id)) {\n // used the saved one\n $lastUl.append(gridInfo.$detachedEls[id])\n } else {\n // create the element from scratch\n $lastUl.append($('
      • ')\n .data({\n id: targetData.id,\n label: targetData.label\n })\n .text(targetData.label))\n }\n\n } else {\n\n gridInfo.$el.find('li').each(function (index, element) {\n $el = $(element)\n if ($el.data().id === id) {\n gridInfo.$detachedEls[id] = $el\n $el.detach()\n }\n })\n\n }\n\n // update the layout input with changes\n setGridPositions()\n\n }\n\n let buildLayout = function () {\n\n gridInfo.$el.append(gridInfo.$inputElement)\n\n $(gridInfo.layout).each(function (row, items) {\n let $ul = $('
          ')\n .addClass(gridInfo.rowClass)\n gridInfo.$el.append($ul)\n\n makeSortable($ul, { connectWith: '.' + gridInfo.rowClass })\n\n $(items).each(function (col, obj) {\n $ul.append($('
        • ')\n .data(obj)\n .text(obj.label)\n .attr('id', `${obj.id}-li-movable-${widgetCount}`))\n })\n\n })\n\n }\n\n buildLayout()\n\n // we need to return some functions\n return {\n onBlur: setSortableLabel,\n onCheck: toggleSortable\n }\n\n }\n\n let makeOptions = function (options, $el) {\n\n // Widget Defaults\n let defaults = {\n options: {\n street1: {\n id: 'street1',\n label: 'Street 1',\n defaultValue: '',\n enabled: true,\n cssClass: 'street1',\n separator: ''\n },\n street2: {\n id: 'street2',\n label: 'Street 2',\n defaultValue: '',\n enabled: true,\n cssClass: 'street2',\n separator: ''\n },\n street3: {\n id: 'street3',\n label: 'Street 3',\n defaultValue: '',\n enabled: true,\n cssClass: 'street3',\n separator: ''\n },\n city: { id: 'city', label: 'City', defaultValue: '', enabled: true, cssClass: 'city', separator: ',' },\n state: { id: 'state', label: 'State', defaultValue: '', enabled: true, cssClass: 'state', separator: '' },\n zip: { id: 'zip', label: 'Postal Code', defaultValue: '', enabled: true, cssClass: 'zip', separator: '' },\n country: {\n id: 'country',\n label: 'Country',\n defaultValue: '',\n enabled: true,\n cssClass: 'country',\n separator: ''\n }\n }\n }\n\n // merge defaults and passed arguments\n let settings = $.extend(defaults, options)\n\n // Add some functionality to the event methods\n function onBlurWithAfter(e) {\n settings.onBlur(e)\n afterOnEvent(e)\n }\n\n function onCheckWithAfter(e) {\n settings.onCheck(e)\n afterOnEvent(e)\n }\n\n // closure scope so its absolutely clear\n let self = {\n $element: $el,\n $inputElement: $('')\n .data('val', settings.options)\n .prop('value', JSON.stringify(settings.options))\n .prop('name', 'acfAddressWidget[' + settings.fieldKey + '][address_options]'),\n options: settings.options,\n onBlur: onBlurWithAfter,\n onCheck: onCheckWithAfter\n }\n\n function afterOnEvent(e) {\n\n let data = self.$inputElement.data()\n\n let col = $(e.target).data('col')\n\n if (e.type === 'change') {\n data.val[e.data.id][col] = e.target.checked\n } else {\n data.val[e.data.id][col] = e.target.value\n }\n\n self.$inputElement.data(data)\n\n self.$inputElement.prop('value', JSON.stringify(data.val))\n }\n\n let makeInput = function (type, value, data) {\n let $input = $('')\n .val(value)\n .data(data)\n\n if (type === 'checkbox') {\n $input.prop('type', 'checkbox')\n .prop('checked', value)\n .on('change', data, self.onCheck)\n }\n if (type === 'text') {\n $input.prop('type', 'text')\n .on('blur', data, self.onBlur)\n }\n\n return $input\n }\n\n let init = function () {\n\n self.$element.append(self.$inputElement)\n\n let $table = $('
          ')\n let $head = $('')\n .append($('Enabled'))\n .append($('Label'))\n .append($('Default Value'))\n .append($('Css Class'))\n .append($('Separator'))\n\n $table.append($head)\n\n $.each(self.options, function (row, obj) {\n\n let $tr = $('')\n\n let $tdEnabled = $('').append(makeInput('checkbox', obj.enabled, obj).data('col', 'enabled').attr('id', `${obj.id}-${widgetCount}`))\n let $tdLabel = $('').append(makeInput('text', obj.label, obj).data('col', 'label'))\n let $tdDefault = $('').append(makeInput('text', obj.defaultValue, obj).data('col', 'defaultValue'))\n let $tdCssClass = $('').append(makeInput('text', obj.cssClass, obj).data('col', 'cssClass'))\n let $tdSeparator = $('').append(makeInput('text', obj.separator, obj).data('col', 'separator'))\n\n $tr.append($tdEnabled)\n .append($tdLabel)\n .append($tdDefault)\n .append($tdCssClass)\n .append($tdSeparator)\n\n $table.append($tr)\n })\n\n self.$element.append($table)\n\n }\n\n init()\n\n // in this case we will just return the jQuery object\n return self.$element\n\n }\n\n $.fn.acfAddressWidget = function (options) {\n\n let $this = $(this)\n\n let settings = $.extend({}, options)\n\n // Call our instance closure\n // to handle multiple elements\n $this.each(function (index, element) {\n\n let $element = $(element)\n\n if ($element.data('acfAddressWidgetized') === true) {\n return\n }\n\n $element.data('acfAddressWidgetized', true)\n\n let $optionsContainer = $('
          ').attr('id', 'options-container')\n let $layoutContainer = $('
          ').attr('id', 'layout-container')\n\n $element.append($optionsContainer)\n .append($layoutContainer)\n\n settings.fieldKey = $element.data('field')\n\n settings.layout = window.acfAddressWidgetData.address_layout\n\n settings.options = window.acfAddressWidgetData.address_options\n\n\n let lc = makeLayout(settings, $layoutContainer)\n\n settings.onBlur = lc.onBlur\n settings.onCheck = lc.onCheck\n makeOptions(settings, $optionsContainer)\n })\n\n return $this\n\n }\n\n})(jQuery)\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/app/plugins/acf-address/js/address.jquery.js\n **/"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/input.b35eeab0e320fe5f625c.css: -------------------------------------------------------------------------------- 1 | tr.field_option_address-field .address_layout ul{list-style-type:none;border:1px solid #999;background-color:#aaa;min-height:36px}tr.field_option_address-field .address_layout li{display:inline-block;margin:3px;padding:5px;border:1px solid #ccc;background-color:#eee;min-width:100px;min-height:15px;cursor:move}tr.field_option_address-field .address_layout li.placeholder{border:1px dashed #333;background-color:#fff}tr.field_option_address-field .address_layout li.disabled{display:none}.postbox .address .address_row{clear:both}.postbox .address .address_row label{float:left;padding:5px 10px 0 0} 2 | /*# sourceMappingURL=input.b35eeab0e320fe5f625c.css.map*/ -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/input.b35eeab0e320fe5f625c.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack:///src/app/plugins/acf-address/scss/input.scss"],"names":[],"mappings":"AAGA,iDACE,qBACA,sBACA,sBACA,eAAiB,CAClB,iDAGC,qBACA,WACA,YACA,sBACA,sBACA,gBACA,gBACA,WAAa,CACd,6DAGC,uBACA,qBAA0B,CAC3B,0DAGC,YAAc,CACf,+BAIC,UAAY,CACb,qCAGC,WACA,oBAAsB","file":"input.b35eeab0e320fe5f625c.css","sourcesContent":["/* Advanced Custom Fields Addon - Address Field */\n\n/* Field Options Screen */\ntr.field_option_address-field .address_layout ul {\n list-style-type: none;\n border: 1px solid #999999;\n background-color: #AAAAAA;\n min-height: 36px;\n}\n\ntr.field_option_address-field .address_layout li {\n display: inline-block;\n margin: 3px;\n padding: 5px;\n border: 1px solid #CCCCCC;\n background-color: #EEEEEE;\n min-width: 100px;\n min-height: 15px;\n cursor: move;\n}\n\ntr.field_option_address-field .address_layout li.placeholder {\n border: 1px dashed #333333;\n background-color: #FFFFFF;\n}\n\ntr.field_option_address-field .address_layout li.disabled {\n display: none;\n}\n\n/* Add/Edit Post */\n.postbox .address .address_row {\n clear: both;\n}\n\n.postbox .address .address_row label {\n float: left;\n padding: 5px 10px 0 0;\n}\n\n/* get_value() and shortcode display */\n\n\n\n/** WEBPACK FOOTER **\n ** webpack:///src/app/plugins/acf-address/scss/input.scss\n **/"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/input.b35eeab0e320fe5f625c.js: -------------------------------------------------------------------------------- 1 | !function(e){function n(d){if(t[d])return t[d].exports;var i=t[d]={exports:{},id:d,loaded:!1};return e[d].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){"use strict";t(1)(function(e){function n(){}var t=window.acf;"undefined"!=typeof t.add_action?t.add_action("ready append",function(d){t.get_fields({type:"address"},d).each(function(){n(e(this))})}):e(document).live("acf/setup_fields",function(t,d){e(d).find('.field[data-field_type="address"]').each(function(){n(e(this))})})})(jQuery)},function(e,n){}]); 2 | //# sourceMappingURL=input.b35eeab0e320fe5f625c.js.map -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/input.b35eeab0e320fe5f625c.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///input.b35eeab0e320fe5f625c.js","webpack:///webpack/bootstrap b35eeab0e320fe5f625c?c630","webpack:///./src/app/plugins/acf-address/js/input.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","$","initialize_field","acf","window","add_action","$el","get_fields","type","each","this","document","live","e","postbox","find","jQuery"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDMM,SAASI,EAAQD,EAASH,GAE/B,YE9CDA,GAAQ,GAEP,SAAUW,GAIT,QAASC,MAFT,GAAIC,GAAMC,OAAOD,GAIa,oBAAnBA,GAAIE,WAgBbF,EAAIE,WAAW,eAAgB,SAAUC,GACvCH,EAAII,YAAaC,KAAM,WAAaF,GAAKG,KAAK,WAC5CP,EAAiBD,EAAES,WAoBvBT,EAAEU,UAAUC,KAAK,mBAAoB,SAAUC,EAAGC,GAChDb,EAAEa,GAASC,KAAK,qCAAqCN,KAAK,WACxDP,EAAiBD,EAAES,aAIxBM,SFkDG,SAAStB,EAAQD","file":"input.b35eeab0e320fe5f625c.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t__webpack_require__(1)(function ($) {\n\t\n\t var acf = window.acf;\n\t\n\t function initialize_field() {}\n\t\n\t if (typeof acf.add_action !== 'undefined') {\n\t\n\t /*\n\t * ready append (ACF5)\n\t *\n\t * These are 2 events which are fired during the page load\n\t * ready = on page load similar to $(document).ready()\n\t * append = on new DOM elements appended via repeater field\n\t *\n\t * @type\tevent\n\t * @date\t20/07/13\n\t *\n\t * @param\t$el (jQuery selection) the jQuery element which contains the ACF fields\n\t * @return\tn/a\n\t */\n\t\n\t acf.add_action('ready append', function ($el) {\n\t acf.get_fields({ type: 'address' }, $el).each(function () {\n\t initialize_field($(this));\n\t });\n\t });\n\t } else {\n\t\n\t /*\n\t * acf/setup_fields (ACF4)\n\t *\n\t * This event is triggered when ACF adds any new elements to the DOM.\n\t *\n\t * @type\tfunction\n\t * @since\t1.0.0\n\t * @date\t01/01/12\n\t *\n\t * @param\tevent\t\te: an event object. This can be ignored\n\t * @param\tElement\t\tpostbox: An element which contains the new HTML\n\t *\n\t * @return\tn/a\n\t */\n\t\n\t $(document).live('acf/setup_fields', function (e, postbox) {\n\t $(postbox).find('.field[data-field_type=\"address\"]').each(function () {\n\t initialize_field($(this));\n\t });\n\t });\n\t }\n\t})(jQuery);\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** input.b35eeab0e320fe5f625c.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap b35eeab0e320fe5f625c\n **/","require('../scss/input.scss')\n\n(function ($) {\n\n let acf = window.acf\n\n function initialize_field() {}\n\n if (typeof acf.add_action !== 'undefined') {\n\n /*\n * ready append (ACF5)\n *\n * These are 2 events which are fired during the page load\n * ready = on page load similar to $(document).ready()\n * append = on new DOM elements appended via repeater field\n *\n * @type\tevent\n * @date\t20/07/13\n *\n * @param\t$el (jQuery selection) the jQuery element which contains the ACF fields\n * @return\tn/a\n */\n\n acf.add_action('ready append', function ($el) {\n acf.get_fields({ type: 'address' }, $el).each(function () {\n initialize_field($(this))\n })\n })\n } else {\n\n /*\n * acf/setup_fields (ACF4)\n *\n * This event is triggered when ACF adds any new elements to the DOM.\n *\n * @type\tfunction\n * @since\t1.0.0\n * @date\t01/01/12\n *\n * @param\tevent\t\te: an event object. This can be ignored\n * @param\tElement\t\tpostbox: An element which contains the new HTML\n *\n * @return\tn/a\n */\n\n $(document).live('acf/setup_fields', function (e, postbox) {\n $(postbox).find('.field[data-field_type=\"address\"]').each(function () {\n initialize_field($(this))\n })\n })\n }\n})(jQuery)\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/app/plugins/acf-address/js/input.js\n **/"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "address_jquery.js": "address_jquery.b35eeab0e320fe5f625c.js", 3 | "address_jquery.js.map": "address_jquery.b35eeab0e320fe5f625c.js.map", 4 | "input.js": "input.b35eeab0e320fe5f625c.js", 5 | "input.css": "input.b35eeab0e320fe5f625c.css", 6 | "input.js.map": "input.b35eeab0e320fe5f625c.js.map", 7 | "input.css.map": "input.b35eeab0e320fe5f625c.css.map", 8 | "render_field.js": "render_field.b35eeab0e320fe5f625c.js", 9 | "render_field.css": "render_field.b35eeab0e320fe5f625c.css", 10 | "render_field.js.map": "render_field.b35eeab0e320fe5f625c.js.map", 11 | "render_field.css.map": "render_field.b35eeab0e320fe5f625c.css.map", 12 | "render_field_options.js": "render_field_options.b35eeab0e320fe5f625c.js", 13 | "render_field_options.css": "render_field_options.b35eeab0e320fe5f625c.css", 14 | "render_field_options.js.map": "render_field_options.b35eeab0e320fe5f625c.js.map", 15 | "render_field_options.css.map": "render_field_options.b35eeab0e320fe5f625c.css.map" 16 | } -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/render_field.b35eeab0e320fe5f625c.css: -------------------------------------------------------------------------------- 1 | div.acf-address-field li{box-sizing:border-box;display:inline-block;padding:5px} 2 | /*# sourceMappingURL=render_field.b35eeab0e320fe5f625c.css.map*/ -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/render_field.b35eeab0e320fe5f625c.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack:///src/app/plugins/acf-address/scss/render_field.scss"],"names":[],"mappings":"AAAA,yBAEI,sBACA,qBACA,WAAa","file":"render_field.b35eeab0e320fe5f625c.css","sourcesContent":["div.acf-address-field {\n li {\n box-sizing: border-box;\n display: inline-block;\n padding: 5px;\n }\n}\n\n\n/** WEBPACK FOOTER **\n ** webpack:///src/app/plugins/acf-address/scss/render_field.scss\n **/"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/app/plugins/acf-address/dist/render_field.b35eeab0e320fe5f625c.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(n){if(a[n])return a[n].exports;var l=a[n]={exports:{},id:n,loaded:!1};return e[n].call(l.exports,l,l.exports,t),l.loaded=!0,l.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}({0:function(e,t,a){"use strict";a(5),jQuery(document).ready(function(e){var t=e(".acf-address-field");t.each(function(t,a){var n=e(a),l=n.data("name"),r=n.data("value"),u=n.data("layout"),p=n.data("options");r=e.extend({street1:null,street2:null,street3:null,city:null,state:null,zip:null,country:null},r),e.each(u,function(t,a){var u=e("
            ");e.each(a,function(t,a){var n=e("
          • "),o=l+"["+a.id+"]";n.append(e("