boot-cli 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/bin/boot +9 -0
- data/lib/Boot/Lib/Commands/Config.rb +28 -0
- data/lib/Boot/Lib/Commands/Help.rb +17 -0
- data/lib/Boot/Lib/Commands/New.rb +77 -0
- data/lib/Boot/Lib/Commands/Template.rb +87 -0
- data/lib/Boot/Lib/Commands/Version.rb +15 -0
- data/lib/Boot/Lib/Core/Config.rb +84 -0
- data/lib/Boot/Lib/Core/InvalidConfigException.rb +4 -0
- data/lib/Boot/Lib/Core/InvalidTemplateException.rb +4 -0
- data/lib/Boot/Lib/Core/SubCommand.rb +61 -0
- data/lib/Boot/Lib/Core/Template.rb +375 -0
- data/lib/Boot/Lib/autoload.rb +23 -0
- data/lib/boot-default-config.json +1 -0
- data/lib/boot.rb +60 -0
- data/lib/template.json-schema +144 -0
- data/lib/templates/.document +1 -0
- data/lib/templates/.gitmodules +3 -0
- data/lib/templates/README.md +3 -0
- data/lib/templates/c/static/ext/__dummy-file__ +0 -0
- data/lib/templates/c/static/src/main.c +0 -0
- data/lib/templates/c/template.json +24 -0
- data/lib/templates/gitignores/Actionscript.gitignore +11 -0
- data/lib/templates/gitignores/Ada.gitignore +5 -0
- data/lib/templates/gitignores/Agda.gitignore +1 -0
- data/lib/templates/gitignores/Android.gitignore +27 -0
- data/lib/templates/gitignores/AppEngine.gitignore +2 -0
- data/lib/templates/gitignores/AppceleratorTitanium.gitignore +3 -0
- data/lib/templates/gitignores/ArchLinuxPackages.gitignore +14 -0
- data/lib/templates/gitignores/Autotools.gitignore +14 -0
- data/lib/templates/gitignores/C++.gitignore +28 -0
- data/lib/templates/gitignores/C.gitignore +32 -0
- data/lib/templates/gitignores/CFWheels.gitignore +12 -0
- data/lib/templates/gitignores/CMake.gitignore +5 -0
- data/lib/templates/gitignores/CONTRIBUTING.md +34 -0
- data/lib/templates/gitignores/CUDA.gitignore +6 -0
- data/lib/templates/gitignores/CakePHP.gitignore +13 -0
- data/lib/templates/gitignores/ChefCookbook.gitignore +9 -0
- data/lib/templates/gitignores/Clojure.gitignore +12 -0
- data/lib/templates/gitignores/CodeIgniter.gitignore +6 -0
- data/lib/templates/gitignores/CommonLisp.gitignore +3 -0
- data/lib/templates/gitignores/Composer.gitignore +6 -0
- data/lib/templates/gitignores/Concrete5.gitignore +3 -0
- data/lib/templates/gitignores/Coq.gitignore +3 -0
- data/lib/templates/gitignores/CraftCMS.gitignore +3 -0
- data/lib/templates/gitignores/DM.gitignore +5 -0
- data/lib/templates/gitignores/Dart.gitignore +14 -0
- data/lib/templates/gitignores/Delphi.gitignore +57 -0
- data/lib/templates/gitignores/Drupal.gitignore +36 -0
- data/lib/templates/gitignores/EPiServer.gitignore +4 -0
- data/lib/templates/gitignores/Eagle.gitignore +36 -0
- data/lib/templates/gitignores/Elisp.gitignore +5 -0
- data/lib/templates/gitignores/Elixir.gitignore +4 -0
- data/lib/templates/gitignores/Erlang.gitignore +10 -0
- data/lib/templates/gitignores/ExpressionEngine.gitignore +19 -0
- data/lib/templates/gitignores/ExtJs.gitignore +4 -0
- data/lib/templates/gitignores/Fancy.gitignore +2 -0
- data/lib/templates/gitignores/Finale.gitignore +13 -0
- data/lib/templates/gitignores/ForceDotCom.gitignore +4 -0
- data/lib/templates/gitignores/Fortran.gitignore +28 -0
- data/lib/templates/gitignores/FuelPHP.gitignore +2 -0
- data/lib/templates/gitignores/GWT.gitignore +28 -0
- data/lib/templates/gitignores/Gcov.gitignore +5 -0
- data/lib/templates/gitignores/GitBook.gitignore +16 -0
- data/lib/templates/gitignores/Global/Anjuta.gitignore +3 -0
- data/lib/templates/gitignores/Global/Archives.gitignore +27 -0
- data/lib/templates/gitignores/Global/BricxCC.gitignore +4 -0
- data/lib/templates/gitignores/Global/CVS.gitignore +4 -0
- data/lib/templates/gitignores/Global/Cloud9.gitignore +3 -0
- data/lib/templates/gitignores/Global/CodeKit.gitignore +3 -0
- data/lib/templates/gitignores/Global/DartEditor.gitignore +2 -0
- data/lib/templates/gitignores/Global/Dreamweaver.gitignore +3 -0
- data/lib/templates/gitignores/Global/Eclipse.gitignore +36 -0
- data/lib/templates/gitignores/Global/EiffelStudio.gitignore +2 -0
- data/lib/templates/gitignores/Global/Emacs.gitignore +32 -0
- data/lib/templates/gitignores/Global/Ensime.gitignore +4 -0
- data/lib/templates/gitignores/Global/Espresso.gitignore +1 -0
- data/lib/templates/gitignores/Global/FlexBuilder.gitignore +3 -0
- data/lib/templates/gitignores/Global/IPythonNotebook.gitignore +2 -0
- data/lib/templates/gitignores/Global/JDeveloper.gitignore +13 -0
- data/lib/templates/gitignores/Global/JetBrains.gitignore +46 -0
- data/lib/templates/gitignores/Global/KDevelop4.gitignore +2 -0
- data/lib/templates/gitignores/Global/Kate.gitignore +3 -0
- data/lib/templates/gitignores/Global/Lazarus.gitignore +15 -0
- data/lib/templates/gitignores/Global/LibreOffice.gitignore +2 -0
- data/lib/templates/gitignores/Global/Linux.gitignore +7 -0
- data/lib/templates/gitignores/Global/LyX.gitignore +4 -0
- data/lib/templates/gitignores/Global/Matlab.gitignore +16 -0
- data/lib/templates/gitignores/Global/Mercurial.gitignore +3 -0
- data/lib/templates/gitignores/Global/MicrosoftOffice.gitignore +10 -0
- data/lib/templates/gitignores/Global/ModelSim.gitignore +23 -0
- data/lib/templates/gitignores/Global/Momentics.gitignore +8 -0
- data/lib/templates/gitignores/Global/MonoDevelop.gitignore +8 -0
- data/lib/templates/gitignores/Global/NetBeans.gitignore +8 -0
- data/lib/templates/gitignores/Global/Ninja.gitignore +2 -0
- data/lib/templates/gitignores/Global/NotepadPP.gitignore +2 -0
- data/lib/templates/gitignores/Global/OSX.gitignore +24 -0
- data/lib/templates/gitignores/Global/README.md +10 -0
- data/lib/templates/gitignores/Global/Redcar.gitignore +1 -0
- data/lib/templates/gitignores/Global/Redis.gitignore +3 -0
- data/lib/templates/gitignores/Global/SBT.gitignore +9 -0
- data/lib/templates/gitignores/Global/SVN.gitignore +1 -0
- data/lib/templates/gitignores/Global/SlickEdit.gitignore +11 -0
- data/lib/templates/gitignores/Global/SublimeText.gitignore +14 -0
- data/lib/templates/gitignores/Global/SynopsysVCS.gitignore +23 -0
- data/lib/templates/gitignores/Global/Tags.gitignore +14 -0
- data/lib/templates/gitignores/Global/TextMate.gitignore +3 -0
- data/lib/templates/gitignores/Global/TortoiseGit.gitignore +2 -0
- data/lib/templates/gitignores/Global/Vagrant.gitignore +1 -0
- data/lib/templates/gitignores/Global/Vim.gitignore +6 -0
- data/lib/templates/gitignores/Global/VirtualEnv.gitignore +9 -0
- data/lib/templates/gitignores/Global/WebMethods.gitignore +14 -0
- data/lib/templates/gitignores/Global/Windows.gitignore +18 -0
- data/lib/templates/gitignores/Global/Xcode.gitignore +14 -0
- data/lib/templates/gitignores/Global/XilinxISE.gitignore +57 -0
- data/lib/templates/gitignores/Go.gitignore +24 -0
- data/lib/templates/gitignores/Gradle.gitignore +8 -0
- data/lib/templates/gitignores/Grails.gitignore +33 -0
- data/lib/templates/gitignores/Haskell.gitignore +16 -0
- data/lib/templates/gitignores/IGORPro.gitignore +5 -0
- data/lib/templates/gitignores/Idris.gitignore +2 -0
- data/lib/templates/gitignores/Java.gitignore +12 -0
- data/lib/templates/gitignores/Jboss.gitignore +19 -0
- data/lib/templates/gitignores/Jekyll.gitignore +3 -0
- data/lib/templates/gitignores/Joomla.gitignore +525 -0
- data/lib/templates/gitignores/Jython.gitignore +2 -0
- data/lib/templates/gitignores/KiCAD.gitignore +11 -0
- data/lib/templates/gitignores/Kohana.gitignore +2 -0
- data/lib/templates/gitignores/LICENSE +19 -0
- data/lib/templates/gitignores/LabVIEW.gitignore +16 -0
- data/lib/templates/gitignores/Laravel.gitignore +4 -0
- data/lib/templates/gitignores/Leiningen.gitignore +12 -0
- data/lib/templates/gitignores/LemonStand.gitignore +21 -0
- data/lib/templates/gitignores/Lilypond.gitignore +6 -0
- data/lib/templates/gitignores/Lithium.gitignore +2 -0
- data/lib/templates/gitignores/Lua.gitignore +41 -0
- data/lib/templates/gitignores/Magento.gitignore +126 -0
- data/lib/templates/gitignores/Maven.gitignore +9 -0
- data/lib/templates/gitignores/Mercury.gitignore +13 -0
- data/lib/templates/gitignores/MetaProgrammingSystem.gitignore +16 -0
- data/lib/templates/gitignores/Meteor.gitignore +2 -0
- data/lib/templates/gitignores/Nanoc.gitignore +10 -0
- data/lib/templates/gitignores/Nim.gitignore +1 -0
- data/lib/templates/gitignores/Node.gitignore +27 -0
- data/lib/templates/gitignores/OCaml.gitignore +20 -0
- data/lib/templates/gitignores/Objective-C.gitignore +26 -0
- data/lib/templates/gitignores/Opa.gitignore +13 -0
- data/lib/templates/gitignores/OpenCart.gitignore +11 -0
- data/lib/templates/gitignores/OracleForms.gitignore +8 -0
- data/lib/templates/gitignores/Packer.gitignore +5 -0
- data/lib/templates/gitignores/Perl.gitignore +20 -0
- data/lib/templates/gitignores/Phalcon.gitignore +2 -0
- data/lib/templates/gitignores/PlayFramework.gitignore +17 -0
- data/lib/templates/gitignores/Plone.gitignore +18 -0
- data/lib/templates/gitignores/Prestashop.gitignore +25 -0
- data/lib/templates/gitignores/Processing.gitignore +7 -0
- data/lib/templates/gitignores/Python.gitignore +57 -0
- data/lib/templates/gitignores/Qooxdoo.gitignore +5 -0
- data/lib/templates/gitignores/Qt.gitignore +34 -0
- data/lib/templates/gitignores/R.gitignore +13 -0
- data/lib/templates/gitignores/README.md +79 -0
- data/lib/templates/gitignores/ROS.gitignore +47 -0
- data/lib/templates/gitignores/Rails.gitignore +35 -0
- data/lib/templates/gitignores/RhodesRhomobile.gitignore +9 -0
- data/lib/templates/gitignores/Ruby.gitignore +35 -0
- data/lib/templates/gitignores/Rust.gitignore +11 -0
- data/lib/templates/gitignores/SCons.gitignore +2 -0
- data/lib/templates/gitignores/Sass.gitignore +2 -0
- data/lib/templates/gitignores/Scala.gitignore +17 -0
- data/lib/templates/gitignores/Scrivener.gitignore +7 -0
- data/lib/templates/gitignores/Sdcc.gitignore +8 -0
- data/lib/templates/gitignores/SeamGen.gitignore +26 -0
- data/lib/templates/gitignores/SketchUp.gitignore +1 -0
- data/lib/templates/gitignores/Stella.gitignore +12 -0
- data/lib/templates/gitignores/SugarCRM.gitignore +25 -0
- data/lib/templates/gitignores/Swift.gitignore +33 -0
- data/lib/templates/gitignores/Symfony.gitignore +37 -0
- data/lib/templates/gitignores/SymphonyCMS.gitignore +6 -0
- data/lib/templates/gitignores/TeX.gitignore +126 -0
- data/lib/templates/gitignores/Textpattern.gitignore +11 -0
- data/lib/templates/gitignores/TurboGears2.gitignore +20 -0
- data/lib/templates/gitignores/Typo3.gitignore +18 -0
- data/lib/templates/gitignores/Umbraco.gitignore +17 -0
- data/lib/templates/gitignores/Unity.gitignore +21 -0
- data/lib/templates/gitignores/VVVV.gitignore +6 -0
- data/lib/templates/gitignores/VisualStudio.gitignore +196 -0
- data/lib/templates/gitignores/Waf.gitignore +3 -0
- data/lib/templates/gitignores/WordPress.gitignore +13 -0
- data/lib/templates/gitignores/Xojo.gitignore +11 -0
- data/lib/templates/gitignores/Yeoman.gitignore +6 -0
- data/lib/templates/gitignores/Yii.gitignore +6 -0
- data/lib/templates/gitignores/ZendFramework.gitignore +20 -0
- data/lib/templates/gitignores/Zephir.gitignore +26 -0
- data/lib/templates/templates/boot-template/static/static/___dummy-file___ +1 -0
- data/lib/templates/templates/boot-template/static/template.json +7 -0
- data/lib/templates/templates/boot-template/template.json +17 -0
- data/lib/templates/templates/c/builder/makefile +12 -0
- data/lib/templates/templates/c/builder/makefile-pch +12 -0
- data/lib/templates/templates/c/misc/main.h +1 -0
- data/lib/templates/templates/c/static/lib/___dummy-file___ +1 -0
- data/lib/templates/templates/c/static/src/main.c +4 -0
- data/lib/templates/templates/c/template.json +32 -0
- data/lib/templates/templates/c/vcs/.gitignore +1 -0
- data/lib/templates/templates/c/vcs/.svnignore +1 -0
- data/lib/templates/templates/gem/Gemfile +3 -0
- data/lib/templates/templates/gem/gemname-git.gemspec +13 -0
- data/lib/templates/templates/gem/static/[[!gemname]].gemspec +13 -0
- data/lib/templates/templates/gem/static/bin/[[!gemname]] +1 -0
- data/lib/templates/templates/gem/static/lib/[[!gemname]].rb +0 -0
- data/lib/templates/templates/gem/static/test/test_helper.rb +0 -0
- data/lib/templates/templates/gem/template.json +33 -0
- data/lib/templates/templates/wordpress-plugin/static/wp-content/plugins/[[!plugin-name]]/[[!plugin-name]].php +11 -0
- data/lib/templates/templates/wordpress-plugin/template.json +26 -0
- data/lib/templates/templates/wordpress-plugin/vcs/git/gitignore.gitignore +1 -0
- data/lib/templates/templates/wordpress-theme/static/wp-content/themes/[[!theme-name]]/index.php +1 -0
- data/lib/templates/templates/wordpress-theme/static/wp-content/themes/[[!theme-name]]/style.css +12 -0
- data/lib/templates/templates/wordpress-theme/template.json +26 -0
- data/lib/templates/templates/wordpress-theme/vcs/git/gitignore.gitignore +1 -0
- data/lib/templates/wordpress/index.php +17 -0
- data/lib/templates/wordpress/license.txt +385 -0
- data/lib/templates/wordpress/readme.html +98 -0
- data/lib/templates/wordpress/wp-activate.php +131 -0
- data/lib/templates/wordpress/wp-admin/about.php +166 -0
- data/lib/templates/wordpress/wp-admin/admin-ajax.php +99 -0
- data/lib/templates/wordpress/wp-admin/admin-footer.php +99 -0
- data/lib/templates/wordpress/wp-admin/admin-functions.php +15 -0
- data/lib/templates/wordpress/wp-admin/admin-header.php +249 -0
- data/lib/templates/wordpress/wp-admin/admin-post.php +71 -0
- data/lib/templates/wordpress/wp-admin/admin.php +361 -0
- data/lib/templates/wordpress/wp-admin/async-upload.php +115 -0
- data/lib/templates/wordpress/wp-admin/comment.php +330 -0
- data/lib/templates/wordpress/wp-admin/credits.php +192 -0
- data/lib/templates/wordpress/wp-admin/css/about-rtl.css +454 -0
- data/lib/templates/wordpress/wp-admin/css/about.css +454 -0
- data/lib/templates/wordpress/wp-admin/css/admin-menu-rtl.css +935 -0
- data/lib/templates/wordpress/wp-admin/css/admin-menu.css +935 -0
- data/lib/templates/wordpress/wp-admin/css/color-picker-rtl.css +127 -0
- data/lib/templates/wordpress/wp-admin/css/color-picker-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/color-picker.css +127 -0
- data/lib/templates/wordpress/wp-admin/css/color-picker.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/_admin.scss +521 -0
- data/lib/templates/wordpress/wp-admin/css/colors/_mixins.scss +43 -0
- data/lib/templates/wordpress/wp-admin/css/colors/_variables.scss +58 -0
- data/lib/templates/wordpress/wp-admin/css/colors/blue/colors-rtl.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/blue/colors-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/blue/colors.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/blue/colors.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/blue/colors.scss +11 -0
- data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors-rtl.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/coffee/colors.scss +7 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors-rtl.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ectoplasm/colors.scss +8 -0
- data/lib/templates/wordpress/wp-admin/css/colors/light/colors-rtl.css +338 -0
- data/lib/templates/wordpress/wp-admin/css/colors/light/colors-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/light/colors.css +338 -0
- data/lib/templates/wordpress/wp-admin/css/colors/light/colors.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/light/colors.scss +38 -0
- data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors-rtl.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/midnight/colors.scss +5 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors-rtl.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/ocean/colors.scss +8 -0
- data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors-rtl.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors.css +330 -0
- data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/colors/sunrise/colors.scss +6 -0
- data/lib/templates/wordpress/wp-admin/css/common-rtl.css +3289 -0
- data/lib/templates/wordpress/wp-admin/css/common.css +3289 -0
- data/lib/templates/wordpress/wp-admin/css/customize-controls-rtl.css +1191 -0
- data/lib/templates/wordpress/wp-admin/css/customize-controls-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/customize-controls.css +1191 -0
- data/lib/templates/wordpress/wp-admin/css/customize-controls.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/customize-widgets-rtl.css +636 -0
- data/lib/templates/wordpress/wp-admin/css/customize-widgets-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/customize-widgets.css +636 -0
- data/lib/templates/wordpress/wp-admin/css/customize-widgets.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/dashboard-rtl.css +1111 -0
- data/lib/templates/wordpress/wp-admin/css/dashboard.css +1111 -0
- data/lib/templates/wordpress/wp-admin/css/deprecated-media-rtl.css +407 -0
- data/lib/templates/wordpress/wp-admin/css/deprecated-media-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/deprecated-media.css +407 -0
- data/lib/templates/wordpress/wp-admin/css/deprecated-media.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/edit-rtl.css +1589 -0
- data/lib/templates/wordpress/wp-admin/css/edit.css +1589 -0
- data/lib/templates/wordpress/wp-admin/css/farbtastic-rtl.css +41 -0
- data/lib/templates/wordpress/wp-admin/css/farbtastic.css +41 -0
- data/lib/templates/wordpress/wp-admin/css/forms-rtl.css +1175 -0
- data/lib/templates/wordpress/wp-admin/css/forms.css +1175 -0
- data/lib/templates/wordpress/wp-admin/css/ie-rtl.css +785 -0
- data/lib/templates/wordpress/wp-admin/css/ie-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/ie.css +785 -0
- data/lib/templates/wordpress/wp-admin/css/ie.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/install-rtl.css +388 -0
- data/lib/templates/wordpress/wp-admin/css/install-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/install.css +388 -0
- data/lib/templates/wordpress/wp-admin/css/install.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/l10n-rtl.css +111 -0
- data/lib/templates/wordpress/wp-admin/css/l10n.css +111 -0
- data/lib/templates/wordpress/wp-admin/css/list-tables-rtl.css +1925 -0
- data/lib/templates/wordpress/wp-admin/css/list-tables.css +1925 -0
- data/lib/templates/wordpress/wp-admin/css/login-rtl.css +265 -0
- data/lib/templates/wordpress/wp-admin/css/login-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/login.css +265 -0
- data/lib/templates/wordpress/wp-admin/css/login.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/media-rtl.css +1193 -0
- data/lib/templates/wordpress/wp-admin/css/media.css +1193 -0
- data/lib/templates/wordpress/wp-admin/css/nav-menus-rtl.css +865 -0
- data/lib/templates/wordpress/wp-admin/css/nav-menus.css +865 -0
- data/lib/templates/wordpress/wp-admin/css/press-this-editor-rtl.css +123 -0
- data/lib/templates/wordpress/wp-admin/css/press-this-editor.css +123 -0
- data/lib/templates/wordpress/wp-admin/css/press-this-rtl.css +2039 -0
- data/lib/templates/wordpress/wp-admin/css/press-this-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/press-this.css +2039 -0
- data/lib/templates/wordpress/wp-admin/css/press-this.min.css +1 -0
- data/lib/templates/wordpress/wp-admin/css/revisions-rtl.css +575 -0
- data/lib/templates/wordpress/wp-admin/css/revisions.css +575 -0
- data/lib/templates/wordpress/wp-admin/css/themes-rtl.css +1760 -0
- data/lib/templates/wordpress/wp-admin/css/themes.css +1760 -0
- data/lib/templates/wordpress/wp-admin/css/widgets-rtl.css +579 -0
- data/lib/templates/wordpress/wp-admin/css/widgets.css +579 -0
- data/lib/templates/wordpress/wp-admin/css/wp-admin-rtl.css +13 -0
- data/lib/templates/wordpress/wp-admin/css/wp-admin-rtl.min.css +8 -0
- data/lib/templates/wordpress/wp-admin/css/wp-admin.css +13 -0
- data/lib/templates/wordpress/wp-admin/css/wp-admin.min.css +8 -0
- data/lib/templates/wordpress/wp-admin/custom-background.php +472 -0
- data/lib/templates/wordpress/wp-admin/custom-header.php +1303 -0
- data/lib/templates/wordpress/wp-admin/customize.php +300 -0
- data/lib/templates/wordpress/wp-admin/edit-comments.php +254 -0
- data/lib/templates/wordpress/wp-admin/edit-form-advanced.php +668 -0
- data/lib/templates/wordpress/wp-admin/edit-form-comment.php +189 -0
- data/lib/templates/wordpress/wp-admin/edit-link-form.php +150 -0
- data/lib/templates/wordpress/wp-admin/edit-tag-form.php +228 -0
- data/lib/templates/wordpress/wp-admin/edit-tags.php +603 -0
- data/lib/templates/wordpress/wp-admin/edit.php +338 -0
- data/lib/templates/wordpress/wp-admin/export.php +242 -0
- data/lib/templates/wordpress/wp-admin/freedoms.php +57 -0
- data/lib/templates/wordpress/wp-admin/images/align-center-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/align-center.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/align-left-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/align-left.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/align-none-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/align-none.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/align-right-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/align-right.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/arrows-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/arrows.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/bubble_bg-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/bubble_bg.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/comment-grey-bubble-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/comment-grey-bubble.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/date-button-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/date-button.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/generic.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/icons32-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/icons32-vs-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/icons32-vs.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/icons32.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/imgedit-icons-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/imgedit-icons.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/list-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/list.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/loading.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/marker.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/mask.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/media-button-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/media-button-image.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/media-button-music.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/media-button-other.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/media-button-video.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/media-button.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/menu-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/menu-vs-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/menu-vs.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/menu.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/no.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/post-formats-vs.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/post-formats.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/post-formats32-vs.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/post-formats32.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/resize-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/resize-rtl-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/resize-rtl.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/resize.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/se.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/sort-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/sort.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/spinner-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/spinner.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/stars-2x.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/stars.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/w-logo-blue.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/w-logo-white.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/wheel.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/wordpress-logo-white.svg +1 -0
- data/lib/templates/wordpress/wp-admin/images/wordpress-logo.png +0 -0
- data/lib/templates/wordpress/wp-admin/images/wordpress-logo.svg +1 -0
- data/lib/templates/wordpress/wp-admin/images/wpspin_light-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/wpspin_light.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/xit-2x.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/xit.gif +0 -0
- data/lib/templates/wordpress/wp-admin/images/yes.png +0 -0
- data/lib/templates/wordpress/wp-admin/import.php +130 -0
- data/lib/templates/wordpress/wp-admin/includes/admin.php +74 -0
- data/lib/templates/wordpress/wp-admin/includes/ajax-actions.php +2973 -0
- data/lib/templates/wordpress/wp-admin/includes/bookmark.php +305 -0
- data/lib/templates/wordpress/wp-admin/includes/class-ftp-pure.php +190 -0
- data/lib/templates/wordpress/wp-admin/includes/class-ftp-sockets.php +250 -0
- data/lib/templates/wordpress/wp-admin/includes/class-ftp.php +906 -0
- data/lib/templates/wordpress/wp-admin/includes/class-pclzip.php +5687 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-comments-list-table.php +643 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-base.php +766 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-direct.php +463 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php +513 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php +446 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php +505 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-importer.php +301 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-links-list-table.php +208 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-list-table.php +1141 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-media-list-table.php +556 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-ms-sites-list-table.php +404 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-ms-themes-list-table.php +480 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-ms-users-list-table.php +306 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-plugin-install-list-table.php +515 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-plugins-list-table.php +648 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-posts-list-table.php +1416 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-press-this.php +1466 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-terms-list-table.php +513 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-theme-install-list-table.php +431 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-themes-list-table.php +285 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-upgrader-skins.php +783 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-upgrader.php +3254 -0
- data/lib/templates/wordpress/wp-admin/includes/class-wp-users-list-table.php +460 -0
- data/lib/templates/wordpress/wp-admin/includes/comment.php +173 -0
- data/lib/templates/wordpress/wp-admin/includes/continents-cities.php +493 -0
- data/lib/templates/wordpress/wp-admin/includes/dashboard.php +1341 -0
- data/lib/templates/wordpress/wp-admin/includes/deprecated.php +1183 -0
- data/lib/templates/wordpress/wp-admin/includes/export.php +510 -0
- data/lib/templates/wordpress/wp-admin/includes/file.php +1229 -0
- data/lib/templates/wordpress/wp-admin/includes/image-edit.php +861 -0
- data/lib/templates/wordpress/wp-admin/includes/image.php +600 -0
- data/lib/templates/wordpress/wp-admin/includes/import.php +204 -0
- data/lib/templates/wordpress/wp-admin/includes/list-table.php +113 -0
- data/lib/templates/wordpress/wp-admin/includes/media.php +3083 -0
- data/lib/templates/wordpress/wp-admin/includes/menu.php +322 -0
- data/lib/templates/wordpress/wp-admin/includes/meta-boxes.php +1132 -0
- data/lib/templates/wordpress/wp-admin/includes/misc.php +889 -0
- data/lib/templates/wordpress/wp-admin/includes/ms-deprecated.php +77 -0
- data/lib/templates/wordpress/wp-admin/includes/ms.php +971 -0
- data/lib/templates/wordpress/wp-admin/includes/nav-menu.php +1324 -0
- data/lib/templates/wordpress/wp-admin/includes/plugin-install.php +580 -0
- data/lib/templates/wordpress/wp-admin/includes/plugin.php +1892 -0
- data/lib/templates/wordpress/wp-admin/includes/post.php +1742 -0
- data/lib/templates/wordpress/wp-admin/includes/revision.php +378 -0
- data/lib/templates/wordpress/wp-admin/includes/schema.php +1046 -0
- data/lib/templates/wordpress/wp-admin/includes/screen.php +1185 -0
- data/lib/templates/wordpress/wp-admin/includes/taxonomy.php +290 -0
- data/lib/templates/wordpress/wp-admin/includes/template.php +2248 -0
- data/lib/templates/wordpress/wp-admin/includes/theme-install.php +205 -0
- data/lib/templates/wordpress/wp-admin/includes/theme.php +564 -0
- data/lib/templates/wordpress/wp-admin/includes/translation-install.php +241 -0
- data/lib/templates/wordpress/wp-admin/includes/update-core.php +1190 -0
- data/lib/templates/wordpress/wp-admin/includes/update.php +435 -0
- data/lib/templates/wordpress/wp-admin/includes/upgrade.php +2410 -0
- data/lib/templates/wordpress/wp-admin/includes/user.php +442 -0
- data/lib/templates/wordpress/wp-admin/includes/widgets.php +245 -0
- data/lib/templates/wordpress/wp-admin/index.php +132 -0
- data/lib/templates/wordpress/wp-admin/install-helper.php +198 -0
- data/lib/templates/wordpress/wp-admin/install.php +307 -0
- data/lib/templates/wordpress/wp-admin/js/accordion.js +75 -0
- data/lib/templates/wordpress/wp-admin/js/accordion.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/bookmarklet.js +166 -0
- data/lib/templates/wordpress/wp-admin/js/bookmarklet.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/color-picker.js +157 -0
- data/lib/templates/wordpress/wp-admin/js/color-picker.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/comment.js +50 -0
- data/lib/templates/wordpress/wp-admin/js/comment.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/common.js +893 -0
- data/lib/templates/wordpress/wp-admin/js/common.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/custom-background.js +75 -0
- data/lib/templates/wordpress/wp-admin/js/custom-background.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/custom-header.js +61 -0
- data/lib/templates/wordpress/wp-admin/js/customize-controls.js +3071 -0
- data/lib/templates/wordpress/wp-admin/js/customize-controls.min.js +2 -0
- data/lib/templates/wordpress/wp-admin/js/customize-widgets.js +2024 -0
- data/lib/templates/wordpress/wp-admin/js/customize-widgets.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/dashboard.js +190 -0
- data/lib/templates/wordpress/wp-admin/js/dashboard.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/edit-comments.js +627 -0
- data/lib/templates/wordpress/wp-admin/js/edit-comments.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/editor-expand.js +1237 -0
- data/lib/templates/wordpress/wp-admin/js/editor-expand.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/editor.js +324 -0
- data/lib/templates/wordpress/wp-admin/js/editor.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/farbtastic.js +276 -0
- data/lib/templates/wordpress/wp-admin/js/gallery.js +237 -0
- data/lib/templates/wordpress/wp-admin/js/gallery.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/image-edit.js +633 -0
- data/lib/templates/wordpress/wp-admin/js/image-edit.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/inline-edit-post.js +360 -0
- data/lib/templates/wordpress/wp-admin/js/inline-edit-post.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/inline-edit-tax.js +152 -0
- data/lib/templates/wordpress/wp-admin/js/inline-edit-tax.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/iris.min.js +4 -0
- data/lib/templates/wordpress/wp-admin/js/language-chooser.js +26 -0
- data/lib/templates/wordpress/wp-admin/js/language-chooser.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/link.js +69 -0
- data/lib/templates/wordpress/wp-admin/js/link.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/media-gallery.js +26 -0
- data/lib/templates/wordpress/wp-admin/js/media-gallery.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/media-upload.js +69 -0
- data/lib/templates/wordpress/wp-admin/js/media-upload.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/media.js +114 -0
- data/lib/templates/wordpress/wp-admin/js/media.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/nav-menu.js +1237 -0
- data/lib/templates/wordpress/wp-admin/js/nav-menu.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/password-strength-meter.js +75 -0
- data/lib/templates/wordpress/wp-admin/js/password-strength-meter.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/plugin-install.js +72 -0
- data/lib/templates/wordpress/wp-admin/js/plugin-install.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/post.js +926 -0
- data/lib/templates/wordpress/wp-admin/js/post.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/postbox.js +199 -0
- data/lib/templates/wordpress/wp-admin/js/postbox.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/press-this.js +796 -0
- data/lib/templates/wordpress/wp-admin/js/press-this.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/revisions.js +1166 -0
- data/lib/templates/wordpress/wp-admin/js/revisions.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/set-post-thumbnail.js +24 -0
- data/lib/templates/wordpress/wp-admin/js/set-post-thumbnail.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/svg-painter.js +240 -0
- data/lib/templates/wordpress/wp-admin/js/svg-painter.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/tags-box.js +202 -0
- data/lib/templates/wordpress/wp-admin/js/tags-box.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/tags.js +72 -0
- data/lib/templates/wordpress/wp-admin/js/tags.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/theme.js +1726 -0
- data/lib/templates/wordpress/wp-admin/js/theme.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/updates.js +553 -0
- data/lib/templates/wordpress/wp-admin/js/updates.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/user-profile.js +149 -0
- data/lib/templates/wordpress/wp-admin/js/user-profile.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/user-suggest.js +30 -0
- data/lib/templates/wordpress/wp-admin/js/user-suggest.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/widgets.js +494 -0
- data/lib/templates/wordpress/wp-admin/js/widgets.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/word-count.js +44 -0
- data/lib/templates/wordpress/wp-admin/js/word-count.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/wp-fullscreen.js +704 -0
- data/lib/templates/wordpress/wp-admin/js/wp-fullscreen.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/js/xfn.js +17 -0
- data/lib/templates/wordpress/wp-admin/js/xfn.min.js +1 -0
- data/lib/templates/wordpress/wp-admin/link-add.php +29 -0
- data/lib/templates/wordpress/wp-admin/link-manager.php +99 -0
- data/lib/templates/wordpress/wp-admin/link-parse-opml.php +87 -0
- data/lib/templates/wordpress/wp-admin/link.php +117 -0
- data/lib/templates/wordpress/wp-admin/load-scripts.php +162 -0
- data/lib/templates/wordpress/wp-admin/load-styles.php +153 -0
- data/lib/templates/wordpress/wp-admin/maint/repair.php +124 -0
- data/lib/templates/wordpress/wp-admin/media-new.php +84 -0
- data/lib/templates/wordpress/wp-admin/media-upload.php +103 -0
- data/lib/templates/wordpress/wp-admin/media.php +146 -0
- data/lib/templates/wordpress/wp-admin/menu-header.php +242 -0
- data/lib/templates/wordpress/wp-admin/menu.php +269 -0
- data/lib/templates/wordpress/wp-admin/moderation.php +12 -0
- data/lib/templates/wordpress/wp-admin/ms-admin.php +13 -0
- data/lib/templates/wordpress/wp-admin/ms-delete-site.php +94 -0
- data/lib/templates/wordpress/wp-admin/ms-edit.php +13 -0
- data/lib/templates/wordpress/wp-admin/ms-options.php +12 -0
- data/lib/templates/wordpress/wp-admin/ms-sites.php +13 -0
- data/lib/templates/wordpress/wp-admin/ms-themes.php +13 -0
- data/lib/templates/wordpress/wp-admin/ms-upgrade-network.php +13 -0
- data/lib/templates/wordpress/wp-admin/ms-users.php +13 -0
- data/lib/templates/wordpress/wp-admin/my-sites.php +143 -0
- data/lib/templates/wordpress/wp-admin/nav-menus.php +796 -0
- data/lib/templates/wordpress/wp-admin/network.php +580 -0
- data/lib/templates/wordpress/wp-admin/network/about.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/admin.php +32 -0
- data/lib/templates/wordpress/wp-admin/network/credits.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/edit.php +42 -0
- data/lib/templates/wordpress/wp-admin/network/freedoms.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/index.php +79 -0
- data/lib/templates/wordpress/wp-admin/network/menu.php +63 -0
- data/lib/templates/wordpress/wp-admin/network/plugin-editor.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/plugin-install.php +19 -0
- data/lib/templates/wordpress/wp-admin/network/plugins.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/profile.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/settings.php +405 -0
- data/lib/templates/wordpress/wp-admin/network/setup.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/site-info.php +187 -0
- data/lib/templates/wordpress/wp-admin/network/site-new.php +170 -0
- data/lib/templates/wordpress/wp-admin/network/site-settings.php +173 -0
- data/lib/templates/wordpress/wp-admin/network/site-themes.php +195 -0
- data/lib/templates/wordpress/wp-admin/network/site-users.php +317 -0
- data/lib/templates/wordpress/wp-admin/network/sites.php +275 -0
- data/lib/templates/wordpress/wp-admin/network/theme-editor.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/theme-install.php +19 -0
- data/lib/templates/wordpress/wp-admin/network/themes.php +323 -0
- data/lib/templates/wordpress/wp-admin/network/update-core.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/update.php +19 -0
- data/lib/templates/wordpress/wp-admin/network/upgrade.php +129 -0
- data/lib/templates/wordpress/wp-admin/network/user-edit.php +16 -0
- data/lib/templates/wordpress/wp-admin/network/user-new.php +107 -0
- data/lib/templates/wordpress/wp-admin/network/users.php +329 -0
- data/lib/templates/wordpress/wp-admin/options-discussion.php +306 -0
- data/lib/templates/wordpress/wp-admin/options-general.php +387 -0
- data/lib/templates/wordpress/wp-admin/options-head.php +18 -0
- data/lib/templates/wordpress/wp-admin/options-media.php +136 -0
- data/lib/templates/wordpress/wp-admin/options-permalink.php +288 -0
- data/lib/templates/wordpress/wp-admin/options-reading.php +182 -0
- data/lib/templates/wordpress/wp-admin/options-writing.php +178 -0
- data/lib/templates/wordpress/wp-admin/options.php +277 -0
- data/lib/templates/wordpress/wp-admin/plugin-editor.php +279 -0
- data/lib/templates/wordpress/wp-admin/plugin-install.php +138 -0
- data/lib/templates/wordpress/wp-admin/plugins.php +489 -0
- data/lib/templates/wordpress/wp-admin/post-new.php +76 -0
- data/lib/templates/wordpress/wp-admin/post.php +320 -0
- data/lib/templates/wordpress/wp-admin/press-this.php +21 -0
- data/lib/templates/wordpress/wp-admin/profile.php +18 -0
- data/lib/templates/wordpress/wp-admin/revision.php +135 -0
- data/lib/templates/wordpress/wp-admin/setup-config.php +352 -0
- data/lib/templates/wordpress/wp-admin/theme-editor.php +241 -0
- data/lib/templates/wordpress/wp-admin/theme-install.php +271 -0
- data/lib/templates/wordpress/wp-admin/themes.php +422 -0
- data/lib/templates/wordpress/wp-admin/tools.php +119 -0
- data/lib/templates/wordpress/wp-admin/update-core.php +661 -0
- data/lib/templates/wordpress/wp-admin/update.php +272 -0
- data/lib/templates/wordpress/wp-admin/upgrade-functions.php +12 -0
- data/lib/templates/wordpress/wp-admin/upgrade.php +120 -0
- data/lib/templates/wordpress/wp-admin/upload.php +294 -0
- data/lib/templates/wordpress/wp-admin/user-edit.php +592 -0
- data/lib/templates/wordpress/wp-admin/user-new.php +440 -0
- data/lib/templates/wordpress/wp-admin/user/about.php +13 -0
- data/lib/templates/wordpress/wp-admin/user/admin.php +32 -0
- data/lib/templates/wordpress/wp-admin/user/credits.php +13 -0
- data/lib/templates/wordpress/wp-admin/user/freedoms.php +13 -0
- data/lib/templates/wordpress/wp-admin/user/index.php +13 -0
- data/lib/templates/wordpress/wp-admin/user/menu.php +22 -0
- data/lib/templates/wordpress/wp-admin/user/profile.php +13 -0
- data/lib/templates/wordpress/wp-admin/user/user-edit.php +13 -0
- data/lib/templates/wordpress/wp-admin/users.php +475 -0
- data/lib/templates/wordpress/wp-admin/widgets.php +459 -0
- data/lib/templates/wordpress/wp-blog-header.php +18 -0
- data/lib/templates/wordpress/wp-comments-post.php +167 -0
- data/lib/templates/wordpress/wp-config-sample.php +80 -0
- data/lib/templates/wordpress/wp-content/index.php +2 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/.htaccess +34 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/akismet.css +366 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/akismet.js +160 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/form.js +30 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/_inc/img/logo-full-2x.png +0 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/akismet.php +59 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/class.akismet-admin.php +885 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/class.akismet-widget.php +110 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/class.akismet.php +1088 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/index.php +2 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/readme.txt +266 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/views/config.php +220 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/views/get.php +5 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/views/notice.php +102 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/views/start.php +95 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/views/stats.php +4 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/views/strict.php +7 -0
- data/lib/templates/wordpress/wp-content/plugins/akismet/wrapper.php +213 -0
- data/lib/templates/wordpress/wp-content/plugins/index.php +2 -0
- data/lib/templates/wordpress/wp-content/themes/index.php +2 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/404.php +30 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/archive.php +64 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/author-bio.php +39 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/comments.php +58 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-link.php +60 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-none.php +37 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-page.php +37 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content-search.php +37 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/content.php +60 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/css/editor-style.css +493 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/css/ie.css +948 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/css/ie7.css +89 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/footer.php +34 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/functions.php +355 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/COPYING.txt +9 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.eot +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.svg +543 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.ttf +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/Genericons.woff +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/LICENSE.txt +339 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/README.md +152 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/example.html +719 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/genericons/genericons.css +209 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/header.php +50 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/image.php +94 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/back-compat.php +63 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/custom-header.php +356 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/customizer.php +715 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/inc/template-tags.php +242 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/index.php +61 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/color-scheme-control.js +78 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/customize-preview.js +35 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/functions.js +162 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/html5.js +9 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/keyboard-image-navigation.js +22 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/js/skip-link-focus-fix.js +26 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/languages/twentyfifteen.pot +328 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/page.php +38 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/readme.txt +92 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/rtl.css +840 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/screenshot.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/search.php +53 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/sidebar.php +47 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/single.php +48 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfifteen/style.css +5994 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/404.php +32 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/archive.php +74 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/author.php +74 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/category.php +58 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/comments.php +66 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-aside.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-audio.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-featured-post.php +34 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-gallery.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-image.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-link.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-none.php +31 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-page.php +31 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-quote.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content-video.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/content.php +71 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/css/editor-style.css +737 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/css/ie.css +1335 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/featured-content.php +39 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/footer.php +28 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/functions.php +519 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/COPYING.txt +9 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/Genericons-Regular.otf +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/LICENSE.txt +339 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/README.txt +123 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/example.html +464 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.eot +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.svg +135 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.ttf +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.woff +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/genericons/genericons.css +197 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/header.php +65 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/image.php +79 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/images/pattern-dark.svg +16 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/images/pattern-light.svg +6 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/back-compat.php +63 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/custom-header.php +147 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/customizer.php +115 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/featured-content.php +531 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/template-tags.php +227 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/inc/widgets.php +269 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/index.php +61 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/customizer.js +38 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/featured-content-admin.js +9 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/functions.js +170 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/html5.js +8 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js +21 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/js/slider.js +598 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/languages/twentyfourteen.pot +480 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/page-templates/contributors.php +52 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/page-templates/full-width.php +42 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/page.php +48 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/rtl.css +854 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/screenshot.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/search.php +49 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/sidebar-content.php +16 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/sidebar-footer.php +19 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/sidebar.php +29 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/single.php +40 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/style.css +4321 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/tag.php +60 -0
- data/lib/templates/wordpress/wp-content/themes/twentyfourteen/taxonomy-post_format.php +85 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/404.php +31 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/archive.php +55 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/author-bio.php +34 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/author.php +62 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/category.php +41 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/comments.php +59 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-aside.php +38 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-audio.php +44 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-chat.php +38 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-gallery.php +52 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-image.php +48 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-link.php +43 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-none.php +31 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-quote.php +34 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-status.php +32 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content-video.php +48 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/content.php +64 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/css/editor-style.css +787 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/css/ie.css +288 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/footer.php +26 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/functions.php +552 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/COPYING.txt +9 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/Genericons-Regular.otf +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/LICENSE.txt +339 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/README.txt +123 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/example.html +464 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.eot +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.svg +135 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.ttf +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.woff +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/genericons/genericons.css +197 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/header.php +51 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/image.php +82 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line-2x.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line-light-2x.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line-light.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/dotted-line.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/circle-thumbnail.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/circle.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/diamond-thumbnail.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/diamond.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/star-thumbnail.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/headers/star.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/search-icon-2x.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/images/search-icon.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/inc/back-compat.php +63 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/inc/custom-header.php +230 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/index.php +38 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/js/functions.js +132 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/js/html5.js +8 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/js/theme-customizer.js +41 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/languages/twentythirteen.pot +336 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/page.php +50 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/rtl.css +766 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/screenshot.png +0 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/search.php +36 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/sidebar-main.php +18 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/sidebar.php +22 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/single.php +28 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/style.css +3227 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/tag.php +43 -0
- data/lib/templates/wordpress/wp-content/themes/twentythirteen/taxonomy-post_format.php +41 -0
- data/lib/templates/wordpress/wp-cron.php +124 -0
- data/lib/templates/wordpress/wp-includes/ID3/getid3.lib.php +1376 -0
- data/lib/templates/wordpress/wp-includes/ID3/getid3.php +1796 -0
- data/lib/templates/wordpress/wp-includes/ID3/license.commercial.txt +27 -0
- data/lib/templates/wordpress/wp-includes/ID3/license.txt +29 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.asf.php +2013 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.flv.php +745 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.matroska.php +1751 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.quicktime.php +2246 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio-video.riff.php +2586 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio.ac3.php +474 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio.dts.php +291 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio.flac.php +443 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio.mp3.php +2012 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.audio.ogg.php +756 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.tag.apetag.php +371 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.tag.id3v1.php +360 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.tag.id3v2.php +3424 -0
- data/lib/templates/wordpress/wp-includes/ID3/module.tag.lyrics3.php +294 -0
- data/lib/templates/wordpress/wp-includes/ID3/readme.txt +604 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Author.php +157 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Cache.php +133 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Cache/Base.php +114 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Cache/DB.php +137 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Cache/File.php +173 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Cache/Memcache.php +183 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Cache/MySQL.php +438 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Caption.php +210 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Category.php +157 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Content/Type/Sniffer.php +332 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Copyright.php +130 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Core.php +57 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Credit.php +156 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Decode/HTML/Entities.php +617 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Enclosure.php +1380 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Exception.php +52 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/File.php +292 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/HTTP/Parser.php +500 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/IRI.php +1238 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Item.php +2964 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Locator.php +372 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Misc.php +2247 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Net/IPv6.php +276 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Parse/Date.php +983 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Parser.php +407 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Rating.php +129 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Registry.php +225 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Restriction.php +155 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Sanitize.php +554 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/Source.php +611 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/XML/Declaration/Parser.php +362 -0
- data/lib/templates/wordpress/wp-includes/SimplePie/gzdecode.php +371 -0
- data/lib/templates/wordpress/wp-includes/Text/Diff.php +450 -0
- data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/native.php +436 -0
- data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/shell.php +162 -0
- data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/string.php +248 -0
- data/lib/templates/wordpress/wp-includes/Text/Diff/Engine/xdiff.php +64 -0
- data/lib/templates/wordpress/wp-includes/Text/Diff/Renderer.php +235 -0
- data/lib/templates/wordpress/wp-includes/Text/Diff/Renderer/inline.php +206 -0
- data/lib/templates/wordpress/wp-includes/admin-bar.php +959 -0
- data/lib/templates/wordpress/wp-includes/atomlib.php +352 -0
- data/lib/templates/wordpress/wp-includes/author-template.php +453 -0
- data/lib/templates/wordpress/wp-includes/bookmark-template.php +298 -0
- data/lib/templates/wordpress/wp-includes/bookmark.php +415 -0
- data/lib/templates/wordpress/wp-includes/cache.php +714 -0
- data/lib/templates/wordpress/wp-includes/canonical.php +587 -0
- data/lib/templates/wordpress/wp-includes/capabilities.php +1575 -0
- data/lib/templates/wordpress/wp-includes/category-template.php +1459 -0
- data/lib/templates/wordpress/wp-includes/category.php +339 -0
- data/lib/templates/wordpress/wp-includes/certificates/ca-bundle.crt +3785 -0
- data/lib/templates/wordpress/wp-includes/class-IXR.php +1111 -0
- data/lib/templates/wordpress/wp-includes/class-feed.php +141 -0
- data/lib/templates/wordpress/wp-includes/class-http.php +2276 -0
- data/lib/templates/wordpress/wp-includes/class-json.php +936 -0
- data/lib/templates/wordpress/wp-includes/class-oembed.php +615 -0
- data/lib/templates/wordpress/wp-includes/class-phpass.php +268 -0
- data/lib/templates/wordpress/wp-includes/class-phpmailer.php +3265 -0
- data/lib/templates/wordpress/wp-includes/class-pop3.php +652 -0
- data/lib/templates/wordpress/wp-includes/class-simplepie.php +3119 -0
- data/lib/templates/wordpress/wp-includes/class-smtp.php +943 -0
- data/lib/templates/wordpress/wp-includes/class-snoopy.php +1256 -0
- data/lib/templates/wordpress/wp-includes/class-wp-admin-bar.php +519 -0
- data/lib/templates/wordpress/wp-includes/class-wp-ajax-response.php +145 -0
- data/lib/templates/wordpress/wp-includes/class-wp-customize-control.php +1378 -0
- data/lib/templates/wordpress/wp-includes/class-wp-customize-manager.php +1591 -0
- data/lib/templates/wordpress/wp-includes/class-wp-customize-panel.php +333 -0
- data/lib/templates/wordpress/wp-includes/class-wp-customize-section.php +453 -0
- data/lib/templates/wordpress/wp-includes/class-wp-customize-setting.php +629 -0
- data/lib/templates/wordpress/wp-includes/class-wp-customize-widgets.php +1549 -0
- data/lib/templates/wordpress/wp-includes/class-wp-editor.php +1492 -0
- data/lib/templates/wordpress/wp-includes/class-wp-embed.php +357 -0
- data/lib/templates/wordpress/wp-includes/class-wp-error.php +219 -0
- data/lib/templates/wordpress/wp-includes/class-wp-http-ixr-client.php +108 -0
- data/lib/templates/wordpress/wp-includes/class-wp-image-editor-gd.php +470 -0
- data/lib/templates/wordpress/wp-includes/class-wp-image-editor-imagick.php +516 -0
- data/lib/templates/wordpress/wp-includes/class-wp-image-editor.php +485 -0
- data/lib/templates/wordpress/wp-includes/class-wp-theme.php +1237 -0
- data/lib/templates/wordpress/wp-includes/class-wp-walker.php +416 -0
- data/lib/templates/wordpress/wp-includes/class-wp-xmlrpc-server.php +5935 -0
- data/lib/templates/wordpress/wp-includes/class-wp.php +714 -0
- data/lib/templates/wordpress/wp-includes/class.wp-dependencies.php +509 -0
- data/lib/templates/wordpress/wp-includes/class.wp-scripts.php +284 -0
- data/lib/templates/wordpress/wp-includes/class.wp-styles.php +248 -0
- data/lib/templates/wordpress/wp-includes/comment-template.php +2421 -0
- data/lib/templates/wordpress/wp-includes/comment.php +3066 -0
- data/lib/templates/wordpress/wp-includes/compat.php +149 -0
- data/lib/templates/wordpress/wp-includes/cron.php +470 -0
- data/lib/templates/wordpress/wp-includes/css/admin-bar-rtl.css +1123 -0
- data/lib/templates/wordpress/wp-includes/css/admin-bar-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/admin-bar.css +1123 -0
- data/lib/templates/wordpress/wp-includes/css/admin-bar.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/buttons-rtl.css +360 -0
- data/lib/templates/wordpress/wp-includes/css/buttons-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/buttons.css +360 -0
- data/lib/templates/wordpress/wp-includes/css/buttons.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/dashicons.css +958 -0
- data/lib/templates/wordpress/wp-includes/css/dashicons.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/editor-rtl.css +2143 -0
- data/lib/templates/wordpress/wp-includes/css/editor-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/editor.css +2143 -0
- data/lib/templates/wordpress/wp-includes/css/editor.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog-rtl.css +362 -0
- data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog-rtl.min.css +17 -0
- data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog.css +362 -0
- data/lib/templates/wordpress/wp-includes/css/jquery-ui-dialog.min.css +17 -0
- data/lib/templates/wordpress/wp-includes/css/media-views-rtl.css +2601 -0
- data/lib/templates/wordpress/wp-includes/css/media-views-rtl.min.css +8 -0
- data/lib/templates/wordpress/wp-includes/css/media-views.css +2601 -0
- data/lib/templates/wordpress/wp-includes/css/media-views.min.css +8 -0
- data/lib/templates/wordpress/wp-includes/css/wp-auth-check-rtl.css +109 -0
- data/lib/templates/wordpress/wp-includes/css/wp-auth-check-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/wp-auth-check.css +109 -0
- data/lib/templates/wordpress/wp-includes/css/wp-auth-check.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/wp-pointer-rtl.css +212 -0
- data/lib/templates/wordpress/wp-includes/css/wp-pointer-rtl.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/css/wp-pointer.css +212 -0
- data/lib/templates/wordpress/wp-includes/css/wp-pointer.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/date.php +1013 -0
- data/lib/templates/wordpress/wp-includes/default-constants.php +323 -0
- data/lib/templates/wordpress/wp-includes/default-filters.php +392 -0
- data/lib/templates/wordpress/wp-includes/default-widgets.php +1479 -0
- data/lib/templates/wordpress/wp-includes/deprecated.php +3493 -0
- data/lib/templates/wordpress/wp-includes/feed-atom-comments.php +115 -0
- data/lib/templates/wordpress/wp-includes/feed-atom.php +87 -0
- data/lib/templates/wordpress/wp-includes/feed-rdf.php +85 -0
- data/lib/templates/wordpress/wp-includes/feed-rss.php +46 -0
- data/lib/templates/wordpress/wp-includes/feed-rss2-comments.php +101 -0
- data/lib/templates/wordpress/wp-includes/feed-rss2.php +117 -0
- data/lib/templates/wordpress/wp-includes/feed.php +651 -0
- data/lib/templates/wordpress/wp-includes/fonts/dashicons.eot +0 -0
- data/lib/templates/wordpress/wp-includes/fonts/dashicons.svg +253 -0
- data/lib/templates/wordpress/wp-includes/fonts/dashicons.ttf +0 -0
- data/lib/templates/wordpress/wp-includes/fonts/dashicons.woff +0 -0
- data/lib/templates/wordpress/wp-includes/formatting.php +4377 -0
- data/lib/templates/wordpress/wp-includes/functions.php +4847 -0
- data/lib/templates/wordpress/wp-includes/functions.wp-scripts.php +296 -0
- data/lib/templates/wordpress/wp-includes/functions.wp-styles.php +222 -0
- data/lib/templates/wordpress/wp-includes/general-template.php +3159 -0
- data/lib/templates/wordpress/wp-includes/http.php +552 -0
- data/lib/templates/wordpress/wp-includes/images/admin-bar-sprite-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/admin-bar-sprite.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/arrow-pointer-blue-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/arrow-pointer-blue.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/blank.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/archive.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/audio.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/code.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/default.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/document.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/interactive.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/license.txt +9 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/spreadsheet.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/text.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/crystal/video.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/down_arrow-2x.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/down_arrow.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/icon-pointer-flag-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/icon-pointer-flag.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/archive.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/audio.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/code.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/default.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/document.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/interactive.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/spreadsheet.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/text.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/media/video.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/rss-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/rss.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/frownie.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_arrow.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_biggrin.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_confused.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_cool.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_cry.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_eek.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_evil.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_exclaim.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_idea.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_lol.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_mad.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_mrgreen.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_neutral.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_question.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_razz.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_redface.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_rolleyes.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_sad.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_smile.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_surprised.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_twisted.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/icon_wink.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/mrgreen.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/rolleyes.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/smilies/simple-smile.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/spinner-2x.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/spinner.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/toggle-arrow-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/toggle-arrow.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/uploader-icons-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/uploader-icons.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/wlw/wp-comments.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/wlw/wp-icon.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/wlw/wp-watermark.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/wpicons-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/wpicons.png +0 -0
- data/lib/templates/wordpress/wp-includes/images/wpspin-2x.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/wpspin.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/xit-2x.gif +0 -0
- data/lib/templates/wordpress/wp-includes/images/xit.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/admin-bar.js +379 -0
- data/lib/templates/wordpress/wp-includes/js/admin-bar.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/autosave.js +591 -0
- data/lib/templates/wordpress/wp-includes/js/autosave.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/backbone.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/colorpicker.js +707 -0
- data/lib/templates/wordpress/wp-includes/js/colorpicker.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/comment-reply.js +47 -0
- data/lib/templates/wordpress/wp-includes/js/comment-reply.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/crop/cropper.css +165 -0
- data/lib/templates/wordpress/wp-includes/js/crop/cropper.js +516 -0
- data/lib/templates/wordpress/wp-includes/js/crop/marqueeHoriz.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/crop/marqueeVert.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/customize-base.js +647 -0
- data/lib/templates/wordpress/wp-includes/js/customize-base.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/customize-loader.js +259 -0
- data/lib/templates/wordpress/wp-includes/js/customize-loader.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/customize-models.js +247 -0
- data/lib/templates/wordpress/wp-includes/js/customize-models.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/customize-preview-widgets.js +129 -0
- data/lib/templates/wordpress/wp-includes/js/customize-preview-widgets.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/customize-preview.js +171 -0
- data/lib/templates/wordpress/wp-includes/js/customize-preview.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/customize-views.js +231 -0
- data/lib/templates/wordpress/wp-includes/js/customize-views.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/heartbeat.js +750 -0
- data/lib/templates/wordpress/wp-includes/js/heartbeat.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/hoverIntent.js +115 -0
- data/lib/templates/wordpress/wp-includes/js/hoverIntent.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/imgareaselect/border-anim-h.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/imgareaselect/border-anim-v.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/imgareaselect/imgareaselect.css +41 -0
- data/lib/templates/wordpress/wp-includes/js/imgareaselect/jquery.imgareaselect.js +1205 -0
- data/lib/templates/wordpress/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/jcrop/Jcrop.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/jcrop/jquery.Jcrop.min.css +29 -0
- data/lib/templates/wordpress/wp-includes/js/jcrop/jquery.Jcrop.min.js +22 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery-migrate.js +521 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery-migrate.min.js +2 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.color.min.js +2 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.form.js +1193 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.form.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.hotkeys.js +134 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.hotkeys.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.js +5 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.masonry.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.query.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.schedule.js +36 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.serialize-object.js +31 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.table-hotkeys.js +99 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.table-hotkeys.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/jquery.ui.touch-punch.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/suggest.js +316 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/suggest.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/accordion.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/autocomplete.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/button.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/core.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/datepicker.min.js +12 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/dialog.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/draggable.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/droppable.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-blind.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-bounce.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-clip.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-drop.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-explode.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-fade.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-fold.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-highlight.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-puff.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-pulsate.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-scale.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-shake.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-size.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-slide.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect-transfer.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/effect.min.js +21 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/menu.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/mouse.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/position.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/progressbar.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/resizable.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/selectable.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/selectmenu.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/slider.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/sortable.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/spinner.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/tabs.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/tooltip.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/jquery/ui/widget.min.js +11 -0
- data/lib/templates/wordpress/wp-includes/js/json2.js +480 -0
- data/lib/templates/wordpress/wp-includes/js/json2.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/masonry.min.js +17 -0
- data/lib/templates/wordpress/wp-includes/js/mce-view.js +881 -0
- data/lib/templates/wordpress/wp-includes/js/mce-view.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/media-audiovideo.js +934 -0
- data/lib/templates/wordpress/wp-includes/js/media-audiovideo.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/media-editor.js +1114 -0
- data/lib/templates/wordpress/wp-includes/js/media-editor.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/media-grid.js +863 -0
- data/lib/templates/wordpress/wp-includes/js/media-grid.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/media-models.js +1503 -0
- data/lib/templates/wordpress/wp-includes/js/media-models.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/media-views.js +8421 -0
- data/lib/templates/wordpress/wp-includes/js/media-views.min.js +4 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/background.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/bigplay.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/bigplay.svg +1 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/controls.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/controls.svg +1 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/flashmediaelement.swf +0 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/froogaloop.min.js +4 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/loading.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/mediaelement-and-player.min.js +28 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/mediaelementplayer.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/silverlightmediaelement.xap +0 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/skipback.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/wp-mediaelement.css +308 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/wp-mediaelement.js +34 -0
- data/lib/templates/wordpress/wp-includes/js/mediaelement/wp-playlist.js +175 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/handlers.js +488 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/handlers.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/license.txt +339 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/plupload.flash.swf +0 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/plupload.full.min.js +28 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/plupload.silverlight.xap +0 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/wp-plupload.js +424 -0
- data/lib/templates/wordpress/wp-includes/js/plupload/wp-plupload.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/quicktags.js +683 -0
- data/lib/templates/wordpress/wp-includes/js/quicktags.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/shortcode.js +356 -0
- data/lib/templates/wordpress/wp-includes/js/shortcode.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/swfobject.js +4 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/handlers.js +376 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/handlers.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/license.txt +32 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.cookies.js +53 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.queue.js +98 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.speed.js +342 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/plugins/swfupload.swfobject.js +105 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/swfupload.js +980 -0
- data/lib/templates/wordpress/wp-includes/js/swfupload/swfupload.swf +0 -0
- data/lib/templates/wordpress/wp-includes/js/thickbox/loadingAnimation.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/thickbox/macFFBgHack.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/thickbox/thickbox.css +138 -0
- data/lib/templates/wordpress/wp-includes/js/thickbox/thickbox.js +314 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/langs/wp-langs-en.js +519 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/license.txt +504 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/charmap/plugin.js +396 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +112 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css +212 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/compat3x/plugin.js +304 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/directionality/plugin.js +64 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/fullscreen/plugin.js +136 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/hr/plugin.js +30 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/hr/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/image/plugin.js +568 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/image/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/lists/plugin.js +813 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/lists/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/media/moxieplayer.swf +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/media/plugin.js +782 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/media/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/paste/plugin.js +1606 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/paste/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +120 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/textcolor/plugin.js +282 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wordpress/plugin.js +754 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +207 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +92 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpdialogs/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +976 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpemoji/plugin.js +128 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpemoji/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js +76 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +112 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpgallery/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wplink/plugin.js +50 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wplink/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.js +738 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/content.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +62 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg +63 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/object.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/lightgray/skin.min.css +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/audio.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/embedded.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/gallery.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/more-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/more.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/pagebreak-2x.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/pagebreak.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/playlist-audio.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/playlist-video.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/images/video.png +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/skins/wordpress/wp-content.css +539 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/themes/modern/theme.js +617 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/themes/modern/theme.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/tiny_mce_popup.js +542 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/tinymce.min.js +14 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/utils/editable_selects.js +70 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/utils/form_utils.js +210 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/utils/mctabs.js +164 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/utils/validate.js +252 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/wp-mce-help.php +142 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/wp-tinymce.js.gz +0 -0
- data/lib/templates/wordpress/wp-includes/js/tinymce/wp-tinymce.php +39 -0
- data/lib/templates/wordpress/wp-includes/js/tw-sack.js +193 -0
- data/lib/templates/wordpress/wp-includes/js/tw-sack.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/twemoji.js +542 -0
- data/lib/templates/wordpress/wp-includes/js/twemoji.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/underscore.min.js +5 -0
- data/lib/templates/wordpress/wp-includes/js/utils.js +197 -0
- data/lib/templates/wordpress/wp-includes/js/utils.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-a11y.js +46 -0
- data/lib/templates/wordpress/wp-includes/js/wp-a11y.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-ajax-response.js +64 -0
- data/lib/templates/wordpress/wp-includes/js/wp-ajax-response.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-auth-check.js +114 -0
- data/lib/templates/wordpress/wp-includes/js/wp-auth-check.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-backbone.js +386 -0
- data/lib/templates/wordpress/wp-includes/js/wp-backbone.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-emoji-loader.js +76 -0
- data/lib/templates/wordpress/wp-includes/js/wp-emoji-loader.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-emoji-release.min.js +4 -0
- data/lib/templates/wordpress/wp-includes/js/wp-emoji.js +170 -0
- data/lib/templates/wordpress/wp-includes/js/wp-emoji.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-list-revisions.js +24 -0
- data/lib/templates/wordpress/wp-includes/js/wp-list-revisions.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-lists.js +469 -0
- data/lib/templates/wordpress/wp-includes/js/wp-lists.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-pointer.js +282 -0
- data/lib/templates/wordpress/wp-includes/js/wp-pointer.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wp-util.js +112 -0
- data/lib/templates/wordpress/wp-includes/js/wp-util.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wpdialog.js +19 -0
- data/lib/templates/wordpress/wp-includes/js/wpdialog.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/wplink.js +707 -0
- data/lib/templates/wordpress/wp-includes/js/wplink.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/zxcvbn-async.js +18 -0
- data/lib/templates/wordpress/wp-includes/js/zxcvbn-async.min.js +1 -0
- data/lib/templates/wordpress/wp-includes/js/zxcvbn.min.js +47 -0
- data/lib/templates/wordpress/wp-includes/kses.php +1543 -0
- data/lib/templates/wordpress/wp-includes/l10n.php +956 -0
- data/lib/templates/wordpress/wp-includes/link-template.php +3631 -0
- data/lib/templates/wordpress/wp-includes/load.php +828 -0
- data/lib/templates/wordpress/wp-includes/locale.php +365 -0
- data/lib/templates/wordpress/wp-includes/media-template.php +1250 -0
- data/lib/templates/wordpress/wp-includes/media.php +3440 -0
- data/lib/templates/wordpress/wp-includes/meta.php +1667 -0
- data/lib/templates/wordpress/wp-includes/ms-blogs.php +946 -0
- data/lib/templates/wordpress/wp-includes/ms-default-constants.php +153 -0
- data/lib/templates/wordpress/wp-includes/ms-default-filters.php +87 -0
- data/lib/templates/wordpress/wp-includes/ms-deprecated.php +349 -0
- data/lib/templates/wordpress/wp-includes/ms-files.php +82 -0
- data/lib/templates/wordpress/wp-includes/ms-functions.php +2433 -0
- data/lib/templates/wordpress/wp-includes/ms-load.php +472 -0
- data/lib/templates/wordpress/wp-includes/ms-settings.php +213 -0
- data/lib/templates/wordpress/wp-includes/nav-menu-template.php +675 -0
- data/lib/templates/wordpress/wp-includes/nav-menu.php +900 -0
- data/lib/templates/wordpress/wp-includes/option.php +1462 -0
- data/lib/templates/wordpress/wp-includes/pluggable-deprecated.php +192 -0
- data/lib/templates/wordpress/wp-includes/pluggable.php +2347 -0
- data/lib/templates/wordpress/wp-includes/plugin.php +907 -0
- data/lib/templates/wordpress/wp-includes/pomo/entry.php +78 -0
- data/lib/templates/wordpress/wp-includes/pomo/mo.php +265 -0
- data/lib/templates/wordpress/wp-includes/pomo/po.php +408 -0
- data/lib/templates/wordpress/wp-includes/pomo/streams.php +241 -0
- data/lib/templates/wordpress/wp-includes/pomo/translations.php +324 -0
- data/lib/templates/wordpress/wp-includes/post-formats.php +232 -0
- data/lib/templates/wordpress/wp-includes/post-template.php +1831 -0
- data/lib/templates/wordpress/wp-includes/post-thumbnail-template.php +160 -0
- data/lib/templates/wordpress/wp-includes/post.php +5937 -0
- data/lib/templates/wordpress/wp-includes/query.php +4725 -0
- data/lib/templates/wordpress/wp-includes/registration-functions.php +7 -0
- data/lib/templates/wordpress/wp-includes/registration.php +7 -0
- data/lib/templates/wordpress/wp-includes/revision.php +657 -0
- data/lib/templates/wordpress/wp-includes/rewrite.php +2195 -0
- data/lib/templates/wordpress/wp-includes/rss-functions.php +9 -0
- data/lib/templates/wordpress/wp-includes/rss.php +936 -0
- data/lib/templates/wordpress/wp-includes/script-loader.php +1090 -0
- data/lib/templates/wordpress/wp-includes/session.php +439 -0
- data/lib/templates/wordpress/wp-includes/shortcodes.php +404 -0
- data/lib/templates/wordpress/wp-includes/taxonomy.php +4726 -0
- data/lib/templates/wordpress/wp-includes/template-loader.php +76 -0
- data/lib/templates/wordpress/wp-includes/template.php +505 -0
- data/lib/templates/wordpress/wp-includes/theme-compat/comments-popup.php +131 -0
- data/lib/templates/wordpress/wp-includes/theme-compat/comments.php +114 -0
- data/lib/templates/wordpress/wp-includes/theme-compat/footer.php +30 -0
- data/lib/templates/wordpress/wp-includes/theme-compat/header.php +49 -0
- data/lib/templates/wordpress/wp-includes/theme-compat/sidebar.php +83 -0
- data/lib/templates/wordpress/wp-includes/theme.php +2048 -0
- data/lib/templates/wordpress/wp-includes/update.php +692 -0
- data/lib/templates/wordpress/wp-includes/user.php +2462 -0
- data/lib/templates/wordpress/wp-includes/vars.php +144 -0
- data/lib/templates/wordpress/wp-includes/version.php +35 -0
- data/lib/templates/wordpress/wp-includes/widgets.php +1720 -0
- data/lib/templates/wordpress/wp-includes/wlwmanifest.xml +43 -0
- data/lib/templates/wordpress/wp-includes/wp-db.php +2949 -0
- data/lib/templates/wordpress/wp-includes/wp-diff.php +544 -0
- data/lib/templates/wordpress/wp-links-opml.php +80 -0
- data/lib/templates/wordpress/wp-load.php +81 -0
- data/lib/templates/wordpress/wp-login.php +987 -0
- data/lib/templates/wordpress/wp-mail.php +260 -0
- data/lib/templates/wordpress/wp-settings.php +374 -0
- data/lib/templates/wordpress/wp-signup.php +732 -0
- data/lib/templates/wordpress/wp-trackback.php +127 -0
- data/lib/templates/wordpress/xmlrpc.php +101 -0
- metadata +1455 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(a,b){var c,d,e=wp.customize;e.Setting=e.Value.extend({initialize:function(a,b,c){e.Value.prototype.initialize.call(this,b,c),this.id=a,this.transport=this.transport||"refresh",this._dirty=c.dirty||!1,this.bind(this.preview)},preview:function(){switch(this.transport){case"refresh":return this.previewer.refresh();case"postMessage":return this.previewer.send("setting",[this.id,this()])}}}),e.utils={},e.utils.bubbleChildValueChanges=function(a,c){b.each(c,function(b,c){a[c].bind(function(b,c){a.parent&&b!==c&&a.parent.trigger("change",a)})})},d=function(a){var b,c,d;b=this,a=a||{},d=function(){var a;a=b.extended(e.Panel)&&b.expanded()?b.container.find(".control-panel-content:first"):b.container,a.find(":focusable:first").focus(),a[0].scrollIntoView(!0)},a.completeCallback?(c=a.completeCallback,a.completeCallback=function(){d(),c()}):a.completeCallback=d,b.expand?b.expand(a):a.completeCallback()},e.utils.prioritySort=function(a,b){return a.priority()===b.priority()&&"number"==typeof a.params.instanceNumber&&"number"==typeof b.params.instanceNumber?a.params.instanceNumber-b.params.instanceNumber:a.priority()-b.priority()},e.utils.isKeydownButNotEnterEvent=function(a){return"keydown"===a.type&&13!==a.which},e.utils.areElementListsEqual=function(a,c){var d=a.length===c.length&&-1===_.indexOf(_.map(_.zip(a,c),function(a){return b(a[0]).is(a[1])}),!1);return d},c=e.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){var d=this;d.id=a,d.params={},b.extend(d,c||{}),d.container=b(d.params.content),d.deferred={embedded:new b.Deferred},d.priority=new e.Value,d.active=new e.Value,d.activeArgumentsQueue=[],d.expanded=new e.Value,d.expandedArgumentsQueue=[],d.active.bind(function(a){var c=d.activeArgumentsQueue.shift();c=b.extend({},d.defaultActiveArguments,c),a=a&&d.isContextuallyActive(),d.onChangeActive(a,c)}),d.expanded.bind(function(a){var c=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.attachEvents(),e.utils.bubbleChildValueChanges(d,["priority","active"]),d.priority.set(isNaN(d.params.priority)?100:d.params.priority),d.active.set(d.params.active),d.expanded.set(!1)},ready:function(){},_children:function(a,b){var c=this,d=[];return e[b].each(function(b){b[a].get()===c.id&&d.push(b)}),d.sort(e.utils.prioritySort),d},isContextuallyActive:function(){throw new Error("Container.isContextuallyActive() must be overridden in a subclass.")},onChangeActive:function(a,c){var d="resolved"===e.previewer.deferred.active.state()?c.duration:0;b.contains(document,this.container)?a?this.container.stop(!0,!0).slideDown(d,c.completeCallback):this.container.stop(!0,!0).slideUp(d,c.completeCallback):(this.container.toggle(a),c.completeCallback&&c.completeCallback())},_toggleActive:function(a,b){var c=this;return b=b||{},a&&this.active.get()||!a&&!this.active.get()?(b.unchanged=!0,c.onChangeActive(c.active.get(),b),!1):(b.unchanged=!1,this.activeArgumentsQueue.push(b),this.active.set(a),!0)},activate:function(a){return this._toggleActive(!0,a)},deactivate:function(a){return this._toggleActive(!1,a)},onChangeExpanded:function(){throw new Error("Must override with subclass.")},_toggleExpanded:function(a,b){var c=this;b=b||{};var d=this,e=b.completeCallback;return b.completeCallback=function(){e&&e.apply(d,arguments),d.container.trigger(a?"expanded":"collapsed")},a&&this.expanded.get()||!a&&!this.expanded.get()?(b.unchanged=!0,c.onChangeExpanded(c.expanded.get(),b),!1):(b.unchanged=!1,this.expandedArgumentsQueue.push(b),this.expanded.set(a),!0)},expand:function(a){return this._toggleExpanded(!0,a)},collapse:function(a){return this._toggleExpanded(!1,a)},focus:d}),e.Section=c.extend({initialize:function(a,d){var f=this;c.prototype.initialize.call(f,a,d),f.id=a,f.panel=new e.Value,f.panel.bind(function(a){b(f.container).toggleClass("control-subsection",!!a)}),f.panel.set(f.params.panel||""),e.utils.bubbleChildValueChanges(f,["panel"]),f.embed(),f.deferred.embedded.done(function(){f.ready()})},embed:function(){var a,c=this;a=function(a){var d;a?e.panel(a,function(a){a.deferred.embedded.done(function(){d=a.container.find("ul:first"),c.container.parent().is(d)||d.append(c.container),c.deferred.embedded.resolve()})}):(d=b("#customize-theme-controls").children("ul"),c.container.parent().is(d)||d.append(c.container),c.deferred.embedded.resolve())},c.panel.bind(a),a(c.panel.get())},attachEvents:function(){var a=this;a.container.find(".accordion-section-title").on("click keydown",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),a.expanded()?a.collapse():a.expand())})},isContextuallyActive:function(){var a=this,b=a.controls(),c=0;return _(b).each(function(a){a.active()&&(c+=1)}),0!==c},controls:function(){return this._children("section","control")},onChangeExpanded:function(a,b){var c,d=this,f=d.container.find(".accordion-section-content");a?(c=b.unchanged?b.completeCallback:function(){f.stop().slideDown(b.duration,b.completeCallback),d.container.addClass("open")},b.allowMultiple||e.section.each(function(a){a!==d&&a.collapse({duration:b.duration})}),d.panel()?e.panel(d.panel()).expand({duration:b.duration,completeCallback:c}):c()):(d.container.removeClass("open"),f.slideUp(b.duration,b.completeCallback))}}),e.ThemesSection=e.Section.extend({currentTheme:"",overlay:"",template:"",screenshotQueue:null,$window:b(window),initialize:function(){return this.$customizeSidebar=b(".wp-full-overlay-sidebar-content:first"),e.Section.prototype.initialize.apply(this,arguments)},ready:function(){var a=this;a.overlay=a.container.find(".theme-overlay"),a.template=wp.template("customize-themes-details-view"),b("body").on("keyup",function(b){a.overlay.find(".theme-wrap").is(":visible")&&(39===b.keyCode&&a.nextTheme(),37===b.keyCode&&a.previousTheme(),27===b.keyCode&&a.closeDetails())}),_.bindAll(this,"renderScreenshots")},isContextuallyActive:function(){return this.active()},attachEvents:function(){var a=this;a.container.find(".change-theme, .customize-theme").on("click keydown",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),a.expanded()?a.collapse():a.expand())}),a.container.on("click keydown",".left",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),a.previousTheme())}),a.container.on("click keydown",".right",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),a.nextTheme())}),a.container.on("click keydown",".theme-backdrop, .close",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),a.closeDetails())});var b=_.throttle(_.bind(a.renderScreenshots,this),100);a.container.on("input","#themes-filter",function(c){var d,e=c.currentTarget.value.toLowerCase().trim().replace("-"," "),f=a.controls();_.each(f,function(a){a.filter(e)}),b(),d=a.container.find("li.customize-control:visible").length,a.container.find(".theme-count").text(d)}),e.bind("ready",function(){_.each(a.controls().slice(0,3),function(a){var b,c=a.params.theme.screenshot[0];c&&(b=new Image,b.src=c)})})},onChangeExpanded:function(a,c){if(c.unchanged)return void(c.completeCallback&&c.completeCallback());var d,f,g=this,h=g.container.closest(".accordion-section"),i=h.closest(".wp-full-overlay"),j=h.closest(".wp-full-overlay-sidebar-content"),k=j.find(".open"),l=i.find("#customize-theme-controls > ul > .accordion-section > .accordion-section-title").add("#customize-info > .accordion-section-title"),m=h.find(".customize-theme"),n=h.find(".change-theme"),o=h.find(".control-panel-content");a?(e.section.each(function(a){a!==g&&a.collapse({duration:c.duration})}),e.panel.each(function(a){a.collapse({duration:0})}),o.show(0,function(){d=o.offset().top,f=j.scrollTop(),o.css("margin-top",b("#customize-header-actions").height()-d-f),h.addClass("current-panel"),i.addClass("in-themes-panel"),j.scrollTop(0),_.delay(g.renderScreenshots,10),g.$customizeSidebar.on("scroll.customize-themes-section",_.throttle(g.renderScreenshots,300)),c.completeCallback&&c.completeCallback()}),l.attr("tabindex","-1"),n.attr("tabindex","-1"),m.focus()):(k.removeClass("open"),h.removeClass("current-panel"),i.removeClass("in-themes-panel"),g.$customizeSidebar.off("scroll.customize-themes-section"),o.delay(180).hide(0,function(){o.css("margin-top","inherit"),c.completeCallback&&c.completeCallback()}),l.attr("tabindex","0"),m.attr("tabindex","0"),n.focus(),j.scrollTop(0))},renderScreenshots:function(){var a=this;null===a.screenshotQueue&&(a.screenshotQueue=a.controls()),a.screenshotQueue.length&&(a.screenshotQueue=_.filter(a.screenshotQueue,function(b){var c=b.container.find(".theme-screenshot"),d=c.find("img");if(!d.length)return!1;if(d.is(":hidden"))return!0;var e=a.$window.scrollTop(),f=e+a.$window.height(),g=d.offset().top,h=c.height(),i=g+h,j=3*h,k=i>=e-j&&f+j>=g;return k&&b.container.trigger("render-screenshot"),!k}))},nextTheme:function(){var a=this;a.getNextTheme()&&a.showDetails(a.getNextTheme(),function(){a.overlay.find(".right").focus()})},getNextTheme:function(){var a,b;return a=e.control("theme_"+this.currentTheme),b=a.container.next("li.customize-control-theme"),b.length?(b=b[0].id.replace("customize-control-",""),a=e.control(b),a.params.theme):!1},previousTheme:function(){var a=this;a.getPreviousTheme()&&a.showDetails(a.getPreviousTheme(),function(){a.overlay.find(".left").focus()})},getPreviousTheme:function(){var a,b;return a=e.control("theme_"+this.currentTheme),b=a.container.prev("li.customize-control-theme"),b.length?(b=b[0].id.replace("customize-control-",""),a=e.control(b),a.params.theme):!1},updateLimits:function(){this.getNextTheme()||this.overlay.find(".right").addClass("disabled"),this.getPreviousTheme()||this.overlay.find(".left").addClass("disabled")},showDetails:function(a,c){var d=this;c=c||function(){},d.currentTheme=a.id,d.overlay.html(d.template(a)).fadeIn("fast").focus(),b("body").addClass("modal-open"),d.containFocus(d.overlay),d.updateLimits(),c()},closeDetails:function(){b("body").removeClass("modal-open"),this.overlay.fadeOut("fast"),e.control("theme_"+this.currentTheme).focus()},containFocus:function(a){var c;a.on("keydown",function(d){return 9===d.keyCode?(c=b(":tabbable",a),c.last()[0]!==d.target||d.shiftKey?c.first()[0]===d.target&&d.shiftKey?(c.last().focus(),!1):void 0:(c.first().focus(),!1)):void 0})}}),e.Panel=c.extend({initialize:function(a,b){var d=this;c.prototype.initialize.call(d,a,b),d.embed(),d.deferred.embedded.done(function(){d.ready()})},embed:function(){var a=this,c=b("#customize-theme-controls > ul");a.container.parent().is(c)||c.append(a.container),a.deferred.embedded.resolve()},attachEvents:function(){var a,b=this;b.container.find(".accordion-section-title").on("click keydown",function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),b.expanded()||b.expand())}),a=b.container.find(".panel-meta:first"),a.find("> .accordion-section-title").on("click keydown",function(c){if(!e.utils.isKeydownButNotEnterEvent(c)&&(c.preventDefault(),!a.hasClass("cannot-expand"))){var d=a.find(".accordion-section-content:first");a.hasClass("open")?(a.toggleClass("open"),d.slideUp(b.defaultExpandedArguments.duration)):(d.slideDown(b.defaultExpandedArguments.duration),a.toggleClass("open"))}})},sections:function(){return this._children("panel","section")},isContextuallyActive:function(){var a=this,b=a.sections(),c=0;return _(b).each(function(a){a.active()&&a.isContextuallyActive()&&(c+=1)}),0!==c},onChangeExpanded:function(a,c){if(c.unchanged)return void(c.completeCallback&&c.completeCallback());var d,f,g=this,h=g.container.closest(".accordion-section"),i=h.closest(".wp-full-overlay"),j=h.closest(".wp-full-overlay-sidebar-content"),k=j.find(".open"),l=i.find("#customize-theme-controls > ul > .accordion-section > .accordion-section-title").add("#customize-info > .accordion-section-title"),m=i.find(".control-panel-back"),n=h.find(".accordion-section-title").first(),o=h.find(".control-panel-content");a?(e.section.each(function(a){a.panel()||a.collapse({duration:0})}),e.panel.each(function(a){g!==a&&a.collapse({duration:0})}),o.show(0,function(){o.parent().show(),d=o.offset().top,f=j.scrollTop(),o.css("margin-top",b("#customize-header-actions").height()-d-f),h.addClass("current-panel"),i.addClass("in-sub-panel"),j.scrollTop(0),c.completeCallback&&c.completeCallback()}),l.attr("tabindex","-1"),m.attr("tabindex","0"),m.focus()):(k.removeClass("open"),h.removeClass("current-panel"),i.removeClass("in-sub-panel"),o.delay(180).hide(0,function(){o.css("margin-top","inherit"),c.completeCallback&&c.completeCallback()}),l.attr("tabindex","0"),m.attr("tabindex","-1"),n.focus(),j.scrollTop(0))}}),e.Control=e.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){var d,f,g,h=this;h.params={},b.extend(h,c||{}),h.id=a,h.selector="#customize-control-"+a.replace(/\]/g,"").replace(/\[/g,"-"),h.templateSelector="customize-control-"+h.params.type+"-content",h.container=b(h.params.content?h.params.content:h.selector),h.deferred={embedded:new b.Deferred},h.section=new e.Value,h.priority=new e.Value,h.active=new e.Value,h.activeArgumentsQueue=[],h.elements=[],d=h.container.find("[data-customize-setting-link]"),f={},d.each(function(){var a,c=b(this);if(c.is(":radio")){if(a=c.prop("name"),f[a])return;f[a]=!0,c=d.filter('[name="'+a+'"]')}e(c.data("customizeSettingLink"),function(a){var b=new e.Element(c);h.elements.push(b),b.sync(a),b.set(a())})}),h.active.bind(function(a){var c=h.activeArgumentsQueue.shift();c=b.extend({},h.defaultActiveArguments,c),h.onChangeActive(a,c)}),h.section.set(h.params.section),h.priority.set(isNaN(h.params.priority)?10:h.params.priority),h.active.set(h.params.active),e.utils.bubbleChildValueChanges(h,["section","priority","active"]),g=b.map(h.params.settings,function(a){return a}),e.apply(e,g.concat(function(){var a;h.settings={};for(a in h.params.settings)h.settings[a]=e(h.params.settings[a]);h.setting=h.settings["default"]||null,h.embed()})),h.deferred.embedded.done(function(){h.ready()})},embed:function(){var a,b=this;a=function(a){var c;a&&e.section(a,function(a){a.deferred.embedded.done(function(){c=a.container.find("ul:first"),b.container.parent().is(c)||(c.append(b.container),b.renderContent()),b.deferred.embedded.resolve()})})},b.section.bind(a),a(b.section.get())},ready:function(){},expand:function(a){e.section(this.section()).expand(a)},focus:d,onChangeActive:function(a,c){b.contains(document,this.container)?a?this.container.slideDown(c.duration,c.completeCallback):this.container.slideUp(c.duration,c.completeCallback):(this.container.toggle(a),c.completeCallback&&c.completeCallback())},toggle:function(a){return this.onChangeActive(a,this.defaultActiveArguments)},activate:c.prototype.activate,deactivate:c.prototype.deactivate,_toggleActive:c.prototype._toggleActive,dropdownInit:function(){var a=this,b=this.container.find(".dropdown-status"),c=this.params,d=!1,f=function(a){"string"==typeof a&&c.statuses&&c.statuses[a]?b.html(c.statuses[a]).show():b.hide()};this.container.on("click keydown",".dropdown",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),d||a.container.toggleClass("open"),a.container.hasClass("open")&&a.container.parent().parent().find("li.library-selected").focus(),d=!0,setTimeout(function(){d=!1},400))}),this.setting.bind(f),f(this.setting())},renderContent:function(){var a,c=this;0!==b("#tmpl-"+c.templateSelector).length&&(a=wp.template(c.templateSelector),a&&c.container&&c.container.html(a(c.params)))}}),e.ColorControl=e.Control.extend({ready:function(){var a=this,b=this.container.find(".color-picker-hex");b.val(a.setting()).wpColorPicker({change:function(){a.setting.set(b.wpColorPicker("color"))},clear:function(){a.setting.set(!1)}}),this.setting.bind(function(a){b.val(a),b.wpColorPicker("color",a)})}}),e.MediaControl=e.Control.extend({ready:function(){var a=this;_.bindAll(a,"restoreDefault","removeFile","openFrame","select","pausePlayer"),a.container.on("click keydown",".upload-button",a.openFrame),a.container.on("click keydown",".upload-button",a.pausePlayer),a.container.on("click keydown",".thumbnail-image img",a.openFrame),a.container.on("click keydown",".default-button",a.restoreDefault),a.container.on("click keydown",".remove-button",a.pausePlayer),a.container.on("click keydown",".remove-button",a.removeFile),a.container.on("click keydown",".remove-button",a.cleanupPlayer),e.section(a.section()).container.on("expanded",function(){a.player&&a.player.setControlsSize()}).on("collapsed",function(){a.pausePlayer()}),a.setting.bind(function(){a.renderContent()})},pausePlayer:function(){this.player&&this.player.pause()},cleanupPlayer:function(){this.player&&wp.media.mixin.removePlayer(this.player)},openFrame:function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.frame||this.initFrame(),this.frame.open())},initFrame:function(){this.frame=wp.media({button:{text:this.params.button_labels.frame_button},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:this.params.mime_type}),multiple:!1,date:!1})]}),this.frame.on("select",this.select)},select:function(){var a,b=this.frame.state().get("selection").first().toJSON(),c=window._wpmejsSettings||{};this.params.attachment=b,this.setting(b.id),a=this.container.find("audio, video").get(0),a?this.player=new MediaElementPlayer(a,c):this.cleanupPlayer()},restoreDefault:function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment=this.params.defaultAttachment,this.setting(this.params.defaultAttachment.url))},removeFile:function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent())}}),e.UploadControl=e.MediaControl.extend({select:function(){var a,b=this.frame.state().get("selection").first().toJSON(),c=window._wpmejsSettings||{};this.params.attachment=b,this.setting(b.url),a=this.container.find("audio, video").get(0),a?this.player=new MediaElementPlayer(a,c):this.cleanupPlayer()},success:function(){},removerVisibility:function(){}}),e.ImageControl=e.UploadControl.extend({thumbnailSrc:function(){}}),e.BackgroundControl=e.UploadControl.extend({ready:function(){e.UploadControl.prototype.ready.apply(this,arguments)},select:function(){e.UploadControl.prototype.select.apply(this,arguments),wp.ajax.post("custom-background-add",{nonce:_wpCustomizeBackground.nonces.add,wp_customize:"on",theme:e.settings.theme.stylesheet,attachment_id:this.params.attachment.id})}}),e.HeaderControl=e.Control.extend({ready:function(){this.btnRemove=b("#customize-control-header_image .actions .remove"),this.btnNew=b("#customize-control-header_image .actions .new"),_.bindAll(this,"openMedia","removeImage"),this.btnNew.on("click",this.openMedia),this.btnRemove.on("click",this.removeImage),e.HeaderTool.currentHeader=this.getInitialHeaderImage(),new e.HeaderTool.CurrentView({model:e.HeaderTool.currentHeader,el:"#customize-control-header_image .current .container"}),new e.HeaderTool.ChoiceListView({collection:e.HeaderTool.UploadsList=new e.HeaderTool.ChoiceList,el:"#customize-control-header_image .choices .uploaded .list"}),new e.HeaderTool.ChoiceListView({collection:e.HeaderTool.DefaultsList=new e.HeaderTool.DefaultsList,el:"#customize-control-header_image .choices .default .list"}),e.HeaderTool.combinedList=e.HeaderTool.CombinedList=new e.HeaderTool.CombinedList([e.HeaderTool.UploadsList,e.HeaderTool.DefaultsList])},getInitialHeaderImage:function(){if(!e.get().header_image||!e.get().header_image_data||_.contains(["remove-header","random-default-image","random-uploaded-image"],e.get().header_image))return new e.HeaderTool.ImageModel;var a=_.find(_wpCustomizeHeader.uploads,function(a){return a.attachment_id===e.get().header_image_data.attachment_id});return a||(a={url:e.get().header_image,thumbnail_url:e.get().header_image,attachment_id:e.get().header_image_data.attachment_id}),new e.HeaderTool.ImageModel({header:a,choice:a.url.split("/").pop()})},calculateImageSelectOptions:function(a,b){var c,d,f,g,h,i,j=parseInt(_wpCustomizeHeader.data.width,10),k=parseInt(_wpCustomizeHeader.data.height,10),l=!!parseInt(_wpCustomizeHeader.data["flex-width"],10),m=!!parseInt(_wpCustomizeHeader.data["flex-height"],10);return h=a.get("width"),g=a.get("height"),this.headerImage=new e.HeaderTool.ImageModel,this.headerImage.set({themeWidth:j,themeHeight:k,themeFlexWidth:l,themeFlexHeight:m,imageWidth:h,imageHeight:g}),b.set("canSkipCrop",!this.headerImage.shouldBeCropped()),c=j/k,d=h,f=g,d/f>c?(k=f,j=k*c):(j=d,k=j/c),i={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:h,imageHeight:g,x1:0,y1:0,x2:j,y2:k},m===!1&&l===!1&&(i.aspectRatio=j+":"+k),m===!1&&(i.maxHeight=k),l===!1&&(i.maxWidth=j),i},openMedia:function(a){var b=_wpMediaViewsL10n;a.preventDefault(),this.frame=wp.media({button:{text:b.selectAndCrop,close:!1},states:[new wp.media.controller.Library({title:b.chooseImage,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:_wpCustomizeHeader.data.width,suggestedHeight:_wpCustomizeHeader.data.height}),new wp.media.controller.Cropper({imgSelectOptions:this.calculateImageSelectOptions})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this),this.frame.open()},onSelect:function(){this.frame.setState("cropper")},onCropped:function(a){var b=a.post_content,c=a.attachment_id,d=a.width,e=a.height;this.setImageFromURL(b,c,d,e)},onSkippedCrop:function(a){var b=a.get("url"),c=a.get("width"),d=a.get("height");this.setImageFromURL(b,a.id,c,d)},setImageFromURL:function(a,b,c,d){var f,g={};g.url=a,g.thumbnail_url=a,g.timestamp=_.now(),b&&(g.attachment_id=b),c&&(g.width=c),d&&(g.height=d),f=new e.HeaderTool.ImageModel({header:g,choice:a.split("/").pop()}),e.HeaderTool.UploadsList.add(f),e.HeaderTool.currentHeader.set(f.toJSON()),f.save(),f.importImage()},removeImage:function(){e.HeaderTool.currentHeader.trigger("hide"),e.HeaderTool.CombinedList.trigger("control:removeImage")}}),e.ThemeControl=e.Control.extend({touchDrag:!1,isRendered:!1,renderContent:function(){var a=this,b=arguments;e.section(a.section(),function(c){c.expanded()?(e.Control.prototype.renderContent.apply(a,b),a.isRendered=!0):c.expanded.bind(function(c){c&&!a.isRendered&&(e.Control.prototype.renderContent.apply(a,b),a.isRendered=!0)})})},ready:function(){var a=this;a.container.on("touchmove",".theme",function(){a.touchDrag=!0}),a.container.on("click keydown touchend",".theme",function(c){if(!e.utils.isKeydownButNotEnterEvent(c)){if(a.touchDrag===!0)return a.touchDrag=!1;if(!b(c.target).is(".theme-actions .button")){var d=b(this).data("previewUrl");b(".wp-full-overlay").addClass("customize-loading"),window.parent.location=d}}}),a.container.on("click keydown",".theme-actions .theme-details",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),e.section(a.section()).showDetails(a.params.theme))}),a.container.on("render-screenshot",function(){var a=b(this).find("img"),c=a.data("src");c&&a.attr("src",c)})},filter:function(a){var b=this,c=b.params.theme.name+" "+b.params.theme.description+" "+b.params.theme.tags+" "+b.params.theme.author;c=c.toLowerCase().replace("-"," "),-1!==c.search(a)?b.activate():b.deactivate()}}),e.defaultConstructor=e.Setting,e.control=new e.Values({defaultConstructor:e.Control}),e.section=new e.Values({defaultConstructor:e.Section}),e.panel=new e.Values({defaultConstructor:e.Panel}),e.PreviewFrame=e.Messenger.extend({sensitivity:2e3,initialize:function(a,c){var d=b.Deferred();d.promise(this),this.container=a.container,this.signature=a.signature,b.extend(a,{channel:e.PreviewFrame.uuid()}),e.Messenger.prototype.initialize.call(this,a,c),this.add("previewUrl",a.previewUrl),this.query=b.extend(a.query||{},{customize_messenger_channel:this.channel()}),this.run(d)},run:function(a){var c=this,d=!1,f=!1;this._ready&&this.unbind("ready",this._ready),this._ready=function(){f=!0,d&&a.resolveWith(c)},this.bind("ready",this._ready),this.bind("ready",function(a){if(this.container.addClass("iframe-ready"),a){var b={panel:a.activePanels,section:a.activeSections,control:a.activeControls};_(b).each(function(a,b){e[b].each(function(b,c){var d=!(!a||!a[c]);b.active(d)})})}}),this.request=b.ajax(this.previewUrl(),{type:"POST",data:this.query,xhrFields:{withCredentials:!0}}),this.request.fail(function(){a.rejectWith(c,["request failure"])}),this.request.done(function(g){var h,i=c.request.getResponseHeader("Location"),j=c.signature;return i&&i!==c.previewUrl()?void a.rejectWith(c,["redirect",i]):"0"===g?void c.login(a):"-1"===g?void a.rejectWith(c,["cheatin"]):(h=g.lastIndexOf(j),-1===h||h<g.lastIndexOf("</html>")?void a.rejectWith(c,["unsigned"]):(g=g.slice(0,h)+g.slice(h+j.length),c.iframe=b("<iframe />",{title:e.l10n.previewIframeTitle}).appendTo(c.container),c.iframe.one("load",function(){d=!0,f?a.resolveWith(c):setTimeout(function(){a.rejectWith(c,["ready timeout"])},c.sensitivity)}),c.targetWindow(c.iframe[0].contentWindow),c.targetWindow().document.open(),c.targetWindow().document.write(g),void c.targetWindow().document.close()))})},login:function(a){var c,d=this;return c=function(){a.rejectWith(d,["logged out"])},this.triedLogin?c():void b.get(e.settings.url.ajax,{action:"logged-in"}).fail(c).done(function(f){var g;"1"!==f&&c(),g=b("<iframe />",{src:d.previewUrl(),title:e.l10n.previewIframeTitle}).hide(),g.appendTo(d.container),g.load(function(){d.triedLogin=!0,g.remove(),d.run(a)})})},destroy:function(){e.Messenger.prototype.destroy.call(this),this.request.abort(),this.iframe&&this.iframe.remove(),delete this.request,delete this.iframe,delete this.targetWindow}}),function(){var a=0;e.PreviewFrame.uuid=function(){return"preview-"+a++}}(),e.setDocumentTitle=function(a){var b,c;b=e.settings.documentTitleTmpl,c=b.replace("%s",a),document.title=c,e.trigger("title",c)},e.Previewer=e.Messenger.extend({refreshBuffer:250,initialize:function(a,c){var d=this,f=/^https?/;b.extend(this,c||{}),this.deferred={active:b.Deferred()},this.refresh=function(a){var b,c=a.refresh,d=function(){b=null,c.call(a)};return function(){if("number"!=typeof b){if(!a.loading)return d();a.abort()}clearTimeout(b),b=setTimeout(d,a.refreshBuffer)}}(this),this.container=e.ensure(a.container),this.allowedUrls=a.allowedUrls,this.signature=a.signature,a.url=window.location.href,e.Messenger.prototype.initialize.call(this,a),this.add("scheme",this.origin()).link(this.origin).setter(function(a){var b=a.match(f);return b?b[0]:""}),this.add("previewUrl",a.previewUrl).setter(function(a){var c;return/\/wp-admin(\/|$)/.test(a.replace(/[#?].*$/,""))?null:(b.each([a.replace(f,d.scheme()),a],function(a,e){return b.each(d.allowedUrls,function(a,b){var d;return b=b.replace(/\/+$/,""),d=e.replace(b,""),0===e.indexOf(b)&&/^([/#?]|$)/.test(d)?(c=e,!1):void 0}),c?!1:void 0}),c?c:null)}),this.previewUrl.bind(this.refresh),this.scroll=0,this.bind("scroll",function(a){this.scroll=a}),this.bind("url",this.previewUrl),this.bind("documentTitle",function(a){e.setDocumentTitle(a)})},query:function(){},abort:function(){this.loading&&(this.loading.destroy(),delete this.loading)},refresh:function(){var a=this;this.send("loading-initiated"),this.abort(),this.loading=new e.PreviewFrame({url:this.url(),previewUrl:this.previewUrl(),query:this.query()||{},container:this.container,signature:this.signature}),this.loading.done(function(){this.bind("synced",function(){a.preview&&a.preview.destroy(),a.preview=this,delete a.loading,a.targetWindow(this.targetWindow()),a.channel(this.channel()),a.deferred.active.resolve(),a.send("active")}),this.send("sync",{scroll:a.scroll,settings:e.get()})}),this.loading.fail(function(b,c){a.send("loading-failed"),"redirect"===b&&c&&a.previewUrl(c),"logged out"===b&&(a.preview&&(a.preview.destroy(),delete a.preview),a.login().done(a.refresh)),"cheatin"===b&&a.cheatin()})},login:function(){var a,c,d,f=this;return this._login?this._login:(a=b.Deferred(),this._login=a.promise(),c=new e.Messenger({channel:"login",url:e.settings.url.login}),d=b("<iframe />",{src:e.settings.url.login,title:e.l10n.loginIframeTitle}).appendTo(this.container),c.targetWindow(d[0].contentWindow),c.bind("login",function(){var b=f.refreshNonces();b.always(function(){d.remove(),c.destroy(),delete f._login}),b.done(function(){a.resolve()}),b.fail(function(){f.cheatin(),a.reject()})}),this._login)},cheatin:function(){b(document.body).empty().addClass("cheatin").append("<p>"+e.l10n.cheatin+"</p>")},refreshNonces:function(){var a,c=b.Deferred();return c.promise(),a=wp.ajax.post("customize_refresh_nonces",{wp_customize:"on",theme:e.settings.theme.stylesheet}),a.done(function(a){e.trigger("nonce-refresh",a),c.resolve()}),a.fail(function(){c.reject()}),c}}),e.controlConstructor={color:e.ColorControl,media:e.MediaControl,upload:e.UploadControl,image:e.ImageControl,header:e.HeaderControl,background:e.BackgroundControl,theme:e.ThemeControl},e.panelConstructor={},e.sectionConstructor={themes:e.ThemesSection},b(function(){if(e.settings=window._wpCustomizeSettings,e.l10n=window._wpCustomizeControlsL10n,e.settings){if(!b.support.postMessage||!b.support.cors&&e.settings.isCrossDomain)return window.location=e.settings.url.fallback;var a,c,d=b(document.body),f=d.children(".wp-full-overlay"),g=b("#customize-info .theme-name.site-title"),h=b(".customize-controls-close"),i=b("#save");b("#customize-controls").on("keydown",function(a){var c=13===a.which,d=b(a.target);c&&(d.is("input:not([type=button])")||d.is("select"))&&a.preventDefault()}),b("#customize-info").find("> .accordion-section-title").on("click keydown",function(a){if(!e.utils.isKeydownButNotEnterEvent(a)){a.preventDefault();var c=b(this).parent(),d=c.find(".accordion-section-content:first");c.hasClass("cannot-expand")||(c.hasClass("open")?(c.toggleClass("open"),d.slideUp(e.Panel.prototype.defaultExpandedArguments.duration)):(d.slideDown(e.Panel.prototype.defaultExpandedArguments.duration),c.toggleClass("open")))}}),e.previewer=new e.Previewer({container:"#customize-preview",form:"#customize-controls",previewUrl:e.settings.url.preview,allowedUrls:e.settings.url.allowed,signature:"WP_CUSTOMIZER_SIGNATURE"},{nonce:e.settings.nonce,query:function(){var a={};return e.each(function(b,c){b._dirty&&(a[c]=b())}),{wp_customize:"on",theme:e.settings.theme.stylesheet,customized:JSON.stringify(a),nonce:this.nonce.preview}},save:function(){var a,c,f=this,g=e.state("processing");d.addClass("saving"),c=function(){var a,c;c=b.extend(f.query(),{nonce:f.nonce.save}),a=wp.ajax.post("customize_save",c),e.trigger("save",a),a.always(function(){d.removeClass("saving")}),a.fail(function(a){"0"===a?a="not_logged_in":"-1"===a&&(a="invalid_nonce"),"invalid_nonce"===a?f.cheatin():"not_logged_in"===a&&(f.preview.iframe.hide(),f.login().done(function(){f.save(),f.preview.iframe.show()})),e.trigger("error",a)}),a.done(function(a){e.each(function(a){a._dirty=!1}),e.trigger("saved",a)})},0===g()?c():(a=function(){0===g()&&(e.state.unbind("change",a),c())},e.state.bind("change",a))}}),e.previewer.bind("nonce",function(a){b.extend(this.nonce,a)}),e.bind("nonce-refresh",function(a){b.extend(e.settings.nonce,a),b.extend(e.previewer.nonce,a)}),b.each(e.settings.settings,function(a,b){e.create(a,a,b.value,{transport:b.transport,previewer:e.previewer,dirty:!!b.dirty})}),b.each(e.settings.panels,function(a,b){var c,d=e.panelConstructor[b.type]||e.Panel;c=new d(a,{params:b}),e.panel.add(a,c)}),b.each(e.settings.sections,function(a,b){var c,d=e.sectionConstructor[b.type]||e.Section;c=new d(a,{params:b}),e.section.add(a,c)}),b.each(e.settings.controls,function(a,b){var c,d=e.controlConstructor[b.type]||e.Control;c=new d(a,{params:b,previewer:e.previewer}),e.control.add(a,c)}),_.each(["panel","section","control"],function(a){var b,c=e.settings.autofocus[a];c&&e[a](c)&&(b=e[a](c),b.deferred.embedded.done(function(){e.previewer.deferred.active.done(function(){
|
|
2
|
+
b.focus()})}))}),e.reflowPaneContents=_.bind(function(){var a,c,d,f=[],g=!1;document.activeElement&&(c=b(document.activeElement)),e.panel.each(function(b){var c=b.sections(),d=_.pluck(c,"container");f.push(b),a=b.container.find("ul:first"),e.utils.areElementListsEqual(d,a.children("[id]"))||(_(c).each(function(b){a.append(b.container)}),g=!0)}),e.section.each(function(b){var c=b.controls(),d=_.pluck(c,"container");b.panel()||f.push(b),a=b.container.find("ul:first"),e.utils.areElementListsEqual(d,a.children("[id]"))||(_(c).each(function(b){a.append(b.container)}),g=!0)}),f.sort(e.utils.prioritySort),d=_.pluck(f,"container"),a=b("#customize-theme-controls").children("ul"),e.utils.areElementListsEqual(d,a.children())||(_(f).each(function(b){a.append(b.container)}),g=!0),e.panel.each(function(a){var b=a.active();a.active.callbacks.fireWith(a.active,[b,b])}),e.section.each(function(a){var b=a.active();a.active.callbacks.fireWith(a.active,[b,b])}),g&&c&&c.focus()},e),e.bind("ready",e.reflowPaneContents),e.reflowPaneContents=_.debounce(e.reflowPaneContents,100),b([e.panel,e.section,e.control]).each(function(a,b){b.bind("add",e.reflowPaneContents),b.bind("change",e.reflowPaneContents),b.bind("remove",e.reflowPaneContents)}),e.previewer.previewUrl()?e.previewer.refresh():e.previewer.previewUrl(e.settings.url.home),function(){var a=new e.Values,b=a.create("saved"),c=a.create("activated"),d=a.create("processing");a.bind("change",function(){c()?b()?(i.val(e.l10n.saved).prop("disabled",!0),h.find(".screen-reader-text").text(e.l10n.close)):(i.val(e.l10n.save).prop("disabled",!1),h.find(".screen-reader-text").text(e.l10n.cancel)):(i.val(e.l10n.activate).prop("disabled",!1),h.find(".screen-reader-text").text(e.l10n.cancel))}),b(!0),c(e.settings.theme.active),d(0),e.bind("change",function(){a("saved").set(!1)}),e.bind("saved",function(){a("saved").set(!0),a("activated").set(!0)}),c.bind(function(a){a&&e.trigger("activated")}),e.state=a}(),i.click(function(a){e.previewer.save(),a.preventDefault()}).keydown(function(a){9!==a.which&&(13===a.which&&e.previewer.save(),a.preventDefault())}),b("#customize-header-actions").on("click keydown",".control-panel-back",function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),e.panel.each(function(a){a.collapse()}))}),h.keydown(function(a){9!==a.which&&(13===a.which&&this.click(),a.preventDefault())}),b(".collapse-sidebar").on("click keydown",function(a){e.utils.isKeydownButNotEnterEvent(a)||(f.toggleClass("collapsed").toggleClass("expanded"),a.preventDefault())}),b(".customize-controls-preview-toggle").on("click keydown",function(a){e.utils.isKeydownButNotEnterEvent(a)||(f.toggleClass("preview-only"),a.preventDefault())}),g.length&&b("#customize-control-blogname input").on("input",function(){g.text(this.value)}),a=new e.Messenger({url:e.settings.url.parent,channel:"loader"}),a.bind("back",function(){h.on("click.customize-controls-close",function(b){b.preventDefault(),a.send("close")})}),b(window).on("beforeunload",function(){return e.state("saved")()?void 0:(setTimeout(function(){f.removeClass("customize-loading")},1),e.l10n.saveAlert)}),b.each(["saved","change"],function(b,c){e.bind(c,function(){a.send(c)})}),e.bind("activated",function(){a.targetWindow()?a.send("activated",e.settings.url.activated):e.settings.url.activated&&(window.location=e.settings.url.activated)}),e.bind("title",function(b){a.send("title",b)}),a.send("ready"),b.each({background_image:{controls:["background_repeat","background_position_x","background_attachment"],callback:function(a){return!!a}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(a){return"page"===a}},header_textcolor:{controls:["header_textcolor"],callback:function(a){return"blank"!==a}}},function(a,c){e(a,function(a){b.each(c.controls,function(b,d){e.control(d,function(b){var d=function(a){b.container.toggle(c.callback(a))};d(a.get()),a.bind(d)})})})}),e.control("display_header_text",function(a){var b="";a.elements[0].unsync(e("header_textcolor")),a.element=new e.Element(a.container.find("input")),a.element.set("blank"!==a.setting()),a.element.bind(function(c){c||(b=e("header_textcolor").get()),a.setting.set(c?b:"blank")}),a.setting.bind(function(b){a.element.set("blank"!==b)})}),e.trigger("ready"),c=h,c.focus(),setTimeout(function(){c.focus()},200)}})}(wp,jQuery);
|
|
@@ -0,0 +1,2024 @@
|
|
|
1
|
+
/* global _wpCustomizeWidgetsSettings */
|
|
2
|
+
(function( wp, $ ){
|
|
3
|
+
|
|
4
|
+
if ( ! wp || ! wp.customize ) { return; }
|
|
5
|
+
|
|
6
|
+
// Set up our namespace...
|
|
7
|
+
var api = wp.customize,
|
|
8
|
+
l10n;
|
|
9
|
+
|
|
10
|
+
api.Widgets = api.Widgets || {};
|
|
11
|
+
|
|
12
|
+
// Link settings
|
|
13
|
+
api.Widgets.data = _wpCustomizeWidgetsSettings || {};
|
|
14
|
+
l10n = api.Widgets.data.l10n;
|
|
15
|
+
delete api.Widgets.data.l10n;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* wp.customize.Widgets.WidgetModel
|
|
19
|
+
*
|
|
20
|
+
* A single widget model.
|
|
21
|
+
*
|
|
22
|
+
* @constructor
|
|
23
|
+
* @augments Backbone.Model
|
|
24
|
+
*/
|
|
25
|
+
api.Widgets.WidgetModel = Backbone.Model.extend({
|
|
26
|
+
id: null,
|
|
27
|
+
temp_id: null,
|
|
28
|
+
classname: null,
|
|
29
|
+
control_tpl: null,
|
|
30
|
+
description: null,
|
|
31
|
+
is_disabled: null,
|
|
32
|
+
is_multi: null,
|
|
33
|
+
multi_number: null,
|
|
34
|
+
name: null,
|
|
35
|
+
id_base: null,
|
|
36
|
+
transport: 'refresh',
|
|
37
|
+
params: [],
|
|
38
|
+
width: null,
|
|
39
|
+
height: null,
|
|
40
|
+
search_matched: true
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* wp.customize.Widgets.WidgetCollection
|
|
45
|
+
*
|
|
46
|
+
* Collection for widget models.
|
|
47
|
+
*
|
|
48
|
+
* @constructor
|
|
49
|
+
* @augments Backbone.Model
|
|
50
|
+
*/
|
|
51
|
+
api.Widgets.WidgetCollection = Backbone.Collection.extend({
|
|
52
|
+
model: api.Widgets.WidgetModel,
|
|
53
|
+
|
|
54
|
+
// Controls searching on the current widget collection
|
|
55
|
+
// and triggers an update event
|
|
56
|
+
doSearch: function( value ) {
|
|
57
|
+
|
|
58
|
+
// Don't do anything if we've already done this search
|
|
59
|
+
// Useful because the search handler fires multiple times per keystroke
|
|
60
|
+
if ( this.terms === value ) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Updates terms with the value passed
|
|
65
|
+
this.terms = value;
|
|
66
|
+
|
|
67
|
+
// If we have terms, run a search...
|
|
68
|
+
if ( this.terms.length > 0 ) {
|
|
69
|
+
this.search( this.terms );
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// If search is blank, show all themes
|
|
73
|
+
// Useful for resetting the views when you clean the input
|
|
74
|
+
if ( this.terms === '' ) {
|
|
75
|
+
this.each( function ( widget ) {
|
|
76
|
+
widget.set( 'search_matched', true );
|
|
77
|
+
} );
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
// Performs a search within the collection
|
|
82
|
+
// @uses RegExp
|
|
83
|
+
search: function( term ) {
|
|
84
|
+
var match, haystack;
|
|
85
|
+
|
|
86
|
+
// Escape the term string for RegExp meta characters
|
|
87
|
+
term = term.replace( /[-\/\\^$*+?.()|[\]{}]/g, '\\$&' );
|
|
88
|
+
|
|
89
|
+
// Consider spaces as word delimiters and match the whole string
|
|
90
|
+
// so matching terms can be combined
|
|
91
|
+
term = term.replace( / /g, ')(?=.*' );
|
|
92
|
+
match = new RegExp( '^(?=.*' + term + ').+', 'i' );
|
|
93
|
+
|
|
94
|
+
this.each( function ( data ) {
|
|
95
|
+
haystack = [ data.get( 'name' ), data.get( 'id' ), data.get( 'description' ) ].join( ' ' );
|
|
96
|
+
data.set( 'search_matched', match.test( haystack ) );
|
|
97
|
+
} );
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
api.Widgets.availableWidgets = new api.Widgets.WidgetCollection( api.Widgets.data.availableWidgets );
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* wp.customize.Widgets.SidebarModel
|
|
104
|
+
*
|
|
105
|
+
* A single sidebar model.
|
|
106
|
+
*
|
|
107
|
+
* @constructor
|
|
108
|
+
* @augments Backbone.Model
|
|
109
|
+
*/
|
|
110
|
+
api.Widgets.SidebarModel = Backbone.Model.extend({
|
|
111
|
+
after_title: null,
|
|
112
|
+
after_widget: null,
|
|
113
|
+
before_title: null,
|
|
114
|
+
before_widget: null,
|
|
115
|
+
'class': null,
|
|
116
|
+
description: null,
|
|
117
|
+
id: null,
|
|
118
|
+
name: null,
|
|
119
|
+
is_rendered: false
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* wp.customize.Widgets.SidebarCollection
|
|
124
|
+
*
|
|
125
|
+
* Collection for sidebar models.
|
|
126
|
+
*
|
|
127
|
+
* @constructor
|
|
128
|
+
* @augments Backbone.Collection
|
|
129
|
+
*/
|
|
130
|
+
api.Widgets.SidebarCollection = Backbone.Collection.extend({
|
|
131
|
+
model: api.Widgets.SidebarModel
|
|
132
|
+
});
|
|
133
|
+
api.Widgets.registeredSidebars = new api.Widgets.SidebarCollection( api.Widgets.data.registeredSidebars );
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* wp.customize.Widgets.AvailableWidgetsPanelView
|
|
137
|
+
*
|
|
138
|
+
* View class for the available widgets panel.
|
|
139
|
+
*
|
|
140
|
+
* @constructor
|
|
141
|
+
* @augments wp.Backbone.View
|
|
142
|
+
* @augments Backbone.View
|
|
143
|
+
*/
|
|
144
|
+
api.Widgets.AvailableWidgetsPanelView = wp.Backbone.View.extend({
|
|
145
|
+
|
|
146
|
+
el: '#available-widgets',
|
|
147
|
+
|
|
148
|
+
events: {
|
|
149
|
+
'input #widgets-search': 'search',
|
|
150
|
+
'keyup #widgets-search': 'search',
|
|
151
|
+
'change #widgets-search': 'search',
|
|
152
|
+
'search #widgets-search': 'search',
|
|
153
|
+
'focus .widget-tpl' : 'focus',
|
|
154
|
+
'click .widget-tpl' : '_submit',
|
|
155
|
+
'keypress .widget-tpl' : '_submit',
|
|
156
|
+
'keydown' : 'keyboardAccessible'
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
// Cache current selected widget
|
|
160
|
+
selected: null,
|
|
161
|
+
|
|
162
|
+
// Cache sidebar control which has opened panel
|
|
163
|
+
currentSidebarControl: null,
|
|
164
|
+
$search: null,
|
|
165
|
+
|
|
166
|
+
initialize: function() {
|
|
167
|
+
var self = this;
|
|
168
|
+
|
|
169
|
+
this.$search = $( '#widgets-search' );
|
|
170
|
+
|
|
171
|
+
_.bindAll( this, 'close' );
|
|
172
|
+
|
|
173
|
+
this.listenTo( this.collection, 'change', this.updateList );
|
|
174
|
+
|
|
175
|
+
this.updateList();
|
|
176
|
+
|
|
177
|
+
// If the available widgets panel is open and the customize controls are
|
|
178
|
+
// interacted with (i.e. available widgets panel is blurred) then close the
|
|
179
|
+
// available widgets panel.
|
|
180
|
+
$( '#customize-controls, .customize-overlay-close' ).on( 'click keydown', function( e ) {
|
|
181
|
+
var isAddNewBtn = $( e.target ).is( '.add-new-widget, .add-new-widget *' );
|
|
182
|
+
if ( $( 'body' ).hasClass( 'adding-widget' ) && ! isAddNewBtn ) {
|
|
183
|
+
self.close();
|
|
184
|
+
}
|
|
185
|
+
} );
|
|
186
|
+
|
|
187
|
+
// Close the panel if the URL in the preview changes
|
|
188
|
+
api.previewer.bind( 'url', this.close );
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
// Performs a search and handles selected widget
|
|
192
|
+
search: function( event ) {
|
|
193
|
+
var firstVisible;
|
|
194
|
+
|
|
195
|
+
this.collection.doSearch( event.target.value );
|
|
196
|
+
|
|
197
|
+
// Remove a widget from being selected if it is no longer visible
|
|
198
|
+
if ( this.selected && ! this.selected.is( ':visible' ) ) {
|
|
199
|
+
this.selected.removeClass( 'selected' );
|
|
200
|
+
this.selected = null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// If a widget was selected but the filter value has been cleared out, clear selection
|
|
204
|
+
if ( this.selected && ! event.target.value ) {
|
|
205
|
+
this.selected.removeClass( 'selected' );
|
|
206
|
+
this.selected = null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// If a filter has been entered and a widget hasn't been selected, select the first one shown
|
|
210
|
+
if ( ! this.selected && event.target.value ) {
|
|
211
|
+
firstVisible = this.$el.find( '> .widget-tpl:visible:first' );
|
|
212
|
+
if ( firstVisible.length ) {
|
|
213
|
+
this.select( firstVisible );
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
// Changes visibility of available widgets
|
|
219
|
+
updateList: function() {
|
|
220
|
+
this.collection.each( function( widget ) {
|
|
221
|
+
var widgetTpl = $( '#widget-tpl-' + widget.id );
|
|
222
|
+
widgetTpl.toggle( widget.get( 'search_matched' ) && ! widget.get( 'is_disabled' ) );
|
|
223
|
+
if ( widget.get( 'is_disabled' ) && widgetTpl.is( this.selected ) ) {
|
|
224
|
+
this.selected = null;
|
|
225
|
+
}
|
|
226
|
+
} );
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
// Highlights a widget
|
|
230
|
+
select: function( widgetTpl ) {
|
|
231
|
+
this.selected = $( widgetTpl );
|
|
232
|
+
this.selected.siblings( '.widget-tpl' ).removeClass( 'selected' );
|
|
233
|
+
this.selected.addClass( 'selected' );
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
// Highlights a widget on focus
|
|
237
|
+
focus: function( event ) {
|
|
238
|
+
this.select( $( event.currentTarget ) );
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
// Submit handler for keypress and click on widget
|
|
242
|
+
_submit: function( event ) {
|
|
243
|
+
// Only proceed with keypress if it is Enter or Spacebar
|
|
244
|
+
if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
this.submit( $( event.currentTarget ) );
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
// Adds a selected widget to the sidebar
|
|
252
|
+
submit: function( widgetTpl ) {
|
|
253
|
+
var widgetId, widget, widgetFormControl;
|
|
254
|
+
|
|
255
|
+
if ( ! widgetTpl ) {
|
|
256
|
+
widgetTpl = this.selected;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if ( ! widgetTpl || ! this.currentSidebarControl ) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
this.select( widgetTpl );
|
|
264
|
+
|
|
265
|
+
widgetId = $( this.selected ).data( 'widget-id' );
|
|
266
|
+
widget = this.collection.findWhere( { id: widgetId } );
|
|
267
|
+
if ( ! widget ) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
widgetFormControl = this.currentSidebarControl.addWidget( widget.get( 'id_base' ) );
|
|
272
|
+
if ( widgetFormControl ) {
|
|
273
|
+
widgetFormControl.focus();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
this.close();
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
// Opens the panel
|
|
280
|
+
open: function( sidebarControl ) {
|
|
281
|
+
this.currentSidebarControl = sidebarControl;
|
|
282
|
+
|
|
283
|
+
// Wide widget controls appear over the preview, and so they need to be collapsed when the panel opens
|
|
284
|
+
_( this.currentSidebarControl.getWidgetFormControls() ).each( function( control ) {
|
|
285
|
+
if ( control.params.is_wide ) {
|
|
286
|
+
control.collapseForm();
|
|
287
|
+
}
|
|
288
|
+
} );
|
|
289
|
+
|
|
290
|
+
$( 'body' ).addClass( 'adding-widget' );
|
|
291
|
+
|
|
292
|
+
this.$el.find( '.selected' ).removeClass( 'selected' );
|
|
293
|
+
|
|
294
|
+
// Reset search
|
|
295
|
+
this.collection.doSearch( '' );
|
|
296
|
+
|
|
297
|
+
if ( ! api.settings.browser.mobile ) {
|
|
298
|
+
this.$search.focus();
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
|
|
302
|
+
// Closes the panel
|
|
303
|
+
close: function( options ) {
|
|
304
|
+
options = options || {};
|
|
305
|
+
|
|
306
|
+
if ( options.returnFocus && this.currentSidebarControl ) {
|
|
307
|
+
this.currentSidebarControl.container.find( '.add-new-widget' ).focus();
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
this.currentSidebarControl = null;
|
|
311
|
+
this.selected = null;
|
|
312
|
+
|
|
313
|
+
$( 'body' ).removeClass( 'adding-widget' );
|
|
314
|
+
|
|
315
|
+
this.$search.val( '' );
|
|
316
|
+
},
|
|
317
|
+
|
|
318
|
+
// Add keyboard accessiblity to the panel
|
|
319
|
+
keyboardAccessible: function( event ) {
|
|
320
|
+
var isEnter = ( event.which === 13 ),
|
|
321
|
+
isEsc = ( event.which === 27 ),
|
|
322
|
+
isDown = ( event.which === 40 ),
|
|
323
|
+
isUp = ( event.which === 38 ),
|
|
324
|
+
isTab = ( event.which === 9 ),
|
|
325
|
+
isShift = ( event.shiftKey ),
|
|
326
|
+
selected = null,
|
|
327
|
+
firstVisible = this.$el.find( '> .widget-tpl:visible:first' ),
|
|
328
|
+
lastVisible = this.$el.find( '> .widget-tpl:visible:last' ),
|
|
329
|
+
isSearchFocused = $( event.target ).is( this.$search ),
|
|
330
|
+
isLastWidgetFocused = $( event.target ).is( '.widget-tpl:visible:last' );
|
|
331
|
+
|
|
332
|
+
if ( isDown || isUp ) {
|
|
333
|
+
if ( isDown ) {
|
|
334
|
+
if ( isSearchFocused ) {
|
|
335
|
+
selected = firstVisible;
|
|
336
|
+
} else if ( this.selected && this.selected.nextAll( '.widget-tpl:visible' ).length !== 0 ) {
|
|
337
|
+
selected = this.selected.nextAll( '.widget-tpl:visible:first' );
|
|
338
|
+
}
|
|
339
|
+
} else if ( isUp ) {
|
|
340
|
+
if ( isSearchFocused ) {
|
|
341
|
+
selected = lastVisible;
|
|
342
|
+
} else if ( this.selected && this.selected.prevAll( '.widget-tpl:visible' ).length !== 0 ) {
|
|
343
|
+
selected = this.selected.prevAll( '.widget-tpl:visible:first' );
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
this.select( selected );
|
|
348
|
+
|
|
349
|
+
if ( selected ) {
|
|
350
|
+
selected.focus();
|
|
351
|
+
} else {
|
|
352
|
+
this.$search.focus();
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// If enter pressed but nothing entered, don't do anything
|
|
359
|
+
if ( isEnter && ! this.$search.val() ) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if ( isEnter ) {
|
|
364
|
+
this.submit();
|
|
365
|
+
} else if ( isEsc ) {
|
|
366
|
+
this.close( { returnFocus: true } );
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if ( isTab && ( isShift && isSearchFocused || ! isShift && isLastWidgetFocused ) ) {
|
|
370
|
+
this.currentSidebarControl.container.find( '.add-new-widget' ).focus();
|
|
371
|
+
event.preventDefault();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Handlers for the widget-synced event, organized by widget ID base.
|
|
378
|
+
* Other widgets may provide their own update handlers by adding
|
|
379
|
+
* listeners for the widget-synced event.
|
|
380
|
+
*/
|
|
381
|
+
api.Widgets.formSyncHandlers = {
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @param {jQuery.Event} e
|
|
385
|
+
* @param {jQuery} widget
|
|
386
|
+
* @param {String} newForm
|
|
387
|
+
*/
|
|
388
|
+
rss: function( e, widget, newForm ) {
|
|
389
|
+
var oldWidgetError = widget.find( '.widget-error:first' ),
|
|
390
|
+
newWidgetError = $( '<div>' + newForm + '</div>' ).find( '.widget-error:first' );
|
|
391
|
+
|
|
392
|
+
if ( oldWidgetError.length && newWidgetError.length ) {
|
|
393
|
+
oldWidgetError.replaceWith( newWidgetError );
|
|
394
|
+
} else if ( oldWidgetError.length ) {
|
|
395
|
+
oldWidgetError.remove();
|
|
396
|
+
} else if ( newWidgetError.length ) {
|
|
397
|
+
widget.find( '.widget-content:first' ).prepend( newWidgetError );
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* wp.customize.Widgets.WidgetControl
|
|
404
|
+
*
|
|
405
|
+
* Customizer control for widgets.
|
|
406
|
+
* Note that 'widget_form' must match the WP_Widget_Form_Customize_Control::$type
|
|
407
|
+
*
|
|
408
|
+
* @constructor
|
|
409
|
+
* @augments wp.customize.Control
|
|
410
|
+
*/
|
|
411
|
+
api.Widgets.WidgetControl = api.Control.extend({
|
|
412
|
+
defaultExpandedArguments: {
|
|
413
|
+
duration: 'fast',
|
|
414
|
+
completeCallback: $.noop
|
|
415
|
+
},
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* @since 4.1.0
|
|
419
|
+
*/
|
|
420
|
+
initialize: function ( id, options ) {
|
|
421
|
+
var control = this;
|
|
422
|
+
api.Control.prototype.initialize.call( control, id, options );
|
|
423
|
+
control.expanded = new api.Value();
|
|
424
|
+
control.expandedArgumentsQueue = [];
|
|
425
|
+
control.expanded.bind( function ( expanded ) {
|
|
426
|
+
var args = control.expandedArgumentsQueue.shift();
|
|
427
|
+
args = $.extend( {}, control.defaultExpandedArguments, args );
|
|
428
|
+
control.onChangeExpanded( expanded, args );
|
|
429
|
+
});
|
|
430
|
+
control.expanded.set( false );
|
|
431
|
+
},
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Set up the control
|
|
435
|
+
*/
|
|
436
|
+
ready: function() {
|
|
437
|
+
this._setupModel();
|
|
438
|
+
this._setupWideWidget();
|
|
439
|
+
this._setupControlToggle();
|
|
440
|
+
this._setupWidgetTitle();
|
|
441
|
+
this._setupReorderUI();
|
|
442
|
+
this._setupHighlightEffects();
|
|
443
|
+
this._setupUpdateUI();
|
|
444
|
+
this._setupRemoveUI();
|
|
445
|
+
|
|
446
|
+
/*
|
|
447
|
+
* Trigger widget-added event so that plugins can attach any event
|
|
448
|
+
* listeners and dynamic UI elements.
|
|
449
|
+
*/
|
|
450
|
+
$( document ).trigger( 'widget-added', [ this.container.find( '.widget:first' ) ] );
|
|
451
|
+
},
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Handle changes to the setting
|
|
455
|
+
*/
|
|
456
|
+
_setupModel: function() {
|
|
457
|
+
var self = this, rememberSavedWidgetId;
|
|
458
|
+
|
|
459
|
+
api.Widgets.savedWidgetIds = api.Widgets.savedWidgetIds || [];
|
|
460
|
+
|
|
461
|
+
// Remember saved widgets so we know which to trash (move to inactive widgets sidebar)
|
|
462
|
+
rememberSavedWidgetId = function() {
|
|
463
|
+
api.Widgets.savedWidgetIds[self.params.widget_id] = true;
|
|
464
|
+
};
|
|
465
|
+
api.bind( 'ready', rememberSavedWidgetId );
|
|
466
|
+
api.bind( 'saved', rememberSavedWidgetId );
|
|
467
|
+
|
|
468
|
+
this._updateCount = 0;
|
|
469
|
+
this.isWidgetUpdating = false;
|
|
470
|
+
this.liveUpdateMode = true;
|
|
471
|
+
|
|
472
|
+
// Update widget whenever model changes
|
|
473
|
+
this.setting.bind( function( to, from ) {
|
|
474
|
+
if ( ! _( from ).isEqual( to ) && ! self.isWidgetUpdating ) {
|
|
475
|
+
self.updateWidget( { instance: to } );
|
|
476
|
+
}
|
|
477
|
+
} );
|
|
478
|
+
},
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Add special behaviors for wide widget controls
|
|
482
|
+
*/
|
|
483
|
+
_setupWideWidget: function() {
|
|
484
|
+
var self = this, $widgetInside, $widgetForm, $customizeSidebar,
|
|
485
|
+
$themeControlsContainer, positionWidget;
|
|
486
|
+
|
|
487
|
+
if ( ! this.params.is_wide ) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
$widgetInside = this.container.find( '.widget-inside' );
|
|
492
|
+
$widgetForm = $widgetInside.find( '> .form' );
|
|
493
|
+
$customizeSidebar = $( '.wp-full-overlay-sidebar-content:first' );
|
|
494
|
+
this.container.addClass( 'wide-widget-control' );
|
|
495
|
+
|
|
496
|
+
this.container.find( '.widget-content:first' ).css( {
|
|
497
|
+
'max-width': this.params.width,
|
|
498
|
+
'min-height': this.params.height
|
|
499
|
+
} );
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Keep the widget-inside positioned so the top of fixed-positioned
|
|
503
|
+
* element is at the same top position as the widget-top. When the
|
|
504
|
+
* widget-top is scrolled out of view, keep the widget-top in view;
|
|
505
|
+
* likewise, don't allow the widget to drop off the bottom of the window.
|
|
506
|
+
* If a widget is too tall to fit in the window, don't let the height
|
|
507
|
+
* exceed the window height so that the contents of the widget control
|
|
508
|
+
* will become scrollable (overflow:auto).
|
|
509
|
+
*/
|
|
510
|
+
positionWidget = function() {
|
|
511
|
+
var offsetTop = self.container.offset().top,
|
|
512
|
+
windowHeight = $( window ).height(),
|
|
513
|
+
formHeight = $widgetForm.outerHeight(),
|
|
514
|
+
top;
|
|
515
|
+
$widgetInside.css( 'max-height', windowHeight );
|
|
516
|
+
top = Math.max(
|
|
517
|
+
0, // prevent top from going off screen
|
|
518
|
+
Math.min(
|
|
519
|
+
Math.max( offsetTop, 0 ), // distance widget in panel is from top of screen
|
|
520
|
+
windowHeight - formHeight // flush up against bottom of screen
|
|
521
|
+
)
|
|
522
|
+
);
|
|
523
|
+
$widgetInside.css( 'top', top );
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
$themeControlsContainer = $( '#customize-theme-controls' );
|
|
527
|
+
this.container.on( 'expand', function() {
|
|
528
|
+
positionWidget();
|
|
529
|
+
$customizeSidebar.on( 'scroll', positionWidget );
|
|
530
|
+
$( window ).on( 'resize', positionWidget );
|
|
531
|
+
$themeControlsContainer.on( 'expanded collapsed', positionWidget );
|
|
532
|
+
} );
|
|
533
|
+
this.container.on( 'collapsed', function() {
|
|
534
|
+
$customizeSidebar.off( 'scroll', positionWidget );
|
|
535
|
+
$( window ).off( 'resize', positionWidget );
|
|
536
|
+
$themeControlsContainer.off( 'expanded collapsed', positionWidget );
|
|
537
|
+
} );
|
|
538
|
+
|
|
539
|
+
// Reposition whenever a sidebar's widgets are changed
|
|
540
|
+
api.each( function( setting ) {
|
|
541
|
+
if ( 0 === setting.id.indexOf( 'sidebars_widgets[' ) ) {
|
|
542
|
+
setting.bind( function() {
|
|
543
|
+
if ( self.container.hasClass( 'expanded' ) ) {
|
|
544
|
+
positionWidget();
|
|
545
|
+
}
|
|
546
|
+
} );
|
|
547
|
+
}
|
|
548
|
+
} );
|
|
549
|
+
},
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Show/hide the control when clicking on the form title, when clicking
|
|
553
|
+
* the close button
|
|
554
|
+
*/
|
|
555
|
+
_setupControlToggle: function() {
|
|
556
|
+
var self = this, $closeBtn;
|
|
557
|
+
|
|
558
|
+
this.container.find( '.widget-top' ).on( 'click', function( e ) {
|
|
559
|
+
e.preventDefault();
|
|
560
|
+
var sidebarWidgetsControl = self.getSidebarWidgetsControl();
|
|
561
|
+
if ( sidebarWidgetsControl.isReordering ) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
self.expanded( ! self.expanded() );
|
|
565
|
+
} );
|
|
566
|
+
|
|
567
|
+
$closeBtn = this.container.find( '.widget-control-close' );
|
|
568
|
+
$closeBtn.on( 'click', function( e ) {
|
|
569
|
+
e.preventDefault();
|
|
570
|
+
self.collapse();
|
|
571
|
+
self.container.find( '.widget-top .widget-action:first' ).focus(); // keyboard accessibility
|
|
572
|
+
} );
|
|
573
|
+
},
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Update the title of the form if a title field is entered
|
|
577
|
+
*/
|
|
578
|
+
_setupWidgetTitle: function() {
|
|
579
|
+
var self = this, updateTitle;
|
|
580
|
+
|
|
581
|
+
updateTitle = function() {
|
|
582
|
+
var title = self.setting().title,
|
|
583
|
+
inWidgetTitle = self.container.find( '.in-widget-title' );
|
|
584
|
+
|
|
585
|
+
if ( title ) {
|
|
586
|
+
inWidgetTitle.text( ': ' + title );
|
|
587
|
+
} else {
|
|
588
|
+
inWidgetTitle.text( '' );
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
this.setting.bind( updateTitle );
|
|
592
|
+
updateTitle();
|
|
593
|
+
},
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Set up the widget-reorder-nav
|
|
597
|
+
*/
|
|
598
|
+
_setupReorderUI: function() {
|
|
599
|
+
var self = this, selectSidebarItem, $moveWidgetArea,
|
|
600
|
+
$reorderNav, updateAvailableSidebars;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* select the provided sidebar list item in the move widget area
|
|
604
|
+
*
|
|
605
|
+
* @param {jQuery} li
|
|
606
|
+
*/
|
|
607
|
+
selectSidebarItem = function( li ) {
|
|
608
|
+
li.siblings( '.selected' ).removeClass( 'selected' );
|
|
609
|
+
li.addClass( 'selected' );
|
|
610
|
+
var isSelfSidebar = ( li.data( 'id' ) === self.params.sidebar_id );
|
|
611
|
+
self.container.find( '.move-widget-btn' ).prop( 'disabled', isSelfSidebar );
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Add the widget reordering elements to the widget control
|
|
616
|
+
*/
|
|
617
|
+
this.container.find( '.widget-title-action' ).after( $( api.Widgets.data.tpl.widgetReorderNav ) );
|
|
618
|
+
$moveWidgetArea = $(
|
|
619
|
+
_.template( api.Widgets.data.tpl.moveWidgetArea, {
|
|
620
|
+
sidebars: _( api.Widgets.registeredSidebars.toArray() ).pluck( 'attributes' )
|
|
621
|
+
} )
|
|
622
|
+
);
|
|
623
|
+
this.container.find( '.widget-top' ).after( $moveWidgetArea );
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Update available sidebars when their rendered state changes
|
|
627
|
+
*/
|
|
628
|
+
updateAvailableSidebars = function() {
|
|
629
|
+
var $sidebarItems = $moveWidgetArea.find( 'li' ), selfSidebarItem,
|
|
630
|
+
renderedSidebarCount = 0;
|
|
631
|
+
|
|
632
|
+
selfSidebarItem = $sidebarItems.filter( function(){
|
|
633
|
+
return $( this ).data( 'id' ) === self.params.sidebar_id;
|
|
634
|
+
} );
|
|
635
|
+
|
|
636
|
+
$sidebarItems.each( function() {
|
|
637
|
+
var li = $( this ),
|
|
638
|
+
sidebarId, sidebar, sidebarIsRendered;
|
|
639
|
+
|
|
640
|
+
sidebarId = li.data( 'id' );
|
|
641
|
+
sidebar = api.Widgets.registeredSidebars.get( sidebarId );
|
|
642
|
+
sidebarIsRendered = sidebar.get( 'is_rendered' );
|
|
643
|
+
|
|
644
|
+
li.toggle( sidebarIsRendered );
|
|
645
|
+
|
|
646
|
+
if ( sidebarIsRendered ) {
|
|
647
|
+
renderedSidebarCount += 1;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
if ( li.hasClass( 'selected' ) && ! sidebarIsRendered ) {
|
|
651
|
+
selectSidebarItem( selfSidebarItem );
|
|
652
|
+
}
|
|
653
|
+
} );
|
|
654
|
+
|
|
655
|
+
if ( renderedSidebarCount > 1 ) {
|
|
656
|
+
self.container.find( '.move-widget' ).show();
|
|
657
|
+
} else {
|
|
658
|
+
self.container.find( '.move-widget' ).hide();
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
updateAvailableSidebars();
|
|
663
|
+
api.Widgets.registeredSidebars.on( 'change:is_rendered', updateAvailableSidebars );
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Handle clicks for up/down/move on the reorder nav
|
|
667
|
+
*/
|
|
668
|
+
$reorderNav = this.container.find( '.widget-reorder-nav' );
|
|
669
|
+
$reorderNav.find( '.move-widget, .move-widget-down, .move-widget-up' ).each( function() {
|
|
670
|
+
$( this ).prepend( self.container.find( '.widget-title' ).text() + ': ' );
|
|
671
|
+
} ).on( 'click keypress', function( event ) {
|
|
672
|
+
if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
$( this ).focus();
|
|
676
|
+
|
|
677
|
+
if ( $( this ).is( '.move-widget' ) ) {
|
|
678
|
+
self.toggleWidgetMoveArea();
|
|
679
|
+
} else {
|
|
680
|
+
var isMoveDown = $( this ).is( '.move-widget-down' ),
|
|
681
|
+
isMoveUp = $( this ).is( '.move-widget-up' ),
|
|
682
|
+
i = self.getWidgetSidebarPosition();
|
|
683
|
+
|
|
684
|
+
if ( ( isMoveUp && i === 0 ) || ( isMoveDown && i === self.getSidebarWidgetsControl().setting().length - 1 ) ) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if ( isMoveUp ) {
|
|
689
|
+
self.moveUp();
|
|
690
|
+
wp.a11y.speak( l10n.widgetMovedUp );
|
|
691
|
+
} else {
|
|
692
|
+
self.moveDown();
|
|
693
|
+
wp.a11y.speak( l10n.widgetMovedDown );
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
$( this ).focus(); // re-focus after the container was moved
|
|
697
|
+
}
|
|
698
|
+
} );
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Handle selecting a sidebar to move to
|
|
702
|
+
*/
|
|
703
|
+
this.container.find( '.widget-area-select' ).on( 'click keypress', 'li', function( event ) {
|
|
704
|
+
if ( event.type === 'keypress' && ( event.which !== 13 && event.which !== 32 ) ) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
event.preventDefault();
|
|
708
|
+
selectSidebarItem( $( this ) );
|
|
709
|
+
} );
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Move widget to another sidebar
|
|
713
|
+
*/
|
|
714
|
+
this.container.find( '.move-widget-btn' ).click( function() {
|
|
715
|
+
self.getSidebarWidgetsControl().toggleReordering( false );
|
|
716
|
+
|
|
717
|
+
var oldSidebarId = self.params.sidebar_id,
|
|
718
|
+
newSidebarId = self.container.find( '.widget-area-select li.selected' ).data( 'id' ),
|
|
719
|
+
oldSidebarWidgetsSetting, newSidebarWidgetsSetting,
|
|
720
|
+
oldSidebarWidgetIds, newSidebarWidgetIds, i;
|
|
721
|
+
|
|
722
|
+
oldSidebarWidgetsSetting = api( 'sidebars_widgets[' + oldSidebarId + ']' );
|
|
723
|
+
newSidebarWidgetsSetting = api( 'sidebars_widgets[' + newSidebarId + ']' );
|
|
724
|
+
oldSidebarWidgetIds = Array.prototype.slice.call( oldSidebarWidgetsSetting() );
|
|
725
|
+
newSidebarWidgetIds = Array.prototype.slice.call( newSidebarWidgetsSetting() );
|
|
726
|
+
|
|
727
|
+
i = self.getWidgetSidebarPosition();
|
|
728
|
+
oldSidebarWidgetIds.splice( i, 1 );
|
|
729
|
+
newSidebarWidgetIds.push( self.params.widget_id );
|
|
730
|
+
|
|
731
|
+
oldSidebarWidgetsSetting( oldSidebarWidgetIds );
|
|
732
|
+
newSidebarWidgetsSetting( newSidebarWidgetIds );
|
|
733
|
+
|
|
734
|
+
self.focus();
|
|
735
|
+
} );
|
|
736
|
+
},
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Highlight widgets in preview when interacted with in the Customizer
|
|
740
|
+
*/
|
|
741
|
+
_setupHighlightEffects: function() {
|
|
742
|
+
var self = this;
|
|
743
|
+
|
|
744
|
+
// Highlight whenever hovering or clicking over the form
|
|
745
|
+
this.container.on( 'mouseenter click', function() {
|
|
746
|
+
self.setting.previewer.send( 'highlight-widget', self.params.widget_id );
|
|
747
|
+
} );
|
|
748
|
+
|
|
749
|
+
// Highlight when the setting is updated
|
|
750
|
+
this.setting.bind( function() {
|
|
751
|
+
self.setting.previewer.send( 'highlight-widget', self.params.widget_id );
|
|
752
|
+
} );
|
|
753
|
+
},
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Set up event handlers for widget updating
|
|
757
|
+
*/
|
|
758
|
+
_setupUpdateUI: function() {
|
|
759
|
+
var self = this, $widgetRoot, $widgetContent,
|
|
760
|
+
$saveBtn, updateWidgetDebounced, formSyncHandler;
|
|
761
|
+
|
|
762
|
+
$widgetRoot = this.container.find( '.widget:first' );
|
|
763
|
+
$widgetContent = $widgetRoot.find( '.widget-content:first' );
|
|
764
|
+
|
|
765
|
+
// Configure update button
|
|
766
|
+
$saveBtn = this.container.find( '.widget-control-save' );
|
|
767
|
+
$saveBtn.val( l10n.saveBtnLabel );
|
|
768
|
+
$saveBtn.attr( 'title', l10n.saveBtnTooltip );
|
|
769
|
+
$saveBtn.removeClass( 'button-primary' ).addClass( 'button-secondary' );
|
|
770
|
+
$saveBtn.on( 'click', function( e ) {
|
|
771
|
+
e.preventDefault();
|
|
772
|
+
self.updateWidget( { disable_form: true } ); // @todo disable_form is unused?
|
|
773
|
+
} );
|
|
774
|
+
|
|
775
|
+
updateWidgetDebounced = _.debounce( function() {
|
|
776
|
+
self.updateWidget();
|
|
777
|
+
}, 250 );
|
|
778
|
+
|
|
779
|
+
// Trigger widget form update when hitting Enter within an input
|
|
780
|
+
$widgetContent.on( 'keydown', 'input', function( e ) {
|
|
781
|
+
if ( 13 === e.which ) { // Enter
|
|
782
|
+
e.preventDefault();
|
|
783
|
+
self.updateWidget( { ignoreActiveElement: true } );
|
|
784
|
+
}
|
|
785
|
+
} );
|
|
786
|
+
|
|
787
|
+
// Handle widgets that support live previews
|
|
788
|
+
$widgetContent.on( 'change input propertychange', ':input', function( e ) {
|
|
789
|
+
if ( self.liveUpdateMode ) {
|
|
790
|
+
if ( e.type === 'change' ) {
|
|
791
|
+
self.updateWidget();
|
|
792
|
+
} else if ( this.checkValidity && this.checkValidity() ) {
|
|
793
|
+
updateWidgetDebounced();
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
} );
|
|
797
|
+
|
|
798
|
+
// Remove loading indicators when the setting is saved and the preview updates
|
|
799
|
+
this.setting.previewer.channel.bind( 'synced', function() {
|
|
800
|
+
self.container.removeClass( 'previewer-loading' );
|
|
801
|
+
} );
|
|
802
|
+
|
|
803
|
+
api.previewer.bind( 'widget-updated', function( updatedWidgetId ) {
|
|
804
|
+
if ( updatedWidgetId === self.params.widget_id ) {
|
|
805
|
+
self.container.removeClass( 'previewer-loading' );
|
|
806
|
+
}
|
|
807
|
+
} );
|
|
808
|
+
|
|
809
|
+
formSyncHandler = api.Widgets.formSyncHandlers[ this.params.widget_id_base ];
|
|
810
|
+
if ( formSyncHandler ) {
|
|
811
|
+
$( document ).on( 'widget-synced', function( e, widget ) {
|
|
812
|
+
if ( $widgetRoot.is( widget ) ) {
|
|
813
|
+
formSyncHandler.apply( document, arguments );
|
|
814
|
+
}
|
|
815
|
+
} );
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Update widget control to indicate whether it is currently rendered.
|
|
821
|
+
*
|
|
822
|
+
* Overrides api.Control.toggle()
|
|
823
|
+
*
|
|
824
|
+
* @since 4.1.0
|
|
825
|
+
*
|
|
826
|
+
* @param {Boolean} active
|
|
827
|
+
* @param {Object} args
|
|
828
|
+
* @param {Callback} args.completeCallback
|
|
829
|
+
*/
|
|
830
|
+
onChangeActive: function ( active, args ) {
|
|
831
|
+
// Note: there is a second 'args' parameter being passed, merged on top of this.defaultActiveArguments
|
|
832
|
+
this.container.toggleClass( 'widget-rendered', active );
|
|
833
|
+
if ( args.completeCallback ) {
|
|
834
|
+
args.completeCallback();
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Set up event handlers for widget removal
|
|
840
|
+
*/
|
|
841
|
+
_setupRemoveUI: function() {
|
|
842
|
+
var self = this, $removeBtn, replaceDeleteWithRemove;
|
|
843
|
+
|
|
844
|
+
// Configure remove button
|
|
845
|
+
$removeBtn = this.container.find( 'a.widget-control-remove' );
|
|
846
|
+
$removeBtn.on( 'click', function( e ) {
|
|
847
|
+
e.preventDefault();
|
|
848
|
+
|
|
849
|
+
// Find an adjacent element to add focus to when this widget goes away
|
|
850
|
+
var $adjacentFocusTarget;
|
|
851
|
+
if ( self.container.next().is( '.customize-control-widget_form' ) ) {
|
|
852
|
+
$adjacentFocusTarget = self.container.next().find( '.widget-action:first' );
|
|
853
|
+
} else if ( self.container.prev().is( '.customize-control-widget_form' ) ) {
|
|
854
|
+
$adjacentFocusTarget = self.container.prev().find( '.widget-action:first' );
|
|
855
|
+
} else {
|
|
856
|
+
$adjacentFocusTarget = self.container.next( '.customize-control-sidebar_widgets' ).find( '.add-new-widget:first' );
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
self.container.slideUp( function() {
|
|
860
|
+
var sidebarsWidgetsControl = api.Widgets.getSidebarWidgetControlContainingWidget( self.params.widget_id ),
|
|
861
|
+
sidebarWidgetIds, i;
|
|
862
|
+
|
|
863
|
+
if ( ! sidebarsWidgetsControl ) {
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
sidebarWidgetIds = sidebarsWidgetsControl.setting().slice();
|
|
868
|
+
i = _.indexOf( sidebarWidgetIds, self.params.widget_id );
|
|
869
|
+
if ( -1 === i ) {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
sidebarWidgetIds.splice( i, 1 );
|
|
874
|
+
sidebarsWidgetsControl.setting( sidebarWidgetIds );
|
|
875
|
+
|
|
876
|
+
$adjacentFocusTarget.focus(); // keyboard accessibility
|
|
877
|
+
} );
|
|
878
|
+
} );
|
|
879
|
+
|
|
880
|
+
replaceDeleteWithRemove = function() {
|
|
881
|
+
$removeBtn.text( l10n.removeBtnLabel ); // wp_widget_control() outputs the link as "Delete"
|
|
882
|
+
$removeBtn.attr( 'title', l10n.removeBtnTooltip );
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
if ( this.params.is_new ) {
|
|
886
|
+
api.bind( 'saved', replaceDeleteWithRemove );
|
|
887
|
+
} else {
|
|
888
|
+
replaceDeleteWithRemove();
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Find all inputs in a widget container that should be considered when
|
|
894
|
+
* comparing the loaded form with the sanitized form, whose fields will
|
|
895
|
+
* be aligned to copy the sanitized over. The elements returned by this
|
|
896
|
+
* are passed into this._getInputsSignature(), and they are iterated
|
|
897
|
+
* over when copying sanitized values over to the the form loaded.
|
|
898
|
+
*
|
|
899
|
+
* @param {jQuery} container element in which to look for inputs
|
|
900
|
+
* @returns {jQuery} inputs
|
|
901
|
+
* @private
|
|
902
|
+
*/
|
|
903
|
+
_getInputs: function( container ) {
|
|
904
|
+
return $( container ).find( ':input[name]' );
|
|
905
|
+
},
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Iterate over supplied inputs and create a signature string for all of them together.
|
|
909
|
+
* This string can be used to compare whether or not the form has all of the same fields.
|
|
910
|
+
*
|
|
911
|
+
* @param {jQuery} inputs
|
|
912
|
+
* @returns {string}
|
|
913
|
+
* @private
|
|
914
|
+
*/
|
|
915
|
+
_getInputsSignature: function( inputs ) {
|
|
916
|
+
var inputsSignatures = _( inputs ).map( function( input ) {
|
|
917
|
+
var $input = $( input ), signatureParts;
|
|
918
|
+
|
|
919
|
+
if ( $input.is( ':checkbox, :radio' ) ) {
|
|
920
|
+
signatureParts = [ $input.attr( 'id' ), $input.attr( 'name' ), $input.prop( 'value' ) ];
|
|
921
|
+
} else {
|
|
922
|
+
signatureParts = [ $input.attr( 'id' ), $input.attr( 'name' ) ];
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
return signatureParts.join( ',' );
|
|
926
|
+
} );
|
|
927
|
+
|
|
928
|
+
return inputsSignatures.join( ';' );
|
|
929
|
+
},
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Get the state for an input depending on its type.
|
|
933
|
+
*
|
|
934
|
+
* @param {jQuery|Element} input
|
|
935
|
+
* @returns {string|boolean|array|*}
|
|
936
|
+
* @private
|
|
937
|
+
*/
|
|
938
|
+
_getInputState: function( input ) {
|
|
939
|
+
input = $( input );
|
|
940
|
+
if ( input.is( ':radio, :checkbox' ) ) {
|
|
941
|
+
return input.prop( 'checked' );
|
|
942
|
+
} else if ( input.is( 'select[multiple]' ) ) {
|
|
943
|
+
return input.find( 'option:selected' ).map( function () {
|
|
944
|
+
return $( this ).val();
|
|
945
|
+
} ).get();
|
|
946
|
+
} else {
|
|
947
|
+
return input.val();
|
|
948
|
+
}
|
|
949
|
+
},
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Update an input's state based on its type.
|
|
953
|
+
*
|
|
954
|
+
* @param {jQuery|Element} input
|
|
955
|
+
* @param {string|boolean|array|*} state
|
|
956
|
+
* @private
|
|
957
|
+
*/
|
|
958
|
+
_setInputState: function ( input, state ) {
|
|
959
|
+
input = $( input );
|
|
960
|
+
if ( input.is( ':radio, :checkbox' ) ) {
|
|
961
|
+
input.prop( 'checked', state );
|
|
962
|
+
} else if ( input.is( 'select[multiple]' ) ) {
|
|
963
|
+
if ( ! $.isArray( state ) ) {
|
|
964
|
+
state = [];
|
|
965
|
+
} else {
|
|
966
|
+
// Make sure all state items are strings since the DOM value is a string
|
|
967
|
+
state = _.map( state, function ( value ) {
|
|
968
|
+
return String( value );
|
|
969
|
+
} );
|
|
970
|
+
}
|
|
971
|
+
input.find( 'option' ).each( function () {
|
|
972
|
+
$( this ).prop( 'selected', -1 !== _.indexOf( state, String( this.value ) ) );
|
|
973
|
+
} );
|
|
974
|
+
} else {
|
|
975
|
+
input.val( state );
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
|
|
979
|
+
/***********************************************************************
|
|
980
|
+
* Begin public API methods
|
|
981
|
+
**********************************************************************/
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* @return {wp.customize.controlConstructor.sidebar_widgets[]}
|
|
985
|
+
*/
|
|
986
|
+
getSidebarWidgetsControl: function() {
|
|
987
|
+
var settingId, sidebarWidgetsControl;
|
|
988
|
+
|
|
989
|
+
settingId = 'sidebars_widgets[' + this.params.sidebar_id + ']';
|
|
990
|
+
sidebarWidgetsControl = api.control( settingId );
|
|
991
|
+
|
|
992
|
+
if ( ! sidebarWidgetsControl ) {
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
return sidebarWidgetsControl;
|
|
997
|
+
},
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* Submit the widget form via Ajax and get back the updated instance,
|
|
1001
|
+
* along with the new widget control form to render.
|
|
1002
|
+
*
|
|
1003
|
+
* @param {object} [args]
|
|
1004
|
+
* @param {Object|null} [args.instance=null] When the model changes, the instance is sent here; otherwise, the inputs from the form are used
|
|
1005
|
+
* @param {Function|null} [args.complete=null] Function which is called when the request finishes. Context is bound to the control. First argument is any error. Following arguments are for success.
|
|
1006
|
+
* @param {Boolean} [args.ignoreActiveElement=false] Whether or not updating a field will be deferred if focus is still on the element.
|
|
1007
|
+
*/
|
|
1008
|
+
updateWidget: function( args ) {
|
|
1009
|
+
var self = this, instanceOverride, completeCallback, $widgetRoot, $widgetContent,
|
|
1010
|
+
updateNumber, params, data, $inputs, processing, jqxhr, isChanged;
|
|
1011
|
+
|
|
1012
|
+
args = $.extend( {
|
|
1013
|
+
instance: null,
|
|
1014
|
+
complete: null,
|
|
1015
|
+
ignoreActiveElement: false
|
|
1016
|
+
}, args );
|
|
1017
|
+
|
|
1018
|
+
instanceOverride = args.instance;
|
|
1019
|
+
completeCallback = args.complete;
|
|
1020
|
+
|
|
1021
|
+
this._updateCount += 1;
|
|
1022
|
+
updateNumber = this._updateCount;
|
|
1023
|
+
|
|
1024
|
+
$widgetRoot = this.container.find( '.widget:first' );
|
|
1025
|
+
$widgetContent = $widgetRoot.find( '.widget-content:first' );
|
|
1026
|
+
|
|
1027
|
+
// Remove a previous error message
|
|
1028
|
+
$widgetContent.find( '.widget-error' ).remove();
|
|
1029
|
+
|
|
1030
|
+
this.container.addClass( 'widget-form-loading' );
|
|
1031
|
+
this.container.addClass( 'previewer-loading' );
|
|
1032
|
+
processing = api.state( 'processing' );
|
|
1033
|
+
processing( processing() + 1 );
|
|
1034
|
+
|
|
1035
|
+
if ( ! this.liveUpdateMode ) {
|
|
1036
|
+
this.container.addClass( 'widget-form-disabled' );
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
params = {};
|
|
1040
|
+
params.action = 'update-widget';
|
|
1041
|
+
params.wp_customize = 'on';
|
|
1042
|
+
params.nonce = api.Widgets.data.nonce;
|
|
1043
|
+
params.theme = api.settings.theme.stylesheet;
|
|
1044
|
+
|
|
1045
|
+
data = $.param( params );
|
|
1046
|
+
$inputs = this._getInputs( $widgetContent );
|
|
1047
|
+
|
|
1048
|
+
// Store the value we're submitting in data so that when the response comes back,
|
|
1049
|
+
// we know if it got sanitized; if there is no difference in the sanitized value,
|
|
1050
|
+
// then we do not need to touch the UI and mess up the user's ongoing editing.
|
|
1051
|
+
$inputs.each( function() {
|
|
1052
|
+
$( this ).data( 'state' + updateNumber, self._getInputState( this ) );
|
|
1053
|
+
} );
|
|
1054
|
+
|
|
1055
|
+
if ( instanceOverride ) {
|
|
1056
|
+
data += '&' + $.param( { 'sanitized_widget_setting': JSON.stringify( instanceOverride ) } );
|
|
1057
|
+
} else {
|
|
1058
|
+
data += '&' + $inputs.serialize();
|
|
1059
|
+
}
|
|
1060
|
+
data += '&' + $widgetContent.find( '~ :input' ).serialize();
|
|
1061
|
+
|
|
1062
|
+
if ( this._previousUpdateRequest ) {
|
|
1063
|
+
this._previousUpdateRequest.abort();
|
|
1064
|
+
}
|
|
1065
|
+
jqxhr = $.post( wp.ajax.settings.url, data );
|
|
1066
|
+
this._previousUpdateRequest = jqxhr;
|
|
1067
|
+
|
|
1068
|
+
jqxhr.done( function( r ) {
|
|
1069
|
+
var message, sanitizedForm, $sanitizedInputs, hasSameInputsInResponse,
|
|
1070
|
+
isLiveUpdateAborted = false;
|
|
1071
|
+
|
|
1072
|
+
// Check if the user is logged out.
|
|
1073
|
+
if ( '0' === r ) {
|
|
1074
|
+
api.previewer.preview.iframe.hide();
|
|
1075
|
+
api.previewer.login().done( function() {
|
|
1076
|
+
self.updateWidget( args );
|
|
1077
|
+
api.previewer.preview.iframe.show();
|
|
1078
|
+
} );
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// Check for cheaters.
|
|
1083
|
+
if ( '-1' === r ) {
|
|
1084
|
+
api.previewer.cheatin();
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
if ( r.success ) {
|
|
1089
|
+
sanitizedForm = $( '<div>' + r.data.form + '</div>' );
|
|
1090
|
+
$sanitizedInputs = self._getInputs( sanitizedForm );
|
|
1091
|
+
hasSameInputsInResponse = self._getInputsSignature( $inputs ) === self._getInputsSignature( $sanitizedInputs );
|
|
1092
|
+
|
|
1093
|
+
// Restore live update mode if sanitized fields are now aligned with the existing fields
|
|
1094
|
+
if ( hasSameInputsInResponse && ! self.liveUpdateMode ) {
|
|
1095
|
+
self.liveUpdateMode = true;
|
|
1096
|
+
self.container.removeClass( 'widget-form-disabled' );
|
|
1097
|
+
self.container.find( 'input[name="savewidget"]' ).hide();
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// Sync sanitized field states to existing fields if they are aligned
|
|
1101
|
+
if ( hasSameInputsInResponse && self.liveUpdateMode ) {
|
|
1102
|
+
$inputs.each( function( i ) {
|
|
1103
|
+
var $input = $( this ),
|
|
1104
|
+
$sanitizedInput = $( $sanitizedInputs[i] ),
|
|
1105
|
+
submittedState, sanitizedState, canUpdateState;
|
|
1106
|
+
|
|
1107
|
+
submittedState = $input.data( 'state' + updateNumber );
|
|
1108
|
+
sanitizedState = self._getInputState( $sanitizedInput );
|
|
1109
|
+
$input.data( 'sanitized', sanitizedState );
|
|
1110
|
+
|
|
1111
|
+
canUpdateState = ( ! _.isEqual( submittedState, sanitizedState ) && ( args.ignoreActiveElement || ! $input.is( document.activeElement ) ) );
|
|
1112
|
+
if ( canUpdateState ) {
|
|
1113
|
+
self._setInputState( $input, sanitizedState );
|
|
1114
|
+
}
|
|
1115
|
+
} );
|
|
1116
|
+
|
|
1117
|
+
$( document ).trigger( 'widget-synced', [ $widgetRoot, r.data.form ] );
|
|
1118
|
+
|
|
1119
|
+
// Otherwise, if sanitized fields are not aligned with existing fields, disable live update mode if enabled
|
|
1120
|
+
} else if ( self.liveUpdateMode ) {
|
|
1121
|
+
self.liveUpdateMode = false;
|
|
1122
|
+
self.container.find( 'input[name="savewidget"]' ).show();
|
|
1123
|
+
isLiveUpdateAborted = true;
|
|
1124
|
+
|
|
1125
|
+
// Otherwise, replace existing form with the sanitized form
|
|
1126
|
+
} else {
|
|
1127
|
+
$widgetContent.html( r.data.form );
|
|
1128
|
+
|
|
1129
|
+
self.container.removeClass( 'widget-form-disabled' );
|
|
1130
|
+
|
|
1131
|
+
$( document ).trigger( 'widget-updated', [ $widgetRoot ] );
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* If the old instance is identical to the new one, there is nothing new
|
|
1136
|
+
* needing to be rendered, and so we can preempt the event for the
|
|
1137
|
+
* preview finishing loading.
|
|
1138
|
+
*/
|
|
1139
|
+
isChanged = ! isLiveUpdateAborted && ! _( self.setting() ).isEqual( r.data.instance );
|
|
1140
|
+
if ( isChanged ) {
|
|
1141
|
+
self.isWidgetUpdating = true; // suppress triggering another updateWidget
|
|
1142
|
+
self.setting( r.data.instance );
|
|
1143
|
+
self.isWidgetUpdating = false;
|
|
1144
|
+
} else {
|
|
1145
|
+
// no change was made, so stop the spinner now instead of when the preview would updates
|
|
1146
|
+
self.container.removeClass( 'previewer-loading' );
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
if ( completeCallback ) {
|
|
1150
|
+
completeCallback.call( self, null, { noChange: ! isChanged, ajaxFinished: true } );
|
|
1151
|
+
}
|
|
1152
|
+
} else {
|
|
1153
|
+
// General error message
|
|
1154
|
+
message = l10n.error;
|
|
1155
|
+
|
|
1156
|
+
if ( r.data && r.data.message ) {
|
|
1157
|
+
message = r.data.message;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
if ( completeCallback ) {
|
|
1161
|
+
completeCallback.call( self, message );
|
|
1162
|
+
} else {
|
|
1163
|
+
$widgetContent.prepend( '<p class="widget-error"><strong>' + message + '</strong></p>' );
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
} );
|
|
1167
|
+
|
|
1168
|
+
jqxhr.fail( function( jqXHR, textStatus ) {
|
|
1169
|
+
if ( completeCallback ) {
|
|
1170
|
+
completeCallback.call( self, textStatus );
|
|
1171
|
+
}
|
|
1172
|
+
} );
|
|
1173
|
+
|
|
1174
|
+
jqxhr.always( function() {
|
|
1175
|
+
self.container.removeClass( 'widget-form-loading' );
|
|
1176
|
+
|
|
1177
|
+
$inputs.each( function() {
|
|
1178
|
+
$( this ).removeData( 'state' + updateNumber );
|
|
1179
|
+
} );
|
|
1180
|
+
|
|
1181
|
+
processing( processing() - 1 );
|
|
1182
|
+
} );
|
|
1183
|
+
},
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Expand the accordion section containing a control
|
|
1187
|
+
*/
|
|
1188
|
+
expandControlSection: function() {
|
|
1189
|
+
api.Control.prototype.expand.call( this );
|
|
1190
|
+
},
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* @since 4.1.0
|
|
1194
|
+
*
|
|
1195
|
+
* @param {Boolean} expanded
|
|
1196
|
+
* @param {Object} [params]
|
|
1197
|
+
* @returns {Boolean} false if state already applied
|
|
1198
|
+
*/
|
|
1199
|
+
_toggleExpanded: api.Section.prototype._toggleExpanded,
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* @since 4.1.0
|
|
1203
|
+
*
|
|
1204
|
+
* @param {Object} [params]
|
|
1205
|
+
* @returns {Boolean} false if already expanded
|
|
1206
|
+
*/
|
|
1207
|
+
expand: api.Section.prototype.expand,
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* Expand the widget form control
|
|
1211
|
+
*
|
|
1212
|
+
* @deprecated 4.1.0 Use this.expand() instead.
|
|
1213
|
+
*/
|
|
1214
|
+
expandForm: function() {
|
|
1215
|
+
this.expand();
|
|
1216
|
+
},
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* @since 4.1.0
|
|
1220
|
+
*
|
|
1221
|
+
* @param {Object} [params]
|
|
1222
|
+
* @returns {Boolean} false if already collapsed
|
|
1223
|
+
*/
|
|
1224
|
+
collapse: api.Section.prototype.collapse,
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Collapse the widget form control
|
|
1228
|
+
*
|
|
1229
|
+
* @deprecated 4.1.0 Use this.collapse() instead.
|
|
1230
|
+
*/
|
|
1231
|
+
collapseForm: function() {
|
|
1232
|
+
this.collapse();
|
|
1233
|
+
},
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Expand or collapse the widget control
|
|
1237
|
+
*
|
|
1238
|
+
* @deprecated this is poor naming, and it is better to directly set control.expanded( showOrHide )
|
|
1239
|
+
*
|
|
1240
|
+
* @param {boolean|undefined} [showOrHide] If not supplied, will be inverse of current visibility
|
|
1241
|
+
*/
|
|
1242
|
+
toggleForm: function( showOrHide ) {
|
|
1243
|
+
if ( typeof showOrHide === 'undefined' ) {
|
|
1244
|
+
showOrHide = ! this.expanded();
|
|
1245
|
+
}
|
|
1246
|
+
this.expanded( showOrHide );
|
|
1247
|
+
},
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* Respond to change in the expanded state.
|
|
1251
|
+
*
|
|
1252
|
+
* @param {Boolean} expanded
|
|
1253
|
+
* @param {Object} args merged on top of this.defaultActiveArguments
|
|
1254
|
+
*/
|
|
1255
|
+
onChangeExpanded: function ( expanded, args ) {
|
|
1256
|
+
var self = this, $widget, $inside, complete, prevComplete;
|
|
1257
|
+
|
|
1258
|
+
// If the expanded state is unchanged only manipulate container expanded states
|
|
1259
|
+
if ( args.unchanged ) {
|
|
1260
|
+
if ( expanded ) {
|
|
1261
|
+
api.Control.prototype.expand.call( self, {
|
|
1262
|
+
completeCallback: args.completeCallback
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
$widget = this.container.find( 'div.widget:first' );
|
|
1269
|
+
$inside = $widget.find( '.widget-inside:first' );
|
|
1270
|
+
|
|
1271
|
+
if ( expanded ) {
|
|
1272
|
+
|
|
1273
|
+
self.expandControlSection();
|
|
1274
|
+
|
|
1275
|
+
// Close all other widget controls before expanding this one
|
|
1276
|
+
api.control.each( function( otherControl ) {
|
|
1277
|
+
if ( self.params.type === otherControl.params.type && self !== otherControl ) {
|
|
1278
|
+
otherControl.collapse();
|
|
1279
|
+
}
|
|
1280
|
+
} );
|
|
1281
|
+
|
|
1282
|
+
complete = function() {
|
|
1283
|
+
self.container.removeClass( 'expanding' );
|
|
1284
|
+
self.container.addClass( 'expanded' );
|
|
1285
|
+
self.container.trigger( 'expanded' );
|
|
1286
|
+
};
|
|
1287
|
+
if ( args.completeCallback ) {
|
|
1288
|
+
prevComplete = complete;
|
|
1289
|
+
complete = function () {
|
|
1290
|
+
prevComplete();
|
|
1291
|
+
args.completeCallback();
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
if ( self.params.is_wide ) {
|
|
1296
|
+
$inside.fadeIn( args.duration, complete );
|
|
1297
|
+
} else {
|
|
1298
|
+
$inside.slideDown( args.duration, complete );
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
self.container.trigger( 'expand' );
|
|
1302
|
+
self.container.addClass( 'expanding' );
|
|
1303
|
+
} else {
|
|
1304
|
+
|
|
1305
|
+
complete = function() {
|
|
1306
|
+
self.container.removeClass( 'collapsing' );
|
|
1307
|
+
self.container.removeClass( 'expanded' );
|
|
1308
|
+
self.container.trigger( 'collapsed' );
|
|
1309
|
+
};
|
|
1310
|
+
if ( args.completeCallback ) {
|
|
1311
|
+
prevComplete = complete;
|
|
1312
|
+
complete = function () {
|
|
1313
|
+
prevComplete();
|
|
1314
|
+
args.completeCallback();
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
self.container.trigger( 'collapse' );
|
|
1319
|
+
self.container.addClass( 'collapsing' );
|
|
1320
|
+
|
|
1321
|
+
if ( self.params.is_wide ) {
|
|
1322
|
+
$inside.fadeOut( args.duration, complete );
|
|
1323
|
+
} else {
|
|
1324
|
+
$inside.slideUp( args.duration, function() {
|
|
1325
|
+
$widget.css( { width:'', margin:'' } );
|
|
1326
|
+
complete();
|
|
1327
|
+
} );
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
},
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Get the position (index) of the widget in the containing sidebar
|
|
1334
|
+
*
|
|
1335
|
+
* @returns {Number}
|
|
1336
|
+
*/
|
|
1337
|
+
getWidgetSidebarPosition: function() {
|
|
1338
|
+
var sidebarWidgetIds, position;
|
|
1339
|
+
|
|
1340
|
+
sidebarWidgetIds = this.getSidebarWidgetsControl().setting();
|
|
1341
|
+
position = _.indexOf( sidebarWidgetIds, this.params.widget_id );
|
|
1342
|
+
|
|
1343
|
+
if ( position === -1 ) {
|
|
1344
|
+
return;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
return position;
|
|
1348
|
+
},
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* Move widget up one in the sidebar
|
|
1352
|
+
*/
|
|
1353
|
+
moveUp: function() {
|
|
1354
|
+
this._moveWidgetByOne( -1 );
|
|
1355
|
+
},
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* Move widget up one in the sidebar
|
|
1359
|
+
*/
|
|
1360
|
+
moveDown: function() {
|
|
1361
|
+
this._moveWidgetByOne( 1 );
|
|
1362
|
+
},
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* @private
|
|
1366
|
+
*
|
|
1367
|
+
* @param {Number} offset 1|-1
|
|
1368
|
+
*/
|
|
1369
|
+
_moveWidgetByOne: function( offset ) {
|
|
1370
|
+
var i, sidebarWidgetsSetting, sidebarWidgetIds, adjacentWidgetId;
|
|
1371
|
+
|
|
1372
|
+
i = this.getWidgetSidebarPosition();
|
|
1373
|
+
|
|
1374
|
+
sidebarWidgetsSetting = this.getSidebarWidgetsControl().setting;
|
|
1375
|
+
sidebarWidgetIds = Array.prototype.slice.call( sidebarWidgetsSetting() ); // clone
|
|
1376
|
+
adjacentWidgetId = sidebarWidgetIds[i + offset];
|
|
1377
|
+
sidebarWidgetIds[i + offset] = this.params.widget_id;
|
|
1378
|
+
sidebarWidgetIds[i] = adjacentWidgetId;
|
|
1379
|
+
|
|
1380
|
+
sidebarWidgetsSetting( sidebarWidgetIds );
|
|
1381
|
+
},
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Toggle visibility of the widget move area
|
|
1385
|
+
*
|
|
1386
|
+
* @param {Boolean} [showOrHide]
|
|
1387
|
+
*/
|
|
1388
|
+
toggleWidgetMoveArea: function( showOrHide ) {
|
|
1389
|
+
var self = this, $moveWidgetArea;
|
|
1390
|
+
|
|
1391
|
+
$moveWidgetArea = this.container.find( '.move-widget-area' );
|
|
1392
|
+
|
|
1393
|
+
if ( typeof showOrHide === 'undefined' ) {
|
|
1394
|
+
showOrHide = ! $moveWidgetArea.hasClass( 'active' );
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
if ( showOrHide ) {
|
|
1398
|
+
// reset the selected sidebar
|
|
1399
|
+
$moveWidgetArea.find( '.selected' ).removeClass( 'selected' );
|
|
1400
|
+
|
|
1401
|
+
$moveWidgetArea.find( 'li' ).filter( function() {
|
|
1402
|
+
return $( this ).data( 'id' ) === self.params.sidebar_id;
|
|
1403
|
+
} ).addClass( 'selected' );
|
|
1404
|
+
|
|
1405
|
+
this.container.find( '.move-widget-btn' ).prop( 'disabled', true );
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
$moveWidgetArea.toggleClass( 'active', showOrHide );
|
|
1409
|
+
},
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Highlight the widget control and section
|
|
1413
|
+
*/
|
|
1414
|
+
highlightSectionAndControl: function() {
|
|
1415
|
+
var $target;
|
|
1416
|
+
|
|
1417
|
+
if ( this.container.is( ':hidden' ) ) {
|
|
1418
|
+
$target = this.container.closest( '.control-section' );
|
|
1419
|
+
} else {
|
|
1420
|
+
$target = this.container;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
$( '.highlighted' ).removeClass( 'highlighted' );
|
|
1424
|
+
$target.addClass( 'highlighted' );
|
|
1425
|
+
|
|
1426
|
+
setTimeout( function() {
|
|
1427
|
+
$target.removeClass( 'highlighted' );
|
|
1428
|
+
}, 500 );
|
|
1429
|
+
}
|
|
1430
|
+
} );
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
* wp.customize.Widgets.SidebarSection
|
|
1434
|
+
*
|
|
1435
|
+
* Customizer section representing a widget area widget
|
|
1436
|
+
*
|
|
1437
|
+
* @since 4.1.0
|
|
1438
|
+
*/
|
|
1439
|
+
api.Widgets.SidebarSection = api.Section.extend({
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Sync the section's active state back to the Backbone model's is_rendered attribute
|
|
1443
|
+
*
|
|
1444
|
+
* @since 4.1.0
|
|
1445
|
+
*/
|
|
1446
|
+
ready: function () {
|
|
1447
|
+
var section = this, registeredSidebar;
|
|
1448
|
+
api.Section.prototype.ready.call( this );
|
|
1449
|
+
registeredSidebar = api.Widgets.registeredSidebars.get( section.params.sidebarId );
|
|
1450
|
+
section.active.bind( function ( active ) {
|
|
1451
|
+
registeredSidebar.set( 'is_rendered', active );
|
|
1452
|
+
});
|
|
1453
|
+
registeredSidebar.set( 'is_rendered', section.active() );
|
|
1454
|
+
}
|
|
1455
|
+
});
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* wp.customize.Widgets.SidebarControl
|
|
1459
|
+
*
|
|
1460
|
+
* Customizer control for widgets.
|
|
1461
|
+
* Note that 'sidebar_widgets' must match the WP_Widget_Area_Customize_Control::$type
|
|
1462
|
+
*
|
|
1463
|
+
* @since 3.9.0
|
|
1464
|
+
*
|
|
1465
|
+
* @constructor
|
|
1466
|
+
* @augments wp.customize.Control
|
|
1467
|
+
*/
|
|
1468
|
+
api.Widgets.SidebarControl = api.Control.extend({
|
|
1469
|
+
|
|
1470
|
+
/**
|
|
1471
|
+
* Set up the control
|
|
1472
|
+
*/
|
|
1473
|
+
ready: function() {
|
|
1474
|
+
this.$controlSection = this.container.closest( '.control-section' );
|
|
1475
|
+
this.$sectionContent = this.container.closest( '.accordion-section-content' );
|
|
1476
|
+
|
|
1477
|
+
this._setupModel();
|
|
1478
|
+
this._setupSortable();
|
|
1479
|
+
this._setupAddition();
|
|
1480
|
+
this._applyCardinalOrderClassNames();
|
|
1481
|
+
},
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* Update ordering of widget control forms when the setting is updated
|
|
1485
|
+
*/
|
|
1486
|
+
_setupModel: function() {
|
|
1487
|
+
var self = this;
|
|
1488
|
+
|
|
1489
|
+
this.setting.bind( function( newWidgetIds, oldWidgetIds ) {
|
|
1490
|
+
var widgetFormControls, removedWidgetIds, priority;
|
|
1491
|
+
|
|
1492
|
+
removedWidgetIds = _( oldWidgetIds ).difference( newWidgetIds );
|
|
1493
|
+
|
|
1494
|
+
// Filter out any persistent widget IDs for widgets which have been deactivated
|
|
1495
|
+
newWidgetIds = _( newWidgetIds ).filter( function( newWidgetId ) {
|
|
1496
|
+
var parsedWidgetId = parseWidgetId( newWidgetId );
|
|
1497
|
+
|
|
1498
|
+
return !! api.Widgets.availableWidgets.findWhere( { id_base: parsedWidgetId.id_base } );
|
|
1499
|
+
} );
|
|
1500
|
+
|
|
1501
|
+
widgetFormControls = _( newWidgetIds ).map( function( widgetId ) {
|
|
1502
|
+
var widgetFormControl = api.Widgets.getWidgetFormControlForWidget( widgetId );
|
|
1503
|
+
|
|
1504
|
+
if ( ! widgetFormControl ) {
|
|
1505
|
+
widgetFormControl = self.addWidget( widgetId );
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
return widgetFormControl;
|
|
1509
|
+
} );
|
|
1510
|
+
|
|
1511
|
+
// Sort widget controls to their new positions
|
|
1512
|
+
widgetFormControls.sort( function( a, b ) {
|
|
1513
|
+
var aIndex = _.indexOf( newWidgetIds, a.params.widget_id ),
|
|
1514
|
+
bIndex = _.indexOf( newWidgetIds, b.params.widget_id );
|
|
1515
|
+
return aIndex - bIndex;
|
|
1516
|
+
});
|
|
1517
|
+
|
|
1518
|
+
priority = 0;
|
|
1519
|
+
_( widgetFormControls ).each( function ( control ) {
|
|
1520
|
+
control.priority( priority );
|
|
1521
|
+
control.section( self.section() );
|
|
1522
|
+
priority += 1;
|
|
1523
|
+
});
|
|
1524
|
+
self.priority( priority ); // Make sure sidebar control remains at end
|
|
1525
|
+
|
|
1526
|
+
// Re-sort widget form controls (including widgets form other sidebars newly moved here)
|
|
1527
|
+
self._applyCardinalOrderClassNames();
|
|
1528
|
+
|
|
1529
|
+
// If the widget was dragged into the sidebar, make sure the sidebar_id param is updated
|
|
1530
|
+
_( widgetFormControls ).each( function( widgetFormControl ) {
|
|
1531
|
+
widgetFormControl.params.sidebar_id = self.params.sidebar_id;
|
|
1532
|
+
} );
|
|
1533
|
+
|
|
1534
|
+
// Cleanup after widget removal
|
|
1535
|
+
_( removedWidgetIds ).each( function( removedWidgetId ) {
|
|
1536
|
+
|
|
1537
|
+
// Using setTimeout so that when moving a widget to another sidebar, the other sidebars_widgets settings get a chance to update
|
|
1538
|
+
setTimeout( function() {
|
|
1539
|
+
var removedControl, wasDraggedToAnotherSidebar, inactiveWidgets, removedIdBase,
|
|
1540
|
+
widget, isPresentInAnotherSidebar = false;
|
|
1541
|
+
|
|
1542
|
+
// Check if the widget is in another sidebar
|
|
1543
|
+
api.each( function( otherSetting ) {
|
|
1544
|
+
if ( otherSetting.id === self.setting.id || 0 !== otherSetting.id.indexOf( 'sidebars_widgets[' ) || otherSetting.id === 'sidebars_widgets[wp_inactive_widgets]' ) {
|
|
1545
|
+
return;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
var otherSidebarWidgets = otherSetting(), i;
|
|
1549
|
+
|
|
1550
|
+
i = _.indexOf( otherSidebarWidgets, removedWidgetId );
|
|
1551
|
+
if ( -1 !== i ) {
|
|
1552
|
+
isPresentInAnotherSidebar = true;
|
|
1553
|
+
}
|
|
1554
|
+
} );
|
|
1555
|
+
|
|
1556
|
+
// If the widget is present in another sidebar, abort!
|
|
1557
|
+
if ( isPresentInAnotherSidebar ) {
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
removedControl = api.Widgets.getWidgetFormControlForWidget( removedWidgetId );
|
|
1562
|
+
|
|
1563
|
+
// Detect if widget control was dragged to another sidebar
|
|
1564
|
+
wasDraggedToAnotherSidebar = removedControl && $.contains( document, removedControl.container[0] ) && ! $.contains( self.$sectionContent[0], removedControl.container[0] );
|
|
1565
|
+
|
|
1566
|
+
// Delete any widget form controls for removed widgets
|
|
1567
|
+
if ( removedControl && ! wasDraggedToAnotherSidebar ) {
|
|
1568
|
+
api.control.remove( removedControl.id );
|
|
1569
|
+
removedControl.container.remove();
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
// Move widget to inactive widgets sidebar (move it to trash) if has been previously saved
|
|
1573
|
+
// This prevents the inactive widgets sidebar from overflowing with throwaway widgets
|
|
1574
|
+
if ( api.Widgets.savedWidgetIds[removedWidgetId] ) {
|
|
1575
|
+
inactiveWidgets = api.value( 'sidebars_widgets[wp_inactive_widgets]' )().slice();
|
|
1576
|
+
inactiveWidgets.push( removedWidgetId );
|
|
1577
|
+
api.value( 'sidebars_widgets[wp_inactive_widgets]' )( _( inactiveWidgets ).unique() );
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
// Make old single widget available for adding again
|
|
1581
|
+
removedIdBase = parseWidgetId( removedWidgetId ).id_base;
|
|
1582
|
+
widget = api.Widgets.availableWidgets.findWhere( { id_base: removedIdBase } );
|
|
1583
|
+
if ( widget && ! widget.get( 'is_multi' ) ) {
|
|
1584
|
+
widget.set( 'is_disabled', false );
|
|
1585
|
+
}
|
|
1586
|
+
} );
|
|
1587
|
+
|
|
1588
|
+
} );
|
|
1589
|
+
} );
|
|
1590
|
+
},
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* Allow widgets in sidebar to be re-ordered, and for the order to be previewed
|
|
1594
|
+
*/
|
|
1595
|
+
_setupSortable: function() {
|
|
1596
|
+
var self = this;
|
|
1597
|
+
|
|
1598
|
+
this.isReordering = false;
|
|
1599
|
+
|
|
1600
|
+
/**
|
|
1601
|
+
* Update widget order setting when controls are re-ordered
|
|
1602
|
+
*/
|
|
1603
|
+
this.$sectionContent.sortable( {
|
|
1604
|
+
items: '> .customize-control-widget_form',
|
|
1605
|
+
handle: '.widget-top',
|
|
1606
|
+
axis: 'y',
|
|
1607
|
+
connectWith: '.accordion-section-content:has(.customize-control-sidebar_widgets)',
|
|
1608
|
+
update: function() {
|
|
1609
|
+
var widgetContainerIds = self.$sectionContent.sortable( 'toArray' ), widgetIds;
|
|
1610
|
+
|
|
1611
|
+
widgetIds = $.map( widgetContainerIds, function( widgetContainerId ) {
|
|
1612
|
+
return $( '#' + widgetContainerId ).find( ':input[name=widget-id]' ).val();
|
|
1613
|
+
} );
|
|
1614
|
+
|
|
1615
|
+
self.setting( widgetIds );
|
|
1616
|
+
}
|
|
1617
|
+
} );
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* Expand other Customizer sidebar section when dragging a control widget over it,
|
|
1621
|
+
* allowing the control to be dropped into another section
|
|
1622
|
+
*/
|
|
1623
|
+
this.$controlSection.find( '.accordion-section-title' ).droppable({
|
|
1624
|
+
accept: '.customize-control-widget_form',
|
|
1625
|
+
over: function() {
|
|
1626
|
+
var section = api.section( self.section.get() );
|
|
1627
|
+
section.expand({
|
|
1628
|
+
allowMultiple: true, // Prevent the section being dragged from to be collapsed
|
|
1629
|
+
completeCallback: function () {
|
|
1630
|
+
// @todo It is not clear when refreshPositions should be called on which sections, or if it is even needed
|
|
1631
|
+
api.section.each( function ( otherSection ) {
|
|
1632
|
+
if ( otherSection.container.find( '.customize-control-sidebar_widgets' ).length ) {
|
|
1633
|
+
otherSection.container.find( '.accordion-section-content:first' ).sortable( 'refreshPositions' );
|
|
1634
|
+
}
|
|
1635
|
+
} );
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
});
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* Keyboard-accessible reordering
|
|
1643
|
+
*/
|
|
1644
|
+
this.container.find( '.reorder-toggle' ).on( 'click keydown', function( event ) {
|
|
1645
|
+
if ( event.type === 'keydown' && ! ( event.which === 13 || event.which === 32 ) ) { // Enter or Spacebar
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
self.toggleReordering( ! self.isReordering );
|
|
1650
|
+
} );
|
|
1651
|
+
},
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* Set up UI for adding a new widget
|
|
1655
|
+
*/
|
|
1656
|
+
_setupAddition: function() {
|
|
1657
|
+
var self = this;
|
|
1658
|
+
|
|
1659
|
+
this.container.find( '.add-new-widget' ).on( 'click keydown', function( event ) {
|
|
1660
|
+
if ( event.type === 'keydown' && ! ( event.which === 13 || event.which === 32 ) ) { // Enter or Spacebar
|
|
1661
|
+
return;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
if ( self.$sectionContent.hasClass( 'reordering' ) ) {
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
if ( ! $( 'body' ).hasClass( 'adding-widget' ) ) {
|
|
1669
|
+
api.Widgets.availableWidgetsPanel.open( self );
|
|
1670
|
+
} else {
|
|
1671
|
+
api.Widgets.availableWidgetsPanel.close();
|
|
1672
|
+
}
|
|
1673
|
+
} );
|
|
1674
|
+
},
|
|
1675
|
+
|
|
1676
|
+
/**
|
|
1677
|
+
* Add classes to the widget_form controls to assist with styling
|
|
1678
|
+
*/
|
|
1679
|
+
_applyCardinalOrderClassNames: function() {
|
|
1680
|
+
var widgetControls = [];
|
|
1681
|
+
_.each( this.setting(), function ( widgetId ) {
|
|
1682
|
+
var widgetControl = api.Widgets.getWidgetFormControlForWidget( widgetId );
|
|
1683
|
+
if ( widgetControl ) {
|
|
1684
|
+
widgetControls.push( widgetControl );
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
|
|
1688
|
+
if ( ! widgetControls.length ) {
|
|
1689
|
+
this.container.find( '.reorder-toggle' ).hide();
|
|
1690
|
+
return;
|
|
1691
|
+
} else {
|
|
1692
|
+
this.container.find( '.reorder-toggle' ).show();
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
$( widgetControls ).each( function () {
|
|
1696
|
+
$( this.container )
|
|
1697
|
+
.removeClass( 'first-widget' )
|
|
1698
|
+
.removeClass( 'last-widget' )
|
|
1699
|
+
.find( '.move-widget-down, .move-widget-up' ).prop( 'tabIndex', 0 );
|
|
1700
|
+
});
|
|
1701
|
+
|
|
1702
|
+
_.first( widgetControls ).container
|
|
1703
|
+
.addClass( 'first-widget' )
|
|
1704
|
+
.find( '.move-widget-up' ).prop( 'tabIndex', -1 );
|
|
1705
|
+
|
|
1706
|
+
_.last( widgetControls ).container
|
|
1707
|
+
.addClass( 'last-widget' )
|
|
1708
|
+
.find( '.move-widget-down' ).prop( 'tabIndex', -1 );
|
|
1709
|
+
},
|
|
1710
|
+
|
|
1711
|
+
|
|
1712
|
+
/***********************************************************************
|
|
1713
|
+
* Begin public API methods
|
|
1714
|
+
**********************************************************************/
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* Enable/disable the reordering UI
|
|
1718
|
+
*
|
|
1719
|
+
* @param {Boolean} showOrHide to enable/disable reordering
|
|
1720
|
+
*
|
|
1721
|
+
* @todo We should have a reordering state instead and rename this to onChangeReordering
|
|
1722
|
+
*/
|
|
1723
|
+
toggleReordering: function( showOrHide ) {
|
|
1724
|
+
showOrHide = Boolean( showOrHide );
|
|
1725
|
+
|
|
1726
|
+
if ( showOrHide === this.$sectionContent.hasClass( 'reordering' ) ) {
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
this.isReordering = showOrHide;
|
|
1731
|
+
this.$sectionContent.toggleClass( 'reordering', showOrHide );
|
|
1732
|
+
|
|
1733
|
+
if ( showOrHide ) {
|
|
1734
|
+
_( this.getWidgetFormControls() ).each( function( formControl ) {
|
|
1735
|
+
formControl.collapse();
|
|
1736
|
+
} );
|
|
1737
|
+
|
|
1738
|
+
this.$sectionContent.find( '.first-widget .move-widget' ).focus();
|
|
1739
|
+
this.$sectionContent.find( '.add-new-widget' ).prop( 'tabIndex', -1 );
|
|
1740
|
+
} else {
|
|
1741
|
+
this.$sectionContent.find( '.add-new-widget' ).prop( 'tabIndex', 0 );
|
|
1742
|
+
}
|
|
1743
|
+
},
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Get the widget_form Customize controls associated with the current sidebar.
|
|
1747
|
+
*
|
|
1748
|
+
* @since 3.9
|
|
1749
|
+
* @return {wp.customize.controlConstructor.widget_form[]}
|
|
1750
|
+
*/
|
|
1751
|
+
getWidgetFormControls: function() {
|
|
1752
|
+
var formControls = [];
|
|
1753
|
+
|
|
1754
|
+
_( this.setting() ).each( function( widgetId ) {
|
|
1755
|
+
var settingId = widgetIdToSettingId( widgetId ),
|
|
1756
|
+
formControl = api.control( settingId );
|
|
1757
|
+
if ( formControl ) {
|
|
1758
|
+
formControls.push( formControl );
|
|
1759
|
+
}
|
|
1760
|
+
} );
|
|
1761
|
+
|
|
1762
|
+
return formControls;
|
|
1763
|
+
},
|
|
1764
|
+
|
|
1765
|
+
/**
|
|
1766
|
+
* @param {string} widgetId or an id_base for adding a previously non-existing widget
|
|
1767
|
+
* @returns {object|false} widget_form control instance, or false on error
|
|
1768
|
+
*/
|
|
1769
|
+
addWidget: function( widgetId ) {
|
|
1770
|
+
var self = this, controlHtml, $widget, controlType = 'widget_form', controlContainer, controlConstructor,
|
|
1771
|
+
parsedWidgetId = parseWidgetId( widgetId ),
|
|
1772
|
+
widgetNumber = parsedWidgetId.number,
|
|
1773
|
+
widgetIdBase = parsedWidgetId.id_base,
|
|
1774
|
+
widget = api.Widgets.availableWidgets.findWhere( {id_base: widgetIdBase} ),
|
|
1775
|
+
settingId, isExistingWidget, widgetFormControl, sidebarWidgets, settingArgs, setting;
|
|
1776
|
+
|
|
1777
|
+
if ( ! widget ) {
|
|
1778
|
+
return false;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
if ( widgetNumber && ! widget.get( 'is_multi' ) ) {
|
|
1782
|
+
return false;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
// Set up new multi widget
|
|
1786
|
+
if ( widget.get( 'is_multi' ) && ! widgetNumber ) {
|
|
1787
|
+
widget.set( 'multi_number', widget.get( 'multi_number' ) + 1 );
|
|
1788
|
+
widgetNumber = widget.get( 'multi_number' );
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
controlHtml = $.trim( $( '#widget-tpl-' + widget.get( 'id' ) ).html() );
|
|
1792
|
+
if ( widget.get( 'is_multi' ) ) {
|
|
1793
|
+
controlHtml = controlHtml.replace( /<[^<>]+>/g, function( m ) {
|
|
1794
|
+
return m.replace( /__i__|%i%/g, widgetNumber );
|
|
1795
|
+
} );
|
|
1796
|
+
} else {
|
|
1797
|
+
widget.set( 'is_disabled', true ); // Prevent single widget from being added again now
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
$widget = $( controlHtml );
|
|
1801
|
+
|
|
1802
|
+
controlContainer = $( '<li/>' )
|
|
1803
|
+
.addClass( 'customize-control' )
|
|
1804
|
+
.addClass( 'customize-control-' + controlType )
|
|
1805
|
+
.append( $widget );
|
|
1806
|
+
|
|
1807
|
+
// Remove icon which is visible inside the panel
|
|
1808
|
+
controlContainer.find( '> .widget-icon' ).remove();
|
|
1809
|
+
|
|
1810
|
+
if ( widget.get( 'is_multi' ) ) {
|
|
1811
|
+
controlContainer.find( 'input[name="widget_number"]' ).val( widgetNumber );
|
|
1812
|
+
controlContainer.find( 'input[name="multi_number"]' ).val( widgetNumber );
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
widgetId = controlContainer.find( '[name="widget-id"]' ).val();
|
|
1816
|
+
|
|
1817
|
+
controlContainer.hide(); // to be slid-down below
|
|
1818
|
+
|
|
1819
|
+
settingId = 'widget_' + widget.get( 'id_base' );
|
|
1820
|
+
if ( widget.get( 'is_multi' ) ) {
|
|
1821
|
+
settingId += '[' + widgetNumber + ']';
|
|
1822
|
+
}
|
|
1823
|
+
controlContainer.attr( 'id', 'customize-control-' + settingId.replace( /\]/g, '' ).replace( /\[/g, '-' ) );
|
|
1824
|
+
|
|
1825
|
+
// Only create setting if it doesn't already exist (if we're adding a pre-existing inactive widget)
|
|
1826
|
+
isExistingWidget = api.has( settingId );
|
|
1827
|
+
if ( ! isExistingWidget ) {
|
|
1828
|
+
settingArgs = {
|
|
1829
|
+
transport: 'refresh',
|
|
1830
|
+
previewer: this.setting.previewer
|
|
1831
|
+
};
|
|
1832
|
+
setting = api.create( settingId, settingId, '', settingArgs );
|
|
1833
|
+
setting.set( {} ); // mark dirty, changing from '' to {}
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
controlConstructor = api.controlConstructor[controlType];
|
|
1837
|
+
widgetFormControl = new controlConstructor( settingId, {
|
|
1838
|
+
params: {
|
|
1839
|
+
settings: {
|
|
1840
|
+
'default': settingId
|
|
1841
|
+
},
|
|
1842
|
+
content: controlContainer,
|
|
1843
|
+
sidebar_id: self.params.sidebar_id,
|
|
1844
|
+
widget_id: widgetId,
|
|
1845
|
+
widget_id_base: widget.get( 'id_base' ),
|
|
1846
|
+
type: controlType,
|
|
1847
|
+
is_new: ! isExistingWidget,
|
|
1848
|
+
width: widget.get( 'width' ),
|
|
1849
|
+
height: widget.get( 'height' ),
|
|
1850
|
+
is_wide: widget.get( 'is_wide' )
|
|
1851
|
+
},
|
|
1852
|
+
previewer: self.setting.previewer
|
|
1853
|
+
} );
|
|
1854
|
+
api.control.add( settingId, widgetFormControl );
|
|
1855
|
+
|
|
1856
|
+
// Make sure widget is removed from the other sidebars
|
|
1857
|
+
api.each( function( otherSetting ) {
|
|
1858
|
+
if ( otherSetting.id === self.setting.id ) {
|
|
1859
|
+
return;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
if ( 0 !== otherSetting.id.indexOf( 'sidebars_widgets[' ) ) {
|
|
1863
|
+
return;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
var otherSidebarWidgets = otherSetting().slice(),
|
|
1867
|
+
i = _.indexOf( otherSidebarWidgets, widgetId );
|
|
1868
|
+
|
|
1869
|
+
if ( -1 !== i ) {
|
|
1870
|
+
otherSidebarWidgets.splice( i );
|
|
1871
|
+
otherSetting( otherSidebarWidgets );
|
|
1872
|
+
}
|
|
1873
|
+
} );
|
|
1874
|
+
|
|
1875
|
+
// Add widget to this sidebar
|
|
1876
|
+
sidebarWidgets = this.setting().slice();
|
|
1877
|
+
if ( -1 === _.indexOf( sidebarWidgets, widgetId ) ) {
|
|
1878
|
+
sidebarWidgets.push( widgetId );
|
|
1879
|
+
this.setting( sidebarWidgets );
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
controlContainer.slideDown( function() {
|
|
1883
|
+
if ( isExistingWidget ) {
|
|
1884
|
+
widgetFormControl.updateWidget( {
|
|
1885
|
+
instance: widgetFormControl.setting()
|
|
1886
|
+
} );
|
|
1887
|
+
}
|
|
1888
|
+
} );
|
|
1889
|
+
|
|
1890
|
+
return widgetFormControl;
|
|
1891
|
+
}
|
|
1892
|
+
} );
|
|
1893
|
+
|
|
1894
|
+
// Register models for custom section and control types
|
|
1895
|
+
$.extend( api.sectionConstructor, {
|
|
1896
|
+
sidebar: api.Widgets.SidebarSection
|
|
1897
|
+
});
|
|
1898
|
+
$.extend( api.controlConstructor, {
|
|
1899
|
+
widget_form: api.Widgets.WidgetControl,
|
|
1900
|
+
sidebar_widgets: api.Widgets.SidebarControl
|
|
1901
|
+
});
|
|
1902
|
+
|
|
1903
|
+
// Refresh the nonce if login sends updated nonces over.
|
|
1904
|
+
api.bind( 'nonce-refresh', function( nonces ) {
|
|
1905
|
+
api.Widgets.data.nonce = nonces['update-widget'];
|
|
1906
|
+
});
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* Init Customizer for widgets.
|
|
1910
|
+
*/
|
|
1911
|
+
api.bind( 'ready', function() {
|
|
1912
|
+
// Set up the widgets panel
|
|
1913
|
+
api.Widgets.availableWidgetsPanel = new api.Widgets.AvailableWidgetsPanelView({
|
|
1914
|
+
collection: api.Widgets.availableWidgets
|
|
1915
|
+
});
|
|
1916
|
+
|
|
1917
|
+
// Highlight widget control
|
|
1918
|
+
api.previewer.bind( 'highlight-widget-control', api.Widgets.highlightWidgetFormControl );
|
|
1919
|
+
|
|
1920
|
+
// Open and focus widget control
|
|
1921
|
+
api.previewer.bind( 'focus-widget-control', api.Widgets.focusWidgetFormControl );
|
|
1922
|
+
} );
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* Highlight a widget control.
|
|
1926
|
+
*
|
|
1927
|
+
* @param {string} widgetId
|
|
1928
|
+
*/
|
|
1929
|
+
api.Widgets.highlightWidgetFormControl = function( widgetId ) {
|
|
1930
|
+
var control = api.Widgets.getWidgetFormControlForWidget( widgetId );
|
|
1931
|
+
|
|
1932
|
+
if ( control ) {
|
|
1933
|
+
control.highlightSectionAndControl();
|
|
1934
|
+
}
|
|
1935
|
+
},
|
|
1936
|
+
|
|
1937
|
+
/**
|
|
1938
|
+
* Focus a widget control.
|
|
1939
|
+
*
|
|
1940
|
+
* @param {string} widgetId
|
|
1941
|
+
*/
|
|
1942
|
+
api.Widgets.focusWidgetFormControl = function( widgetId ) {
|
|
1943
|
+
var control = api.Widgets.getWidgetFormControlForWidget( widgetId );
|
|
1944
|
+
|
|
1945
|
+
if ( control ) {
|
|
1946
|
+
control.focus();
|
|
1947
|
+
}
|
|
1948
|
+
},
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* Given a widget control, find the sidebar widgets control that contains it.
|
|
1952
|
+
* @param {string} widgetId
|
|
1953
|
+
* @return {object|null}
|
|
1954
|
+
*/
|
|
1955
|
+
api.Widgets.getSidebarWidgetControlContainingWidget = function( widgetId ) {
|
|
1956
|
+
var foundControl = null;
|
|
1957
|
+
|
|
1958
|
+
// @todo this can use widgetIdToSettingId(), then pass into wp.customize.control( x ).getSidebarWidgetsControl()
|
|
1959
|
+
api.control.each( function( control ) {
|
|
1960
|
+
if ( control.params.type === 'sidebar_widgets' && -1 !== _.indexOf( control.setting(), widgetId ) ) {
|
|
1961
|
+
foundControl = control;
|
|
1962
|
+
}
|
|
1963
|
+
} );
|
|
1964
|
+
|
|
1965
|
+
return foundControl;
|
|
1966
|
+
};
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* Given a widget ID for a widget appearing in the preview, get the widget form control associated with it.
|
|
1970
|
+
*
|
|
1971
|
+
* @param {string} widgetId
|
|
1972
|
+
* @return {object|null}
|
|
1973
|
+
*/
|
|
1974
|
+
api.Widgets.getWidgetFormControlForWidget = function( widgetId ) {
|
|
1975
|
+
var foundControl = null;
|
|
1976
|
+
|
|
1977
|
+
// @todo We can just use widgetIdToSettingId() here
|
|
1978
|
+
api.control.each( function( control ) {
|
|
1979
|
+
if ( control.params.type === 'widget_form' && control.params.widget_id === widgetId ) {
|
|
1980
|
+
foundControl = control;
|
|
1981
|
+
}
|
|
1982
|
+
} );
|
|
1983
|
+
|
|
1984
|
+
return foundControl;
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* @param {String} widgetId
|
|
1989
|
+
* @returns {Object}
|
|
1990
|
+
*/
|
|
1991
|
+
function parseWidgetId( widgetId ) {
|
|
1992
|
+
var matches, parsed = {
|
|
1993
|
+
number: null,
|
|
1994
|
+
id_base: null
|
|
1995
|
+
};
|
|
1996
|
+
|
|
1997
|
+
matches = widgetId.match( /^(.+)-(\d+)$/ );
|
|
1998
|
+
if ( matches ) {
|
|
1999
|
+
parsed.id_base = matches[1];
|
|
2000
|
+
parsed.number = parseInt( matches[2], 10 );
|
|
2001
|
+
} else {
|
|
2002
|
+
// likely an old single widget
|
|
2003
|
+
parsed.id_base = widgetId;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
return parsed;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* @param {String} widgetId
|
|
2011
|
+
* @returns {String} settingId
|
|
2012
|
+
*/
|
|
2013
|
+
function widgetIdToSettingId( widgetId ) {
|
|
2014
|
+
var parsed = parseWidgetId( widgetId ), settingId;
|
|
2015
|
+
|
|
2016
|
+
settingId = 'widget_' + parsed.id_base;
|
|
2017
|
+
if ( parsed.number ) {
|
|
2018
|
+
settingId += '[' + parsed.number + ']';
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
return settingId;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
})( window.wp, jQuery );
|